/**
 * Wuuf Design Configurator Styles
 * Matches wearwuuf.com design system
 */

/* ============================================================================
   CSS Variables (Design System)
   ============================================================================ */

:root {
    /* Primary (heading / logo / strong text color — historically misnamed
       but kept for backwards compat). */
    --color-primary: #121212;
    --color-primary-light: #ffffff;

    /* Brand orange — used for CTAs (Pick a color/size, Begin Checkout,
       View all designs, etc.), active swatch borders, prices, links.
       Matches the marquee + Design Now button on the home page. */
    --color-brand-orange: #E4632B;
    --color-brand-orange-hover: #D05520;

    /* Accent */
    --color-accent: #76191c;
    --color-accent-alt: #3070c1;

    /* Text */
    --color-text: #222222;
    --color-text-muted: #666666;
    --color-text-light: #999999;

    /* Background */
    --color-bg: #ffffff;
    --color-bg-alt: #f5f5f5;
    --color-bg-dark: #121212;

    /* Warm "paper" tones — sampled from the Design-Your-Bestie sticker
       collage. Used as the backdrop behind product artwork so hand-drawn
       portraits read as stickers on paper rather than floating in cold grey. */
    --color-paper: #F7F2E9;
    --color-paper-deep: #EFE6D5;

    /* Friendly-positive green (matches the badge ring) — for delivery/
       promise chips so they read as reassurance, not an alert. */
    --color-positive: #1B8A48;

    /* Brand-orange tint — hairline borders and soft fills that stay in the
       warm family instead of the cool grey #e0e0e0. */
    --color-brand-orange-tint: rgba(228, 99, 43, 0.14);

    /* Borders */
    --color-border: #e0e0e0;
    --color-border-dark: #333333;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Sticker shadow — warm-tinted lift for product cards, so the shadow
       feels like it belongs to the orange brand rather than a neutral UI. */
    --shadow-sticker: 0 4px 16px rgba(228, 99, 43, 0.10), 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-sticker-hover: 0 12px 30px rgba(228, 99, 43, 0.18), 0 3px 8px rgba(0, 0, 0, 0.07);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-full: 50px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Playful "overshoot" easing for presses and reveals — gives motion a
       gentle bounce that reads as lively rather than mechanical. */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Display face for headings + product names — IBM Plex Sans Thai, the
       site's established display font (covers Latin + Thai). Chonburi was
       tried on 2026-07-11 and reverted here at the user's request; this one
       token drives every heading/name, so the typeface swaps in one place. */
    --font-display: 'IBM Plex Sans Thai', 'Noto Sans Thai', sans-serif;
}

/* Global press feedback — any button/CTA/card link dips slightly when tapped,
   giving the whole UI a tactile, toy-like responsiveness on mobile. Kept
   subtle so it never feels gimmicky. */
@media (hover: none) {
    a:active, button:active { -webkit-tap-highlight-color: transparent; }
}

/* Respect reduced-motion: strip transforms/animations for anyone who asked
   the OS to minimise motion. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Scroll-reveal — elements marked `.reveal` fade + rise into place as they
   scroll into view. The hidden start-state is gated behind `.js-anim`, which
   the reveal script in base.html only adds when IntersectionObserver is
   available AND the user hasn't requested reduced motion. So with no JS, an
   old browser, or reduced-motion, `.reveal` elements are never hidden — they
   render normally. Motion is transform/opacity only (compositor-friendly). */
.js-anim .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s var(--ease-spring);
    will-change: opacity, transform;
}
.js-anim .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ============================================================================
   Base Styles
   ============================================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Zen Kaku Gothic New', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
}

/* /catalog page h1 doesn't have .display-title yet — apply the brand
   display font here so the catalog page heading matches the rest. The
   .display-title rule itself lives in theme-select.css. (catalog.html's
   inline block sets the size/weight; this guarantees the family even if
   that block is ever removed.) */
.catalog-header h1 {
    font-family: var(--font-display);
    font-weight: 700;
}

