:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --stage: #ebe7e0;
  --line: #e3dfd7;
  --text: #141414;
  --muted: #7a766e;
  --dark: #141414;
  --amber: #ffb22a;
  --amber-glow: rgba(255, 178, 42, .5);
  --radius: 20px;
  --panel-w: 400px;
  --header-h: 64px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.08; margin: 0; letter-spacing: -.025em; font-weight: 700; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
button { font-family: inherit; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 30; height: var(--header-h); display: flex; align-items: center; gap: 32px; padding: 0 clamp(16px, 3vw, 36px);
  background: rgba(244, 242, 238, .85); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; font-size: 1.3rem; letter-spacing: -.04em; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.logo::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber-glow); }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); font-size: .93rem; font-weight: 500; }
.nav a:hover { color: var(--text); }
.cart-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--dark); color: #fff; border: 0; border-radius: 99px; padding: 9px 10px 9px 16px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.cart-count { background: #fff; color: var(--dark); min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; font-size: .75rem; font-weight: 800; padding: 0 6px; }
.cart-count.bump { animation: bump .45s; }
@keyframes bump { 40% { transform: scale(1.4); background: var(--amber); } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 15px 22px; border-radius: 14px; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform .15s, background .2s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: #2b2b2b; }
.btn-dark:disabled { opacity: .55; cursor: wait; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }
.btn.full { width: 100%; }
.btn .sep { opacity: .45; }
.grow { flex: 1; }
.link { background: none; border: 0; padding: 0; color: var(--text); font-weight: 600; font-size: .85rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- studio ---------- */
.studio { position: relative; height: calc(100svh - var(--header-h)); min-height: 560px; background: var(--stage); transition: background .6s; }
.studio.night { background: #121318; }
.stage { position: absolute; inset: 0; overflow: hidden; }
.stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; outline: none; }
.stage canvas:active { cursor: grabbing; }
.stage-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font-size: .9rem; background: var(--stage); transition: opacity .6s; pointer-events: none; }
.stage-loading span { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--text); animation: spin .8s linear infinite; }
.stage-loading.done { opacity: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 10% calc(var(--panel-w) + 10%) 10% 10%; }
.stage-fallback > * { max-width: 520px; }

