/* Storefront refinements (theme workstream, round 2). The phone menu drawer (storefront/partials/header/_menu.php), for every
   header: the default one and the theme variants. A <details>, so it opens
   with no script; storefront-menu.js adds Escape, a focus trap and closing on
   the backdrop. Tokens only — see tests/Unit/DesignSystemTest. */

.shop-menu { position: relative; }
.shop-menu > summary { list-style: none; cursor: pointer; }
.shop-menu > summary::-webkit-details-marker { display: none; }
.shop-menu-list { list-style: none; margin: 0; padding: 0; display: grid; }
.shop-menu-list a {
    display: flex;
    align-items: center;
    min-height: var(--tap-target);
    padding-inline: var(--space-3);
    color: inherit;
    text-decoration: none;
    border-radius: var(--shop-radius);
    overflow-wrap: anywhere;
}
.shop-menu-list a:hover { background: color-mix(in srgb, var(--shop-text) 6%, transparent); }

/* Phones and small tablets: a drawer from the start edge over a dimmed page. */
@media (max-width: 63.99rem) {
    .shop-menu[open] > summary::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: var(--z-overlay);
        background: color-mix(in srgb, var(--shop-text) 45%, transparent);
        cursor: default;
    }
    .shop-menu .shop-menu-panel {
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        top: 0;
        z-index: var(--z-dialog);
        inline-size: min(20rem, 86vw);
        min-inline-size: 0;
        max-block-size: none;
        block-size: 100dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: var(--space-4) var(--space-3);
        background: var(--shop-bg);
        color: var(--shop-text);
        border: 0;
        border-inline-end: 1px solid color-mix(in srgb, var(--shop-text) 14%, transparent);
        border-radius: 0;
        box-shadow: var(--shadow-lg);
    }
    .shop-menu .shop-menu-list a { font-size: var(--text-md); }
    html.shop-menu-open { overflow: hidden; }
}

/* The default header (Lustre): the inline nav on wide screens, the drawer
   below that, so the header is one compact row on a phone. */
.shop-header-default .shop-menu { display: none; }
@media (max-width: 63.99rem) {
    .shop-header-default .shop-menu { display: block; }
    .shop-header-default .shop-nav { display: none; }
    .shop-header-default .shop-header-inner { flex-wrap: nowrap; gap: var(--space-2); }
    .shop-header-default .shop-header-actions { margin-inline-start: auto; flex-wrap: nowrap; gap: var(--space-1); }
    /* Account moves into the drawer by name; the cart and search stay. */
    .shop-header-default .shop-act-account { display: none; }
}

/* A long shop name on a phone: two lines at most, never three
   (live audit D-T9), and never pushing the cart off the row. */
@media (max-width: 48rem) {
    .shop-brand { min-width: 0; flex: 0 1 auto; }
    .shop-brand > span {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        font-size: var(--text-lg);
        line-height: var(--leading-snug);
        overflow-wrap: anywhere;
    }
}

/* "Add to cart" on a two-column phone grid stays one line: at 376px a card is
   about 165px wide and the button's desktop padding wrapped the label. */
