/**
 * Keramikpost Voucher Picker — Styles v1.8
 * Single-Select Wert-Picker für Gutscheine.
 * Gleiche Designsprache wie der Color Picker (Terra-Akzent, Mono-Font).
 */
.kcp-voucher-wrap {
  --kcp-cream:#FAF4EA;
  --kcp-paper:#FAFAFA;
  --kcp-ink:#000000;
  --kcp-ink-soft:rgba(0,0,0,.62);
  --kcp-accent:#955251;
  --kcp-accent-deep:#A25D5C;
  --kcp-burgundy:#955251;
  --kcp-line:#F3EEEE;

  font-family: var(--e-global-typography-text-font-family, 'Manrope', system-ui, -apple-system, sans-serif);
  color: var(--kcp-ink);
  margin: 0 0 24px;
}
.kcp-voucher-wrap, .kcp-voucher-wrap * { box-sizing: border-box; }

/* Original WC-Variation-Zeile ausblenden, sobald JS sie markiert. */
tr.kcp-voucher-hide-row {
  display: none !important;
}

/* Theme-Reset für unsere Buttons */
.kcp-voucher-wrap button {
  font-family: inherit;
  line-height: 1;
  background: transparent;
  color: inherit;
  letter-spacing: normal;
  text-transform: none;
  text-shadow: none;
  box-shadow: none;
  min-height: 0;
  min-width: 0;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.kcp-voucher-wrap button:hover,
.kcp-voucher-wrap button:focus,
.kcp-voucher-wrap button:active {
  background: transparent;
  color: inherit;
  box-shadow: none;
  outline: none;
}

/* Section */
.kcp-voucher-section {
  background: var(--kcp-paper);
  border: 1px solid var(--kcp-line);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 18px;
}

.kcp-voucher-wrap .kcp-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; margin-bottom: 18px; flex-wrap: wrap;
}
.kcp-voucher-wrap .kcp-h3 {
  font-family: var(--e-global-typography-primary-font-family, Georgia, "Instrument Serif", serif);
  font-size: 22px; line-height: 1.1;
  color: var(--kcp-burgundy);
  margin: 0;
  font-weight: 400;
}
.kcp-voucher-wrap .kcp-mono {
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.kcp-voucher-selected {
  color: var(--kcp-accent);
  background: var(--kcp-cream);
  border: 1px solid var(--kcp-line);
  padding: 6px 12px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Grid mit den Wert-Swatches */
.kcp-voucher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

/* Einzelner Wert-Swatch */
.kcp-voucher-swatch {
  position: relative;
  display: flex !important;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  padding: 10px 8px !important;
  background: #fff !important;
  border: 1.5px solid var(--kcp-line) !important;
  border-radius: 10px !important;
  font-family: ui-monospace, "JetBrains Mono", monospace !important;
  font-variant-numeric: tabular-nums;
  color: var(--kcp-ink) !important;
  transition: border-color .15s ease, background .15s ease, transform .15s ease, color .15s ease;
}
.kcp-voucher-swatch:hover {
  border-color: var(--kcp-accent) !important;
  background: var(--kcp-cream) !important;
  transform: translateY(-1px);
}
.kcp-voucher-swatch:focus-visible {
  outline: 2px solid var(--kcp-accent) !important;
  outline-offset: 2px;
}
.kcp-voucher-swatch .kcp-voucher-num {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.kcp-voucher-swatch .kcp-voucher-cur {
  font-size: 12px;
  color: var(--kcp-ink-soft);
  font-weight: 500;
}

/* Aktiver Zustand */
.kcp-voucher-swatch.is-active {
  border-color: var(--kcp-accent) !important;
  border-width: 2px !important;
  background: var(--kcp-cream) !important;
  color: var(--kcp-accent-deep) !important;
  padding: 9.5px 7.5px !important; /* gleicht 0.5px-Border-Sprung aus */
}
.kcp-voucher-swatch.is-active .kcp-voucher-cur {
  color: var(--kcp-accent);
}
.kcp-voucher-swatch.is-active::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  border-radius: 10px;
  box-shadow: 0 0 0 4px rgba(149,82,81,0.10);
  pointer-events: none;
}

/* Hinweis-Zeile */
.kcp-voucher-hint {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 0;
  padding: 12px 14px;
  background: var(--kcp-cream);
  border: 1px solid var(--kcp-line);
  border-radius: 12px;
  font-size: 13px;
  color: var(--kcp-ink-soft);
  line-height: 1.4;
}
.kcp-voucher-hint svg {
  flex: 0 0 auto;
  color: var(--kcp-accent);
}

/* Responsive: auf engen Spalten 4er-Grid bevorzugen */
@media (max-width: 480px) {
  .kcp-voucher-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .kcp-voucher-swatch { min-height: 52px; padding: 8px 4px !important; }
  .kcp-voucher-swatch.is-active { padding: 7.5px 3.5px !important; }
  .kcp-voucher-swatch .kcp-voucher-num { font-size: 15px; }
  .kcp-voucher-swatch .kcp-voucher-cur { font-size: 11px; }
}
