/* Aphro navigation: desktop bar + "Shop" mega menu (≥ 901px) and the phone
 * menu sheet (< 901px, .aphro-mnav). */

body.aphro-has-desknav {
    --dn-bg: #ffffff;
    --dn-ink: #24161e;
    --dn-muted: #777078;
    --dn-line: rgba(36, 22, 30, .1);
    --dn-rose: #b24d64;
    --dn-rose-deep: #a9475d;
    --dn-rose-text: #a9475d;
    --dn-panel: #ffffff;
    --dn-tile: #f8f3f1;
    --dn-hover: #f8f3f1;
    --dn-shadow: 0 24px 60px rgba(36, 22, 30, .16), 0 2px 6px rgba(36, 22, 30, .06);
}

html.aphro-dark body.aphro-has-desknav {
    --dn-bg: #20161d;
    --dn-ink: #f6edf0;
    --dn-muted: #c6b6c0;
    --dn-line: #57444f;
    --dn-rose: #f0a1b2;
    --dn-rose-deep: #f0a1b2;
    --dn-rose-text: #f0a1b2;
    --dn-panel: #2b2129;
    --dn-tile: #20161d;
    --dn-hover: #352a33;
    --dn-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .3);
}

.aphro-desknav {
    display: none;
}

@media (min-width: 901px) {
    /* The bar: same surface as the logo row, hairline above and below. */
    body.aphro-has-desknav .site-header__nav {
        padding: 0 !important;
        background: var(--dn-bg) !important;
        border-top: 1px solid var(--dn-line) !important;
        border-bottom: 0 !important;
    }

    body.aphro-has-desknav .site-header__nav-inner > .primary-menu {
        display: none !important;
    }

    .aphro-desknav {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        min-height: 50px;
        color: var(--dn-ink);
        font-family: inherit;
    }

    .aphro-desknav__list {
        display: flex;
        align-items: stretch;
        gap: clamp(14px, 2.2vw, 34px);
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .aphro-desknav__item {
        position: static;
        display: flex;
        align-items: stretch;
    }

    /* Top-level links: sentence case, medium weight, rose underline on hover/current. */
    .aphro-desknav__list > .aphro-desknav__item > .aphro-desknav__link {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        height: 50px;
        padding: 0 2px;
        border-radius: 0;
        background: transparent;
        color: var(--dn-ink);
        font-size: 14.5px;
        font-weight: 600;
        letter-spacing: .01em;
        line-height: 1;
        text-decoration: none;
        text-transform: none;
        white-space: nowrap;
        transition: color .18s ease;
    }

    .aphro-desknav__list > .aphro-desknav__item > .aphro-desknav__link::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 2px;
        border-radius: 2px 2px 0 0;
        background: var(--dn-rose);
        transform: scaleX(0);
        transform-origin: center;
        transition: transform .22s cubic-bezier(.2, .7, .2, 1);
    }

    .aphro-desknav__list > .aphro-desknav__item > .aphro-desknav__link:hover,
    .aphro-desknav__list > .aphro-desknav__item > .aphro-desknav__link:focus-visible,
    .aphro-desknav__item.is-open > .aphro-desknav__trigger {
        color: var(--dn-rose-deep);
        background: transparent;
    }

    .aphro-desknav__list > .aphro-desknav__item > .aphro-desknav__link:hover::after,
    .aphro-desknav__list > .aphro-desknav__item > .aphro-desknav__link:focus-visible::after,
    .aphro-desknav__list > .aphro-desknav__item > .aphro-desknav__link.is-current::after,
    .aphro-desknav__item.is-open > .aphro-desknav__trigger::after {
        transform: scaleX(1);
    }

    .aphro-desknav__list > .aphro-desknav__item > .aphro-desknav__link.is-current {
        color: var(--dn-ink);
    }

    .aphro-desknav__link:focus-visible {
        outline: 2px solid var(--dn-rose);
        outline-offset: -2px;
        border-radius: 6px;
    }

    .aphro-desknav__list > .aphro-desknav__item--sale > .aphro-desknav__link {
        color: var(--dn-rose-deep);
    }

    .aphro-desknav__chevron {
        width: 12px;
        height: 12px;
        margin-top: 1px;
        transition: transform .22s ease;
    }

    .aphro-desknav__item.is-open .aphro-desknav__chevron {
        transform: rotate(180deg);
    }

    /* Right-hand group: language pill + reassurance. */
    .aphro-desknav__aside {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .aphro-desknav__note {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin: 0;
        color: var(--dn-muted);
        font-size: 13px;
        letter-spacing: .01em;
        white-space: nowrap;
    }

    .aphro-desknav__note svg {
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
    }

    .aphro-desknav__lang + .aphro-desknav__note::before {
        content: "";
        width: 1px;
        height: 16px;
        margin-right: 6px;
        background: var(--dn-line);
    }

    /* --- Mega panel --------------------------------------------------------- */
    .aphro-desknav__panel {
        position: absolute;
        left: 0;
        top: 100%;
        z-index: 60;
        width: min(100%, 1040px);
        margin-top: -1px;
        padding-top: 10px;              /* hover bridge between bar and panel */
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: opacity .18s ease, transform .22s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .22s;
    }

    .aphro-desknav__item.is-open > .aphro-desknav__panel {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition-delay: 0s;
    }

    .aphro-desknav__grid {
        display: grid;
        grid-template-columns: 1.05fr 1fr .95fr 300px;
        gap: 28px 32px;
        padding: 28px 32px 30px;
        border: 1px solid var(--dn-line);
        border-radius: 18px;
        background: var(--dn-panel);
        box-shadow: var(--dn-shadow);
        max-height: calc(100vh - 230px);
        overflow: auto;
    }

    .aphro-desknav__heading {
        margin: 0 0 10px;
        color: var(--dn-muted);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .16em;
        text-transform: uppercase;
    }

    .aphro-desknav__heading + .aphro-desknav__links + .aphro-desknav__heading {
        margin-top: 22px;
    }

    .aphro-desknav__links {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .aphro-desknav__links li + li {
        margin-top: 2px;
    }

    .aphro-desknav__links .aphro-desknav__link {
        display: flex;
        flex-direction: column;
        gap: 2px;
        margin: 0 -10px;
        padding: 8px 10px;
        border-radius: 10px;
        color: var(--dn-ink);
        font-size: 15px;
        font-weight: 600;
        line-height: 1.25;
        text-decoration: none;
        transition: background-color .16s ease, color .16s ease;
    }

    .aphro-desknav__col--compact .aphro-desknav__links .aphro-desknav__link {
        padding: 6px 10px;
        font-size: 14px;
        font-weight: 500;
    }

    .aphro-desknav__links .aphro-desknav__link:hover,
    .aphro-desknav__links .aphro-desknav__link:focus-visible {
        background: var(--dn-hover);
        color: var(--dn-rose-deep);
    }

    .aphro-desknav__links .aphro-desknav__link.is-current {
        color: var(--dn-rose-deep);
    }

    .aphro-desknav__links .aphro-desknav__link--sale {
        color: var(--dn-rose-deep);
    }

    .aphro-desknav__desc {
        color: var(--dn-muted);
        font-size: 12.5px;
        font-weight: 400;
        letter-spacing: .01em;
    }

    /* Featured tile on the right. */
    .aphro-desknav__feature {
        position: relative;
        display: block;
        min-height: 250px;
        overflow: hidden;
        border-radius: 14px;
        background: var(--dn-tile);
        color: #fff;
        text-decoration: none;
        isolation: isolate;
    }

    .aphro-desknav__feature-img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: scale(1.02);
        transition: transform .6s cubic-bezier(.2, .7, .2, 1);
    }

    .aphro-desknav__feature:hover .aphro-desknav__feature-img {
        transform: scale(1.07);
    }

    .aphro-desknav__feature::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(36, 22, 30, 0) 30%, rgba(36, 22, 30, .78) 100%);
    }

    .aphro-desknav__feature-body {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1;
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 18px 20px 20px;
    }

    .aphro-desknav__feature-eyebrow {
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .16em;
        text-transform: uppercase;
        opacity: .85;
    }

    .aphro-desknav__feature-title {
        font-family: "Cardo", Georgia, "Times New Roman", serif;
        font-size: 22px;
        font-weight: 400;
        line-height: 1.15;
    }

    .aphro-desknav__feature-text {
        font-size: 13px;
        opacity: .9;
    }

    .aphro-desknav__feature-cta {
        margin-top: 6px;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .aphro-desknav__feature:focus-visible {
        outline: 2px solid var(--dn-rose);
        outline-offset: 3px;
    }
}