/* ============================================================================
   Typography
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.3;
    color: var(--color-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* ============================================================================
   Layout
   ============================================================================ */

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 max(var(--spacing-lg), env(safe-area-inset-right)) 0 max(var(--spacing-lg), env(safe-area-inset-left));
}

.main {
    flex: 1;
    padding: var(--spacing-sm) 0 var(--spacing-2xl);
}
.main:has(> .hero-carousel:first-child) {
    padding-top: 0;
}

/* ============================================================================
   Hero carousel — 3 auto-rotating full-screen slides on the home page
   Mirrors wearwuuf.com structure: min-height 70vh mobile / 100vh tablet+
   ============================================================================ */

.hero-carousel {
    position: relative;
    width: 100%;
    min-height: 60vh;
    overflow: hidden;
    background: #1a1a1a;  /* dark behind slides while images load */
}
/* Desktop: nearly-full-screen hero. 85vh = ~653px tall on a 1366×768
   laptop, ~918px on 1920×1080. Leaves a small sliver of the next
   section visible at the bottom so visitors know there's more below. */
@media (min-width: 768px) {
    .hero-carousel {
        min-height: 85vh;
    }
}
.hero-carousel__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 800ms ease-in-out;
    pointer-events: none;
}
.hero-carousel__slide.is-active {
    opacity: 1;
    pointer-events: auto;
}
.hero-carousel__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
/* Per-slide crop overrides — slide 3 (hero-3) anchors mid-photo so the
   subjects' upper bodies show. Add more [data-slide="N"] rules as needed. */
.hero-carousel__slide[data-slide="2"] .hero-carousel__image {
    object-position: center 35%;
}
.hero-carousel__overlay {
    position: absolute;
    inset: 0;
    /* Centered text — soft top+bottom darken so the headline reads against
       any photo without one side feeling heavier than the other. */
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.25) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.45) 100%
    );
    display: flex;
    align-items: center;         /* vertical center */
    justify-content: center;     /* horizontal center */
    padding: 2rem 1.5rem 5rem;   /* leave room for dot nav below */
}
@media (min-width: 768px) {
    .hero-carousel__overlay {
        padding: 3rem 3rem 6rem;
    }
}
.hero-carousel__inner {
    max-width: 720px;
    text-align: center;
}
.hero-carousel__title {
    color: #ffffff;              /* explicit white — overrides global h1 dark */
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 1rem;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}
.hero-carousel__subtitle {
    color: #ffffff;              /* explicit white */
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* Dot navigation */
.hero-carousel__dots {
    position: absolute;
    bottom: 1.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 2;
}
@media (min-width: 768px) {
    .hero-carousel__dots { bottom: 2.5rem; }
}
.hero-carousel__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}
.hero-carousel__dot:hover { background: rgba(255, 255, 255, 0.4); }
.hero-carousel__dot.is-active {
    background: #fff;
    transform: scale(1.15);
}

/* ============================================================================
   Brand mark — inline highlight on the word WUUF in body copy
   Use: <span class="brand-mark">WUUF</span>
   ============================================================================ */

