/* =====================================================================
   Sticker-Generator — EH-Productions
   Eigenes CSS fuer die Tool-Seite sticker.html. Nutzt die Tokens aus
   css/style.css (Petrol/Lime, Archivo/Manrope, Dark + Light Theme).
   Sticker-Fonts liegen self-hosted in assets/fonts/sticker/ (DSGVO).
   ===================================================================== */

/* ---------- Tool-Layout: Vorschau | Steuerung ---------- */
.stk {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
}
@media (max-width: 900px) { .stk { grid-template-columns: 1fr; } }

/* Vorschau klebt beim Scrollen mit (Desktop) */
.stk__previewcol { position: sticky; top: calc(var(--nav-h) + 28px); }
/* Mobil bleibt die Vorschau beim Tippen oben sichtbar (kompakt, sticky) */
@media (max-width: 900px) {
  .stk__previewcol {
    position: sticky; top: calc(var(--nav-h) + 6px); z-index: 5; order: -1;
    background: var(--bg); padding-bottom: 10px;
    box-shadow: 0 14px 18px -12px var(--bg);
  }
  .stk-stage { aspect-ratio: 16 / 11; max-height: 44vh; }
  .stk__previewcol .stk-hint { display: none; }
}

/* ---------- Vorschau-Buehne ---------- */
.stk-stage {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: clamp(20px, 4vw, 40px);
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  transition: background .3s var(--ease);
}
/* Hell/Dunkel-Untergrund nur fuer die Vorschau (nicht das Produkt) */
.stk-stage[data-bg="hell"] {
  background:
    radial-gradient(120% 120% at 30% 15%, #ffffff 0%, #e9edea 75%);
}
.stk-stage[data-bg="dunkel"] {
  background:
    radial-gradient(120% 120% at 30% 15%, #1b3136 0%, #0c1719 80%);
}
.stk-stage[data-bg="transparent"] {
  background-color: #d9dedb;
  background-image:
    linear-gradient(45deg, #c4cbc7 25%, transparent 25%),
    linear-gradient(-45deg, #c4cbc7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #c4cbc7 75%),
    linear-gradient(-45deg, transparent 75%, #c4cbc7 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.stk-preview {
  width: 100%;
  max-width: 420px;
  /* Gestapelt: enger Kontaktschatten + weiche Tiefe = der Sticker "liegt" auf der Buehne */
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .24)) drop-shadow(0 20px 34px rgba(0, 0, 0, .34));
}
.stk-preview svg { width: 100%; height: auto; display: block; }

.stk-size-badge {
  position: absolute;
  top: 14px; left: 14px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .02em;
  color: #122023;
  background: var(--lime);
  padding: 4px 11px;
  border-radius: 999px;
}
/* Preis-Pille in der Vorschau — nur auf Mobil, damit der Preis ohne Scrollen sichtbar ist */
.stk-price-badge {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 4;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: .8rem;
  color: var(--lime);
  background: rgba(18, 32, 35, .82);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 4px 11px;
  border-radius: 999px;
  display: none;
}
@media (max-width: 900px) {
  .stk-price-badge:not(:empty) { display: block; }
}

/* Untergrund-Umschalter unter der Buehne */
.stk-bgswitch {
  display: inline-flex;
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.stk-bgswitch button {
  font: 600 .82rem/1 var(--font-body);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  transition: color .2s, background .2s;
}
.stk-bgswitch button[aria-pressed="true"] {
  background: var(--bg-2);
  color: var(--lime);
}

.stk-hint { color: var(--muted); font-size: .9rem; margin-top: 14px; }

/* Mockup-Auswahl + Szenen-Modus (randlose Vorschau) */
.stk-mockups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.stk-mockchip { font-size: .82rem; padding: 8px 14px; min-height: 0; }
.stk-stage.is-scene { padding: 0; }
.stk-stage.is-scene .stk-preview { max-width: none; filter: none; }
.stk-sublabel { font-size: .82rem; color: var(--muted); font-weight: 600; margin: 16px 0 8px; }
.stk-dims { margin-top: 12px; font-weight: 700; color: var(--accent-ink); font-size: .9rem; }
.stk-dims:empty { display: none; }
.stk-qty-custom { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.stk-qty-custom label { font-size: .88rem; color: var(--muted); }
.stk-qty-custom input { width: 110px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font: 600 1rem var(--font-body); padding: 10px 12px; }
.stk-qty-custom input:focus { outline: none; border-color: var(--accent-ink); }
.stk-qty-hint { font-size: .8rem; color: var(--muted); }
.stk-size-input { display: flex; align-items: center; gap: 16px; }
.stk-size-input input[type="range"] { flex: 1; accent-color: var(--lime); height: 6px; cursor: pointer; }
.stk-size-num { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.stk-size-num input { width: 66px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font: 700 1rem var(--font-body); padding: 8px 10px; text-align: center; }
.stk-size-num input:focus { outline: none; border-color: var(--accent-ink); }
@media (max-width: 480px) { .stk-size-input { flex-wrap: wrap; } .stk-size-input input[type="range"] { flex: 1 1 100%; } }

/* ---- Review-Polish ---- */
.stk-group + .stk-group { border-top: 1px solid var(--line); padding-top: 22px; }
.stk-group__num {
  display: inline-grid; place-items: center; width: 23px; height: 23px;
  border-radius: 50%; background: var(--lime-dim); border: 1px solid var(--lime);
  color: var(--accent-ink); font-size: .7rem; font-weight: 800;
}
.stk-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.06; }
.stk-chip small { margin-top: 2px; }
.stk-preview { max-width: 500px; }
.stk-mockchip { font-size: .76rem; padding: 7px 12px; }
.stk-stage.is-scene .stk-size-badge {
  background: rgba(18, 32, 35, .72); color: var(--lime);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); font-size: .74rem;
}
.btn.is-disabled { opacity: .45; pointer-events: none; }

/* Schnellstart-Vorlagen */
.stk-presets-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.stk-presets-label { font-weight: 700; font-size: .82rem; color: var(--muted); }
.stk-presetchip { background: var(--bg-2); border-color: var(--od-line); color: var(--od-text); }
.stk-presetchip:hover { border-color: var(--lime); color: var(--lime); }

/* Logo-Fehler + Bestell-Fallback + Trust */
.stk-logo-err { color: var(--red); font-size: .85rem; font-weight: 600; margin-top: 8px; min-height: 1.1em; }
.stk-logo-err:empty { margin-top: 0; }
.stk-fallback { font-size: .88rem; color: var(--muted); margin-top: 10px; }
.stk-fallback a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.stk-trust { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); list-style: none; }
.stk-trust li { position: relative; padding-left: 22px; font-size: .84rem; color: var(--text); }
.stk-trust li::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 14px; height: 14px; transform: translateY(-50%);
  background: var(--lime);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}
.stk-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- Wow / Motion ---- */
.stk-size-badge { z-index: 4; }
.stk-preview { transition: transform .2s var(--ease); }
.stk-stage.is-tilt .stk-preview { transform: perspective(1100px) rotateX(var(--stk-ry, 0deg)) rotateY(var(--stk-rx, 0deg)); }
.stk-preview.is-pop { animation: stkPop .42s var(--ease); }
@keyframes stkPop { 0% { transform: scale(.93); } 60% { transform: scale(1.035); } 100% { transform: scale(1); } }
.stk-gloss {
  position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0;
  mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .5) 50%, transparent 60%);
  background-size: 250% 100%; background-position: 130% 0;
  transition: opacity .4s var(--ease);
}
.stk-stage.is-glossy .stk-gloss { opacity: .8; animation: stkSheen 3.6s var(--ease) infinite; }
@keyframes stkSheen { 0% { background-position: 135% 0; } 55%, 100% { background-position: -35% 0; } }
@media (prefers-reduced-motion: reduce) {
  .stk-stage.is-tilt .stk-preview { transform: none !important; }
  .stk-preview.is-pop { animation: none; }
  .stk-stage.is-glossy .stk-gloss { animation: none; opacity: .35; }
}