.stage-tools { position: absolute; left: clamp(16px, 3vw, 36px); top: 20px; display: flex; gap: 8px; z-index: 2; }
.tool { display: inline-flex; align-items: center; gap: 8px; height: 40px; min-width: 40px; justify-content: center; padding: 0 12px; border-radius: 99px; border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.7); backdrop-filter: blur(10px); color: var(--text); font-weight: 600; font-size: .85rem; cursor: pointer; transition: background .3s, color .3s; }
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool .i-moon { display: none; }
.night .tool { background: rgba(255,255,255,.1); color: #f1efe9; border-color: rgba(255,255,255,.12); }
.night .tool .i-sun { display: none; }
.night .tool .i-moon { display: block; }
.stage-hint { position: absolute; left: clamp(16px, 3vw, 36px); bottom: 20px; margin: 0; font-size: .82rem; color: var(--muted); pointer-events: none; transition: opacity .6s, color .6s; }
.night .stage-hint { color: #8b8a86; }
.stage-hint.gone { opacity: 0; }

/* ---------- panel ---------- */
.panel { position: absolute; top: 20px; right: 20px; bottom: 20px; width: var(--panel-w); z-index: 3; overflow-y: auto; display: flex; flex-direction: column; gap: 16px;
  background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 20px 50px -20px rgba(0,0,0,.18); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--bg); border-radius: 14px; }
.seg button { border: 0; background: transparent; border-radius: 10px; padding: 9px 6px; cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--muted); line-height: 1.2; transition: background .2s, color .2s; }
.seg button small { display: block; font-weight: 500; font-size: .74rem; margin-top: 2px; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.panel-head { padding: 8px 2px 0; }
.kicker { margin: 0 0 8px; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.panel-head h1 { font-size: 1.85rem; margin-bottom: 6px; }
.panel-head p { margin: 0; }

.field label { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 8px; font-size: .88rem; }
.field label span { color: var(--muted); font-weight: 500; }
.field input { width: 100%; padding: 15px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 1.15rem; font-weight: 600; font-family: inherit; transition: border-color .2s, background .2s; }
.field input::placeholder { color: #b7b2a8; font-weight: 500; }
.field input:focus { outline: none; border-color: var(--text); background: var(--surface); }
.field.error input { border-color: #e5483d; }
.field .err { color: #e5483d; font-size: .8rem; margin: 6px 0 0; }

.opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; }
.opt b { display: block; font-size: .95rem; font-weight: 600; }
.opt em { font-style: normal; color: var(--muted); font-weight: 500; }
.opt small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.opt-check { cursor: pointer; position: relative; transition: border-color .2s, background .2s; }
.opt-check input { position: absolute; opacity: 0; pointer-events: none; }
.opt-check:has(input:checked) { border-color: var(--text); }
.opt-check:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.checkmark { flex: none; width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--line); display: grid; place-items: center; transition: background .2s, border-color .2s; }
.opt-check input:checked ~ .checkmark { background: var(--dark); border-color: var(--dark); }
.opt-check input:checked ~ .checkmark::after { content: ""; width: 10px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }

.switch { flex: none; width: 52px; height: 30px; border-radius: 99px; border: 0; background: #d9d5cd; position: relative; cursor: pointer; transition: background .25s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s cubic-bezier(.3,.9,.3,1.2); }
.switch[aria-checked="true"] { background: var(--amber); box-shadow: 0 0 18px -2px var(--amber-glow); }
.switch[aria-checked="true"] span { transform: translateX(22px); }

.more { border-top: 1px solid var(--line); padding-top: 12px; }
.more summary { cursor: pointer; font-size: .88rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.more summary::after { content: "+"; color: var(--muted); }
.more[open] summary::after { content: "−"; }
.more p { color: var(--muted); font-size: .9rem; margin: 10px 0 0; }

.buy { display: flex; gap: 10px; margin-top: auto; padding-top: 4px; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; flex: none; }
.qty button { width: 40px; height: 50px; background: none; border: 0; color: var(--text); font-size: 1.15rem; cursor: pointer; }
.qty output { min-width: 22px; text-align: center; font-weight: 700; }
.qty.sm { display: inline-flex; border-radius: 10px; }
.qty.sm button { width: 30px; height: 30px; font-size: 1rem; }
.qty.sm output { min-width: 20px; font-size: .88rem; }
.panel-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); }
.saved { display: inline-flex; align-items: center; gap: 7px; }
.saved i { width: 7px; height: 7px; border-radius: 50%; background: #3fb36b; }
.saved.pulse i { animation: pulse .8s; }
@keyframes pulse { 30% { box-shadow: 0 0 0 5px rgba(63,179,107,.25); } }

/* ---------- sections ---------- */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.facts div { padding: 26px clamp(16px, 3vw, 36px); border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; }
.facts b { display: block; font-weight: 600; }
.facts span { color: var(--muted); font-size: .88rem; }
.section { max-width: 1200px; margin: 0 auto; padding: 110px clamp(16px, 4vw, 48px); }
.section h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); max-width: 18ch; margin-bottom: 48px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { border-top: 1px solid var(--text); padding-top: 20px; }
.steps span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.steps h3 { font-size: 1.3rem; margin: 10px 0 8px; }
.steps p { color: var(--muted); margin: 0; max-width: 30ch; }

.social h2 a { text-decoration: none; background: linear-gradient(transparent 62%, rgba(255,178,42,.45) 62%); }
.social-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.social-card { display: flex; align-items: center; gap: 18px; padding: 24px; border-radius: var(--radius); background: var(--surface); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.social-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -22px rgba(0,0,0,.3); }
.social-card svg { width: 30px; height: 30px; flex: none; }
.social-card b { display: block; font-weight: 600; }
.social-card span { color: var(--muted); font-size: .9rem; }
.social-card .arrow { margin-left: auto; color: var(--muted); font-size: 1.2rem; }
.reels { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 24px; }
.reels video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 16px; background: #000; }

.faq details { border-top: 1px solid var(--line); padding: 20px 0; max-width: 760px; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 1.3rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--muted); margin: 12px 0 0; max-width: 62ch; }

.foot { display: flex; flex-wrap: wrap; gap: 32px 64px; align-items: flex-start; padding: 48px clamp(16px, 4vw, 48px); border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.foot .logo { color: var(--text); margin-right: auto; }
.foot-links { display: flex; flex-direction: column; gap: 8px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--text); }

/* ---------- CSS predogledi (košarica, zahvala, fallback) ---------- */
.lightbox { position: relative; width: 100%; aspect-ratio: 2 / 1; border-radius: 9px; display: grid; place-items: center; overflow: hidden; container-type: inline-size;
  background: #2a2826; box-shadow: inset 0 0 0 4px #1f1d1c, inset 0 0 0 5px #34312f, 0 20px 50px -20px rgba(0,0,0,.5); }
.lb-text { font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif; font-weight: 800; color: #ff6a52; font-size: calc(var(--fs, 12) * 1cqw); white-space: nowrap; text-align: center; line-height: 1.12;
  text-shadow: 0 0 6px rgba(255,59,40,.8), 0 0 22px rgba(255,59,40,.45); }
.engine-box { width: 100%; aspect-ratio: 4 / 3; border-radius: 22%/28%; display: grid; place-items: center; background: #2a2826; box-shadow: inset 0 0 0 4px #1f1d1c, inset 0 0 0 5px #34312f; }
.engine-box svg { width: 62%; filter: drop-shadow(0 0 5px rgba(255,178,58,.9)) drop-shadow(0 0 18px rgba(255,178,58,.45)); }
.sil-box { width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; display: grid; place-items: center; padding: 10%; background: #e9e5dd; container-type: inline-size; position: relative; }
.sil-box img { width: 100%; filter: invert(1) brightness(.2); }
.sil-label { position: absolute; bottom: 12%; left: 0; right: 0; text-align: center; font-family: var(--display); letter-spacing: .2em; font-size: clamp(.6rem, 3cqw, 1rem); color: var(--muted); text-transform: uppercase; }

/* ---------- cart drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(20,20,20,.35); backdrop-filter: blur(2px); opacity: 0; transition: opacity .25s; }
.drawer-panel { position: absolute; top: 0; right: 0; height: 100%; width: min(420px, 100%); background: var(--surface); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-panel > header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.drawer-panel h3 { font-size: 1.15rem; }
.close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.cart-items { list-style: none; margin: 0; padding: 4px 24px; overflow-y: auto; flex: 1; }
.cart-items li { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start; }
.cart-thumb { width: 84px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--stage); }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-thumb .lightbox, .cart-thumb .engine-box, .cart-thumb .sil-box { box-shadow: none; border-radius: 0; height: 100%; aspect-ratio: auto; }
.cart-thumb .sil-label { display: none; }
.cart-items h4 { margin: 0 0 2px; font-size: .95rem; font-weight: 600; }
.cart-items .meta { color: var(--muted); font-size: .84rem; margin: 0 0 10px; }
.cart-items .line-price { font-weight: 600; text-align: right; }
.cart-items .remove { background: none; border: 0; color: var(--muted); font-size: .8rem; cursor: pointer; padding: 6px 0 0; text-decoration: underline; }
.cart-empty { padding: 48px 24px; text-align: center; color: var(--muted); flex: 1; }
.cart-foot { padding: 20px 24px 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.cart-foot .row { display: flex; justify-content: space-between; font-size: .95rem; }
.cart-foot .total { font-size: 1.15rem; padding-top: 6px; margin-bottom: 8px; }
.ship-bar { height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.ship-bar div { height: 100%; background: var(--amber); width: 0; transition: width .4s; }
.ship-note { margin: 0 0 6px; font-size: .85rem; color: var(--muted); }
.tiny { font-size: .78rem; color: var(--muted); text-align: center; margin: 4px 0 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, calc(100% + 40px)); visibility: hidden; background: var(--dark); color: #fff; padding: 13px 20px; border-radius: 14px; font-weight: 500; font-size: .92rem; z-index: 60; transition: transform .35s cubic-bezier(.2,.8,.2,1), visibility .35s; max-width: calc(100vw - 32px); box-shadow: 0 12px 30px -10px rgba(0,0,0,.4); }
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* ---------- simple pages ---------- */
.page { max-width: 720px; margin: 0 auto; padding: 72px 16px; }
.page h1 { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: 16px; }
.page p, .page li { color: var(--muted); }
.page h2 { font-size: 1.3rem; margin-top: 2em; margin-bottom: .5em; }
.todo { background: rgba(255,178,42,.22); color: #7a4c00; padding: 0 4px; border-radius: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  :root { --header-h: 58px; }
  .studio { height: auto; min-height: 0; display: flex; flex-direction: column; }
  .stage { position: relative; height: 56svh; min-height: 340px; }
  .stage-fallback { padding: 12%; }
  .panel { position: relative; inset: auto; width: auto; margin: -24px 0 0; border-radius: 24px 24px 0 0; overflow: visible; padding: 20px 16px 16px; box-shadow: 0 -10px 30px -20px rgba(0,0,0,.25); }
  .buy { position: sticky; bottom: 0; margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); z-index: 4; }
  .stage-hint { bottom: 36px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(2) { border-right: 0; }
  .facts div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .section { padding: 72px 16px; }
}
@media (max-width: 600px) {
  .nav { display: none; }
  .cart-btn { margin-left: auto; }
  .panel-head h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
#addBtn { white-space: nowrap; }
.studio.night .stage-loading { background: #121318; color: #8b8a86; }
.studio.night .stage-loading span { border-color: #2a2b31; border-top-color: #f1efe9; }
.engine-box.esp { aspect-ratio: 7 / 6; }
.engine-box.esp svg { width: 52%; }

/* ---------- AR ---------- */
.tool-ar { background: var(--dark); color: #fff; border-color: transparent; }
.night .tool-ar { background: #f1efe9; color: var(--dark); }
.tool-ar.pulse { animation: arPulse 1.6s ease-out 4; }
@keyframes arPulse { 0% { box-shadow: 0 0 0 0 rgba(255,178,42,.7); } 100% { box-shadow: 0 0 0 16px rgba(255,178,42,0); } }
.ar-sheet { border: 0; padding: 0; background: transparent; width: min(440px, calc(100vw - 24px)); color: var(--text); }
.ar-sheet::backdrop { background: rgba(20,20,20,.45); backdrop-filter: blur(3px); }
.ar-sheet[open] { animation: arIn .3s cubic-bezier(.2,.8,.2,1); }
@keyframes arIn { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.ar-inner { position: relative; background: var(--surface); border-radius: 24px; padding: 26px 22px 22px; display: flex; flex-direction: column; gap: 12px; }
.ar-inner h3 { font-size: 1.4rem; padding-right: 40px; }
.ar-inner .close { position: absolute; top: 16px; right: 16px; }
.ar-inner .kicker { margin: 0; }
#arBody { display: flex; flex-direction: column; gap: 14px; }
.ar-loading { display: grid; justify-items: center; gap: 14px; padding: 48px 0; color: var(--muted); font-size: .92rem; text-align: center; }
.ar-loading span { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--text); animation: spin .8s linear infinite; }
.ar-preview { display: block; border-radius: 16px; overflow: hidden; background: var(--stage); aspect-ratio: 4 / 3; }
.ar-preview img { width: 100%; height: 100%; object-fit: cover; }
.ar-viewer { width: 100%; height: 320px; border-radius: 16px; background: var(--stage); --poster-color: transparent; }
.ar-slot { position: absolute; left: 12px; right: 12px; bottom: 12px; }
.ar-qr { width: min(240px, 70vw); margin: 4px auto; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.ar-qr svg { display: block; width: 100%; height: auto; }
.ar-note { margin: 0; color: var(--muted); font-size: .9rem; text-align: center; }
.ar-note.err { color: #b3261e; }
#arCopy { align-self: center; }
@media (max-width: 600px) {
  .tool-ar span { display: none; }
  .tool-ar { width: auto; padding: 0 12px; }
  .tool-ar::after { content: "AR"; font-weight: 700; }
}