.brand-mark {
    color: var(--color-brand-orange);
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* ============================================================================
   Announcement bar — sitewide promo above the header
   ============================================================================ */

/* Slim single-line announcement bar — modelled after Wituka's
   ticker-style top strip. Padding is intentionally tight (≈0.3rem) and
   white-space: nowrap on the slide keeps every promo on one line.
   Arrows shrink to icon-only without their own height baggage. */
.announcement-bar {
    background-color: var(--color-bg-dark);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 400;
    padding: 0.45rem 0.75rem;
    text-align: center;
    letter-spacing: 0.02em;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}
.announcement-bar__inner {
    display: grid;
    place-items: center;
    min-width: 0;
}
.announcement-bar__arrow {
    background: transparent;
    border: 0;
    color: #ffffff;
    opacity: 0.45;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0 0.25rem;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}
.announcement-bar__arrow:hover,
.announcement-bar__arrow:focus-visible {
    opacity: 1;
}
.announcement-bar__arrow:focus-visible {
    outline: 1px solid #ffffff;
    outline-offset: 1px;
    border-radius: 2px;
}
.announcement-bar__slide {
    grid-area: 1 / 1;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    /* nowrap is the key change — no more multi-line wrap on narrow
       screens, the slide stays a single thin strip. Long promos get
       truncated by ellipsis instead of growing the bar's height. */
    flex-wrap: nowrap;
    white-space: nowrap;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease;
}
.announcement-bar__slide.is-active {
    opacity: 1;
    visibility: visible;
}
.announcement-bar__code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    background-color: var(--color-brand-orange);
    color: #ffffff;
    padding: 0.04rem 0.4rem;
    border-radius: 0.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
    line-height: 1.2;
}
.announcement-bar__highlight {
    font-weight: 600;
}
@media (max-width: 480px) {
    .announcement-bar { font-size: 0.66rem; padding: 0.35rem 0.5rem; }
    .announcement-bar__code { font-size: 0.66rem; padding: 0.04rem 0.32rem; }
    .announcement-bar__arrow { font-size: 0.85rem; }
}

/* ============================================================================
   First-visit discount popup — modal that surfaces NEWCOMER code
   ============================================================================ */

.fv-popup {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.fv-popup.is-open { display: flex; }
.fv-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.fv-popup__card {
    position: relative;
    background: #ffffff;
    border-radius: 1rem;
    max-width: 420px;
    width: 100%;
    padding: 2rem 1.75rem 1.5rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: fv-pop-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fv-pop-in {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.fv-popup__close {
    position: absolute;
    top: 0.5rem;
    right: 0.85rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem 0.6rem;
    border-radius: 0.3rem;
}
.fv-popup__close:hover { color: var(--color-primary); background: var(--color-bg-alt, #f5f5f5); }
.fv-popup__emoji {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}
.fv-popup__title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 0.4rem;
    line-height: 1.25;
}
.fv-popup__subtitle {
    font-size: 1.1rem;
    color: var(--color-brand-orange);
    font-weight: 700;
    margin: 0 0 0.85rem;
}
.fv-popup__body {
    color: var(--color-text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0 0 1.25rem;
}
.fv-popup__code-block {
    background: var(--color-bg-alt, #f5f5f5);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}
.fv-popup__code-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
    font-weight: 600;
}
.fv-popup__code-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}
.fv-popup__code {
    flex: 1;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.06em;
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.35rem;
    border: 1px dashed #cbd5e1;
}
.fv-popup__copy {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.5rem 0.95rem;
    border-radius: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}
.fv-popup__copy:hover { background: #333; }
.fv-popup__cta {
    display: block;
    background: var(--color-brand-orange);
    color: white;
    text-decoration: none;
    padding: 0.85rem 1.5rem;
    border-radius: 0.4rem;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.6rem;
}
.fv-popup__cta:hover { background: var(--color-brand-orange-hover); }
.fv-popup__dismiss {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    text-decoration: underline;
}
.fv-popup__dismiss:hover { color: var(--color-primary); }

body.fv-popup-open { overflow: hidden; }

@media (max-width: 480px) {
    .fv-popup__card { padding: 1.75rem 1.25rem 1.25rem; }
    .fv-popup__title { font-size: 1.2rem; }
    .fv-popup__subtitle { font-size: 1rem; }
    .fv-popup__code { font-size: 1rem; }
}

/* ============================================================================
   Trust badges — 3-tile strip on home + PDP
   ============================================================================ */

.trust-badges {
    /* Cream "sticker card" — matches the product-card language instead of the
       old cool-grey panel. */
    background: var(--color-paper);
    padding: var(--spacing-xl, 2rem) var(--spacing-md, 1rem);
    margin: var(--spacing-xl, 2rem) 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-brand-orange-tint);
    box-shadow: var(--shadow-sticker);
}
.trust-badges__grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg, 1.5rem);
}
.trust-badge {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    text-align: left;
}
.trust-badge__icon {
    font-size: 1.85rem;
    line-height: 1;
    flex-shrink: 0;
}
.trust-badge__headline {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}
.trust-badge__subtext {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}
@media (max-width: 768px) {
    .trust-badges { padding: 1.25rem 0.85rem; }
    .trust-badges__grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    .trust-badge__icon { font-size: 1.5rem; }
    .trust-badge__headline { font-size: 0.9rem; }
    .trust-badge__subtext { font-size: 0.78rem; }
}

/* When nested inside the PDP info column (narrow, ~400-500px on desktop),
   force a single-column stack regardless of viewport width — 3 columns
   would render cramped with text wrapping awkwardly. */
.product-detail__info .trust-badges {
    padding: 1.25rem 0.85rem;
    margin-top: 1rem;
}
.product-detail__info .trust-badges__grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

/* ============================================================================
   Header
   ============================================================================ */

.header {
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: max(var(--spacing-sm), env(safe-area-inset-top)) 0 var(--spacing-sm);
}

.header .container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.05em;
}

.logo-img {
    height: 36px;
    width: auto;
}

.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.nav-link {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.nav-link:hover {
    background-color: var(--color-bg-alt);
}

/* Language Switcher */
.header-left {
    display: none;
    align-items: center;
}

.lang-switch {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-xs);
}

/* Header Right (lang switch + user/login) */
.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* LINE Login Button */
.btn-line-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #06C755;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition-base);
}

.btn-line-login:hover {
    background: #05b34c;
}

.btn-line-login .line-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* User Menu (logged in) */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    transition: background var(--transition-base);
}

