/* ===================================================================
   BALTHROP LOGIC™ — Premium Store UI v2
   Lifted navy/slate palette · Admin-wired theme · Mobile nav
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=DM+Mono:wght@400;500&display=swap');

/* ─── BASE TOKENS (dark navy/slate — lifted from near-black) ─── */
:root {
    --void:        #0d1420;
    --abyss:       #111827;
    --surface:     #1a2235;
    --surface-2:   #212d42;
    --surface-3:   #28364f;
    --edge:        rgba(255,255,255,0.08);
    --edge-bright: rgba(255,255,255,0.16);

    /* Brand amber — these get overridden by admin pickers below */
    --brand:       #e8a020;
    --brand-warm:  #f5b833;
    --brand-deep:  #b87a12;
    --brand-muted: rgba(232,160,32,0.12);
    --brand-glow:  0 0 44px rgba(232,160,32,0.18);

    --ink:         #e8ecf3;
    --ink-2:       #8f9ab0;
    --ink-3:       #5c6880;

    --radius-xl:   32px;
    --radius-lg:   24px;
    --radius-md:   16px;
    --radius-sm:   10px;
    --radius-xs:   6px;

    --shadow-sm:   0 2px 14px rgba(0,0,0,0.35);
    --shadow-md:   0 8px 36px rgba(0,0,0,0.45);
    --shadow-lg:   0 24px 64px rgba(0,0,0,0.55);
    --shadow-brand: 0 12px 40px rgba(232,160,32,0.20);

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'DM Sans', system-ui, sans-serif;
    --font-mono:    'DM Mono', 'Courier New', monospace;

    /* Compat shims — PHP injects these from admin */
    --shop-font-family:    var(--font-body);
    --shop-heading-scale:  1;
    --shop-body-scale:     1;
    --panel: var(--surface-2);
}

/* ─── ADMIN COLOR WIRING ─────────────────────────────────────────
   The PHP <style> block injects:
     --brand      ← primary_color
     --brand-warm ← secondary_color
     --brand-deep ← accent_color
     --void       ← hero_background  (page atmosphere)
     --abyss      ← page_background  (used for bg tint)
     --surface    ← panel_tint       (card surfaces)
     --ink        ← text_color
   The index.php <style> block maps them via CSS overrides below.
   ──────────────────────────────────────────────────────────────── */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: calc(16px * var(--shop-body-scale, 1));
    color: var(--ink);
    background-color: var(--abyss);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -8%, rgba(232,160,32,0.07), transparent),
        radial-gradient(ellipse 50% 40% at 92% 55%, rgba(232,160,32,0.035), transparent);
    min-height: 100vh;
}

body.viewer-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* Subtle grain */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.028;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

.site-shell { position: relative; z-index: 1; min-height: 100vh; }

/* ─── ANNOUNCEMENT BANNER ─── */
.announcement-bar {
    position: relative;
    z-index: 201;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    background: linear-gradient(90deg, var(--brand-deep), var(--brand), var(--brand-warm), var(--brand), var(--brand-deep));
    background-size: 300% 100%;
    animation: bannerShimmer 8s linear infinite;
    color: var(--void);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}

@keyframes bannerShimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.announcement-bar .ann-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--void);
    opacity: 0.6;
    font-size: 1rem;
    line-height: 1;
    padding: 4px;
    transition: opacity 180ms;
}

.announcement-bar .ann-close:hover { opacity: 1; }

/* ─── TOPBAR ─── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(17,24,39,0.88);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--edge);
}

.topbar::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    opacity: 0.5;
}

.topbar-inner,
.content-shell,
.footer-inner {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.brand-kicker {
    font-family: var(--font-mono);
    font-size: 0.60rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--brand);
    opacity: 0.9;
}

.brand-title {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
    letter-spacing: -0.01em;
}

/* Desktop nav links */
.top-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.top-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.87rem;
    font-weight: 500;
    color: var(--ink-2);
    transition: color 180ms, background 180ms;
    white-space: nowrap;
}

.top-link:hover {
    color: var(--ink);
    background: var(--edge);
}

