/* The account actions are shared; only the mobile presentation changes. */
.header-menu-toggle__hamburger,
.header-dropdown-close,
.header-dropdown-visual,
.header-dropdown-item-symbol,
.account-menu-promotions,
.account-menu-backdrop {
    display: none;
}

@media (max-width: 767px) {
    .app-header .header-menu-toggle,
    .app-header .header-menu-toggle.is-open {
        display: grid;
        place-items: center;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        color: #fff;
        transform: none;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .header-menu-toggle__chevron { display: none; }
    .header-menu-toggle__hamburger {
        display: block;
        width: 28px;
        height: 26px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.8;
        stroke-linecap: round;
    }

    html.account-menu-open { overflow: hidden; overscroll-behavior: none; }
    body.account-menu-open { overflow: hidden; overscroll-behavior: none; }

    .account-menu-backdrop:not([hidden]) {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 80;
        background: rgba(0, 0, 0, .38);
        opacity: 0;
        transition: opacity 280ms ease;
        touch-action: none;
    }

    .account-menu-backdrop.is-open { opacity: 1; }

    .header-dropdown.is-mobile-drawer {
        position: fixed;
        inset: 0 0 0 auto;
        z-index: 81;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        width: min(78vw, 380px);
        height: 100vh;
        height: 100dvh;
        max-height: none;
        margin: 0;
        padding: max(78px, calc(env(safe-area-inset-top) + 64px)) 18px max(28px, env(safe-area-inset-bottom));
        border: 0;
        border-radius: 0;
        background: #202120;
        box-shadow: -12px 0 36px rgba(0, 0, 0, .2);
        transform: translateX(100%);
        transition: transform 300ms cubic-bezier(.22, .75, .25, 1);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .header-dropdown.is-mobile-drawer.is-open { transform: translateX(0); }

    .is-mobile-drawer .header-dropdown-content {
        flex-shrink: 0;
        margin-block: 12px auto;
        width: 100%;
    }

    .is-mobile-drawer .account-menu-promotions {
        display: block;
        flex-shrink: 0;
        width: 100%;
        margin-top: 30px;
        padding: 20px 0 4px;
        border-top: 1px solid rgba(255, 255, 255, .09);
        text-align: center;
    }

    .account-menu-promotions h2 {
        margin: 0 0 12px;
        color: #e8e9df;
        font: 700 clamp(12px, 3.4vw, 16px)/1.35 "Trebuchet MS", sans-serif;
        letter-spacing: .01em;
    }

    .account-menu-promotions__items {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-items: center;
        gap: 14px;
        width: min(100%, 244px);
        margin-inline: auto;
    }

    .account-menu-promo {
        position: relative;
        display: block;
        isolation: isolate;
        width: min(100%, 100px);
        height: 140px;
        padding: 0;
        border: 0;
        border-radius: 12px;
        background: none;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .account-menu-promo .mega-pix-launcher__ball { left: calc(50% - 37px); }
    .account-menu-promo .mega-pix-launcher__shadow { left: calc(50% - 20px); }
    .account-menu-promo :is(.mega-pix-launcher__label, .iphone-promo-launcher__label) {
        left: 50%;
        right: auto;
        bottom: 1px;
        width: min(100%, 92px);
        transform: translateX(-50%);
    }
    .account-menu-promo--iphone img {
        position: absolute;
        display: block;
        top: 27px;
        left: -8%;
        width: 116%;
        max-width: none;
        height: 82px;
        object-fit: contain;
        filter: drop-shadow(0 5px 3px #0009);
        animation: iphone-promo-float 3.6s ease-in-out infinite;
        pointer-events: none;
    }
    .account-menu-promo--iphone .iphone-promo-launcher__glow { inset: 24px -6px 8px; }
    .account-menu-promo > * { pointer-events: none; }
    .account-menu-promo :is(svg, img, .mega-pix-launcher__shadow) { animation-play-state: paused; }
    .is-mobile-drawer.is-open .account-menu-promo :is(svg, img, .mega-pix-launcher__shadow) { animation-play-state: running; }

    .is-mobile-drawer .header-dropdown-visual {
        display: flex;
        justify-content: center;
        margin: 0 0 30px;
    }

    .is-mobile-drawer .header-dropdown-visual img {
        display: block;
        width: min(180px, 86%);
        height: auto;
    }

    .is-mobile-drawer .header-dropdown-links {
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
        gap: 0;
        margin: 0;
    }

    .is-mobile-drawer .header-dropdown-item {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        min-height: 58px;
        padding: 15px 8px;
        border-radius: 8px;
        color: #e6e6e2;
        font-size: clamp(18px, 5vw, 23px);
        font-weight: 700;
        line-height: 1.25;
        letter-spacing: .025em;
        text-align: left;
        text-decoration: none;
        white-space: nowrap;
        touch-action: manipulation;
    }

    .is-mobile-drawer .header-dropdown-item:hover,
    .is-mobile-drawer .header-dropdown-item:active {
        background: rgba(255, 255, 255, .06);
        color: #fff;
    }

    .is-mobile-drawer .header-dropdown-item-icon { display: none; }

    .is-mobile-drawer .header-dropdown-item-symbol {
        display: block;
        flex: 0 0 24px;
        width: 24px;
        height: 24px;
        fill: none;
        stroke: #adc69d;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .is-mobile-drawer .header-dropdown-item:not(:last-child)::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 8px;
        right: 8px;
        height: 1px;
        background: rgba(255, 255, 255, .09);
        pointer-events: none;
    }

    .is-mobile-drawer .header-dropdown-close {
        position: absolute;
        top: max(14px, env(safe-area-inset-top));
        right: max(14px, env(safe-area-inset-right));
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        padding: 8px;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: #fff;
        cursor: pointer;
        touch-action: manipulation;
    }

    .header-dropdown-close svg {
        display: block;
        width: 28px;
        height: 28px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.5;
        stroke-linecap: round;
    }

    .header-menu-toggle:focus-visible,
    .is-mobile-drawer button:focus-visible,
    .is-mobile-drawer a:focus-visible {
        outline: 2px solid #a0d857;
        outline-offset: 3px;
    }
}

@media (max-width: 340px) {
    .is-mobile-drawer .header-dropdown-item {
        gap: 10px;
        padding-inline: 4px;
        font-size: 17px;
    }

    .is-mobile-drawer .header-dropdown-item-symbol {
        flex-basis: 20px;
        width: 20px;
        height: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header-dropdown.is-mobile-drawer,
    .account-menu-backdrop { transition: none; }
    .account-menu-promo :is(svg, img, .mega-pix-launcher__shadow) { animation: none !important; }
}
