.maeth-site-header {
    --maeth-menu-header-height: 76px;
    --maeth-menu-admin-offset: 0px;
    --maeth-menu-gutter: var(--maeth-catalog-gutter, max(16px, 3.63vw));
    position: relative;
    z-index: 1;
    background: #fbf6ef;
    border-bottom: 1px solid #e5dbd1;
}

.admin-bar .maeth-site-header {
    --maeth-menu-admin-offset: var(--wp-admin--admin-bar--height, 32px);
}

.maeth-page > .maeth-site-header {
    position: sticky;
    top: var(--maeth-menu-admin-offset);
    z-index: 20;
}

.maeth-page:has(> .maeth-site-header) :is(#main, #about-maeth, #categories, #where-to-buy) {
    scroll-margin-top: 72px;
}

.maeth-site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(16px, 2.5vw, 38px);
    width: min(1600px, 100%);
    min-height: var(--maeth-menu-header-height);
    margin-inline: auto;
    padding: 8px var(--maeth-menu-gutter);
}

.maeth-site-header .maeth-logo {
    width: 116px;
    height: 44px;
}

.maeth-site-header-links,
.maeth-site-header-actions {
    display: flex;
    align-items: center;
}

.maeth-site-header-links {
    gap: 6px;
}

.maeth-site-header-actions {
    gap: 8px;
}

.maeth-site-header-links a,
.maeth-site-header-catalog,
.maeth-site-header-cart,
.maeth-site-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 650;
}

.maeth-site-header-links a {
    padding-inline: 14px;
    border-radius: 100px;
}

.maeth-site-header a[href$="#about-maeth"] {
    --maeth-nav-highlight: #f8e0e8;
}

.maeth-site-header a[href$="#where-to-buy"] {
    --maeth-nav-highlight: #e6ebd3;
}

.maeth-site-catalog-control {
    display: inline-flex;
    align-items: center;
    border-radius: 100px;
    background: #171817;
}

.maeth-site-header .maeth-site-header-catalog {
    padding-inline: 16px 12px;
    border-radius: 100px 0 0 100px;
    color: #fff;
}

.maeth-site-header-cart {
    padding: 0 13px;
    border: 1px solid #cbbdcc;
    border-radius: 100px;
    background: #fffaf5;
}

.maeth-site-header .maeth-site-header-cart {
    gap: 5px;
    padding-inline: 10px 8px;
    color: #352746;
}

.maeth-site-cart-icon {
    position: relative;
    width: 24px;
    height: 22px;
    flex: none;
}

.maeth-site-cart-icon span {
    position: absolute;
    top: 2px;
    left: 1px;
    width: 8px;
    height: 2.5px;
    border-radius: 999px;
    background: currentColor;
    transform: rotate(36deg);
    transform-origin: left center;
}