.user-menu-btn:hover {
    background: var(--color-bg-alt);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* Initials avatar fallback for email accounts (no LINE picture) */
.user-avatar--initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-brand-orange);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
}

/* Header "Log in" entry point (shown when not logged in) */
.auth-login-link {
    font-weight: 600;
}

/* Checkout points-redemption widget (in order summary) */
.checkout-points {
    margin: 0.75rem 0 0;
    padding: 0.75rem 0.9rem;
    background: #fff7f3;
    border: 1px solid #f6d8c8;
    border-radius: var(--radius-md);
}
.checkout-points__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    cursor: pointer;
}
.checkout-points__toggle input:disabled {
    cursor: not-allowed;
}
.checkout-points__info {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.3rem;
}
.checkout-points__info strong {
    color: var(--color-brand-orange);
}
.checkout-points__note {
    font-size: 0.8rem;
    color: #b91c1c;
    margin-top: 0.3rem;
}
.checkout-points__note:empty {
    display: none;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 150px;
    z-index: 100;
    overflow: hidden;
}

.user-dropdown.hidden {
    display: none;
}

.user-dropdown-link {
    display: block;
    padding: 10px 16px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background var(--transition-base);
}

.user-dropdown-link:hover {
    background: var(--color-bg-alt);
}

/* Mobile nav user section */
.mobile-nav-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    font-size: 0.9rem;
}

.mobile-nav-logout {
    margin-left: auto;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.8rem;
}

.mobile-line-btn {
    width: 100%;
    justify-content: center;
    margin-bottom: var(--spacing-sm);
}

/* LINE Connected Badge */
.line-connected {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: #f0faf4;
    border: 1px solid #c8e6c9;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.line-connected-badge {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2e7d32;
    background: #e8f5e9;
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

/* Hamburger button — hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
}

.mobile-nav-overlay.hidden {
    display: none;
}

/* Mobile Nav Drawer */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: var(--color-bg);
    z-index: 201;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mobile-nav.open {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--color-text);
    line-height: 1;
}

.mobile-nav-links {
    flex: 1 1 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.mobile-nav-link {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
}

.mobile-nav-link:hover {
    color: #E4632B;
}

.mobile-nav-featured {
    flex: 0 0 auto;
    padding: 0 var(--spacing-lg) var(--spacing-md);
}

.mobile-nav-market {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: var(--spacing-sm);
}

.mobile-nav-products {
    display: flex;
    gap: var(--spacing-sm);
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-products::-webkit-scrollbar {
    height: 4px;
}

.mobile-nav-products::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 999px;
}

.mobile-nav-product {
    flex: 0 0 7.25rem;
    color: var(--color-text);
    text-decoration: none;
    scroll-snap-align: start;
}

.mobile-nav-product__image {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    background: #f8faf7;
    overflow: hidden;
}

.mobile-nav-product__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.35rem;
}

