/* ---------- Schriften für Schriftzüge (lokal) ---------- */
@font-face { font-family: "Bebas Neue"; font-display: swap; src: url("../fonts/bebas-neue-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 700; font-display: swap; src: url("../fonts/oswald-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto Slab"; font-weight: 700; font-display: swap; src: url("../fonts/roboto-slab-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Pacifico"; font-display: swap; src: url("../fonts/pacifico-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Permanent Marker"; font-display: swap; src: url("../fonts/permanent-marker-latin-400-normal.woff2") format("woff2"); }

.site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- Hero ---------- */
.cfg-hero { padding: 140px 0 40px; position: relative; overflow: hidden; }
.cfg-hero::before {
  content: ""; position: absolute; right: -10%; top: -40%;
  width: 700px; height: 700px; border-radius: 50%;
  background: var(--brand); filter: blur(140px); opacity: .35; z-index: -1;
}
.cfg-hero h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); font-weight: 800; letter-spacing: -0.045em; }
.cfg-hero p { color: var(--muted); font-size: 1.15rem; max-width: 640px; margin: 18px 0 0; }

/* ---------- Layout ---------- */
.cfg { padding: 20px 0 110px; }
.cfg-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.cfg-preview { position: sticky; top: 100px; }

/* ---------- Bühne ---------- */
.stage-wrap {
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 40%, rgba(47, 123, 255, .18), transparent 60%),
    linear-gradient(180deg, #0d1436, #070b1f);
  padding: 22px;
}
.stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  aspect-ratio: 500 / 580;
  touch-action: none;
  user-select: none;
}
.garment, .garment svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.garment svg { filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .55)); transition: opacity .3s; }

