/* =========================================================
   KOOTZY KIOSK — GLOBAL STYLES & DESIGN SYSTEM
   Bright, rounded, friendly. Brand kit: kootzy-logo-v003-baloo2.
   Tagline: MADE TO MAKE YOU SMILE.

   Token NAMES are unchanged so customize.css / admin.css / legal.css
   inherit them; only the VALUES move to the Kootzy palette.

   Palette mapping kept the old hierarchy so nothing shifts weight:
     vermilion  -> Nuclear Red  (primary / CTA)
     cobalt     -> Lagoon Blue  (brand chrome, secondary accent)
     warm ink   -> Navy
     warm paper -> Pale neutral / Mint
   Filament swatches in COLOR_PALETTES are NOT brand colours and are
   deliberately left alone — they describe real PLA stock.
   ========================================================= */

:root {
    /* ---- Surfaces: cool and bright, not warm paper ---- */
    --bg-dark:   #F5FAFB;   /* page background (name kept for compat) */
    --bg-main:   #F5FAFB;   /* alias used by customize.css */
    --bg-panel:  #FFFFFF;   /* cards / panels */
    --paper-2:   #DDF7FA;   /* recessed wells (Mint) */

    --border-color: #D3E7EB;
    --border-color-hover: #A9D5DE;

    /* ---- Brand accents ---- */
    --primary: #FF1E36;                 /* Nuclear Red — CTA */
    --primary-ink: #DB0B21;             /* pressed / hover */
    --primary-glow: rgba(255, 30, 54, 0.16);
    --primary-gradient: linear-gradient(135deg, #FF1E36 0%, #FF5A6B 100%);
    --accent: #1F8E4D;                  /* success / savings — semantic, not brand */
    --accent-glow: rgba(31, 142, 77, 0.16);
    --cobalt: #00B5C8;                  /* Lagoon Blue — brand chrome */
    --cobalt-wash: rgba(0, 181, 200, 0.12);

    /* ---- Brand extras (new; safe to use, nothing depends on them yet) ---- */
    --lagoon: #00B5C8;
    --lagoon-ink: #009AAB;
    /* Lagoon is only 2.49:1 on white — it cannot carry text at any size. Use this
       darkened shade whenever a lagoon-COLOURED label is wanted (4.76:1 on white).
       Lagoon as a FILL is fine: navy on lagoon measures 5.89:1. */
    --lagoon-text: #007F8C;
    /* Nuclear Red carries white text only at large bold sizes (3.82:1). For small
       white labels on red, use this (5.14:1). */
    --primary-strong: #DB0B21;
    --mint: #DDF7FA;
    --blush: #FFE6EA;
    --yellow: #FFC94A;

    /* ---- Ink ---- */
    --text-main:  #172B35;              /* Navy */
    --text-muted: #4F6874;              /* AA on --bg-dark */
    --text-dark:  #172B35;

    /* Body copy is a neutral sans per the brand guidelines; Baloo 2 is for
       short, joyful headlines only, never paragraphs. */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --card-shadow: 0 1px 2px rgba(23,43,53,.06), 0 6px 18px rgba(23,43,53,.08);
    --transition-smooth: all 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
    --focus-ring: 0 0 0 3px var(--bg-panel), 0 0 0 5px var(--primary);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Subtle paper grain over everything */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
    opacity: .03;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: multiply;
}

/* Accessibility: visible focus + reduced motion */
:where(a, button, input, [tabindex]):focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* Kiosk Layout Container */
.kiosk-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 1rem 1rem 3rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.kiosk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-panel);
    border: 1.5px solid var(--text-main);
    border-radius: 16px;
    margin-bottom: 1.25rem;
    box-shadow: 3px 3px 0 var(--text-main);
    gap: 0.35rem;
}

/* ── Cart link + count badge in the header ── */
/* "My orders" is no longer in the home header: a visitor who has not signed in
   has no orders to look at, and a signed-in one reaches it from the profile
   menu. Kept as a class because cart.html still uses it inline. */
.header-orders-link {
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    /* Matched to the 44px cart circle so the header row aligns on one baseline
       instead of the link floating at its own text height. */
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.6rem;
    border-radius: 8px;
    flex: 0 0 auto;
    white-space: nowrap;
}
.header-orders-link:hover { background: var(--paper-2); }

