body {
    display: flex;
    flex-flow: column;
    align-items: center;
}

main {
    max-width: var(--max-page-width);
    width: 100%;
}

main section {
    padding: 40px min(var(--side-spacing), 80px);
}

header,
footer {
    width: 100%;
}

header {
    z-index: 5;
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    flex-flow: column;
}

header>div {
    width: 100%;
    display: flex;
    justify-content: center;
}

.banner {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
    color: var(--color-banner-text);
    padding: 8px min(var(--side-spacing), 80px);
}

.top-menu nav a,
.mobile-menu a {
    text-transform: uppercase;
}


@media only screen and (min-width: 587px) {
    .banner>div {
        display: flex;
        width: 100%;
        align-items: center;
        max-width: var(--max-page-width);
        flex-flow: row nowrap;
        justify-content: space-between;
    }

    .search-container {
        max-width: fit-content !important;
    }
}

@media only screen and (max-width: 586px) {
    .banner>.top-menu {
        display: none;
    }
}

.banner>div>nav {
    display: flex;
    gap: 16px;
    padding: 0;
    margin: 0;
}

.banner form {
    display: flex;
    flex-direction: row;
}

.mobile-menu {
    display: none;
}

#top-menu {
    background-color: var(--color-white);
}

#top-menu>div {
    width: 100%;
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    align-items: center;
    height: 150px;
    padding: 8px min(var(--side-spacing), 80px);
    color: var(--color-black);
    max-width: var(--max-page-width);
}

#top-menu a,
#top-menu img {
    display: flex;
    justify-content: center;
    object-fit: contain;
}

#top-menu>div>div {
    display: flex;
    gap: 16px;
    align-items: center;
}

#top-menu>div>a {
    aspect-ratio: 906/500;
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0%);
}

#top-menu>div>div>svg:first-of-type {
    padding: 0 16px;
    border-right: 1px solid var(--color-gray-1);
    box-sizing: content-box;
}

.dropdown-anchor {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: center;
}

.dropdown-content {
    display: none;
    position: absolute;
    flex-flow: column;
    background-color: var(--color-primary-beige);
    top: 100%;
    right: -16px;
    width: min-content;
    white-space: nowrap;
    box-shadow: 0px 8px 12px 0px rgba(170, 170, 170, 0.10);
    z-index: 10;
}

.dropdown-content svg {
    padding: 0;
    right: 14px;
    top: -14px;
    position: absolute;
    color: var(--color-primary-beige);
}

.dropdown-content button,
.dropdown-content a {
    padding: 16px 24px;
    min-width: 128px;
    color: var(--color-black);
    align-items: flex-start;
    font-size: 16px;
    justify-content: flex-start !important;
    font-weight: 400;
}

.dropdown-content a:hover,
.dropdown-content button:hover {
    color: var(--color-gray-4);
}

.dropdown-anchor:hover .dropdown-content {
    display: flex;
}

.modal {
    z-index: 5;
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    height: 100%;
    width: 100%;
    overflow: auto;
    background-color: var(--modal-overlay-background);
}

.modal-open {
    display: flex;
}

.close-modal {
    color: var(--color-gray-3);
}

.modal>.content {
    margin: auto;
    z-index: 6;
    display: flex;
    background-color: var(--modal-content-background);
}

.modal>.content section {
    display: flex;
    flex-flow: column;
    gap: 24px;
}

.heading-elements {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

#cart-modal {
    display: none;
    justify-content: flex-end;
}

#cart-modal .content {
    display: flex;
    flex-grow: 1;
    background-color: var(--color-white);
    padding: 48px;
    min-width: 384px;
    max-width: 480px;
    height: 100%;
    flex-flow: column nowrap;
    margin: initial;
}

#cart-modal .content h2 {
    display: flex;
    justify-content: space-between;
    height: auto;
    padding-bottom: 5px;

}

#cart-modal .content>h2 {
    height: calc(100vh * (32/928));
}

#cart-modal .content svg {
    cursor: pointer;
}

#cart-modal .content p {
    color: var(--color-gray-4);
}


#to-checkout-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#to-checkout-form button {
    width: 100%;
}

#to-checkout-form button:disabled {
    pointer-events: auto;
}

#cart-list {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px;
    border: solid var(--color-gray-1);
    border-width: 1px 0;
    max-height: 60%;
}

