/*
Theme Name: Sjokoladefabrikken i Skien
Theme URI: https://sjokoladefabrikken-skien.no
Author: Sjokoladefabrikken i Skien
Description: Steampunk factory WooCommerce theme for The Cocoa Forge. Interactive chocolate plate builder with conveyor belt animations.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: Proprietary
Text Domain: choco-theme
WC requires at least: 8.0
WC tested up to: 9.5
*/

/* =============================================================================
   CSS Variables (Steampunk Design Tokens)
   ============================================================================= */
:root {
    --dark: #0F0500;
    --mid: #2A1000;
    --brown: #5C2E00;
    --warm: #8B4513;
    --gold: #C8960C;
    --gold-l: #F0C040;
    --cream: #FFF8E7;
    --copper: #B87333;
    --green: #2ECC71;
    --red: #E74C3C;

    --font-heading: 'Cinzel', Georgia, serif;
    --font-body: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(15, 5, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(15, 5, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(15, 5, 0, 0.4);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1200px;

    --price-bar-height: 0px;
    --progress-strip-height: 38px;
}

/* =============================================================================
   Reset & Base
   ============================================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--cream);
    background-color: var(--dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body.steampunk-legal,
body.woocommerce-page:not(.home) {
    overflow: auto;
    height: auto;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--gold-l);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--gold);
}

h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

/* =============================================================================
   Layout
   ============================================================================= */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* =============================================================================
   Steampunk Header (Minimal for factory)
   ============================================================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(90deg, var(--brown), var(--warm), var(--brown));
    border-bottom: 2px solid var(--gold);
    height: 32px;
    display: flex;
    align-items: center;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.site-logo {
    font-family: var(--font-heading);
    font-size: clamp(0.6rem, 0.9vw, 0.8rem);
    font-weight: 700;
    color: var(--gold-l);
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
}

.site-logo span {
    color: var(--gold);
}

.site-logo img,
.site-logo .custom-logo {
    height: 22px;
    width: auto;
}

.nav-main {
    display: none;
}

.nav-main.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(26, 10, 2, 0.97), rgba(15, 5, 0, 0.98));
    border-bottom: 2px solid var(--copper);
    padding: var(--space-md);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
}

.nav-main a,
.nav-main .menu-item a {
    padding: var(--space-sm) var(--space-md);
    font-weight: 500;
    color: var(--copper);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    display: block;
}

.nav-main a:hover,
.nav-main .menu-item a:hover {
    background: rgba(184, 115, 51, 0.15);
    color: var(--gold-l);
}

.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--copper);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--copper);
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--gold);
    color: var(--dark);
    font-size: 0.6rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-switch {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border: 1px solid var(--copper);
    border-radius: var(--radius-sm);
    background: rgba(26, 10, 2, 0.9);
    color: var(--copper);
    cursor: pointer;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

/* =============================================================================
   Pages (Factory Scenes)
   ============================================================================= */
.page {
    position: fixed;
    inset: 0;
    top: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, transform 0.6s ease;
    z-index: 1;
    overflow: hidden;
    overflow-y: auto;
}

.page.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
    transform: none;
}

.page.exit-zoom {
    transform: scale(3);
    opacity: 0;
}

.page.enter-from-right {
    transform: translateX(60px);
}

.page.enter-from-left {
    transform: translateX(-60px);
}

/* =============================================================================
   Steampunk Background Elements
   ============================================================================= */
.sp-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.sp-bg .brick {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 38px, rgba(90, 40, 5, 0.25) 38px, rgba(90, 40, 5, 0.25) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 78px, rgba(90, 40, 5, 0.2) 78px, rgba(90, 40, 5, 0.2) 80px);
    background-color: var(--mid);
}

.sp-bg .vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.65) 100%);
}

/* Gears */
.gear {
    position: absolute;
    border-radius: 50%;
    border: 4px solid var(--copper);
    opacity: 0.12;
    animation: spin 20s linear infinite;
}

