/* ═══════════════════════════════════════════════════════
   Produktdesigner — Styling
   Passend zum mittelalterlich-dunklen Design-System
   ═══════════════════════════════════════════════════════ */

/* ── Modal-Overlay ── */
.designer-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.designer-modal[hidden] {
  display: none;
}

.designer-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--bg-modal-backdrop, rgba(4,4,10,0.82));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.designer-modal__dialog {
  position: relative;
  z-index: 1;
  background: var(--bg-modal, #0d0d18);
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 6px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8), inset 0 0 40px rgba(201, 168, 76, 0.03);
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 2.5rem 2rem 2rem;
}

.designer-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  background: none;
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 3px;
  color: var(--gold);
  font-size: 1rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  line-height: 1;
}

.designer-modal__close:hover {
  background: rgba(201, 168, 76, 0.12);
  border-color: var(--gold);
}

#product-designer {
  /* im Modal braucht es keinen extra Abstand oben */
}

/* ── Wrapper ── */
.designer-wrap {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.designer-title {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--gold-light);
  margin: 0.5rem 0 0.25rem;
  letter-spacing: 0.08em;
}

.designer-ornament {
  color: var(--gold);
  font-size: 1.2rem;
  opacity: 0.7;
  margin: 0.4rem 0;
}

.designer-ornament--small {
  font-size: 0.95rem;
  letter-spacing: 0.15em;
}

/* ── Body: Vorschau + Steuerung ── */
.designer-body {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  justify-content: center;
  margin: 2rem 0 1.5rem;
  flex-wrap: wrap;
}

/* ── Vorschau-Panel ── */
.designer-preview {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.designer-canvas {
  position: relative;
  width: 180px;
  height: 252px;   /* 200×280 SVG skaliert proportional */
  filter: drop-shadow(0 4px 18px rgba(0,0,0,0.65));
  transition: filter 0.25s ease;
}

.designer-canvas:hover {
  filter: drop-shadow(0 6px 28px rgba(201,168,76,0.25));
}

/* SVG-Ebenen übereinander */
.designer-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.designer-svg--overlay {
  /* Overlay-SVGs liegen über dem Basis-SVG */
  pointer-events: none;
}

/* CSS-Custom-Properties für die SVG-Farben */
.ds-fill {
  fill: var(--ds-color, #1c1c1c);
  transition: fill 0.3s ease;
}

.ds-fill--dark {
  fill: var(--ds-color-dark, #111111);
  transition: fill 0.3s ease;
}

/* Dreispitz — Hut */
.ds-fill-hut {
  fill: var(--ds-hut, #1c1c1c);
  transition: fill 0.3s ease;
}

.ds-fill-hut--dark {
  fill: var(--ds-hut-dark, #111111);
  transition: fill 0.3s ease;
}

/* Dreispitz — Feder */
.ds-fill-feder {
  fill: var(--ds-feder, #e8e0d0);
  transition: fill 0.3s ease;
}

.designer-color-name {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--gold);
  font-size: 0.95rem;
  margin: 0;
}

.designer-no-svg {
  font-family: var(--font-body);
  color: var(--parchment);
  opacity: 0.6;
  font-style: italic;
}

/* ── Steuerung ── */
.designer-controls {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: left;
}

.ds-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ds-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}

/* Farbpalette */
.ds-swatches {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.ds-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.ds-swatch:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(201,168,76,0.4);
}

.ds-swatch.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.25);
  transform: scale(1.12);
}

/* Toggle-Buttons */
.ds-toggles {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ds-toggle {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 3px;
  background: rgba(201,168,76,0.05);
  color: var(--parchment);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  outline: none;
}

.ds-toggle:hover {
  background: rgba(201,168,76,0.1);
  border-color: rgba(201,168,76,0.6);
}

.ds-toggle.is-active {
  background: rgba(201,168,76,0.18);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* CTA-Button */
.designer-cta {
  margin-top: 0.5rem;
  width: 100%;
  justify-content: center;
}

/* ── Responsive ── */
@media (max-width: 540px) {
  .designer-body {
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
  }

  .designer-controls {
    text-align: center;
    max-width: 100%;
  }

  .ds-swatches,
  .ds-toggles {
    justify-content: center;
  }
}

/* ── Light Mode Overrides ── */
[data-theme="light"] .designer-modal__dialog {
  box-shadow: 0 0 40px rgba(100,70,20,0.25), inset 0 0 30px rgba(201,168,76,0.04);
  border-color: rgba(100,70,20,0.3);
}

[data-theme="light"] .designer-modal__close {
  border-color: rgba(100,70,20,0.25);
}

[data-theme="light"] .designer-modal__close:hover {
  background: rgba(100,70,20,0.1);
  border-color: var(--gold-dim);
}

[data-theme="light"] .ds-toggle {
  border-color: rgba(100,70,20,0.25);
  background: rgba(100,70,20,0.04);
  color: var(--text);
}

[data-theme="light"] .ds-toggle:hover {
  background: rgba(100,70,20,0.1);
  border-color: var(--gold-dim);
}

[data-theme="light"] .ds-toggle.is-active {
  background: rgba(201,168,76,0.2);
  border-color: var(--gold-dim);
  color: var(--gold);
}