#cart-list>div {
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: content-box;
    border-top: 1px solid var(--color-gray-1);
    padding: 24px 0;
    width: 100%;

    display: grid;
    grid-auto-rows: 1fr;
    grid-template-columns: 96px 1fr min-content;
    grid-template-rows: min-content 1fr min-content;
    gap: 0px 24px;
    grid-template-areas:
        "img title remove"
        "img title sum"
        "img count price";
}

#cart-list>div:first-of-type {
    border-top: none;
}

#cart-list div>* {
    overflow: hidden;
    display: flex;
    padding: 0;
    margin: 0;
    height: min-content;
    width: min-content;
}

#cart-list div>div {
    display: flex;
    height: 100%;
    aspect-ratio: 1/1;
    grid-area: img;
    flex-flow: column;
}

#cart-list img {
    width: 100%;
    height: 1px;
    flex-grow: 1;
    object-fit: cover;
}

#cart-list h2,
#cart-list h3 {
    width: 100%;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    grid-area: title;
    max-height: 72px;
    /* These are technically the same, but use both */
    overflow-wrap: break-word;
    word-wrap: break-word;
    -ms-word-break: break-all;
    /* Instead use this non-standard one: */
    word-break: break-word;
    /* Adds a hyphen where the word breaks, if supported (No Blink) */
    -ms-hyphens: auto;
    -moz-hyphens: auto;
    -webkit-hyphens: auto;
    hyphens: auto;
    text-transform: none;
}

#cart-list h3,
#cart-list span {
    white-space: nowrap;
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

#cart-list h3 {
    grid-area: sum;
    flex-flow: column;
    align-items: flex-end;
    justify-content: center;
    height: 100%;
    color: var(--color-signal-error);
}

#cart-list h3>b:last-child {
    color: var(--color-black);
}

#cart-list h3>b:nth-child(2) {
    text-decoration: line-through;
    color: var(--color-gray-4);
    font-size: 0.8rem;
    line-height: 0.8rem;
}

#cart-list span {
    color: var(--color-gray-4);
    grid-area: price;
    font-size: 14px;
    line-height: 16px;
    align-self: flex-end;
}

#cart-list input {
    grid-area: count;
    padding: 4px 8px;
    width: min-content;
    max-width: 73px;
    font-size: 16px;
}

#cart-list svg {
    color: var(--color-gray-3);
    display: block;
    aspect-ratio: 1/1;
    grid-area: remove;
    justify-self: end;
    height: 24px;
    width: 24px;
}

#cart-total>* {
    display: flex;
    justify-content: space-between;
}

#cart-total {
    border-bottom: 1px solid var(--color-gray-1);
}

.auth-modal form {
    flex-flow: column;
    border-radius: 2px;
    padding: 24px;
    width: calc(100vw * (528/1440));
    max-width: 528px;
    min-width: 350px;
}

.auth-modal section p,
.auth-modal section h1 {
    padding: 0;
    margin: 0;
}

.auth-modal section {
    padding: 24px;
}

.auth-modal section>* {
    width: 100%;
}

.auth-modal svg:first-child {
    align-self: flex-end;
}

.auth-modal section {
    padding-top: 0;
}

.errors-modal form {
    flex-flow: column;
    border-radius: 2px;
    padding: 24px;
    width: calc(100vw * (528/1440));
    max-width: 528px;
    min-width: 350px;
}

.errors-modal svg:first-child {
    align-self: flex-end;
}

#login-modal section>span {
    color: var(--color-gray-4);
    font-size: 14px;
    line-height: 16px;
}

#login-modal section p {
    border-top: 1px solid var(--color-gray-1);
    padding-top: 24px;
}

footer {
    display: flex;
    align-items: center;
    flex-flow: column;
    margin-top: auto;
    padding-top: 14px;
}

footer>div {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

#footer-content {
    max-width: var(--max-page-width);
    padding: 36px;
    align-items: center;

    gap: 20px;
}

#footer-content>div {
    display: flex;
    flex-flow: column;
    justify-content: flex-start;
    gap: 5px;
    max-width: 25%;
}

#footer-content p,
#footer-content a,
#footer-content label {
    padding: 0;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    color: var(--color-primary-blue);
}

.product-block,
.brand-block {
    width: 17.66%;
    aspect-ratio: 16 / 9;
    min-width: 17.66%;
    border: none;
    position: relative;
}

.product-block>div:not(.overlay-gift),
.brand-block>div {
    display: flex;
    width: 100%;
    padding: 0.3rem;
    margin: 0;
    justify-content: space-between;
    align-items: center;
}

