/* =========================================================================
   Flaegs Flaggen-Konfigurator – Frontend-Styles
   Bewusst eigenständig gehalten, damit der Konfigurator auch mit anderen
   Themes gut aussieht. Harmoniert mit dem Flaegs-Theme.
   ========================================================================= */

.flaegs-configurator {
  --fc-navy: #0b1f3a;
  --fc-signal: #e2453c;
  --fc-line: rgba(11, 31, 58, 0.14);
  --fc-radius: 12px;

  margin: 2rem 0;
  padding: 1.75rem;
  background: #fff;
  border: 1px solid var(--fc-line);
  border-radius: 18px;
  box-shadow: 0 2px 6px rgba(11, 31, 58, 0.05), 0 18px 44px -24px rgba(11, 31, 58, 0.28);
}

.flaegs-conf-title {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--fc-navy);
}

/* ---------- Vorschau ---------- */
.flaegs-preview-stage {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: linear-gradient(180deg, #dfe9f5, #f2f0e9);
  border-radius: var(--fc-radius);
  padding: 1.5rem;
}
.flaegs-preview-pole {
  width: 7px;
  border-radius: 4px;
  background: linear-gradient(180deg, #d8dde5, #97a1b0);
  margin-right: 2px;
  flex-shrink: 0;
}
.flaegs-preview {
  flex: 1;
  aspect-ratio: 5 / 3;
  border-radius: 3px 10px 10px 3px;
  overflow: hidden;
  box-shadow: 0 14px 34px -14px rgba(11, 31, 58, 0.45);
}
.flaegs-preview svg,
.flaegs-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.flaegs-preview.is-loading img {
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.flaegs-preview-note {
  margin: 0.6rem 0 1.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}

/* ---------- Modus-Umschalter ---------- */
.flaegs-mode-switch {
  display: inline-flex;
  background: rgba(11, 31, 58, 0.06);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 1.5rem;
}
.flaegs-mode {
  border: none;
  background: transparent;
  padding: 0.55em 1.3em;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--fc-navy);
  transition: background 0.15s ease, color 0.15s ease;
}
.flaegs-mode.is-active {
  background: var(--fc-navy);
  color: #fff;
}
.flaegs-mode .woocommerce-Price-amount { color: inherit; }

/* ---------- Farbzonen ---------- */
.flaegs-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--fc-line);
}
.flaegs-zone:last-child { border-bottom: none; }

.flaegs-zone-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 140px;
}
.flaegs-zone-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}
.flaegs-zone-label {
  font-weight: 700;
  color: var(--fc-navy);
}

.flaegs-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.flaegs-swatch-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.flaegs-swatch-btn:hover { transform: scale(1.12); }
.flaegs-swatch-btn.is-selected {
  border-color: var(--fc-navy);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--fc-navy);
}
.flaegs-swatch-btn:focus-visible {
  outline: 2px solid var(--fc-signal);
  outline-offset: 3px;
}

.flaegs-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.flaegs-picker input[type="color"] {
  width: 52px;
  height: 38px;
  border: 1px solid var(--fc-line);
  border-radius: 8px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
}
.flaegs-picker-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ---------- Wunschtext & Koordinaten ---------- */
.flaegs-extra {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--fc-line);
}
.flaegs-extra label {
  display: block;
  font-weight: 700;
  color: var(--fc-navy);
  margin-bottom: 0.5rem;
}
.flaegs-required { color: var(--fc-signal); }
.flaegs-extra input[type="text"] {
  width: 100%;
  padding: 0.7em 0.9em;
  border: 1.5px solid var(--fc-line);
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
}
.flaegs-extra input[type="text"]:focus {
  outline: 2px solid var(--fc-navy);
  outline-offset: 1px;
}
.flaegs-char-count {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  opacity: 0.6;
  text-align: right;
}
.flaegs-extra-hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  opacity: 0.65;
}

.flaegs-address-wrap { position: relative; }
.flaegs-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: #fff;
  border: 1px solid var(--fc-line);
  border-radius: 10px;
  box-shadow: 0 16px 40px -16px rgba(11, 31, 58, 0.35);
  max-height: 280px;
  overflow-y: auto;
}
.flaegs-suggestion button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  font: inherit;
}
.flaegs-suggestion button:hover,
.flaegs-suggestion button:focus-visible {
  background: rgba(11, 31, 58, 0.06);
}
.flaegs-suggestion strong {
  display: block;
  color: var(--fc-navy);
  font-size: 0.95rem;
}
.flaegs-suggestion span {
  display: block;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  opacity: 0.65;
}
.flaegs-suggestion.is-empty {
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  opacity: 0.65;
}

.flaegs-coords-preview {
  margin: 0.6rem 0 0;
  padding: 0.6rem 0.9rem;
  background: rgba(11, 31, 58, 0.05);
  border-radius: 8px;
}
.flaegs-coords-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  color: var(--fc-navy);
  letter-spacing: 0.03em;
}

/* ---------- Preis ---------- */
.flaegs-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--fc-navy);
}
.flaegs-price-label {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fc-navy);
}
.flaegs-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--fc-navy);
}
.flaegs-price.has-surcharge { color: var(--fc-signal); }

/* ---------- Warenkorb / Checkout / Bestellungen ---------- */
.flaegs-cart-preview {
  display: block;
  max-width: 120px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 12px -4px rgba(11, 31, 58, 0.35);
}
.flaegs-cart-preview svg {
  display: block;
  width: 100%;
  height: auto;
}
.flaegs-swatch-inline {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  vertical-align: baseline;
  margin-right: 2px;
}

@media (max-width: 600px) {
  .flaegs-configurator { padding: 1.25rem; }
  .flaegs-zone { flex-direction: column; align-items: flex-start; }
}