.header-auth-btn {
    font-family: var(--font-family);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    background: transparent;
    border: 1.5px solid var(--border-color-hover);
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    min-height: 44px;               /* touch target */
    cursor: pointer;
    white-space: nowrap;
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-auth-btn:hover { background: var(--paper-2); }
.header-auth-btn[data-auth-state="in"] {
    border-color: var(--text-main);
}

/* ── Profile chip: identity in the header, sign-out one tap deeper ──────── */
.header-profile { position: relative; flex: 0 0 auto; display: inline-flex; }

.profile-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;          /* matches the cart circle */
    padding: 0;
    border-radius: 50%;
    background: var(--paper-2);
    border: 1.5px solid var(--text-main);
    cursor: pointer;
    overflow: hidden;
    flex: 0 0 auto;
}
.profile-chip:hover { background: var(--mint, var(--paper-2)); }
.profile-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar-initial {
    font-family: var(--font-display, var(--font-family));
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-main);
}

.profile-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 60;
    min-width: 12.5rem;
    max-width: 15rem;
    padding: 0.4rem;
    background: var(--bg-panel);
    border: 1.5px solid var(--text-main);
    border-radius: 12px;
    box-shadow: 3px 3px 0 var(--text-main);
}
.profile-menu[hidden] { display: none; }
.profile-menu-id {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.45rem 0.55rem 0.5rem;
    border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.12));
    margin-bottom: 0.3rem;
}
.profile-menu-id strong {
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--text-main);
}
.profile-menu-id span {
    font-size: 0.72rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-menu-link,
.profile-menu-signout {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 0 0.55rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.profile-menu-link:hover,
.profile-menu-signout:hover { background: var(--paper-2); }
.profile-menu-signout { color: var(--primary-strong, var(--primary)); }

.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;          /* full touch target */
    border-radius: 50%;
    color: var(--text-main);
    text-decoration: none;
    flex: 0 0 auto;
    /* Carries the right-edge push now that "My orders" (which used to own the
       auto margin) has left the home header. */
    margin-left: auto;
}
.cart-link:hover { background: var(--paper-2); }
.cart-count {
    position: absolute;
    top: 2px; right: 0;
    min-width: 18px;
    padding: 0 4px;
    border-radius: 999px;
    /* --primary-strong: white on Nuclear Red is 3.82:1 and this text is tiny. */
    background: var(--primary-strong);
    color: #fff;
    font-family: var(--font-family);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

/* Add to cart, beside the pay button on the review step. */
.stepper-btn-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 1.2rem;
    border-radius: var(--r-pill, 999px);
    background: var(--bg-panel);
    color: var(--text-main);
    border: 2px solid var(--text-main);
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.stepper-btn-cart:hover { background: var(--paper-2); }
.stepper-btn-cart:disabled { opacity: 0.7; cursor: default; }

.logo-area { display: flex; align-items: center; gap: 0.6rem; }

/* ── Full-page state screens (404, payment failed, maintenance) ──
   The brand kit's state illustrations bake headline, subcopy and a
   non-functional button into the artwork. We use the -illus.svg variants
   (artwork only) and let HTML own the copy and the real CTA, so the heading
   structure and focus behaviour are correct. */
.state-page {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: var(--bg-dark);
}
.state-card {
    width: 100%;
    max-width: 520px;
    background: var(--bg-panel);
    border: 1.5px solid var(--border-color);
    border-radius: var(--r-lg, 20px);
    box-shadow: var(--card-shadow);
    padding: 2rem 1.5rem 2.25rem;
    text-align: center;
}
.state-illus {
    display: block;
    width: 100%;
    max-width: 340px;
    height: auto;
    margin: 0 auto 0.5rem;
}
.state-card h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.5rem, 6vw, 2rem);
    line-height: 1.15;
    color: var(--text-main);
    margin: 0 0 0.5rem;
}
.state-card p {
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0 auto 1.5rem;
    max-width: 34ch;
}
/* --primary-strong, not --primary: white on Nuclear Red is 3.82:1 and only
   clears AA at large bold sizes, while this is 5.14:1 at any size. */