/* ---------- Steuerung ---------- */
.stk-group { margin-bottom: 28px; }
.stk-group__label {
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 12px;
}
.stk-group__num {
  font-size: .8rem;
  color: var(--accent-ink);
  font-weight: 800;
}
.stk-group__opt { font-size: .8rem; color: var(--muted); font-weight: 500; font-family: var(--font-body); }

/* Auswahl-Chips */
.stk-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.stk-chip {
  font: 600 .92rem/1 var(--font-body);
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 18px;
  min-height: 44px;
  transition: border-color .2s, color .2s, background .2s, transform .15s;
}
.stk-chip:hover { border-color: var(--accent-ink); }
.stk-chip[aria-pressed="true"] {
  border-color: var(--lime);
  color: var(--lime);
  background: var(--lime-dim);
}
[data-theme="light"] .stk-chip[aria-pressed="true"] { color: var(--accent-ink); }
.stk-chip small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); margin-top: 2px; }
.stk-chip[aria-pressed="true"] small { color: inherit; opacity: .8; }

/* Schrift-Chips zeigen die jeweilige Schrift */
.stk-fontchip { font-size: 1.15rem; padding: 8px 18px; }

/* Farb-Swatches */
.stk-swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stk-swatch {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid var(--line);
  position: relative;
  transition: transform .15s, border-color .2s;
}
.stk-swatch:hover { transform: scale(1.08); }
.stk-swatch[aria-pressed="true"] {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--lime);
}
.stk-swatch--custom {
  display: grid; place-items: center;
  background: var(--card);
  color: var(--muted);
  overflow: hidden;
}
.stk-swatch--custom input[type="color"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

/* Text-Eingabe */
.stk-input, .stk-select {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: 500 1rem/1.4 var(--font-body);
  padding: 13px 15px;
}
.stk-input:focus, .stk-select:focus { outline: none; border-color: var(--accent-ink); }
.stk-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .stk-row { grid-template-columns: 1fr; } }