.gear.r {
    animation-direction: reverse;
}

.gear.g1 { width: 120px; height: 120px; top: 5%; left: 3%; }
.gear.g2 { width: 80px; height: 80px; top: 8%; left: 8%; animation-duration: 14s; }
.gear.g3 { width: 160px; height: 160px; bottom: 12%; right: 2%; animation-duration: 25s; }
.gear.g4 { width: 60px; height: 60px; top: 20%; right: 8%; animation-duration: 10s; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pipes */
.pipe-h {
    position: absolute;
    height: 12px;
    background: linear-gradient(180deg, var(--copper), #7a5020, var(--copper));
    opacity: 0.18;
    border-radius: 6px;
}

.pipe-v {
    position: absolute;
    width: 12px;
    background: linear-gradient(90deg, var(--copper), #7a5020, var(--copper));
    opacity: 0.18;
    border-radius: 6px;
}

.pipe-h.p1 { top: 15%; left: 0; width: 35%; }
.pipe-h.p2 { bottom: 22%; right: 0; width: 28%; }
.pipe-v.p3 { left: 12%; top: 0; height: 30%; }
.pipe-v.p4 { right: 15%; bottom: 0; height: 25%; }

/* Steam puffs */
.steam {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 70%);
    border-radius: 50%;
    animation: steam-rise 4s ease-out infinite;
}

.steam.s1 { bottom: 20%; left: 12%; animation-delay: 0s; }
.steam.s2 { bottom: 18%; left: 13%; animation-delay: 1.5s; width: 20px; height: 20px; }
.steam.s3 { bottom: 25%; right: 15%; animation-delay: 0.8s; }
.steam.s4 { bottom: 22%; right: 14%; animation-delay: 2.2s; width: 25px; height: 25px; }

@keyframes steam-rise {
    0% { transform: translateY(0) scale(1); opacity: 0.6; }
    100% { transform: translateY(-80px) scale(2.5); opacity: 0; }
}

/* Lanterns */
.lantern {
    position: absolute;
    width: 20px;
    height: 30px;
}

.lantern .body {
    width: 16px;
    height: 22px;
    margin: 0 auto;
    background: linear-gradient(180deg, #333, #1a1a1a);
    border: 1px solid var(--copper);
    border-radius: 3px 3px 6px 6px;
    position: relative;
}

.lantern .glow {
    position: absolute;
    top: 4px;
    left: 3px;
    right: 3px;
    bottom: 4px;
    background: radial-gradient(circle, rgba(255, 180, 40, 0.7), rgba(200, 100, 0, 0.3));
    border-radius: 2px;
    animation: flicker 3s ease-in-out infinite alternate;
}

.lantern .hook {
    width: 8px;
    height: 6px;
    margin: 0 auto;
    border: 2px solid var(--copper);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.lantern.l1 { top: 8%; left: 20%; }
.lantern.l2 { top: 10%; right: 22%; }

@keyframes flicker {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* =============================================================================
   Conveyor Belt
   ============================================================================= */
.belt-area {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    width: min(650px, 94vw);
    height: 90px;
    z-index: 5;
}

#belt-pay { width: min(420px, 70vw); }

.belt-svg {
    width: 100%;
    height: 100%;
}

/* =============================================================================
   Control Panel
   ============================================================================= */
.ctrl-panel {
    position: relative;
    z-index: 20;
    width: min(560px, 92vw);
    background: linear-gradient(180deg, #3a2010, #1a0a02);
    border: 3px solid var(--copper);
    border-radius: 16px;
    padding: clamp(12px, 2vw, 24px);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 200, 100, 0.1);
    margin-bottom: 10px;
}

.ctrl-panel::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px solid rgba(184, 115, 51, 0.2);
    border-radius: 12px;
    pointer-events: none;
}

.ctrl-rivets {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    pointer-events: none;
}

.rivet {
    position: absolute;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle at 35% 35%, #d4a050, #6b3a10);
    border-radius: 50%;
    border: 1px solid #4a2800;
}

.rivet.tl { top: 8px; left: 8px; }
.rivet.tr { top: 8px; right: 8px; }
.rivet.bl { bottom: 8px; left: 8px; }
.rivet.br { bottom: 8px; right: 8px; }

.ctrl-title {
    font-family: var(--font-heading);
    color: var(--gold);
    text-align: center;
    font-size: clamp(0.9rem, 1.8vw, 1.2rem);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.ctrl-screen {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(184, 115, 51, 0.3);
    border-radius: 10px;
    padding: clamp(10px, 1.5vw, 20px);
    min-height: 80px;
}

/* =============================================================================
   Steampunk Buttons
   ============================================================================= */
.btn-sp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: clamp(10px, 1.4vw, 14px) clamp(16px, 2.5vw, 28px);
    background: linear-gradient(180deg, #5a3010, #2a1505);
    border: 2px solid var(--copper);
    border-radius: 8px;
    color: var(--gold-l);
    font-family: var(--font-heading);
    font-size: clamp(0.75rem, 1.3vw, 1rem);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 44px;
    min-height: 44px;
    text-align: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.3;
}

.btn-sp:hover,
.btn-sp:active {
    background: linear-gradient(180deg, #7a4520, #3a1a08);
    box-shadow: 0 0 15px rgba(200, 150, 12, 0.3);
}

.btn-sp:active {
    transform: scale(0.96);
}

.btn-sp.selected {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(200, 150, 12, 0.4);
    background: linear-gradient(180deg, #7a4520, #3a1a08);
}

.btn-sp.green {
    background: linear-gradient(180deg, #1a8a4a, #0d5a2a);
    border-color: var(--green);
    color: #fff;
}

.btn-sp.green:hover {
    background: linear-gradient(180deg, #22a85a, #107030);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.3);
}

.btn-sp.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.btn-sp.skip {
    background: linear-gradient(180deg, #4a3020, #2a1a10);
    border-color: rgba(184, 115, 51, 0.5);
    color: var(--copper);
}

.btn-sp.skip:hover {
    background: linear-gradient(180deg, #5a3a28, #3a2218);
    border-color: var(--copper);
}

.btn-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(4px, 0.8vw, 8px);
}

.btn-grid.toppings-grid {
    grid-template-columns: repeat(4, 1fr);
    max-height: clamp(180px, 28vh, 280px);
    overflow-y: auto;
    padding-right: 4px;
}

.btn-grid.toppings-grid::-webkit-scrollbar { width: 4px; }
.btn-grid.toppings-grid::-webkit-scrollbar-thumb { background: var(--copper); border-radius: 2px; }

@media (max-width: 480px) {
    .btn-grid { grid-template-columns: repeat(2, 1fr); }
    .btn-grid.toppings-grid { grid-template-columns: repeat(3, 1fr); }
}

/* =============================================================================
   Count Selector
   ============================================================================= */
.count-sel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 10px 0;
}

.count-num {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--gold);
    min-width: 60px;
    text-align: center;
}

.count-btn {
    width: clamp(44px, 6vw, 56px);
    height: clamp(44px, 6vw, 56px);
    border-radius: 50%;
    font-size: 1.5rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================================================
   Plate Visual
   ============================================================================= */
.plate-vis {
    width: 100px;
    height: 60px;
    border-radius: 10px;
    border: 2px solid #5a3800;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
    padding: 3px;
    position: absolute;
    z-index: 6;
    transition: left 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.plate-vis .seg {
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.plate-vis .top-icon {
    position: absolute;
    font-size: 0.55rem;
    pointer-events: none;
}

/* Topping dots */
.top-bar {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 8px 0;
}

.top-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--copper);
    background: transparent;
    transition: background 0.3s;
}

.top-dot.filled {
    background: var(--gold);
}

/* Stock badge */
.stock-badge {
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 8px;
    display: inline-block;
    margin-top: 2px;
}

.stock-badge.in { background: rgba(46, 204, 113, 0.2); color: var(--green); }
.stock-badge.out { background: rgba(231, 76, 60, 0.2); color: var(--red); }

/* =============================================================================
   Entrance Door
   ============================================================================= */
.door-wrap {
    position: relative;
    width: clamp(220px, 40vw, 380px);
    height: clamp(300px, 50vh, 500px);
    cursor: pointer;
    margin: 10px auto;
    -webkit-tap-highlight-color: transparent;
}

.door-frame {
    position: absolute;
    inset: -14px;
    background: linear-gradient(180deg, var(--copper), #6b3a10);
    border-radius: 18px;
    box-shadow: 0 0 40px rgba(184, 115, 51, 0.3);
}

.door-panel {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #3a1a08, #1a0a02);
    border-radius: 12px;
    border: 3px solid #5a3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left center;
}

.door-panel.open {
    transform: perspective(800px) rotateY(-85deg);
}

.door-knob {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--gold-l), var(--copper));
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 10px rgba(200, 150, 12, 0.4);
}

.door-hinge {
    position: absolute;
    left: 0;
    width: 10px;
    height: 40px;
    background: var(--copper);
    border-radius: 2px;
}

.door-hinge.t { top: 15%; }
.door-hinge.b { bottom: 15%; }

.door-sign {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: clamp(0.65rem, 1.3vw, 0.95rem);
    text-align: center;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(200, 150, 12, 0.4);
    pointer-events: none;
}

.door-icon {
    font-size: clamp(2rem, 5vw, 3.5rem);
    pointer-events: none;
}

/* Entrance title */
.entrance-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    color: var(--gold);
    text-shadow: 0 0 30px rgba(200, 150, 12, 0.4), 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: clamp(3px, 0.8vw, 8px);
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.entrance-sub {
    font-size: clamp(0.8rem, 1.3vw, 1rem);
    color: var(--copper);
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

/* Sucked in animation */
@keyframes suck-in {
    0% { transform: scale(1); opacity: 1; filter: blur(0); }
    70% { transform: scale(2.5); opacity: 0.5; filter: blur(2px); }
    100% { transform: scale(4); opacity: 0; filter: blur(8px); }
}

.suck-in {
    animation: suck-in 0.8s ease-in forwards;
}

/* =============================================================================
   Factory / Scene Content
   ============================================================================= */
.scene-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1;
    justify-content: flex-start;
    padding-bottom: calc(12% + 260px);
    padding-top: clamp(50px, 8vh, 80px);
    overflow-y: auto;
}

/* Nozzle/pipe above belt */
.nozzle-area {
    position: absolute;
    bottom: calc(12% + 90px);
    left: 50%;
    transform: translateX(-50%);
    width: min(650px, 94vw);
    height: 100px;
    z-index: 4;
    pointer-events: none;
}

.nozzle {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 34px;
}

.nozzle-pipe {
    width: 34px;
    height: 40px;
    background: linear-gradient(90deg, #6b3a10, var(--copper), #6b3a10);
    border-radius: 4px 4px 0 0;
    border: 2px solid #5a2800;
    margin: 0 auto;
}

.nozzle-tip {
    width: 18px;
    height: 12px;
    background: var(--copper);
    margin: 0 auto;
    border-radius: 0 0 6px 6px;
    border: 2px solid #5a2800;
    border-top: none;
}

/* Pour animation */
.pour-stream {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 52px;
    width: 8px;
    height: 0;
    border-radius: 0 0 4px 4px;
    opacity: 0;
    transition: height 0.5s ease-in, opacity 0.2s;
}

.pour-stream.active {
    height: 48px;
    opacity: 1;
}

/* Topping sprinkle particles */
.sprinkle-particle {
    position: absolute;
    font-size: clamp(0.6rem, 1vw, 0.9rem);
    pointer-events: none;
    z-index: 10;
    opacity: 1;
    animation: sprinkle-fall 1s ease-in forwards;
}

@keyframes sprinkle-fall {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
    60% { opacity: 1; }
    100% { transform: translateY(calc(100px + 12vh)) rotate(360deg) scale(0.7); opacity: 0; }
}

/* =============================================================================
   Packaging
   ============================================================================= */
.pack-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pack-icon {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}

/* Packaging shelf */
.pack-shelf {
    position: absolute;
    right: clamp(5%, 8vw, 15%);
    bottom: calc(12% + 100px);
    z-index: 6;
}

.shelf-board {
    width: clamp(140px, 20vw, 200px);
    height: 10px;
    background: linear-gradient(180deg, #8a6030, #5a3a18);
    border: 2px solid var(--copper);
    border-radius: 3px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.shelf-items {
    display: flex;
    gap: clamp(6px, 1vw, 14px);
    justify-content: center;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.shelf-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    -webkit-tap-highlight-color: transparent;
    min-width: 44px;
    min-height: 44px;
    justify-content: flex-end;
}

.shelf-item:hover {
    transform: translateY(-4px);
}

.shelf-item.picked {
    opacity: 0.3;
    pointer-events: none;
}

.shelf-item span {
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
}

.shelf-item small {
    font-size: clamp(0.5rem, 0.8vw, 0.65rem);
    color: var(--copper);
    text-align: center;
    white-space: nowrap;
}

.shelf-legs {
    position: absolute;
    top: 10px;
    left: 10%;
    right: 10%;
    display: flex;
    justify-content: space-between;
}

.shelf-legs::before,
.shelf-legs::after {
    content: '';
    width: 8px;
    height: clamp(30px, 5vh, 50px);
    background: linear-gradient(90deg, #5a3a18, #8a6030, #5a3a18);
    border: 1px solid var(--copper);
    border-radius: 2px;
}

/* Robot arm */
.robot-arm {
    position: absolute;
    z-index: 9;
    left: 50%;
    transform: translateX(-50%);
    top: clamp(130px, 22vh, 200px);
    pointer-events: none;
}

.robot-arm .arm-rail {
    width: min(500px, 90vw);
    height: 14px;
    background: linear-gradient(180deg, #888, #555, #888);
    border: 2px solid var(--copper);
    border-radius: 7px;
    position: relative;
}

.robot-arm .arm-rail::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    border-radius: 2px;
}

.robot-arm .arm-vertical {
    position: absolute;
    top: 14px;
    width: 16px;
    background: linear-gradient(90deg, #666, #999, #666);
    border: 1px solid var(--copper);
    border-radius: 2px;
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1), left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    height: 20px;
    left: 75%;
}

.robot-arm .arm-claw {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    display: flex;
    justify-content: center;
}

.robot-arm .claw-l,
.robot-arm .claw-r {
    width: 14px;
    height: 18px;
    background: linear-gradient(180deg, #888, #666);
    border: 1px solid var(--copper);
    border-radius: 0 0 4px 4px;
    transition: transform 0.3s;
}

.robot-arm .claw-l { border-radius: 0 0 0 6px; transform-origin: top right; }
.robot-arm .claw-r { border-radius: 0 0 6px 0; transform-origin: top left; }
.robot-arm.grabbing .claw-l { transform: rotate(10deg); }
.robot-arm.grabbing .claw-r { transform: rotate(-10deg); }

.robot-arm .claw-item {
    position: absolute;
    bottom: -34px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.robot-arm.has-item .claw-item { opacity: 1; }
.robot-arm.at-belt .arm-vertical { left: 40%; height: clamp(120px, 30vh, 220px); }
.robot-arm.at-shelf .arm-vertical { left: 75%; height: clamp(80px, 20vh, 160px); }

/* =============================================================================
   Label
   ============================================================================= */
.label-input {
    width: 100%;
    padding: clamp(10px, 1.5vw, 14px);
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--copper);
    border-radius: 8px;
    color: var(--cream);
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1.3vw, 1.1rem);
    outline: none;
    transition: border-color 0.3s;
}

.label-input:focus {
    border-color: var(--gold);
}

.label-input::placeholder {
    color: rgba(255, 248, 231, 0.4);
}

/* Stamp machine */
.stamp-machine {
    position: absolute;
    bottom: calc(12% + 90px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stamp-base {
    width: 60px;
    height: 16px;
    background: linear-gradient(180deg, #777, #444);
    border: 2px solid var(--copper);
    border-radius: 4px 4px 0 0;
}

.stamp-rod {
    width: 20px;
    height: 30px;
    background: linear-gradient(90deg, #666, #999, #666);
    border: 1px solid var(--copper);
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stamp-head {
    width: 50px;
    height: 24px;
    background: linear-gradient(180deg, var(--copper), #6b3a10);
    border: 2px solid #5a2800;
    border-radius: 0 0 4px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    color: var(--gold);
    font-family: var(--font-heading);
    letter-spacing: 1px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stamp-machine.stamping .stamp-rod { height: 70px; }
.stamp-machine.stamping .stamp-head { transform: scale(1.05); }

/* =============================================================================
   Payment / Summary
   ============================================================================= */
.summary-box {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(184, 115, 51, 0.3);
    border-radius: 10px;
    padding: clamp(12px, 2vw, 20px);
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(184, 115, 51, 0.1);
    font-size: clamp(0.8rem, 1.1vw, 0.95rem);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    border-top: 2px solid var(--copper);
    margin-top: 6px;
    padding-top: 10px;
    font-weight: 700;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    color: var(--gold);
}

/* Van */
.van-wrap {
    position: absolute;
    bottom: 0;
    z-index: 8;
    transition: left 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.van-svg {
    width: clamp(160px, 22vw, 260px);
    height: auto;
}

/* =============================================================================
   Thank You
   ============================================================================= */
.thanks-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--gold);
    text-align: center;
    margin-bottom: 16px;
}

.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    opacity: 0;
    animation: confetti-fall 3s ease-in forwards;
}

@keyframes confetti-fall {
    0% { transform: translateY(-20px) rotate(0); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* =============================================================================
   Progress Strip (Steampunk Price/Progress Bar)
   ============================================================================= */
#ps-strip {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: linear-gradient(180deg, rgba(26, 10, 2, 0.95), rgba(15, 5, 0, 0.98));
    border-top: 2px solid var(--copper);
    padding: 6px 0;
    display: flex;
    justify-content: center;
    gap: clamp(4px, 0.8vw, 12px);
    align-items: center;
}

.ps-dot {
    width: clamp(10px, 1.4vw, 14px);
    height: clamp(10px, 1.4vw, 14px);
    border-radius: 50%;
    border: 2px solid var(--copper);
    background: transparent;
    transition: all 0.3s;
    position: relative;
}

.ps-dot.done {
    background: var(--gold);
    border-color: var(--gold);
}

.ps-dot.current {
    border-color: var(--gold-l);
    box-shadow: 0 0 8px rgba(240, 192, 64, 0.5);
    animation: ps-pulse 1.5s ease-in-out infinite;
}

.ps-line {
    width: clamp(16px, 3vw, 36px);
    height: 2px;
    background: var(--copper);
    opacity: 0.4;
}

@keyframes ps-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(240, 192, 64, 0.4); }
    50% { box-shadow: 0 0 14px rgba(240, 192, 64, 0.8); }
}

/* Price display in strip */
.ps-price {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 1px;
    margin-left: clamp(8px, 2vw, 20px);
    white-space: nowrap;
}

/* =============================================================================
   Toast Notifications
   ============================================================================= */
#toast-box {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    pointer-events: none;
}

.toast {
    padding: 10px 22px;
    border-radius: 8px;
    font-size: clamp(0.8rem, 1.2vw, 0.95rem);
    color: #fff;
    opacity: 0;
    transform: translateY(-10px);
    animation: toast-in 0.3s forwards;
    pointer-events: auto;
    max-width: 90vw;
    text-align: center;
}

.toast.info {
    background: rgba(42, 16, 0, 0.92);
    border: 1px solid var(--gold);
}

.toast.error {
    background: rgba(100, 10, 10, 0.92);
    border: 1px solid var(--red);
}

.toast.success {
    background: rgba(10, 60, 30, 0.92);
    border: 1px solid var(--green);
}

@keyframes toast-in {
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================================================
   WooCommerce Overrides (Steampunk-styled)
   ============================================================================= */
.woocommerce .products .product {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    background: var(--mid);
    border: 2px solid rgba(184, 115, 51, 0.2);
}

.woocommerce .products .product:hover {
    box-shadow: 0 0 20px rgba(200, 150, 12, 0.3);
    transform: translateY(-2px);
    border-color: var(--copper);
}

.woocommerce .price {
    color: var(--gold) !important;
    font-family: var(--font-heading);
    font-weight: 700;
}

.woocommerce .button,
.woocommerce button.button,
.woocommerce input.button {
    background: linear-gradient(180deg, #5a3010, #2a1505) !important;
    color: var(--gold-l) !important;
    border: 2px solid var(--copper) !important;
    border-radius: var(--radius-md) !important;
    font-family: var(--font-heading) !important;
    font-weight: 600 !important;
    transition: all var(--transition-normal) !important;
}

.woocommerce .button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
    background: linear-gradient(180deg, #7a4520, #3a1a08) !important;
    box-shadow: 0 0 15px rgba(200, 150, 12, 0.3) !important;
}

.woocommerce-message,
.woocommerce-info {
    border-top-color: var(--copper) !important;
    background: rgba(42, 16, 0, 0.8) !important;
    color: var(--cream) !important;
}

.woocommerce-message::before,
.woocommerce-info::before {
    color: var(--gold) !important;
}

.woocommerce-error {
    background: rgba(100, 10, 10, 0.8) !important;
    color: var(--cream) !important;
    border-top-color: var(--red) !important;
}

/* WooCommerce cart/checkout pages */
.woocommerce table.shop_table {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(184, 115, 51, 0.3);
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    border-color: rgba(184, 115, 51, 0.15);
    color: var(--cream);
}

.woocommerce table.shop_table th {
    color: var(--gold);
    font-family: var(--font-heading);
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(184, 115, 51, 0.3);
    color: var(--cream);
    border-radius: var(--radius-md);
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus {
    border-color: var(--gold);
}

.woocommerce form .form-row label {
    color: var(--copper);
}

/* =============================================================================
   Legal Pages (Dark Steampunk Background)
   ============================================================================= */
.legal-page-wrap {
    min-height: 100vh;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 38px, rgba(90, 40, 5, 0.15) 38px, rgba(90, 40, 5, 0.15) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 78px, rgba(90, 40, 5, 0.12) 78px, rgba(90, 40, 5, 0.12) 80px);
    background-color: var(--mid);
    position: relative;
}

.legal-page-wrap::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
    z-index: 0;
}

.legal-page {
    position: relative;
    z-index: 1;
    max-width: var(--container-md);
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-md);
    padding-top: calc(32px + var(--space-2xl));
}

.legal-page h1 {
    color: var(--gold);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid rgba(184, 115, 51, 0.3);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.legal-page h2 {
    color: var(--gold);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
    font-family: var(--font-heading);
}

.legal-page p,
.legal-page li {
    margin-bottom: var(--space-md);
    color: rgba(255, 248, 231, 0.8);
    line-height: 1.8;
}

.legal-page ul,
.legal-page ol {
    padding-left: var(--space-xl);
}

.legal-page a {
    color: var(--gold);
    text-decoration: underline;
    text-decoration-color: rgba(200, 150, 12, 0.4);
}

.legal-page a:hover {
    color: var(--gold-l);
    text-decoration-color: var(--gold-l);
}

/* =============================================================================
   Responsive: Mobile (max 600px)
   ============================================================================= */
@media (max-width: 600px) {
    .scene-content {
        padding-top: clamp(40px, 6vh, 60px);
    }

    .pack-shelf {
        right: 2%;
        bottom: calc(12% + 80px);
    }
}

/* =============================================================================
   Responsive: Tablet (768px+)
   ============================================================================= */
@media (min-width: 768px) {
    .container {
        padding: 0 var(--space-xl);
    }
}

/* =============================================================================
   Responsive: Desktop (1024px+)
   ============================================================================= */
@media (min-width: 1024px) {
    .nav-main {
        display: flex;
        gap: var(--space-xs);
    }

    .nav-main a,
    .nav-main .menu-item a {
        display: inline-block;
    }

    .nav-toggle {
        display: none;
    }
}

/* =============================================================================
   Responsive: Large Desktop (1400px+)
   ============================================================================= */
@media (min-width: 1400px) {
    html {
        font-size: 18px;
    }
}

/* =============================================================================
   Print Styles
   ============================================================================= */
@media print {
    .site-header,
    #ps-strip,
    .nav-toggle,
    .site-footer {
        display: none !important;
    }

    body {
        padding-bottom: 0;
        overflow: auto;
        background: #fff;
        color: #000;
    }
}

/* =============================================================================
   Accessibility
   ============================================================================= */
:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reduced motion */
/* =============================================================================
   Landing Page (Steampunk themed info page)
   ============================================================================= */
.landing-scroll {
    height: 100%;
    scroll-behavior: smooth;
}

.landing-hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px 40px;
}

.landing-hero__badge {
    display: inline-block;
    background: var(--gold);
    color: var(--dark);
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 4px 16px;
    border-radius: 99px;
    margin-bottom: 16px;
}

.landing-section {
    padding: 60px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.landing-heading {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    text-align: center;
    font-size: clamp(1.3rem, 3vw, 2rem);
    margin-bottom: 32px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.landing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.landing-card {
    background: rgba(42, 16, 0, 0.6);
    border: 1px solid rgba(184, 115, 51, 0.25);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: border-color 0.3s, transform 0.3s;
}

.landing-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
}

.landing-card__icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.landing-card h3 {
    font-family: 'Cinzel', serif;
    color: var(--gold-l);
    font-size: clamp(0.9rem, 1.4vw, 1.1rem);
    margin-bottom: 8px;
}

.landing-card p {
    color: rgba(255, 248, 231, 0.6);
    font-size: 0.9rem;
    line-height: 1.5;
}

.landing-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.landing-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.landing-step__num {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: linear-gradient(180deg, #5a3010, #2a1505);
    border: 2px solid var(--copper);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
}

.landing-step h3 {
    font-family: 'Cinzel', serif;
    color: var(--gold-l);
    font-size: clamp(0.9rem, 1.3vw, 1.05rem);
    margin-bottom: 4px;
}

.landing-step p {
    color: rgba(255, 248, 231, 0.6);
    font-size: 0.9rem;
    line-height: 1.5;
}

.landing-footer {
    border-top: 1px solid rgba(184, 115, 51, 0.2);
    padding: 40px 20px 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.landing-footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.landing-footer h4 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 0.9rem;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.landing-footer p {
    color: rgba(255, 248, 231, 0.5);
    font-size: 0.85rem;
    line-height: 1.6;
}

.landing-footer a {
    display: block;
    color: rgba(255, 248, 231, 0.5);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 3px 0;
    transition: color 0.2s;
}

.landing-footer a:hover {
    color: var(--gold);
}

.landing-footer__bottom {
    border-top: 1px solid rgba(184, 115, 51, 0.1);
    padding-top: 16px;
    font-size: 0.8rem;
    color: rgba(255, 248, 231, 0.35);
}

@media (min-width: 768px) {
    .landing-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================================================
   Reduced Motion
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