.state-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.state-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 1.4rem;
    border-radius: var(--r-pill, 999px);
    background: var(--primary-strong);
    color: #fff;
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.state-btn:hover { filter: brightness(1.08); }
.state-btn.secondary {
    background: transparent;
    color: var(--text-main);
    border: 1.5px solid var(--border-color-hover);
}
.state-tagline {
    margin-top: 1.5rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* The approved wordmark ships as SVG with the Baloo 2 subset embedded, so it
   renders identically everywhere and needs no webfont to be correct. */
.logo-mark {
    display: block;
    height: 34px;
    width: auto;
}

/* Tagline sits beside the mark on wide screens only — at phone widths the header
   is tight and the wordmark alone carries the brand. */
.logo-tagline {
    display: none;
    font-family: var(--font-family);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-left: 0.6rem;
    border-left: 1.5px solid var(--border-color);
}
@media (min-width: 560px) {
    .logo-tagline { display: inline-block; }
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.kiosk-badge {
    background: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bg-panel);
}

/* Hero */
.kiosk-hero { text-align: center; padding: 0.75rem 0.5rem; margin-bottom: 1.25rem; }

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.85rem, 7vw, 2.4rem);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 0.6rem;
    letter-spacing: -0.5px;
    color: var(--text-main);
}
.hero-title::after {
    content: "";
    display: block;
    width: 56px; height: 4px;
    margin: 0.6rem auto 0;
    background: var(--primary);
    border-radius: 99px;
    transform: rotate(-1deg);
}

.hero-subtitle { font-size: 0.95rem; color: var(--text-muted); }

/* Batch savings banner */
.batch-savings-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--accent-glow);
    border: 1.5px solid var(--accent);
    padding: 0.85rem 1rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
}
.banner-icon { font-size: 1.25rem; }
.banner-text { display: flex; flex: 1; flex-direction: column; gap: 0.3rem; }
.banner-title { font-weight: 800; font-size: 0.9rem; color: var(--accent); }
.banner-desc { font-size: 0.82rem; color: var(--text-main); line-height: 1.35; }
.batch-offer-links { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.25rem; }
.batch-offer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    min-height: 38px;
    padding: 0.4rem 0.65rem;
    border: 1.5px solid var(--text-main);
    border-radius: 10px;
    background: var(--bg-panel);
    color: var(--text-main);
    font-size: 0.76rem;
    font-weight: 800;
    text-decoration: none;
}
.batch-offer-swatches { display: inline-flex; }
.batch-offer-swatch {
    display: block;
    width: 17px;
    height: 17px;
    margin-left: -3px;
    border: 1px solid var(--text-main);
    border-radius: 50%;
}
.batch-offer-swatch:first-child { margin-left: 0; }

.store-status-banner {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin: 0 0 1rem;
    padding: .8rem .9rem;
    border: 1.5px solid #b45309;
    border-radius: 14px;
    background: #fff7ed;
    color: #7c2d12;
    box-shadow: 2px 2px 0 #b45309;
}
.store-status-banner[hidden] { display: none; }
.store-status-icon {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 50%;
    background: #fed7aa;
    font-weight: 900;
}
.store-status-banner > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .12rem;
}
.store-status-banner strong { font-size: .85rem; }
.store-status-banner span:not(.store-status-icon) {
    font-size: .74rem;
    line-height: 1.35;
}
.store-status-banner small {
    color: #9a3412;
    font-size: .68rem;
    font-weight: 750;
}
.store-order-action-paused {
    opacity: .58;
    cursor: not-allowed !important;
}

/* Category Tabs */
.featured-products-section {
    margin: 0 0 1.35rem;
    padding: .85rem;
    border: 1.5px solid var(--text-main);
    border-radius: 18px;
    background: linear-gradient(135deg, var(--blush), var(--bg-panel) 62%);
    box-shadow: 3px 3px 0 var(--text-main);
}
.featured-products-section[hidden] { display: none; }
.featured-products-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .7rem;
}
.featured-products-heading h2 {
    font: 800 1.2rem var(--font-display);
    color: var(--text-main);
    line-height: 1.1;
}
.featured-products-kicker {
    display: block;
    margin-bottom: .12rem;
    color: var(--primary-ink);
    font-size: .65rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.featured-product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}