.cart-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 999px;
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--void);
    background: var(--brand);
    border: 1px solid var(--brand-warm);
    transition: background 180ms, box-shadow 180ms, transform 120ms;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.cart-pill:hover {
    background: var(--brand-warm);
    box-shadow: var(--shadow-brand);
    transform: translateY(-1px);
}

/* ─── MOBILE HAMBURGER NAV ─── */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--edge-bright);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--ink-2);
    border-radius: 2px;
    transition: transform 240ms ease, opacity 240ms ease, width 240ms ease;
    transform-origin: center;
}

.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 199;
    background: rgba(13,20,32,0.98);
    backdrop-filter: blur(16px);
    padding: 80px 32px 32px;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 280ms ease, transform 280ms ease;
    pointer-events: none;
}

.mobile-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.mobile-nav a {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--ink-2);
    border-bottom: 1px solid var(--edge);
    transition: color 180ms, background 180ms;
}

.mobile-nav a:hover,
.mobile-nav a:focus {
    color: var(--ink);
    background: var(--surface);
}

.mobile-nav .mobile-cart {
    margin-top: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--void);
    background: var(--brand);
    text-align: center;
    border-bottom: none;
}

.mobile-nav .mobile-cart:hover { background: var(--brand-warm); }

/* ─── HERO ─── */
.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 100% 80% at 50% 0%, rgba(232,160,32,0.08), transparent 60%),
        linear-gradient(180deg, var(--void) 0%, var(--abyss) 100%);
    color: var(--ink);
    border-bottom: 1px solid var(--edge);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: radial-gradient(ellipse 90% 100% at 50% 0%, black 20%, transparent 100%);
}

.hero::after {
    content: '';
    position: absolute;
    top: -30%; left: 50%;
    transform: translateX(-50%);
    width: 900px; height: 420px;
    background: radial-gradient(ellipse, rgba(232,160,32,0.09), transparent 70%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr minmax(280px, 400px);
    gap: 56px;
    align-items: center;
    padding: 96px 0 112px;
}

.layout-centered-hero .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    max-width: 860px;
}

.layout-centered-hero .hero-copy p,
.layout-centered-hero .hero-card { margin-left: auto; margin-right: auto; }

.layout-catalog-first .content-shell { margin-top: 24px; }

.catalog-intro {
    margin: 0 0 28px;
    padding: 36px 40px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--edge-bright);
}

.catalog-intro h1 {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.03em;
}

.catalog-intro p {
    margin: 0;
    max-width: 60ch;
    color: var(--ink-2);
    line-height: 1.7;
}

.hero-announcement {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--brand-muted);
    border: 1px solid rgba(232,160,32,0.28);
    color: var(--brand-warm);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.13em;
}

.hero-copy h1 {
    margin: 0 0 22px;
    font-family: var(--font-display);
    font-size: clamp(calc(3rem * var(--shop-heading-scale,1)), 6vw, calc(5rem * var(--shop-heading-scale,1)));
    font-weight: 900;
    line-height: 0.93;
    letter-spacing: -0.04em;
    background: linear-gradient(140deg, var(--ink) 35%, var(--brand-warm) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-copy p {
    max-width: 52ch;
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--ink-2);
    font-weight: 300;
}

.hero-card {
    padding: 28px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--edge-bright);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
}

.hero-card-media {
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--edge);
}

.hero-card-media img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.hero-stat-label {
    display: block;
    margin-bottom: 8px;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.20em;
    color: var(--brand);
}

.hero-stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.hero-stat-copy {
    margin: 12px 0 0;
    color: var(--ink-2);
    line-height: 1.7;
    font-size: 0.93rem;
}

/* ─── FEATURED PRODUCT SPOTLIGHT ─── */
.featured-spotlight {
    margin: 0 0 28px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--edge-bright);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
}

.featured-spotlight::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-deep), var(--brand), var(--brand-warm));
}

.featured-inner {
    display: grid;
    grid-template-columns: 340px 1fr;
    align-items: center;
    gap: 0;
}

.featured-media {
    aspect-ratio: 1/1;
    background: var(--surface-2);
    overflow: hidden;
}

.featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms ease;
}

.featured-spotlight:hover .featured-media img { transform: scale(1.04); }

.featured-copy {
    padding: 40px 44px;
}

.featured-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--brand-muted);
    border: 1px solid rgba(232,160,32,0.25);
    color: var(--brand-warm);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.featured-eyebrow::before {
    content: '★';
    font-size: 0.7rem;
}

.featured-copy h2 {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.featured-copy p {
    margin: 0 0 24px;
    color: var(--ink-2);
    line-height: 1.75;
    font-size: 0.97rem;
    max-width: 52ch;
}

.featured-price {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 24px;
}

.featured-price .amount {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 500;
    color: var(--brand);
    letter-spacing: -0.02em;
}

.featured-price .from-label {
    font-size: 0.82rem;
    color: var(--ink-3);
}

/* ─── CONTENT SHELL ─── */
.content-shell {
    margin-top: -44px;
    padding-bottom: 80px;
}

/* ─── TOOLBAR ─── */
.toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 28px 32px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--edge-bright);
    box-shadow: var(--shadow-md);
    margin-bottom: 28px;
}

.toolbar-copy h2,
.section-title {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.toolbar-copy p,
.section-subtitle {
    margin: 0;
    color: var(--ink-2);
    line-height: 1.6;
    font-size: 0.92rem;
}

.filters { display: flex; gap: 12px; flex-wrap: wrap; }

.filters input,
.filters select,
.variant-group select {
    min-width: 180px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--edge-bright);
    background: var(--surface-2);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.92rem;
    outline: none;
    appearance: none;
    transition: border-color 180ms, box-shadow 180ms;
}

.filters select,
.variant-group select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%238f9ab0' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.filters input:focus,
.filters select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(232,160,32,0.11);
}

.filters input { min-width: min(360px, 68vw); }
.filters input::placeholder { color: var(--ink-3); }

/* ─── PRODUCT GRID ─── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.product-link { text-decoration: none; }
.product-shell.is-hidden { display: none; }

.product-card {
    overflow: hidden;
    border-radius: var(--radius-xl);
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--edge);
    box-shadow: var(--shadow-sm);
    transition: transform 260ms cubic-bezier(0.34,1.56,0.64,1), box-shadow 260ms ease, border-color 260ms ease;
    position: relative;
}

.product-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(232,160,32,0.05), transparent 55%);
    opacity: 0;
    transition: opacity 260ms ease;
    pointer-events: none;
}

.product-card:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow-lg), var(--brand-glow);
    border-color: rgba(232,160,32,0.22);
}

.product-card:hover::after { opacity: 1; }

.product-media {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--surface-2);
    overflow: hidden;
}

.product-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(13,20,32,0.55) 100%);
    pointer-events: none;
    z-index: 2;
}

.product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 420ms ease;
    display: block;
}

.product-card:hover .product-media img { transform: scale(1.07); }

.product-badge {
    position: absolute;
    top: 14px; left: 14px;
    z-index: 3;
    padding: 5px 12px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.63rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--brand-warm);
    background: rgba(13,20,32,0.84);
    border: 1px solid rgba(232,160,32,0.28);
    backdrop-filter: blur(8px);
}

.product-body { padding: 22px 24px 26px; position: relative; z-index: 2; }

.product-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.product-card h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.14rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.price-tag {
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.96rem;
    font-weight: 500;
    color: var(--brand);
}

.product-description {
    margin: 0 0 16px;
    color: var(--ink-2);
    line-height: 1.65;
    font-size: 0.90rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta-line { display: flex; flex-wrap: wrap; gap: 8px; }

.meta-pill {
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.73rem;
    color: var(--ink-3);
    background: var(--surface-2);
    border: 1px solid var(--edge);
    font-family: var(--font-mono);
    letter-spacing: 0.03em;
}

/* ─── PRODUCT DETAIL ─── */
.detail-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1.08fr);
    gap: 24px;
    align-items: start;
}

.page-layout { margin-bottom: 28px; }

