:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --ink: #1F1F1F;
  --ink-soft: #767670;
  --ink-xsoft: #CFCBC3;
  --accent: #6F8F74;
  --accent-deep: #4E7054;
  --border: #E7E5E0;
  --radius: 14px;
  --shadow: 0 2px 20px rgba(0,0,0,0.06);
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* TOPBAR */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 32px;
  padding: 16px 40px;
  position: sticky; top: 0; z-index: 10;
}
.wordmark {
  font-family: "Fraunces", serif; font-weight: 600;
  font-size: 18px; letter-spacing: -0.02em; color: var(--ink);
  text-decoration: none; margin-right: 8px;
}
.topbar-nav { display: flex; gap: 24px; align-items: center; }
.topbar-nav a {
  font-size: 14px; color: var(--ink-soft); text-decoration: none;
  transition: color .15s;
}
.topbar-nav a:hover { color: var(--ink); }
.topbar-spacer { flex: 1; }
.tag { color: var(--ink-xsoft); font-size: 13px; }

main { max-width: 760px; margin: 0 auto; padding: 0 20px 100px; }

/* HERO */
.hero {
  display: grid; grid-template-columns: 1fr auto;
  gap: 40px; align-items: center; padding: 36px 0 36px;
}
.hero-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.hero h1 {
  font-family: "Fraunces", serif; font-weight: 500;
  font-size: clamp(32px, 5vw, 48px); line-height: 1.08;
  letter-spacing: -0.03em; margin-bottom: 16px;
}
.lede { color: var(--ink-soft); font-size: 15px; max-width: 38ch; line-height: 1.7; margin-bottom: 24px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 20px; }
.trust-item { font-size: 13px; color: var(--ink-soft); display: flex; align-items: center; gap: 5px; }
.trust-item::before { content: "✓"; color: var(--accent); font-weight: 600; }

.pedestal-wrap { display: flex; justify-content: center; }
.pedestal {
  position: relative; width: 230px; height: 300px;
  display: flex; align-items: flex-end; justify-content: center;
}
.hero-art {
  /* Grøn soldat-illustration */
  width: 169px; height: 300px;
  background: url("/pages/Figurio-png2.png") center bottom / contain no-repeat;
  position: relative; z-index: 1;
}
.preview-img { max-width: 90%; max-height: 220px; position: relative; z-index: 1; margin-bottom: 12px; border-radius: 12px; }