/* Tighter widths: hide the reassurance line first, then the tile. */
@media (min-width: 901px) and (max-width: 1180px) {
    .aphro-desknav__note {
        display: none;
    }

    .aphro-desknav__list > .aphro-desknav__item > .aphro-desknav__link {
        font-size: 13.5px;
    }
}

@media (min-width: 901px) and (max-width: 1040px) {
    .aphro-desknav__grid {
        grid-template-columns: 1.05fr 1fr .95fr;
    }

    .aphro-desknav__feature {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aphro-desknav__panel,
    .aphro-desknav__chevron,
    .aphro-desknav__feature-img,
    .aphro-desknav__list > .aphro-desknav__item > .aphro-desknav__link::after {
        transition: none;
    }
}

/* --- Language pill (EN | FR): desktop bar and mobile drawer -------------- */
.aphro-desknav__lang {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border: 1px solid var(--dn-line);
    border-radius: 999px;
}

.aphro-desknav__lang .aphro-desknav__lang-link,
.primary-menu .aphro-lang-menu-item .aphro-desknav__lang-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 40px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: transparent;
    color: var(--dn-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    transition: background-color .16s ease, color .16s ease;
}

.aphro-desknav__lang .aphro-desknav__lang-link:hover,
.aphro-desknav__lang .aphro-desknav__lang-link:focus-visible,
.primary-menu .aphro-lang-menu-item .aphro-desknav__lang-link:hover {
    background: var(--dn-hover);
    color: var(--dn-ink);
}

.aphro-desknav__lang .aphro-desknav__lang-link.is-current,
.primary-menu .aphro-lang-menu-item .aphro-desknav__lang-link.is-current {
    background: var(--dn-ink);
    color: var(--dn-bg);
}

/* Night mode: the theme's link colour rule is more specific than the one
 * above and painted the current language cream on cream. */
html.aphro-dark body.aphro-has-desknav .aphro-desknav__lang .aphro-desknav__lang-link.is-current,
html.aphro-dark body.aphro-has-desknav .aphro-mnav .aphro-desknav__lang-link.is-current {
    background: var(--dn-ink) !important;
    color: var(--dn-bg) !important;
}

html.aphro-dark body.aphro-has-desknav .aphro-desknav__lang .aphro-desknav__lang-link:not(.is-current),
html.aphro-dark body.aphro-has-desknav .aphro-mnav .aphro-desknav__lang-link:not(.is-current) {
    background: transparent !important;
    color: var(--dn-muted) !important;
}

.aphro-desknav__lang .aphro-desknav__lang-link:focus-visible {
    outline: 2px solid var(--dn-rose);
    outline-offset: 2px;
}

/* Mobile drawer row. */
.primary-menu .aphro-lang-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--dn-line);
    list-style: none;
}