/* Logo-Upload */
.stk-upload {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.stk-upload:hover, .stk-upload.is-drag { border-color: var(--lime); color: var(--text); }
.stk-upload strong { color: var(--text); }
.stk-upload input { display: none; }
.stk-upload__file { margin-top: 8px; color: var(--accent-ink); font-weight: 600; font-size: .9rem; }

/* Mode-Panels */
.stk-panel { display: none; }
.stk-panel.is-active { display: block; animation: stkFade .3s var(--ease); }
@keyframes stkFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .stk-panel.is-active, .stk-preview { animation: none !important; }
}

/* ---------- Preis ---------- */
.stk-price {
  background: var(--bg-2);
  border: 1px solid var(--od-line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 4px 0 22px;
  color: var(--od-text);
}
.stk-price__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stk-price__row + .stk-price__row { margin-top: 6px; }
.stk-price__total {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  color: var(--lime);
  line-height: 1;
}
.stk-price__unit { color: var(--od-muted); font-size: .9rem; }
.stk-price__note { color: var(--od-muted); font-size: .78rem; margin-top: 10px; }
.stk-price__lines { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--od-line); }
.stk-price__lines .stk-price__row { font-size: .92rem; color: var(--od-text); }
.stk-price__lines .stk-price__row span:last-child { font-weight: 600; }
.stk-price__free { font-size: .82rem; font-weight: 700; color: var(--lime); margin-top: 10px; }

/* ---------- Aktionen ---------- */
.stk-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.stk-actions .btn { flex: 1 1 auto; justify-content: center; }

/* ---------- Bestell-Formular ---------- */
.stk-order {
  margin-top: 38px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.stk-order .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .stk-order .form-row { grid-template-columns: 1fr; } }
.stk-order label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.stk-order input, .stk-order textarea {
  width: 100%; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); font: 500 1rem/1.5 var(--font-body); padding: 13px 15px;
}
.stk-order input:focus, .stk-order textarea:focus { outline: none; border-color: var(--accent-ink); }
.stk-order .form-field { margin-bottom: 16px; }

.stk-confirm {
  background: var(--lime-dim);
  border: 1px solid var(--lime);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: .9rem;
  margin-bottom: 16px;
}
.stk-confirm strong { color: var(--accent-ink); }

/* Ohne JS: Hinweis statt Tool */
.stk-nojs {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; color: var(--muted);
}
.js .stk-nojs { display: none; }