/* HOW IT WORKS */
.how-it-works {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 36px 32px; margin: 0 0 14px;
  text-align: center;
}
.how-it-works h2 {
  font-family: "Fraunces", serif; font-weight: 500;
  font-size: 20px; letter-spacing: -0.01em; margin-bottom: 28px;
}
.steps { display: flex; align-items: flex-start; justify-content: center; gap: 0; }
.step-item { flex: 1; max-width: 180px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.step-icon {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.step-title { font-weight: 500; font-size: 14px; }
.step-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.step-arrow {
  flex: none; align-self: flex-start; margin-top: 26px;
  color: var(--ink-xsoft); font-size: 20px; padding: 0 8px;
}

/* PANELS */
.panel {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 28px;
  margin: 14px 0;
}
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.step-no {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  background: var(--ink); color: #fff;
}
.panel h2 {
  font-family: "Fraunces", serif; font-weight: 500;
  font-size: 20px; letter-spacing: -0.01em;
}
.hint { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }
.fineprint { color: var(--ink-xsoft); font-size: 12px; text-align: center; margin-top: 14px; }

/* UPLOAD SLOTS */
.slots { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 20px; }
.slot {
  width: 120px; height: 120px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background-size: cover; background-position: center;
}
.slot-add {
  border: 2px dashed var(--border); cursor: pointer; color: var(--ink-soft);
  background: var(--bg);
  transition: border-color .15s, background .15s, color .15s;
}
.slot-add:hover { border-color: var(--accent); background: #f0f5f1; color: var(--accent); }
.slot-plus { font-size: 28px; line-height: 1; font-weight: 300; }
.slot-name { font-size: 12px; font-weight: 500; }
.slot-thumb { position: relative; border: 1.5px solid var(--accent); }
.slot-del {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.5); color: #fff; cursor: pointer;
  font-size: 14px; line-height: 1; display: grid; place-items: center;
}
.slot-del:hover { background: rgba(0,0,0,.75); }

/* POPULAR BADGE — ligger oven på billedet, så kort med og uden badge flugter */
.popular-badge {
  position: absolute; top: 20px; left: 16px; z-index: 2;
  font-size: 10px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--accent-deep);
  background: rgba(234, 242, 235, 0.95); border-radius: 999px;
  padding: 3px 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* STYLE PICKER */
.style-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
/* Stil-vælgeren: kortene deler altid hele bredden, uanset hvor mange stile der er */
#style-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
.style-card {
  appearance: none; font: inherit; cursor: pointer; text-align: center;
  position: relative; /* ankerpunkt for .popular-badge */
  background: var(--bg); border: 1.5px solid transparent; border-radius: 12px;
  padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 7px;
  transition: border-color .15s, background .15s;
}
.style-card:hover { background: #f0f5f1; border-color: var(--accent); }
.style-card.selected { border: 2px solid var(--accent); background: #f0f5f1; }
.style-thumb {
  /* 4:3 — samme format som stil-billederne, så intet beskæres */
  position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
}
.style-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.style-thumb-zoom {
  position: absolute; bottom: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.45); color: #fff;
  font-size: 12px; cursor: pointer;
  display: grid; place-items: center; opacity: 0;
  transition: opacity .15s, background .15s; z-index: 1;
}
.style-card:hover .style-thumb-zoom { opacity: 1; }
.style-thumb-zoom:hover { background: rgba(0,0,0,.75); }
.style-fallback { font-family: "Fraunces", serif; font-size: 13px; color: var(--ink-soft); }
.style-name { font-weight: 500; font-size: 13px; }
.style-blurb { font-size: 11px; color: var(--ink-soft); line-height: 1.3; }

/* POSITUR */
.posture-label { margin: 20px 0 0; }
.posture-grid { grid-template-columns: 1fr 1fr; margin: 10px 0 20px; }
.posture-grid .style-name { font-size: 14px; }

/* TILPASNING */
.req-note-label { display: block; font-size: 13px; color: var(--ink-soft); margin: 16px 0 6px; }
#photo-req { margin-top: 8px; font-weight: 500; }
#photo-req.photo-req-ok { color: var(--accent-deep); }

/* INPUT-METODE (gruppe: fælles billede vs. pr. person) */
.input-mode-tabs { display: inline-flex; gap: 4px; background: var(--border); border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.input-mode-tab {
  appearance: none; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  padding: 7px 16px; border-radius: 8px; border: none; background: transparent; color: var(--ink-soft);
  transition: background .15s, color .15s;
}
.input-mode-tab.selected { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.person-slots { display: flex; flex-wrap: wrap; gap: 12px; }
.person-slot .person-tag {
  position: absolute; left: 6px; bottom: 6px; z-index: 2;
  background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 500;
  padding: 2px 7px; border-radius: 6px;
}
.req-input, .req-note {
  width: 100%; padding: 12px 15px; font: inherit; font-size: 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--ink); outline: none;
  transition: border-color .15s;
}
.req-note { resize: vertical; }
.req-input:focus, .req-note:focus { border-color: var(--accent); }

/* SAMTYKKE */
.consent {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 16px 0 4px; font-size: 12.5px; line-height: 1.45;
  color: var(--ink-soft); cursor: pointer;
}
.consent input { margin-top: 2px; width: 16px; height: 16px; flex: none; accent-color: var(--accent); cursor: pointer; }
.consent a { color: var(--accent); }

/* BUTTONS */
.btn {
  appearance: none; font: inherit; font-size: 14px; font-weight: 500;
  padding: 12px 22px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--ink);
  transition: background .15s, border-color .15s, transform .08s;
  text-decoration: none; display: inline-flex; align-items: center;
}
.btn:hover { background: var(--bg); border-color: #ccc; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-order { width: 100%; padding: 14px; font-size: 15px; justify-content: center; }
.row { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.link-btn {
  appearance: none; background: none; border: none; font: inherit; font-size: 13px;
  color: var(--accent); cursor: pointer; text-decoration: underline; padding: 0;
}

/* BASE TEXT STEP */
.base-text-items { display: flex; flex-direction: column; gap: 10px; }
.base-text-item { display: flex; align-items: center; gap: 10px; }
.base-text-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex-shrink: 0; border: 1px solid var(--border); }
.base-text-item .req-input { flex: 1; margin: 0; }
.base-eye-btn {
  appearance: none; background: none; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 0; width: 40px; height: 40px; font-size: 18px;
  cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s;
}
.base-eye-btn:hover { border-color: var(--accent); background: #f0f5f1; }
.base-3d-wrap { margin-top: 16px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.base-3d-label { margin: 10px 0 6px 12px !important; }
.base-canvas { display: block; width: 100%; height: 220px; }

/* BASKET BAR */
/* KURV-KNAP (topbar) */
.cart-btn {
  position: relative; appearance: none; cursor: pointer;
  width: 42px; height: 42px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.cart-btn:hover { background: var(--bg); border-color: #ccc; }
.cart-btn svg { width: 21px; height: 21px; }
.cart-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.cart-badge.pulse { animation: cartPulse .4s ease; }
@keyframes cartPulse { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* KURV-DRAWER */
.cart-drawer { position: fixed; inset: 0; z-index: 200; }
.cart-backdrop { position: absolute; inset: 0; background: rgba(31,31,31,.35); }
.cart-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: 380px; max-width: 90vw;
  background: var(--surface); box-shadow: -8px 0 30px rgba(0,0,0,.12);
  display: flex; flex-direction: column; animation: cartSlide .22s ease;
}
@keyframes cartSlide { from { transform: translateX(100%); } to { transform: translateX(0); } }
.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px; border-bottom: 1px solid var(--border);
}
.cart-head h3 { font-family: "Fraunces", serif; font-weight: 500; font-size: 20px; }
.cart-close { appearance: none; border: none; background: none; font-size: 28px; line-height: 1; color: var(--ink-soft); cursor: pointer; }
.cart-close:hover { color: var(--ink); }
.cart-items { flex: 1; overflow-y: auto; padding: 8px 22px; }
.cart-empty { padding: 48px 10px; text-align: center; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.cart-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); flex: none; }
.cart-item-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cart-item-info strong { font-size: 14px; }
.cart-item-text { font-size: 12.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-text.muted { color: var(--ink-xsoft); }
.cart-remove { appearance: none; border: none; background: none; font-size: 20px; line-height: 1; color: var(--ink-xsoft); cursor: pointer; padding: 0 4px; flex: none; }
.cart-remove:hover { color: #9a2c2c; }
.cart-foot { padding: 18px 22px 22px; border-top: 1px solid var(--border); }
.cart-continue { width: 100%; justify-content: center; margin-top: 10px; }

/* GALLERY META */
.gallery-meta { margin-top: 2px; }
.preview-counter { font-size: 13px; font-weight: 500; color: var(--ink-xsoft); white-space: nowrap; letter-spacing: 0.02em; margin-left: auto; }

/* PREVIEW GALLERY */
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 16px; }
.preview-card {
  position: relative; border: 2px solid transparent; border-radius: 12px;
  overflow: hidden; cursor: pointer; background: var(--bg);
  transition: border-color .15s;
}
.preview-card img { width: 100%; display: block; }
.preview-card.selected { border-color: var(--accent); }
.preview-check {
  position: absolute; top: 8px; right: 8px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(0,0,0,0.14);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  transition: background .2s, border-color .2s;
  pointer-events: none;
}
.preview-card.selected .preview-check {
  background: rgba(111,143,116,0.65);
  border-color: rgba(255,255,255,0.5);
  box-shadow: 0 1px 4px rgba(111,143,116,0.3);
}
.preview-del {
  position: absolute; bottom: 8px; right: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.45); color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; opacity: 0;
  transition: opacity .15s, background .15s;
}
.preview-zoom {
  position: absolute; bottom: 8px; left: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.45); color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; opacity: 0;
  transition: opacity .15s, background .15s;
}
.preview-card:hover .preview-zoom { opacity: 1; }
.preview-zoom:hover { background: rgba(0,0,0,.75); }
.preview-card:hover .preview-del { opacity: 1; }
.preview-del:hover { background: rgba(0,0,0,.75); }
.preview-card.loading { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; cursor: default; }
.preview-loader { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 75%; }
.loading-pct { font-family: "Fraunces", serif; font-size: 26px; font-weight: 500; color: var(--ink); line-height: 1; }
.loading-bar-track { width: 100%; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.loading-bar { height: 100%; width: 0%; background: var(--accent); border-radius: 2px; transition: width 0.6s ease-out; }
.loading-label { font-size: 12px; color: var(--ink-soft); }

/* LIGHTBOX */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.lightbox img {
  max-width: min(90vw, 640px); max-height: 90vh;
  border-radius: 12px; object-fit: contain;
  box-shadow: 0 8px 60px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: fixed; top: 20px; right: 24px;
  background: rgba(255,255,255,0.12); border: none; color: #fff;
  font-size: 28px; line-height: 1; width: 40px; height: 40px;
  border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  transition: background .15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }

/* LOADER + ERROR */
.loader { display: flex; align-items: center; gap: 10px; justify-content: center; color: var(--ink-soft); margin: 20px 0; font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { background: #fef2f0; border: 1px solid #f5c6bc; color: #9e3d28; padding: 12px 16px; border-radius: 10px; margin: 12px 0; font-size: 13px; }
.is-hidden { display: none; }

@media (max-width: 600px) {
  .topbar { padding: 14px 20px; gap: 16px; }
  .topbar-nav { display: none; }
  .hero { grid-template-columns: 1fr; text-align: center; padding: 40px 0 36px; }
  .hero .lede { margin: 0 auto; }
  .hero-img-wrap { display: none; }
  .trust-row { justify-content: center; }
  .style-grid { grid-template-columns: 1fr 1fr; }
  .preview-grid { grid-template-columns: 1fr 1fr; }
  .slot { width: calc(33.333% - 7px); aspect-ratio: 1; height: auto; }
  main { padding: 0 16px 80px; }
  .steps { flex-direction: column; align-items: center; }
  .step-arrow { transform: rotate(90deg); margin: 0; padding: 4px 0; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