/* Druckbereiche: Klicks gehen an die Elemente bzw. die Bühne, nicht an den Rahmen */
.print-zone { position: absolute; outline: 1.5px dashed transparent; outline-offset: 0; pointer-events: none; transition: outline-color .2s, background .2s; }
.print-zone .el { pointer-events: auto; }
.stage.show-zone .print-zone { outline-color: rgba(120, 170, 255, .35); }
.stage.show-zone .print-zone.active { outline: 2px dashed var(--cyan); background: rgba(0, 209, 255, .06); z-index: 2; }
.stage .print-zone.overflow { outline: 2px dashed #ff6b7d; }
.stage.show-zone .print-zone.active::after, .stage .print-zone.overflow::after {
  content: attr(data-label);
  position: absolute; left: 50%; top: -18px; transform: translateX(-50%); white-space: nowrap;
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(120, 170, 255, .7); pointer-events: none;
}
.stage.show-zone .print-zone.active::after { color: var(--cyan); }
.stage .print-zone.overflow::after { content: "Ragt über den Druckbereich"; color: #ff6b7d; }
.print-zone.active.empty::before {
  content: attr(data-hint);
  position: absolute; inset: 0;
  display: grid; place-items: center; text-align: center;
  padding: 6px;
  font-size: 12px; font-weight: 700; line-height: 1.3;
  color: var(--cyan);
}

/* Auswahl der Druckposition */
.step-label { margin: 0 0 10px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.places { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.place {
  position: relative;
  display: grid; justify-items: center; gap: 2px;
  padding: 10px 6px 10px;
  border: 1.5px solid var(--border); border-radius: 16px;
  background: rgba(0, 0, 0, .2);
  color: var(--text); font: inherit; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.place:hover { transform: translateY(-2px); border-color: rgba(111, 163, 255, .5); }
.place[aria-checked="true"] { border-color: var(--cyan); background: rgba(0, 209, 255, .1); }
.place svg { width: 100%; max-width: 74px; height: auto; margin-bottom: 4px; }
.place strong { font-size: .85rem; line-height: 1.2; }
.place span { font-size: .72rem; color: var(--muted); }
.place em {
  position: absolute; right: -6px; top: -6px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--cyan); color: #001033; font-style: normal; font-size: .72rem; font-weight: 800;
}

.el {
  position: absolute;
  left: 0; top: 0;
  cursor: move;
  transform-origin: center;
  touch-action: none;
}
.el img { display: block; width: 100%; height: auto; pointer-events: none; }
.el-text { white-space: pre; line-height: 1.15; text-align: center; padding: 0 .05em; }
.el.selected { outline: 1.5px solid var(--cyan); outline-offset: 4px; }
.handle {
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff; color: var(--brand);
  border: 2px solid var(--cyan);
  display: none; place-items: center;
  font-size: 12px; font-weight: 800; line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}
.el.selected .handle { display: grid; }
.handle-resize { right: -15px; bottom: -15px; cursor: nwse-resize; }
.handle-rotate { left: 50%; top: -38px; margin-left: -11px; cursor: grab; }
.handle-rotate::after { content: ""; position: absolute; left: 50%; top: 20px; width: 1.5px; height: 14px; background: var(--cyan); }


.stage-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.side-toggle { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid var(--border); }
.side-toggle button {
  padding: 9px 18px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted);
  font: 600 .9rem var(--font); cursor: pointer;
  transition: background .25s, color .25s;
}
.side-toggle button[aria-selected="true"] { background: var(--brand); color: #fff; }
.zone-toggle { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .9rem; cursor: pointer; }
.zone-toggle input { accent-color: var(--brand); }

.selection-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 14px; padding: 10px 12px;
  border-radius: 16px; background: rgba(0, 209, 255, .08); border: 1px solid rgba(0, 209, 255, .25);
}
.selection-bar[hidden] { display: none; }
.selection-bar span { font-size: .85rem; font-weight: 700; margin-right: auto; color: var(--cyan); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selection-bar button {
  padding: 7px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, .05);
  color: var(--text); font: 600 .82rem var(--font); cursor: pointer;
}
.selection-bar button:hover { background: rgba(255, 255, 255, .12); }
.selection-bar .danger { color: #ff8a98; border-color: rgba(255, 100, 120, .35); }
.stage-hint { margin: 12px 0 0; font-size: .82rem; color: var(--muted); text-align: center; }

/* ---------- Panel ---------- */
.cfg-panel { display: grid; gap: 18px; }
.cfg-step {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
}
.cfg-step h2 { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; margin-bottom: 18px; letter-spacing: -0.02em; }
.cfg-step h2 > span {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gradient); font-size: .9rem;
}
.cfg-step h2 small { margin-left: auto; font-size: .85rem; font-weight: 600; color: var(--light); letter-spacing: 0; text-align: right; }

/* Produkte */
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product {
  position: relative;
  display: grid; justify-items: center; gap: 6px;
  padding: 16px 12px 14px;
  border: 1.5px solid var(--border); border-radius: 18px;
  background: rgba(0, 0, 0, .2);
  color: var(--text); font: inherit; text-align: center;
  cursor: pointer;
  transition: border-color .25s, background .25s, transform .25s var(--ease);
}
.product:hover { transform: translateY(-3px); border-color: rgba(111, 163, 255, .5); }
.product[aria-checked="true"] { border-color: var(--cyan); background: rgba(0, 209, 255, .08); box-shadow: 0 0 0 4px rgba(0, 209, 255, .12); }
.product svg { width: 92px; height: 104px; }
.product strong { font-size: 1rem; }
.product span { font-size: .8rem; color: var(--muted); line-height: 1.4; }

/* Farbfelder als Mini-Produktbilder */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; max-height: 330px; overflow-y: auto; padding: 4px; margin: -4px; scrollbar-width: thin; }
.swatch {
  position: relative;
  aspect-ratio: 1;
  border: 1.5px solid transparent; border-radius: 14px;
  background: rgba(255, 255, 255, .06);
  padding: 4px; cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.swatch svg { width: 100%; height: 100%; pointer-events: none; }
.swatch:hover { transform: scale(1.08); background: rgba(255, 255, 255, .12); z-index: 2; }
.swatch[aria-checked="true"] { border-color: var(--cyan); background: rgba(0, 209, 255, .14); }
.swatch[aria-checked="true"]::after {
  content: "✓"; position: absolute; right: -6px; top: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--cyan); color: #001033; font-size: 11px; font-weight: 800;
}
.swatch .tip {
  position: absolute; left: 50%; bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(4px);
  white-space: nowrap; padding: 4px 9px; border-radius: 8px;
  background: #fff; color: #050816; font-size: .75rem; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
}
.swatch:hover .tip, .swatch:focus-visible .tip { opacity: 1; transform: translateX(-50%); }

/* Upload */
.upload {
  position: relative;
  display: grid; justify-items: center; gap: 4px;
  padding: 24px 16px;
  border: 1.5px dashed rgba(111, 163, 255, .45); border-radius: 18px;
  background: rgba(47, 123, 255, .06);
  text-align: center; cursor: pointer;
  transition: background .25s, border-color .25s;
}
.upload:hover, .upload.drag { background: rgba(47, 123, 255, .14); border-color: var(--cyan); }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-icon {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gradient); font-size: 1.2rem; margin-bottom: 6px;
}
.upload span:last-child { font-size: .82rem; color: var(--muted); }
.upload-small { padding: 12px 14px; justify-items: start; text-align: left; border-radius: 14px; }
.upload-small strong { font-size: .92rem; }

/* Text */
.text-tool { display: grid; gap: 10px; margin-top: 18px; }
.text-tool > label { font-size: .9rem; font-weight: 600; color: var(--muted); }
.text-tool textarea, .cfg select, .field-inline select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: rgba(0, 0, 0, .3); color: var(--text);
  font: inherit; resize: vertical;
}
.cfg select option { background: #0a0f2c; }
.text-tool textarea:focus, .cfg select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 123, 255, .2); }
.text-options { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.text-colors { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tcolor {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25); cursor: pointer; padding: 0;
  transition: transform .15s;
}
.tcolor:hover { transform: scale(1.12); }
.tcolor[aria-checked="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--cyan); }
.tcolor-custom { position: relative; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.tcolor-custom input { position: absolute; inset: -6px; opacity: 0; cursor: pointer; }
.text-tool .btn { justify-self: start; }

/* Ebenen */
.layers { display: grid; gap: 8px; margin-top: 18px; }
.layer {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 8px 10px 8px 8px;
  border: 1px solid var(--border); border-radius: 14px;
  background: rgba(0, 0, 0, .2); cursor: pointer;
}
.layer.active { border-color: var(--cyan); }
.layer-thumb { width: 40px; height: 40px; border-radius: 10px; background: #fff center / contain no-repeat; display: grid; place-items: center; color: #050816; font-weight: 800; overflow: hidden; }
.layer-name { font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-name small { display: block; font-weight: 500; font-size: .76rem; color: var(--muted); }
.layer-name small.warn { color: #ffc46b; }
.layer button { border: 0; background: transparent; color: #ff8a98; font-size: 1.1rem; cursor: pointer; padding: 4px 8px; }

/* Größen */
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.size {
  display: grid; gap: 6px; justify-items: center;
  padding: 10px 6px;
  border: 1px solid var(--border); border-radius: 14px;
  background: rgba(0, 0, 0, .2);
  transition: border-color .2s, background .2s;
}
.size.has { border-color: var(--cyan); background: rgba(0, 209, 255, .07); }
.size strong { font-size: .95rem; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(255, 255, 255, .06);
  color: var(--text); cursor: pointer; font-weight: 700; line-height: 1;
}
.stepper button:hover { background: var(--brand); }
.stepper input {
  width: 38px; padding: 4px 0; text-align: center;
  border: 0; background: transparent; color: var(--text);
  font: 700 .95rem var(--font); -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.field-inline { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; margin-top: 16px; color: var(--muted); font-size: .9rem; }

/* Formular */
#anfrage { display: grid; gap: 14px; }
#anfrage h2 { margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cfg .field input, .cfg .field textarea {
  width: 100%;
  padding: 24px 16px 9px;
  border: 1px solid var(--border); border-radius: 14px;
  background: rgba(0, 0, 0, .3); color: var(--text);
  font: inherit; resize: vertical;
}
.cfg .field input[type="date"] { color-scheme: dark; min-height: 58px; }
.cfg .field input:focus, .cfg .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 123, 255, .2); }
.cfg .field input:invalid.touched { border-color: #ff6b7d; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.summary {
  display: grid; gap: 6px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(0, 56, 255, .12);
  border: 1px solid rgba(111, 163, 255, .3);
  font-size: .9rem;
}
.summary div { display: flex; justify-content: space-between; gap: 16px; }
.summary span { color: var(--muted); }
.summary strong { text-align: right; }
#anfrage .btn { justify-self: start; }
#anfrage .btn[disabled] { opacity: .6; cursor: wait; }
.form-status.error { color: #ff8a98; }

/* Erfolg */
.success {
  max-width: 560px; width: calc(100% - 32px);
  border: 1px solid var(--border); border-radius: 28px;
  background: #0a0f2c; color: var(--text);
  padding: 40px; text-align: center;
}
.success::backdrop { background: rgba(2, 4, 12, .75); backdrop-filter: blur(6px); }
.success-check {
  width: 70px; height: 70px; margin: 0 auto 18px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--gradient); font-size: 2rem; font-weight: 800;
  box-shadow: 0 0 40px rgba(0, 140, 255, .6);
}
.success p { color: var(--muted); }
.success-shots { display: flex; gap: 12px; justify-content: center; margin: 22px 0 26px; }
.success-shots img { width: 46%; max-width: 220px; border-radius: 16px; background: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .cfg-grid { grid-template-columns: 1fr; }
  .cfg-preview { position: relative; top: 0; }
}
@media (max-width: 600px) {
  .cfg-hero { padding: 110px 0 24px; }
  .stage-wrap { padding: 14px; border-radius: 22px; }
  .cfg-step { padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .text-options { grid-template-columns: 1fr; }
  .text-colors { justify-content: flex-start; }
  .success { padding: 28px 20px; }
}

/* ---------- Absicherung gegen globale button/input-Stile anderer Plugins ---------- */
.cfg button, .cfg input, .cfg select, .cfg textarea, .success button {
  margin: 0; text-transform: none; letter-spacing: normal; min-width: 0; min-height: 0; box-shadow: none;
}
.stepper button {
  display: grid; place-items: center;
  padding: 0; line-height: 1; font: 700 1rem var(--font); appearance: none;
}
.stepper input {
  display: block; height: auto; padding: 4px 0; border: 0; border-radius: 0;
  background: transparent; color: var(--text); appearance: textfield; -webkit-appearance: none;
}
.cfg input[type="checkbox"] { display: inline-block; width: auto; height: auto; padding: 0; appearance: auto; }

/* ---------- Handy & Tablet: Vorschau bleibt oben sichtbar ---------- */
@media (max-width: 1000px) {
  .cfg-grid { gap: 18px; }
  .cfg-preview { position: sticky; top: 78px; z-index: 30; }
  .admin-bar .cfg-preview { top: 124px; }
  .stage-wrap {
    padding: 10px 12px 12px;
    background: linear-gradient(180deg, #0d1436, #080d26);
    box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .95);
  }
  .stage { max-width: calc(26vh * 500 / 580); }
  /* Sprungziele (z. B. Hinweis „Menge fehlt“) unterhalb der fixierten Vorschau anzeigen */
  .cfg-panel [id], .cfg-step { scroll-margin-top: calc(78px + 26vh + 80px); }
  .stage-hint { display: none; }
  .stage-bar { margin-top: 6px; gap: 8px; }
  .side-toggle button { padding: 7px 14px; font-size: .82rem; }
  .zone-toggle { font-size: .8rem; }
  .selection-bar { margin-top: 8px; padding: 6px 8px; gap: 6px; }
  .selection-bar button { padding: 6px 9px; font-size: .76rem; }
  .selection-bar span { display: none; }

  .sizes { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .stepper { gap: 6px; }
  .stepper button { width: 34px; height: 34px; font-size: 1.15rem; }
  .stepper input { width: 46px; font-size: 16px; }
}

/* Kleine Druckbereiche (Herzseite am Handy): Hinweis passt hinein */
@media (max-width: 560px) {
  .print-zone.active.empty::before { padding: 2px; font-size: 9px; line-height: 1.15; }
}