.detail-card {
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--edge-bright);
    box-shadow: var(--shadow-md);
}

.detail-media { padding: 24px; position: sticky; top: 72px; }

.detail-media-frame {
    aspect-ratio: 1/1;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    border: 1px solid var(--edge);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-media-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
}

.main-image-button {
    width: 100%; height: 100%;
    padding: 0; border: 0;
    background: transparent;
    cursor: zoom-in;
}

.detail-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 0 0;
}

.gallery-thumb {
    width: 74px; height: 74px;
    padding: 4px;
    border: 2px solid var(--edge);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 180ms;
    flex-shrink: 0;
}

.gallery-thumb.is-active,
.gallery-thumb:hover { border-color: var(--brand); }

.gallery-thumb img {
    width: 100%; height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.image-viewer[hidden] { display: none; }

.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.image-viewer-backdrop {
    position: absolute;
    inset: 0; border: 0;
    background: rgba(0,0,0,0.93);
    backdrop-filter: blur(14px);
    cursor: pointer;
}

.image-viewer-dialog {
    position: relative;
    width: min(92vw, 1000px);
    height: min(88vh, 880px);
    margin: 4vh auto 0;
    padding: 24px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--edge-bright);
    box-shadow: var(--shadow-lg);
}

.image-viewer-dialog img {
    width: 100%; height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.image-viewer-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 40px; height: 40px;
    border: 1px solid var(--edge-bright);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--ink-2);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color 180ms, border-color 180ms;
}

.image-viewer-close:hover { color: var(--brand); border-color: var(--brand); }

.detail-copy { padding: 32px 36px; }

.detail-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 14px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--brand-muted);
    border: 1px solid rgba(232,160,32,0.24);
    color: var(--brand-warm);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.detail-card h1 {
    margin: 0 0 20px;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.detail-description {
    margin: 0 0 24px;
    color: var(--ink-2);
    line-height: 1.8;
    font-size: 0.95rem;
}

.rich-text p { margin: 0 0 16px; }
.rich-text ul, .rich-text ol { margin: 0 0 16px 22px; color: var(--ink-2); }
.rich-text li { margin-bottom: 6px; }
.rich-text strong { color: var(--ink); font-weight: 600; }

.price-block {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px 24px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--edge);
}

.price-block strong {
    font-family: var(--font-mono);
    font-size: 2.1rem;
    font-weight: 500;
    color: var(--brand);
    letter-spacing: -0.02em;
}

.price-block span { color: var(--ink-3); font-size: 0.86rem; line-height: 1.5; }

.variant-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 24px;
}

.variant-group label {
    display: block;
    margin-bottom: 8px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.variant-group select {
    width: 100%;
    padding: 13px 36px 13px 16px;
    border-radius: var(--radius-md);
    transition: border-color 180ms, box-shadow 180ms;
}

.variant-group select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(232,160,32,0.11);
}

.cta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 24px;
}

.button, button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    border: 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: all 200ms ease;
}

.button-primary {
    color: var(--void);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-warm) 100%);
    box-shadow: var(--shadow-brand);
}

.button-primary:hover {
    background: linear-gradient(135deg, var(--brand-warm) 0%, #ffcf5e 100%);
    transform: translateY(-2px);
    box-shadow: 0 16px 48px rgba(232,160,32,0.28);
}

.button-secondary {
    color: var(--ink-2);
    background: var(--surface-2);
    border: 1px solid var(--edge-bright);
}

.button-secondary:hover { color: var(--ink); background: var(--surface-3); }

.share-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--edge);
}

.share-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-3);
    font-weight: 500;
}

.share-button {
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    font-size: 0.82rem;
    font-weight: 500;
    background: var(--surface-2);
    color: var(--ink-2);
    border: 1px solid var(--edge);
    transition: color 180ms, border-color 180ms;
}

.share-button:hover { color: var(--brand); border-color: rgba(232,160,32,0.3); }

/* ─── CART ─── */
.cart-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--edge-bright);
    box-shadow: var(--shadow-md);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 28px 32px 0;
    flex-wrap: wrap;
}