.maeth-site-cart-icon::before {
    content: '';
    position: absolute;
    inset: 6px 2px auto 5px;
    height: 12px;
    box-sizing: border-box;
    border: 1.5px solid currentColor;
    border-radius: 3px 4px 6px 5px;
    background: radial-gradient(circle at 70% 29%, #fffaf5 1px, transparent 1.6px), #e2d1fa;
    transform: skewX(-8deg);
}

.maeth-site-cart-icon::after {
    content: '';
    position: absolute;
    top: 19px;
    left: 7px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 10px 0 currentColor;
}

.maeth-site-cart-count {
    display: grid;
    min-width: 23px;
    min-height: 23px;
    padding-inline: 5px;
    place-items: center;
    border-radius: 100px;
    background: #ece0f9;
    font-size: 13px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.maeth-site-menu-toggle {
    width: 44px;
    padding: 0;
    border-inline-start: 1px solid rgb(255 255 255 / .25);
    border-radius: 0 100px 100px 0;
    color: #fff;
    list-style: none;
    cursor: pointer;
}

.maeth-site-menu-toggle::-webkit-details-marker {
    display: none;
}

.maeth-site-header :is(.maeth-site-header-catalog, .maeth-site-menu-toggle):focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.maeth-site-menu-icon {
    position: relative;
    display: block;
    width: 20px;
    height: 16px;
}

.maeth-site-menu-icon span {
    position: absolute;
    inset: 7px 0 auto;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.maeth-site-menu-icon span:first-child { transform: translateY(-6px); }
.maeth-site-menu-icon span:last-child { transform: translateY(6px); }
.maeth-site-menu[open] .maeth-site-menu-icon span:first-child { transform: rotate(45deg); }
.maeth-site-menu[open] .maeth-site-menu-icon span:nth-child(2) { opacity: 0; }
.maeth-site-menu[open] .maeth-site-menu-icon span:last-child { transform: rotate(-45deg); }

.maeth-site-header-cart[aria-current] {
    border-color: #b9a4d7;
    background: #eee4f9;
}

.maeth-site-menu-panel {
    position: absolute;
    inset: 100% 0 auto;
    max-height: calc(100vh - var(--maeth-menu-header-height) - var(--maeth-menu-admin-offset));
    max-height: calc(100dvh - var(--maeth-menu-header-height) - var(--maeth-menu-admin-offset));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-bottom: 1px solid #e5dbd1;
    background: #fbf6ef;
    box-shadow: 0 18px 34px rgba(44, 29, 34, .16);
}

.maeth-site-menu-inner {
    width: min(1600px, 100%);
    margin-inline: auto;
    padding: 16px var(--maeth-menu-gutter) 26px;
}

.maeth-site-menu-promo {
    display: none;
}

.maeth-site-menu-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.maeth-site-menu-section {
    --maeth-nav-highlight: #e1d2f7;
    padding: clamp(14px, 2vw, 24px);
    border-radius: 20px;
    background: #eee4f9;
}

.maeth-site-menu-section-care {
    --maeth-nav-highlight: #cee5ef;
    background: #e2f0f6;
}

.maeth-site-menu-section-title {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 8px;
    border-radius: 10px;
    font-family: Farabee, Inter, Arial, sans-serif;
    font-size: clamp(25px, 3vw, 38px);
    font-weight: 700;
    line-height: 1.08;
}

.maeth-site-menu-subcategories {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.maeth-site-menu-subcategories a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.maeth-site-menu-section-title[aria-current],
.maeth-site-menu-subcategories [aria-current] {
    background: #fffaf5;
    box-shadow: inset 0 0 0 1px #b9a4d7;
}

.maeth-site-catalog-control:has(.maeth-site-menu[open], .maeth-site-header-catalog[aria-current]) {
    background: #4a345d;
}

@media (hover: hover) and (pointer: fine) {
    .maeth-site-header-links a:hover,
    .maeth-site-menu-promo a:hover,
    .maeth-site-menu-section-title:not([aria-current]):hover,
    .maeth-site-menu-subcategories a:not([aria-current]):hover {
        background: var(--maeth-nav-highlight);
    }

    .maeth-site-catalog-control:hover {
        background: #4a345d;
    }

    .maeth-site-catalog-control :is(.maeth-site-header-catalog, .maeth-site-menu-toggle):hover {
        background: rgb(255 255 255 / .12);
    }

    .maeth-site-header-cart:hover {
        background: #eee4f9;
    }

    .maeth-site-header-cart:hover .maeth-site-cart-count {
        background-color: #fff;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .maeth-site-header-links a,
    .maeth-site-header-actions > a,
    .maeth-site-cart-count,
    .maeth-site-catalog-control,
    .maeth-site-header-catalog,
    .maeth-site-menu-panel a,
    .maeth-site-menu-toggle {
        transition: background-color .18s ease, border-color .18s ease;
    }

    .maeth-site-menu-icon span {
        transition: transform .2s ease, opacity .2s ease;
    }

    .maeth-site-menu[open] .maeth-site-menu-panel {
        animation: maeth-menu-open .2s ease-out both;
    }

    @keyframes maeth-menu-open {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

@media (max-width: 850px) {
    body:has(.maeth-site-menu[open]) #maeth-cookie-banner {
        visibility: hidden;
    }

    .maeth-site-header {
        --maeth-menu-header-height: 64px;
    }

    .maeth-site-header-links {
        display: none;
    }

    .maeth-site-menu-promo {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px 8px;
        margin-bottom: 14px;
    }

    .maeth-site-menu-promo a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding-inline: 4px;
        border-radius: 100px;
        font-size: 14px;
        font-weight: 650;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .admin-bar .maeth-site-header {
        --maeth-menu-admin-offset: 0px;
    }

    .maeth-site-header-inner {
        gap: 8px;
    }

    .maeth-site-header .maeth-logo {
        width: 96px;
        min-width: 58px;
        height: auto;
        flex: 0 1 96px;
        aspect-ratio: 96 / 37;
    }

    .maeth-site-header .maeth-site-header-catalog {
        padding-inline: 12px 8px;
        font-size: 13px;
    }

    .maeth-site-menu-sections {
        grid-template-columns: 1fr;
    }
}