.featured-product-grid .product-card {
    border-color: var(--primary-strong);
    box-shadow: 2px 2px 0 var(--primary-strong);
}
.featured-product-grid .product-card:hover {
    box-shadow: 5px 5px 0 var(--primary-strong);
}
@media (max-width: 620px) {
    .featured-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.category-tabs {
    display: flex;
    background: var(--paper-2);
    border: 1.5px solid var(--text-main);
    border-radius: 14px;
    padding: 0.35rem;
    margin-bottom: 1.5rem;
    gap: 0.35rem;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.6rem 0.25rem;
    min-height: 44px;               /* touch target */
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}
.tab-btn:hover { color: var(--text-main); background: var(--bg-panel); }
.tab-btn.active {
    background: var(--text-main);
    color: var(--bg-panel);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--bg-panel);
    border: 1.5px solid var(--text-main);
    border-radius: 18px;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: 2px 2px 0 var(--text-main);
    opacity: 1;
}
.product-card:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--text-main); }
.product-card:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--text-main); }
.product-card[hidden] { display: none !important; }
.product-card-paused {
    cursor: not-allowed;
    filter: saturate(.55);
}
.product-card-paused .card-img-wrap::after {
    content: "ORDERS PAUSED";
    position: absolute;
    inset: auto .55rem .55rem;
    padding: .28rem .45rem;
    border-radius: 999px;
    background: rgba(23,43,53,.9);
    color: #fff;
    font-size: .62rem;
    font-weight: 850;
    text-align: center;
}
.product-catalog-badge {
    position: absolute;
    top: .55rem;
    left: .55rem;
    z-index: 2;
    padding: .22rem .45rem;
    border-radius: 999px;
    background: var(--yellow);
    color: var(--text-main);
    font-size: .62rem;
    font-weight: 850;
}

.card-img-wrap {
    width: 100%;
    height: 116px;
    background:
        repeating-linear-gradient(45deg, var(--paper-2) 0 10px, var(--bg-panel) 10px 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1.5px solid var(--text-main);
    padding: 0.65rem;
}
.card-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    transition: var(--transition-smooth);
}

.card-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.75rem;
    flex-grow: 1;
    gap: 0.5rem;
}

/* FIX: was white-on-white (leftover dark theme) */
.card-name {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}
.card-desc { display: none; }

.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }

.card-time {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--paper-2);
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
}

.card-action {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary-ink);
    transition: var(--transition-smooth);
}
.product-card:hover .card-action { transform: translateX(3px); }
.product-card:hover .card-img-wrap img { transform: scale(1.05); }

/* ── Animated SVG card previews (card-previews.js) ── */
.card-img-wrap.cardpv-wrap {
    position: relative;
    padding: 0.55rem;
    overflow: hidden;
}
.cardpv-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem;
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: opacity, transform;
}
.cardpv-layer.cardpv-on {
    opacity: 1;
    transform: scale(1);
}
.cardpv-svg {
    width: 100%;
    height: 100%;
    max-height: 100%;
    overflow: visible;
}
.product-card:hover .cardpv-layer.cardpv-on { transform: scale(1.04); }

@media (prefers-reduced-motion: reduce) {
    .cardpv-layer { transition: opacity 0.2s linear; transform: none; }
    .product-card:hover .cardpv-layer.cardpv-on { transform: none; }
}

/* Footer */
.kiosk-footer {
    text-align: center;
    padding: 1.5rem 0 0.5rem 0;
    margin-top: auto;
    border-top: 1.5px solid var(--text-main);
}
.kiosk-footer p {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.92; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color-hover); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =========================================================
   KIOSK LANDING — self-playing 3D demo reel
   ========================================================= */