.mobile-nav-product__placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    padding: 0.6rem;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.mobile-nav-product__name {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.25;
}

.mobile-nav-footer {
    flex: 0 0 auto;
    padding: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.mobile-nav-lang {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.lang-btn {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.lang-btn:hover {
    color: var(--color-text);
    background-color: var(--color-bg-alt);
}

.lang-btn.active {
    color: var(--color-primary);
    font-weight: 700;
}

.lang-divider {
    color: var(--color-border);
    font-size: 0.8125rem;
    user-select: none;
}

/* ============================================================================
   Footer
   ============================================================================ */

.footer {
    background-color: var(--color-bg-dark);
    padding: var(--spacing-2xl) 0 max(var(--spacing-lg), env(safe-area-inset-bottom));
    margin-top: auto;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

/* Mobile: About spans the full row, then the three link-list columns share
   a 2-up grid below — keeps the footer compact instead of one long stack.
   Desktop (≥768px) reverts to 4 columns side-by-side. */
.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--spacing-lg);
    row-gap: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}
.footer-col--wide {
    grid-column: 1 / -1;
}
@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr 1fr;
        column-gap: var(--spacing-2xl);
        row-gap: var(--spacing-2xl);
        padding-bottom: var(--spacing-xl);
    }
    .footer-col--wide {
        grid-column: auto;     /* About becomes a regular column on desktop */
    }
}

.footer-col-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 var(--spacing-sm);
}
@media (min-width: 768px) {
    .footer-col-title {
        margin-bottom: var(--spacing-md);
    }
}

.footer-col-body {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8125rem;
    line-height: 1.5;
    max-width: 40ch;
}

.footer-col-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}
@media (min-width: 768px) {
    .footer-col-list {
        gap: var(--spacing-sm);
    }
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.875rem;
}

.footer-link:hover {
    color: #fff;
}

.footer-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Thin divider rule then a tight copyright row with the wordmark + copy text. */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: var(--spacing-md);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
}

.footer-logo {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    letter-spacing: 0.18em;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.75rem;
    margin: 0;
}

/* ============================================================================
   Hero (page header — used on theme-select, /order, /checkout, /track)
   ============================================================================ */

.hero {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

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

/* ============================================================================
   Form primitives (label + hint + input/textarea — used everywhere)
   ============================================================================ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.form-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

.form-hint {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text);
    background: #fff;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(228, 99, 43, 0.12);
}

textarea.form-input {
    resize: vertical;
    min-height: 70px;
    font-family: inherit;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--color-brand-orange);
    color: #ffffff;
    border-color: var(--color-brand-orange);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-brand-orange-hover);
    border-color: var(--color-brand-orange-hover);
    color: #ffffff;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-primary);
    color: var(--color-primary-light);
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================================================
   Step Indicator
   ============================================================================ */

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-2xl);
}

.step {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    opacity: 0.4;
}

.step.active,
.step.completed {
    opacity: 1;
}

.step-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    text-decoration: none;
    color: inherit;
}

.step-link:hover {
    opacity: 0.7;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-primary);
}

.step.active .step-number {
    background-color: var(--color-primary);
    color: var(--color-primary-light);
}

.step.completed .step-number {
    background-color: var(--color-primary);
    color: var(--color-primary-light);
}

.step-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

.step-line {
    width: 40px;
    height: 2px;
    background-color: var(--color-border);
}

@media (max-width: 480px) {
    .step-label {
        display: none;
    }
    .step-line {
        width: 24px;
    }
}

/* Progress Encouragement */
.progress-encourage {
    text-align: center;
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    margin-top: calc(-1 * var(--spacing-lg));
    margin-bottom: var(--spacing-xl);
}