.brand-block button {
    width: 100%;
    border: none;
}

.product-block picture,
.brand-block picture {
    display: flex;
    flex-grow: 1;
    height: 1px;
    min-height: 200px;
    flex-flow: column;
}

.brand-block img {
    display: block;
    /* to remove extra space below image */
}

.product-block img {
    height: 1px;
    flex-grow: 1;
    width: 100%;
}

.brand-block img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
}

.product-block h3 {
    margin: 0px 5px 0px 0px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: none;
    font-size: 12px;
}

.price-container {
    width: 100%;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary-blue);
    text-transform: none;
}

.product-block span {
    color: var(--color-gray-3);
    white-space: nowrap;
}

.page-message {
    width: 100%;
    background-color: var(--color-primary-beige);
    color: var(--color-primary-blue);
    padding: 0.5rem;
    display: flex;
    justify-content: center;
}

.overlay-gift {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    background: rgb(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}

.overlay-gift button {
    width: 95%;
    cursor: pointer;
}

.product-block:hover .overlay-gift {
    opacity: 1;
}

#nothing-here {
    display: flex;
    color: var(--color-gray-3);
    flex-flow: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding-top: calc(100vh * (192/1358));
}

#nothing-here svg {
    width: 135px;
    margin-bottom: 64px;
}

#nothing-here h2,
#noting-here p {
    margin: 0;
}

#burger-button {
    display: none;
}

#search-icon {
    display: none !important;
}

.search-container {
    margin: 0px 5px;
    max-width: fit-content;
}

#language-toggle {
    border: none;
}

iframe {
    max-width: 100%;
    border: none;
}

@media only screen and (max-width: 930px) {

    .product-block,
    .brand-block {
        min-width: 30%;
    }
}

/* Start tablet specific rules */
@media only screen and (max-width: 905px) {
    #top-menu>div>a {
        position: relative;
        left: 0%;
        transform: translate(0%, 0%);
    }

    #footer-content {
        display: flex;
        flex-flow: row wrap;
    }

    #footer-content>div,
    #footer-content>form {
        width: 40%;
        max-width: 40%;
    }

}

@media only screen and (max-width: 850px) {

    .search-container {
        position: relative;
        display: inline-block;
    }

    .product-block,
    .brand-block {
        min-width: 50%;
    }
}

/* Start mobile specific rules */
@media only screen and (max-width: 635px) {

    #footer-content>div,
    #footer-content>form {
        width: 100%;
        max-width: 100%;
    }

    header .banner p {
        display: none;
    }

    header form {
        display: none;
    }

    #cart-modal {
        right: auto;
    }

    #cart-modal .content {
        padding: 12px;
        min-width: initial;
        max-width: initial;
        width: 100%;
    }

    .modal {
        overflow: auto;
    }

    .modal>.content {
        width: 100%;
        height: auto;
        min-height: 100%;
        max-width: initial;
        min-width: initial;
    }

    footer .banner div {
        align-items: flex-start;
        flex-flow: column;
        gap: 8px;
    }

    #footer-content {
        flex-direction: column;
        align-items: baseline;
    }

    #footer-content>* {
        justify-content: center;
        border: none;
    }

    .banner {
        justify-content: space-between;
    }

    #burger-button {
        display: block;
    }

    .mobile-menu-container {
        position: fixed;
        top: 210px;
        z-index: 10;
        max-height: 70%;
        overflow-y: auto;
    }

    .mobile-menu {
        width: 100vw;
        background-color: #fff;
        padding: 0 1em;
    }

    .mobile-menu>div {
        width: 100%;
    }

    .mobile-groups-link {
        display: flex;
        justify-content: space-between;
        cursor: pointer;
    }


    .mobile-groups-link>button {
        border: none;
        padding: 0;
        font-size: 30px;
        font-weight: 100;
    }

    .mobile-menu a {
        color: black;
        padding: 14px 16px;
        text-decoration: none;
        font-size: 17px;
        display: block;
        width: 100%;
    }

    .mobile-menu a:hover,
    .mobile-groups-link>button:hover {
        background-color: var(--color-gray-1);
    }
}

@media only screen and (max-width: 480px) {
    .banner {
        justify-content: space-between;
    }

    #top-menu>div {
        flex-flow: column nowrap;
        justify-content: center;
    }

    #top-menu a {
        width: 90%;
        height: 40%;
    }
}