.demo-device {
    display: flex; flex-direction: column; gap: .75rem;
    margin-bottom: 1.5rem;
}
.demo-preview {
    position: relative;
    height: 300px;
    border: 2px solid var(--text-main);
    border-radius: 18px;
    background:
        radial-gradient(120% 90% at 50% 18%, var(--bg-panel) 0%, var(--paper-2) 70%),
        repeating-linear-gradient(0deg, transparent 0 27px, rgba(26,23,20,.05) 27px 28px);
    box-shadow: 6px 6px 0 var(--cobalt), 6px 6px 0 1.5px var(--text-main);
    overflow: hidden;
}
.demo-canvas { position: absolute; inset: 0; }
.demo-canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.demo-loading {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.demo-loading .loader-spinner {
    width: 34px; height: 34px;
    border: 3px solid var(--border-color-hover);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.demo-caption {
    position: absolute; left: 12px; bottom: 12px;
    font-family: var(--font-mono); font-size: .7rem; font-weight: 700;
    color: var(--text-main); background: var(--bg-panel);
    border: 1.5px solid var(--text-main); border-radius: 999px;
    padding: 4px 11px; box-shadow: 2px 2px 0 var(--text-main);
    z-index: 5;
}

/* Touch-friendly 3D Canvas Interaction for Mobile Landing */
.demo-touch-hint {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-main);
    background: var(--bg-panel);
    border: 1.5px solid var(--text-main);
    border-radius: 999px;
    padding: 4px 11px;
    box-shadow: 2px 2px 0 var(--text-main);
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.demo-touch-hint:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 var(--text-main);
}

.demo-touch-hint .exit-touch-btn {
    display: inline-flex;
    align-items: center;
    margin-left: 2px;
    padding: 1px 7px;
    background: var(--primary-strong);
    color: #fff;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
}

/* Touch vs Mouse handling */
@media (pointer: coarse) {
    /* On mobile touch devices: default state passes vertical scrolls freely */
    .demo-preview:not(.is-interactive) .demo-canvas {
        pointer-events: none;
    }
    .demo-preview.is-interactive {
        box-shadow: 0 0 0 3px var(--primary), 6px 6px 0 var(--cobalt), 6px 6px 0 1.5px var(--text-main);
    }
    .demo-preview.is-interactive .demo-canvas {
        pointer-events: auto;
        touch-action: none;
    }
    .demo-preview.is-interactive .demo-touch-hint {
        background: var(--text-main);
        color: var(--bg-panel);
    }
}

@media (pointer: fine) and (hover: hover) {
    /* On desktop mouse devices: mouse drag rotates 3D immediately, mouse wheel scrolls page */
    .demo-canvas {
        pointer-events: auto;
        cursor: grab;
    }
    .demo-canvas:active {
        cursor: grabbing;
    }
    .demo-touch-hint {
        display: none;
    }
}

/* scene dots */
.reel-dots { display: flex; justify-content: center; gap: 7px; }
.reel-dots i {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--border-color-hover);
    transition: background .2s, transform .2s;
}
.reel-dots i.active { background: var(--primary); transform: scale(1.35); }

/* mock customizer UI */
.demo-ui {
    display: flex; flex-direction: column; gap: .7rem;
    background: var(--bg-panel);
    border: 2px solid var(--text-main);
    border-radius: 18px;
    padding: 1rem 1.1rem;
    box-shadow: var(--card-shadow);
}
.mini-step { display: flex; align-items: center; gap: .7rem; }
.mini-label {
    font-family: var(--font-mono); font-size: .62rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-muted); min-width: 58px;
}
.mini-field {
    flex: 1; display: flex; align-items: center;
    background: var(--bg-dark); border: 1.5px solid var(--text-main);
    border-radius: 10px; padding: 7px 11px;
    font-weight: 700; color: var(--text-main); min-height: 36px;
}
.caret { width: 2px; height: 15px; background: var(--primary); margin-left: 2px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.mini-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.mini-chip {
    padding: 4px 10px; border: 1.5px solid var(--text-main); border-radius: 999px;
    background: var(--bg-panel); color: var(--text-muted);
    font-size: .78rem; font-weight: 700;
}
.mini-chip.active { background: var(--text-main); color: var(--bg-panel); }
.mini-swatches { display: flex; gap: 6px; }
.mini-swatch {
    width: 24px; height: 24px; border-radius: 50%;
    border: 1.5px solid var(--text-main);
    transition: transform .15s, box-shadow .15s;
}
.mini-swatch.active { transform: scale(1.18); box-shadow: 0 0 0 2px var(--bg-panel), 0 0 0 4px var(--text-main); }

/* reel CTA — stamped primary button */
.demo-cta {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; margin-top: .25rem;
    padding: .9rem 1.5rem;
    background: var(--primary); color: #fff !important;
    font-family: var(--font-display); font-weight: 800; font-size: 1.02rem;
    text-decoration: none;
    border: 1.5px solid var(--text-main); border-radius: 999px;
    box-shadow: 3px 3px 0 var(--text-main);
    transition: transform .15s, box-shadow .15s, background .15s;
}
.demo-cta:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--text-main); }

/* =========================================================
   DESKTOP / WIDE SCREENS (>= 880px) — kiosk landing.
   Mobile (520px column) is untouched; this only widens + lays
   out the hero side-by-side and the product grid multi-column.
   ========================================================= */