.primary-menu .aphro-lang-menu-item__label {
    color: var(--dn-ink);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
}

.primary-menu .aphro-lang-menu-item .aphro-desknav__lang-link {
    height: 28px;
    padding: 0 12px;
    font-size: 12.5px;
    letter-spacing: .02em;
}

@media (min-width: 901px) {
    .primary-menu .aphro-lang-menu-item {
        display: none;
    }
}


/* =========================================================================
 * Phone menu (< 901px)
 * ====================================================================== */
.aphro-mnav {
    display: none;
}

@media (max-width: 900px) {
    body.aphro-has-desknav .site-header__nav .primary-menu {
        display: none !important;
    }

    .aphro-mnav {
        position: fixed;
        top: var(--aphro-mnav-top, 58px);
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 75;
        display: block;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        border-top: 1px solid var(--dn-line);
        background: var(--dn-bg);
        color: var(--dn-ink);
        visibility: hidden;
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
    }

    body.mobile-menu-open .aphro-mnav {
        visibility: visible;
        opacity: 1;
        transform: none;
        transition: opacity .18s ease, transform .18s ease;
    }

    body.aphro-has-desknav.mobile-menu-open {
        overflow: hidden;
    }

    .aphro-mnav__inner {
        display: block;
        width: min(560px, 100%);
        margin: 0 auto;
        padding: 6px 16px calc(32px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
    }

    .aphro-mnav__heading {
        margin: 20px 0 10px;
        color: var(--dn-muted);
        font-size: 12px;
        font-weight: 700;
        letter-spacing: .14em;
        line-height: 1.3;
        text-transform: uppercase;
    }

    .aphro-mnav ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .aphro-mnav a {
        -webkit-tap-highlight-color: transparent;
    }

    .aphro-mnav__tiles {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .aphro-mnav__tile {
        display: grid;
        align-content: center;
        gap: 3px;
        min-height: 76px;
        padding: 12px 14px;
        border: 1px solid transparent;
        border-radius: 14px;
        background: var(--dn-hover);
        color: var(--dn-ink) !important;
        text-decoration: none;
        box-sizing: border-box;
        transition: border-color .15s ease, background-color .15s ease;
    }

    .aphro-mnav__tile:active,
    .aphro-mnav__tile.is-current {
        border-color: var(--dn-rose);
    }

    .aphro-mnav__tile-label {
        font-family: "Cardo", Georgia, "Times New Roman", serif;
        font-size: 21px;
        line-height: 1.1;
    }

    .aphro-mnav__tile-desc {
        color: var(--dn-muted);
        font-size: 12.5px;
        line-height: 1.35;
    }

    .aphro-mnav__list {
        border-top: 1px solid var(--dn-line);
    }

    .aphro-mnav__list a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 52px;
        border-bottom: 1px solid var(--dn-line);
        color: var(--dn-ink) !important;
        font-size: 17px;
        font-weight: 600;
        text-decoration: none;
    }

    .aphro-mnav__list a.is-current span {
        text-decoration: underline;
        text-decoration-color: var(--dn-rose);
        text-underline-offset: 5px;
    }

    .aphro-mnav__list a.aphro-mnav__sale {
        color: var(--dn-rose-text) !important;
    }

    .aphro-mnav__chev {
        width: 14px;
        height: 14px;
        flex: 0 0 14px;
        color: var(--dn-muted);
    }

    .aphro-mnav__all {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 50px;
        margin-top: 16px;
        border-radius: 999px;
        background: var(--dn-ink);
        color: var(--dn-bg) !important;
        font-size: 15px;
        font-weight: 700;
        text-decoration: none;
    }

    .aphro-mnav__links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 16px;
    }

    .aphro-mnav__links a {
        display: flex;
        align-items: center;
        min-height: 44px;
        color: var(--dn-ink) !important;
        font-size: 15px;
        text-decoration: none;
    }

    .aphro-mnav__lang {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-top: 18px;
        padding-top: 16px;
        border-top: 1px solid var(--dn-line);
    }

    .aphro-mnav__lang-label {
        color: var(--dn-ink);
        font-size: 14px;
        font-weight: 600;
    }

    .aphro-mnav .aphro-desknav__lang .aphro-desknav__lang-link {
        height: 38px;
        padding: 0 16px;
        font-size: 14px;
        letter-spacing: .01em;
    }

    /* Hamburger: the three bars meet in a clean X. */
    body.aphro-has-desknav .mobile-menu-toggle {
        position: relative;
        width: 44px;
        height: 44px;
        min-height: 44px;
        flex-basis: 44px;
    }

    body.aphro-has-desknav .mobile-menu-toggle span {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 22px;
        height: 2px;
        margin: -1px 0 0 -11px;
        transition: transform .2s ease, opacity .15s ease;
    }

    body.aphro-has-desknav .mobile-menu-toggle span:nth-child(1) {
        transform: translateY(-7px);
    }

    body.aphro-has-desknav .mobile-menu-toggle span:nth-child(3) {
        transform: translateY(7px);
    }

    body.aphro-has-desknav.mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
        transform: rotate(45deg);
    }

    body.aphro-has-desknav.mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    body.aphro-has-desknav.mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
        transform: rotate(-45deg);
    }
}

@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
    .aphro-mnav,
    body.mobile-menu-open .aphro-mnav,
    body.aphro-has-desknav .mobile-menu-toggle span {
        transition: none;
    }
}