/* Selection Encouragement Flash */
.selection-encourage {
    text-align: center;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-accent);
    background: var(--color-bg-alt);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    opacity: 1;
    transition: opacity var(--transition-base);
}

.selection-encourage.hidden {
    display: block !important;
    opacity: 0;
    pointer-events: none;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* ============================================================================
   Modal
   ============================================================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.modal-content h2 {
    margin-bottom: var(--spacing-md);
}

.modal-content p {
    margin-bottom: var(--spacing-md);
    color: var(--color-text-muted);
}

.modal-content .btn {
    margin-top: var(--spacing-md);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.modal-actions .btn {
    margin-top: 0;
    width: 100%;
}

/* ============================================================================
   Size Guide Modal
   ============================================================================ */

.btn-link {
    background: none;
    border: none;
    color: var(--color-accent-alt);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: var(--spacing-xs) 0;
    transition: color var(--transition-fast);
}

.btn-link:hover {
    color: var(--color-primary);
}

.modal-content-wide {
    position: relative;
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    max-width: 640px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    max-height: 85vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-bg-alt);
    color: var(--color-primary);
}

.size-guide-tabs {
    display: flex;
    gap: var(--spacing-xs);
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--spacing-xl);
}

.size-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
}

.size-tab:hover {
    color: var(--color-text);
}

.size-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.size-tab-content {
    display: none;
}

.size-tab-content.active {
    display: block;
}

.size-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.size-table th,
.size-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.size-table th {
    background: var(--color-bg-alt);
    font-weight: 600;
    color: var(--color-primary);
}

.size-table td:first-child,
.size-table th:first-child {
    text-align: left;
}

.product-details-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.product-details-list li {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.9375rem;
}

.product-details-list .detail-label {
    font-weight: 500;
    color: var(--color-primary);
    min-width: 120px;
    flex-shrink: 0;
}

.product-details-list .detail-value {
    color: var(--color-text-muted);
}

.care-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

.care-list li {
    padding-left: var(--spacing-lg);
    position: relative;
}

.care-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-text-light);
}

/* ============================================================================
   Mobile UX Fixes
   ============================================================================ */

@media (max-width: 767px) {
    .nav-center {
        display: none;
    }

    .header .container {
        grid-template-columns: auto 1fr auto;
    }

    .header-left {
        display: flex;
    }

    .logo {
        justify-content: center;
    }

    .hamburger {
        display: flex;
    }

    .header-right .btn-line-login {
        display: none;
    }

    /* Hide the header "Sign in" link on mobile — it crowds the cart + lang
       switch. Login lives in the hamburger drawer instead (.mobile-nav-login),
       leaving a clean header: hamburger · logo · cart · language. */
    .auth-login-link {
        display: none;
    }

    .user-name {
        display: none;
    }

    .configurator {
        overflow-x: hidden;
    }

    .configurator-grid {
        min-width: 0;
    }

    .preview-panel,
    .options-panel {
        min-width: 0;
        max-width: 100%;
    }

    .preview-panel {
        position: static;
    }

    .preview-image-container {
        aspect-ratio: auto;
        max-height: 50vh;
        overflow: hidden;
    }

    .preview-image {
        max-height: 50vh;
        max-width: 100%;
        width: auto;
        margin: 0 auto;
        display: block;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .options-form {
        gap: var(--spacing-lg);
    }

    .form-group + .form-group {
        border-top: 1px solid var(--color-border);
        padding-top: var(--spacing-lg);
    }
}

@media (max-width: 375px) {
    .preview-image-container {
        max-height: 40vh;
    }

    .preview-image {
        max-height: 40vh;
    }
}

@media (max-width: 374px) {
    .text-color-swatches {
        grid-template-columns: repeat(3, 1fr);
    }

    .placement-options {
        flex-direction: column;
    }

    .placement-option {
        flex-direction: row;
        width: 100%;
        min-width: unset;
    }

}

@media (max-width: 479px) {
    .size-quantity-grid {
        grid-template-columns: 1fr 1fr;
    }
}