.hero-zone { display: contents; }   /* no effect on mobile; overridden below on desktop */
.desktop-only { display: none; }     /* shown only at >=880px */

@media (min-width: 880px) {
    .kiosk-container { max-width: 1200px; padding: 1.5rem 2rem 3rem; }

    /* hero: copy left, reel right — generous height so it reads as a hero */
    .hero-zone {
        display: grid;
        grid-template-columns: 1.05fr 1fr;
        align-items: center;
        gap: 3rem;
        margin-bottom: 2rem;
        min-height: 64vh;
    }
    .desktop-only { display: revert; }
    .kiosk-hero { text-align: left; margin-bottom: 0; padding: 0; }
    .kiosk-hero .hero-title { font-size: clamp(2.6rem, 4.5vw, 3.8rem); }
    .kiosk-hero .hero-title::after { margin-left: 0; }   /* left-align the accent underline */
    .kiosk-hero .hero-subtitle { font-size: 1.1rem; max-width: 44ch; margin-bottom: 1.6rem; }
    /* desktop CTA + trust line under the copy so the left column isn't empty */
    .kiosk-hero .hero-cta-row { display: flex; gap: .9rem; align-items: center; margin-top: .4rem; }
    .kiosk-hero .hero-trust { margin-top: 1.1rem; font-family: var(--font-mono); font-size: .76rem; color: var(--text-muted); }
    .demo-device { margin-bottom: 0; }
    .demo-preview { height: 380px; }
    .demo-cta { font-size: 1.08rem; padding: 1rem 1.5rem; }

    /* product grid: more columns on wide screens */
    .product-grid { grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
    .card-img-wrap { height: 150px; }

    /* category tabs don't need to stretch full width */
    .category-tabs { max-width: 480px; }
}

@media (min-width: 1200px) {
    .product-grid { grid-template-columns: repeat(5, 1fr); }
}

/* =========================================================
   EXACT-RENDER PRODUCT CARD REELS
   Generated from the real customer geometry; no card owns a live WebGL viewer.
   ========================================================= */
.card-img-wrap.classic-reel-wrap {
    position: relative;
    padding: 0;
    overflow: hidden;
    background: #e4f8fa;
}

.classic-reel-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 52% 38%, rgba(255,255,255,.98) 0 17%, rgba(225,249,251,.88) 52%, rgba(196,237,242,.96) 100%),
        linear-gradient(145deg, #f9feff, #ddf7fa);
    transition: transform .35s cubic-bezier(.22,.61,.36,1);
}

.classic-reel-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    background:
        linear-gradient(118deg, rgba(255,255,255,.30), transparent 32%),
        radial-gradient(circle at 50% 110%, rgba(23,43,53,.08), transparent 45%);
}

.classic-reel-poster,
.classic-reel-poster img,
.classic-reel-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.classic-reel-poster {
    z-index: 1;
    opacity: 1;
    transition: opacity .38s ease;
}

.classic-reel-poster img {
    display: block;
    object-fit: contain;
}

.classic-reel-poster img,
.classic-reel-layer {
    filter: drop-shadow(0 7px 3px rgba(23,43,53,.22));
}

.classic-reel-poster-hidden { opacity: 0; }

.classic-reel-layer {
    z-index: 2;
    opacity: 0;
    background-repeat: no-repeat;
    background-size: 500% 100%;
    background-position: 50% 0;
    transition: opacity .42s ease;
    will-change: opacity, background-position;
}

.classic-reel-layer.classic-reel-visible { opacity: 1; }

.classic-reel-layer.classic-reel-playing {
    animation: classic-reel-orbit 1.8s steps(1, end) 1 both;
}

@keyframes classic-reel-orbit {
    0%    { background-position: 50% 0; }
    12.5% { background-position: 25% 0; }
    25%   { background-position: 0 0; }
    37.5% { background-position: 25% 0; }
    50%   { background-position: 50% 0; }
    62.5% { background-position: 75% 0; }
    75%   { background-position: 100% 0; }
    87.5% { background-position: 75% 0; }
    100%  { background-position: 50% 0; }
}

.product-card:hover .classic-reel-stage { transform: scale(1.025); }

@media (prefers-reduced-motion: reduce) {
    .classic-reel-layer { animation: none !important; }
    .product-card:hover .classic-reel-stage { transform: none; }
}