@media (max-width: 30rem) {
    .shop-card-add .shop-btn,
    .shop-cv-choose {
        padding-inline: var(--space-2);
        white-space: nowrap;
        letter-spacing: normal;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .shop-card-add .shop-btn > span { overflow: hidden; text-overflow: ellipsis; }
}

/* Heading capitals (Design -> Style details -> Heading capitals, DesignTokens):
   set only when the merchant chose one, so "as the theme does it" leaves each
   theme's own text-transform alone. html[style] outranks [data-theme] rules. */
html[style*="--shop-heading-case:"] .shop-brand,
html[style*="--shop-heading-case:"] .shop-section-title,
html[style*="--shop-heading-case:"] .shop-hero-title,
html[style*="--shop-heading-case:"] .shop-product-title,
html[style*="--shop-heading-case:"] .shop-card-title,
html[style*="--shop-heading-case:"] .shop-category-title,
html[style*="--shop-heading-case:"] .shop-post-title,
html[style*="--shop-heading-case:"] .shop-article-title,
html[style*="--shop-heading-case:"] .shop-main h1,
html[style*="--shop-heading-case:"] .shop-main h2 { text-transform: var(--shop-heading-case); }

/* Top bar on phones and tablets (owner report, 2026-10-22): the benefit lines
   sat flush left under a centred row of social icons. Below the width where
   the bar becomes one row, every line is centred, like the icons under it. */
@media (max-width: 63.99rem) {
    .shop-announcement-inner { flex-direction: column; text-align: center; }
    .shop-announcement-items,
    .shop-announcement-social { justify-content: center; }
    .shop-announcement-items { flex-direction: column; align-items: center; gap: var(--space-1); }
    /* A line that wraps on a small phone keeps its icon beside the first word,
       so icon and text centre as one block instead of the icon pinned left. */
    .shop-announcement-items > li { display: block; max-width: 100%; text-align: center; }
    .shop-announcement-items .shop-announcement-icon { display: inline-flex; vertical-align: -0.2em; margin-inline-end: 0.45rem; }
}

/* Header on phones: a wide logo image (the merchant can set ~190px) ran under
   the language switcher. The brand now takes only the room left beside the
   menu button and the actions, and the image scales down inside it. */
@media (max-width: 63.99rem) {
    .shop-header-default .shop-brand { flex: 1 1 auto; min-width: 0; }
    /* the logo carries an inline max-width from settings, so the phone rule must win over it */
    .shop-header-default .shop-brand img { max-width: 100% !important; height: auto; object-fit: contain; object-position: left center; }
    .shop-header-default .shop-header-actions { flex: none; }
}

/* Phones: the language control is the widest thing in the header, so it drops
   its globe and tightens up; the full language name stays (a cut-off name read
   as broken). The logo gets that room back. */
@media (max-width: 30rem) {
    .shop .shop-header-actions .lang-switcher-icon { display: none; }
    .shop .shop-header-actions .lang-select { padding-inline: 0.7rem 1.45rem; font-size: 0.8125rem; }
    .shop .shop-header-actions .lang-switcher::after { inset-inline-end: 0.6rem; }
}
/* The smallest phones (under 375px): the search icon moves into the menu
   (header/_menu.php lists it), or the logo would shrink to a smudge. */
@media (max-width: 23.4rem) {
    .shop-header-default .shop-header-actions .shop-icon-search { display: none; }
}

/* ── Seasonal effects (Theme settings -> Seasonal effects) ─────────────────
   Only active on a body with .shop-season-*; nothing here applies otherwise.
   No images and no extra requests: shapes drawn in CSS. The logo is never
   touched. */
.shop-snow {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9990;
}
/* A festive stripe under the header: red, green and gold. */
.shop-season-christmas .shop-header {
    border-bottom-color: transparent;
    background-image: linear-gradient(90deg, #c62828 0 25%, #1b5e20 25% 50%, #d4a017 50% 75%, #c62828 75% 100%);
    background-size: 64px 3px;
    background-repeat: repeat-x;
    background-position: left bottom;
}
/* A Santa hat on the cart icon (a tiny inline SVG, no file to download). */
.shop-season-christmas a.shop-icon-button[href$="/cart"]::before {
    content: "";
    position: absolute;
    top: 0.1rem;
    left: 0.4rem;
    width: 1.25rem;
    height: 1.05rem;
    pointer-events: none;
    transform: rotate(-12deg);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M3 16C6 7 11 2 18 3c-2 3-3 7-2 13z' fill='%23c62828'/%3E%3Crect x='1' y='14.5' width='17' height='4.5' rx='2.2' fill='%23fff' stroke='%23cfcfcf' stroke-width='.8'/%3E%3Ccircle cx='19.6' cy='4' r='2.6' fill='%23fff' stroke='%23cfcfcf' stroke-width='.8'/%3E%3C/svg%3E") no-repeat center / contain;
}
/* Quick order form, Christmas: a Santa hat on the form box and on the
   "Confirm my order" button, a festive stripe on the box's top edge, and a
   soft shine across the button every few seconds. CSS only. */
.shop-season-christmas section.shop-qo,
.shop-season-christmas form[data-quick-order] .fg-hp + .op-card,
.shop-season-christmas .shop-qo-button {
    position: relative;
}
.shop-season-christmas section.shop-qo::before,
.shop-season-christmas form[data-quick-order] .fg-hp + .op-card::before,
.shop-season-christmas .shop-qo-button::before {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 2;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath d='M3 16C6 7 11 2 18 3c-2 3-3 7-2 13z' fill='%23c62828'/%3E%3Crect x='1' y='14.5' width='17' height='4.5' rx='2.2' fill='%23fff' stroke='%23cfcfcf' stroke-width='.8'/%3E%3Ccircle cx='19.6' cy='4' r='2.6' fill='%23fff' stroke='%23cfcfcf' stroke-width='.8'/%3E%3C/svg%3E") no-repeat center / contain;
}
.shop-season-christmas section.shop-qo::before,
.shop-season-christmas form[data-quick-order] .fg-hp + .op-card::before {
    top: -1.15rem;
    left: -0.85rem;
    width: 2.3rem;
    height: 1.95rem;
    transform: rotate(-20deg);
}
.shop-season-christmas .shop-qo-button::before {
    top: -0.7rem;
    left: -0.45rem;
    width: 1.55rem;
    height: 1.3rem;
    transform: rotate(-20deg);
}
.shop-season-christmas section.shop-qo::after,
.shop-season-christmas form[data-quick-order] .fg-hp + .op-card::after {
    content: "";
    position: absolute;
    top: -2px;
    left: 2.2rem;
    right: 1rem;
    height: 3px;
    border-radius: 2px;
    pointer-events: none;
    background: repeating-linear-gradient(90deg, #c62828 0 16px, #1b5e20 16px 32px, #d4a017 32px 48px);
}
.shop-season-christmas .shop-qo-button {
    background-image: linear-gradient(110deg, transparent 42%, rgba(255, 255, 255, 0.38) 50%, transparent 58%);
    background-size: 260% 100%;
    background-repeat: no-repeat;
    background-position: 130% 0;
    animation: shop-season-shine 4.5s ease-in-out 1.5s infinite;
}
@keyframes shop-season-shine {
    0% { background-position: 130% 0; }
    28%, 100% { background-position: -30% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .shop-season-christmas .shop-qo-button { animation: none; background-image: none; }
}