.cart-header h1, .cart-header h2 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0;
    color: var(--ink);
}

.cart-body { padding: 24px 32px 32px; }
.cart-table { width: 100%; border-collapse: collapse; }

.cart-table th, .cart-table td {
    padding: 18px 16px;
    border-bottom: 1px solid var(--edge);
    text-align: left;
}

.cart-table th {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-3);
    font-weight: 500;
}

.cart-table td { color: var(--ink-2); font-size: 0.93rem; }

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--edge-bright);
}

.cart-summary-copy { display: flex; flex-direction: column; gap: 6px; }
.cart-summary-copy span { color: var(--ink-3); line-height: 1.6; font-size: 0.88rem; }

.qty-input {
    width: 80px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--edge-bright);
    background: var(--surface-2);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.95rem;
    text-align: center;
    outline: none;
    transition: border-color 180ms;
}

.qty-input:focus { border-color: var(--brand); }

.button-disabled { color: var(--ink-3); background: var(--surface-2); cursor: not-allowed; opacity: 0.55; }

.error-banner {
    margin-bottom: 20px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: rgba(220,60,60,0.09);
    border: 1px solid rgba(220,60,60,0.28);
    color: #ef7070;
    font-size: 0.92rem;
}

.empty-state { padding: 64px 32px; text-align: center; }

.empty-state h2 {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--ink);
}

.empty-state p { margin: 0 0 28px; color: var(--ink-2); }
.remove-link { color: rgba(220,60,60,0.65); font-weight: 500; font-size: 0.84rem; transition: color 180ms; }
.remove-link:hover { color: #ef7070; }

/* ─── BUILDER SECTIONS ─── */
.builder-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 32px;
}

.builder-card, .custom-html-block {
    background: var(--surface);
    border: 1px solid var(--edge);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-xl);
}

.builder-card { padding: 28px; }

.builder-card h3 {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.builder-card p { margin: 0 0 20px; line-height: 1.75; color: var(--ink-2); font-size: 0.93rem; }
.custom-html-block { margin-top: 28px; padding: 28px; }

/* ─── FOOTER ─── */
.footer {
    margin-top: 64px;
    background: var(--void);
    border-top: 1px solid var(--edge);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    opacity: 0.3;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 28px 0;
    flex-wrap: wrap;
}

.footer-inner div { font-size: 0.83rem; color: var(--ink-3); font-family: var(--font-mono); letter-spacing: 0.04em; }
.footer-note { color: var(--ink-3); font-size: 0.83rem; }
.gallery-preview-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .featured-inner { grid-template-columns: 260px 1fr; }
}

@media (max-width: 980px) {
    .hero-inner, .detail-layout, .builder-grid { grid-template-columns: 1fr; }
    .hero-inner { padding: 72px 0 88px; }
    .detail-media { position: static; }
    .variant-grid { grid-template-columns: 1fr; }
    .featured-inner { grid-template-columns: 1fr; }
    .featured-media { aspect-ratio: 16/7; }
    .featured-copy { padding: 28px 28px; }
}

@media (max-width: 768px) {
    /* Show hamburger, hide desktop links */
    .nav-toggle { display: flex; }
    .top-actions { display: none; }
    .mobile-nav { display: flex; }
    .topbar-inner { padding: 12px 0; }
}

@media (max-width: 640px) {
    .topbar-inner, .footer-inner, .toolbar, .cart-header, .cart-total {
        flex-direction: column;
        align-items: flex-start;
    }
    .product-grid { grid-template-columns: 1fr; }
    .filters, .cta-row { width: 100%; }
    .filters input, .filters select, .button, button.button { width: 100%; }
    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
    .cart-table thead { display: none; }
    .cart-table tr { padding: 14px 0; border-bottom: 1px solid var(--edge); }
    .cart-table td { padding: 6px 0; border: 0; }
    .detail-copy { padding: 24px 20px; }
    .cart-body, .cart-header { padding-left: 20px; padding-right: 20px; }
    .hero-copy h1 { -webkit-text-fill-color: var(--ink); background: none; }
    .featured-copy { padding: 24px 20px; }
}
