
/* =========================================================
   CM Woo Gutschein – Frontend v0.2.49
   Änderung:
   - feste Gutschein-Karte Variante 7 als Preview-Basis
   - PNG als sichtbare Vorschau
   - Positionslogik an SVG-Maßen ausgerichtet
   - alte Vorlagenauswahl im Frontend entfernt
   - Produktpreis im Single Product wieder fix auf Standardwert
   - dynamische Auswahl bleibt nur in der Zeile „Aktuell ausgewählt“
   - Gutscheinwert-Feld nochmals kompakter
   ========================================================= */

.cm-woo-gutschein-shortcode-cart,
.cm-woo-gutschein-box { width: 100%; }

.cm-woo-gutschein-box {
  margin-top: 18px;
  font-family: Poppins, Arial, sans-serif;
  color: #333333;
}

.cm-woo-gutschein-box h1,
.cm-woo-gutschein-box h2,
.cm-woo-gutschein-box h3,
.cm-woo-gutschein-box h4,
.cm-woo-gutschein-box .cm-woo-gutschein-title,
.cm-woo-gutschein-box .cm-woo-gutschein-giftcard-title { display: none !important; }

.cm-woo-gutschein-box label,
.cm-woo-gutschein-box .cm-woo-gutschein-presets-label,
.cm-woo-gutschein-box .cm-woo-gutschein-personalization-title {
  display: block;
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
  color: #333333;
}

.cm-woo-gutschein-box .required,
.cm-woo-gutschein-box abbr.required { color: #005761; text-decoration: none; border: 0; }

.cm-woo-gutschein-box .form-row,
.cm-woo-gutschein-box .woocommerce-form-row,
.cm-woo-gutschein-box p { margin-bottom: 14px !important; }

.cm-woo-gutschein-box .cm-woo-gutschein-presets-wrap { margin: 0 0 16px; }

.cm-woo-gutschein-box .cm-woo-gutschein-presets-subline,
.cm-woo-gutschein-box .cm-woo-gutschein-amount-subline,
.cm-woo-gutschein-box .cm-woo-gutschein-personalization-note,
.cm-woo-gutschein-box .cm-woo-gutschein-fixed-card-note {
  display: none;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 400;
  color: #666666;
}

.cm-woo-gutschein-box .cm-woo-gutschein-fixed-card-note {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #e3dacd;
  background: #fffaf4;
}

.cm-woo-gutschein-box .cm-woo-gutschein-amount-subline { margin: 0 0 8px; }

.cm-woo-gutschein-box .cm-woo-gutschein-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 0;
}

.cm-woo-gutschein-box .cm-woo-gutschein-preset {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 10px 8px;
  border: 1px solid #005761;
  background: #dcf0f1;
  color: #005761;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.cm-woo-gutschein-box .cm-woo-gutschein-preset:hover {
  border-color: #005761;
  color: #005761;
  background: #cde9ea;
  transform: translateY(-1px);
}

.cm-woo-gutschein-box .cm-woo-gutschein-preset.is-active {
  border: 1px solid #005761;
  background: #005761;
  color: #ffffff;
  font-weight: 600;
  letter-spacing: .01em;
  text-shadow: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.cm-woo-gutschein-box .cm-woo-gutschein-amount-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: min(100%, 172px);
  max-width: 172px;
  min-height: 54px;
  border: 1px solid #005761;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 244, .6);
  box-sizing: border-box;
}

.cm-woo-gutschein-box .cm-woo-gutschein-amount-input-wrap:focus-within {
  border-color: #005761;
  box-shadow: 0 0 0 1px rgba(212, 156, 27, .12), inset 0 0 0 1px rgba(255, 250, 244, .6);
}

.cm-woo-gutschein-box .cm-woo-gutschein-amount-input-wrap::after {
  content: '€';
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  color: #005761;
  pointer-events: none;
}

.cm-woo-gutschein-box .cm-woo-gutschein-input,
.cm-woo-gutschein-box input[name="cm_woo_gutschein_amount"] {
  width: 100%;
  height: 52px;
  padding: 0 28px 0 14px;
  border: 0 !important;
  background: transparent !important;
  color: #005761;
  opacity: 1;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  -webkit-text-fill-color: #005761;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.cm-woo-gutschein-box .cm-woo-gutschein-input:focus,
.cm-woo-gutschein-box input[name="cm_woo_gutschein_amount"]:focus {
  outline: none;
  color: #005761;
  opacity: 1;
  font-weight: 700;
  -webkit-text-fill-color: #005761;
  box-shadow: none !important;
}

.cm-woo-gutschein-box .cm-woo-gutschein-input:not(:placeholder-shown),
.cm-woo-gutschein-box input[name="cm_woo_gutschein_amount"]:not(:placeholder-shown) {
  color: #005761;
  opacity: 1;
  font-weight: 600;
  -webkit-text-fill-color: #005761;
}


.cm-woo-gutschein-box .cm-woo-gutschein-input::placeholder,
.cm-woo-gutschein-box input[name="cm_woo_gutschein_amount"]::placeholder {
  color: #9a847f;
  opacity: 1;
}

.cm-woo-gutschein-box .cm-woo-gutschein-personalization {
  margin: 0 0 18px;
  padding: 16px 16px 2px;
  border: 1px solid #e3dacd;
  background: #f2f2f2;
}

.cm-woo-gutschein-box .cm-woo-gutschein-personalization-head { margin: 0 0 14px; }
.cm-woo-gutschein-box .cm-woo-gutschein-personal-field { margin: 0 0 16px; }

.cm-woo-gutschein-box .cm-woo-gutschein-personal-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 14px 0 16px;
}

.cm-woo-gutschein-box .cm-woo-gutschein-personal-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 12px 18px;
  border: 1px solid #d9d2c2;
  background: #ffffff;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 400;
  color: #333333;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, color .2s ease;
}

.cm-woo-gutschein-box .cm-woo-gutschein-personal-mode-option input[type="radio"] {
  margin: 0 8px 0 0;
  vertical-align: middle;
}

.cm-woo-gutschein-box .cm-woo-gutschein-personal-mode-option input { margin: 0; }
.cm-woo-gutschein-box .cm-woo-gutschein-personal-mode-option.is-active {
  border: 2px solid #005761;
  background: #fff4f2;
  color: #005761;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(212, 156, 27, .16);
}
.cm-woo-gutschein-box .cm-woo-gutschein-personal-input-wrap.is-hidden { display: none; }

.cm-woo-gutschein-box .cm-woo-gutschein-text,
.cm-woo-gutschein-box .cm-woo-gutschein-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d9d2c2 !important;
  background: #ffffff !important;
  color: #333333;
  font-family: Poppins, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  box-sizing: border-box;
  box-shadow: none !important;
}

.cm-woo-gutschein-box .cm-woo-gutschein-text:focus,
.cm-woo-gutschein-box .cm-woo-gutschein-textarea:focus {
  border-color: #005761 !important;
  outline: none;
  box-shadow: 0 0 0 1px rgba(212, 156, 27, .12) !important;
}

.cm-woo-gutschein-box .cm-woo-gutschein-textarea { min-height: 112px; height: 112px; resize: none; }

.cm-woo-gutschein-live-preview { margin: 20px 0 18px; }
.cm-woo-gutschein-live-preview-head { margin: 0 0 10px; font-size: 14px; line-height: 1.4; font-weight: 600; color: #333333; }

.cm-woo-gutschein-print-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 12px 0 8px;
}

.woocommerce a.cm-woo-gutschein-print-trigger.button.alt,
.woocommerce button.cm-woo-gutschein-print-trigger.button.alt,
.cm-woo-gutschein-print-trigger.button,
.cm-woo-gutschein-print-trigger.button.alt,
.cm-woo-gutschein-print-trigger {
  min-height: 44px;
  padding: 10px 18px !important;
  border: 1px solid #005761 !important;
  background: #005761 !important;
  background-color: #005761 !important;
  color: #ffffff !important;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  box-shadow: none !important;
  border-radius: 0px !important;
}

.woocommerce a.cm-woo-gutschein-print-trigger.button.alt:hover,
.woocommerce a.cm-woo-gutschein-print-trigger.button.alt:focus,
.woocommerce button.cm-woo-gutschein-print-trigger.button.alt:hover,
.woocommerce button.cm-woo-gutschein-print-trigger.button.alt:focus,
.cm-woo-gutschein-print-trigger:hover,
.cm-woo-gutschein-print-trigger:focus {
  border-color: #005761 !important;
  background: #00464e !important;
  background-color: #00464e !important;
  color: #ffffff !important;
}

.cm-woo-gutschein-print-tools-note {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  font-size: 13px;
  line-height: 1.6;
  color: #666666;
  margin: 4px 0 25px;
}

.cm-woo-gutschein-live-card {
  --cm-woo-gutschein-font-code: 17px;
  --cm-woo-gutschein-font-for: 14px;
  --cm-woo-gutschein-font-from: 14px;
  --cm-woo-gutschein-font-amount: 24px;
  --cm-woo-gutschein-font-amount-words: 12px;
  --cm-woo-gutschein-font-message: 12px;
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 99;
  max-width: 1100px;
  border: 1px solid #005761;
  border-radius: 0 !important;
  background-color: #ffffff;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% 100%;
  overflow: hidden;
}

/* A5 (04.08.2026): Voransicht war "verzerrt" — feste px-Schriften auf einer
   skalierenden Karte, v. a. der Betrag viel zu klein. Jetzt Container-Query-
   Einheiten: Schrift skaliert mit der Kartenbreite und entspricht den
   Proportionen der ECHTEN Karte (GD-Render bei 1191px: Betrag 45pt bold=60px
   =5.04% · Code 24pt=2.69% · Für/Von/Zahlwort 20pt=2.24% · Botschaft 16pt=1.79%).
   Die px-Werte oben bleiben als Fallback für Browser ohne cq-Support. */
@supports (font-size: 1cqw) {
  .cm-woo-gutschein-live-card {
    --cm-woo-gutschein-font-code: 2.69cqw;
    --cm-woo-gutschein-font-for: 2.24cqw;
    --cm-woo-gutschein-font-from: 2.24cqw;
    --cm-woo-gutschein-font-amount: 5.04cqw;
    --cm-woo-gutschein-font-amount-words: 2.24cqw;
    --cm-woo-gutschein-font-message: 1.79cqw;
  }
}

.cm-woo-gutschein-live-overlay {
  position: absolute;
  z-index: 2;
  display: block;
  color: #000000;
  pointer-events: none;
  white-space: normal;
  box-sizing: border-box;
}

.cm-woo-gutschein-live-overlay.is-hidden { display: none; }

.cm-woo-gutschein-live-overlay-code,
.cm-woo-gutschein-live-overlay-amount,
.cm-woo-gutschein-live-overlay-amount-words,
.cm-woo-gutschein-live-overlay-for,
.cm-woo-gutschein-live-overlay-from {
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
}

.cm-woo-gutschein-live-overlay-code {
  justify-content: center;
}

/* A5 (04.08.2026): Betrag + Zahlwort linksbuendig wie im GD-Render (align 'left'
   der Render-Map) — vorher zentriert, dadurch wanderte der Betrag je nach
   Wertlaenge und kollidierte mit dem gedruckten "Gutscheinwert:"-Label. */
.cm-woo-gutschein-live-overlay-for,
.cm-woo-gutschein-live-overlay-from,
.cm-woo-gutschein-live-overlay-amount,
.cm-woo-gutschein-live-overlay-amount-words {
  justify-content: flex-start;
}

/* Der Betrag ist BEWUSST groesser als seine Positions-Box (wie auf der echten
   Karte, der GD-Render ueberragt die Box genauso) — das overflow:hidden der
   Overlay-Gruppe hat ihm oben die Ziffern abgeschnitten. */
.cm-woo-gutschein-live-overlay-amount {
  overflow: visible;
}

.cm-woo-gutschein-live-overlay-message-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  white-space: nowrap;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  font-size: var(--cm-woo-gutschein-font-from);
  line-height: 1;
  font-weight: 400;
  color: #000000;
}

.cm-woo-gutschein-live-overlay-code {
  font-family: Arial, Helvetica, sans-serif;
  font-size: var(--cm-woo-gutschein-font-code);
  line-height: 1;
  font-weight: 700;
  letter-spacing: .005em;
  color: #ffffff;
}

.cm-woo-gutschein-live-overlay-for,
.cm-woo-gutschein-live-overlay-from {
  font-family: Arial, Helvetica, sans-serif;
  font-size: var(--cm-woo-gutschein-font-for);
  line-height: 1;
  font-weight: 400;
}

.cm-woo-gutschein-live-overlay-from {
  font-size: var(--cm-woo-gutschein-font-from);
  line-height: 1.8;
}

.cm-woo-gutschein-live-overlay-amount {
  font-family: Arial, Helvetica, sans-serif;
  font-size: var(--cm-woo-gutschein-font-amount);
  letter-spacing: .002em;
  line-height: 1;
  font-weight: 700;
}

.cm-woo-gutschein-live-overlay-amount-words {
  font-family: Arial, Helvetica, sans-serif;
  font-size: var(--cm-woo-gutschein-font-amount-words);
  line-height: 1;
  font-weight: 400;
}

.cm-woo-gutschein-live-overlay-message {
  font-family: Arial, Helvetica, sans-serif;
  font-size: var(--cm-woo-gutschein-font-message);
  line-height: 1.2;
  font-weight: 400;
  white-space: pre-wrap;
  overflow: hidden;
  word-break: break-word;
}

.cm-woo-gutschein-live-overlay-code {
  transform: translateY(0%);
}

.cm-woo-gutschein-live-overlay-for {
  transform: translateY(0%);
}

.cm-woo-gutschein-live-overlay-from {
  transform: translateY(0%);
}

.cm-woo-gutschein-live-overlay-amount {
  transform: translateY(0%);
}

.cm-woo-gutschein-live-overlay-amount-words {
  transform: translateY(0%);
}

.cm-woo-gutschein-live-overlay-message {
  transform: translateY(0%);
}

.cm-woo-gutschein-cart-badge { color: #005761; }

@media (max-width: 980px) {
  .cm-woo-gutschein-box .cm-woo-gutschein-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cm-woo-gutschein-box .cm-woo-gutschein-personal-mode-switch { gap: 8px; }
}

@media (max-width: 767px) {
  .cm-woo-gutschein-box .cm-woo-gutschein-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-woo-gutschein-box .cm-woo-gutschein-amount-input-wrap { width: 100%; max-width: none; }

  .cm-woo-gutschein-box .cm-woo-gutschein-input::placeholder,
  .cm-woo-gutschein-box input[name="cm_woo_gutschein_amount"]::placeholder {
    color: #9a847f;
    opacity: 1;
  }

  .cm-woo-gutschein-box .cm-woo-gutschein-personalization { padding: 14px 12px 2px; }
  .cm-woo-gutschein-box .cm-woo-gutschein-personal-mode-option { width: 100%; justify-content: flex-start; }
  .cm-woo-gutschein-live-preview-head { margin-bottom: 8px; }

  /* Mobile Feinjustierung der Texte auf der Karte — seit A5 (04.08.2026) nur noch
     FALLBACK für Browser ohne Container-Queries. Mit cq-Support skalieren die
     cqw-Werte oben stufenlos mit der Kartenbreite; diese festen px würden das
     mit !important zerschlagen (waren die Ursache der "verzerrten" Voransicht). */
  @supports not (font-size: 1cqw) {
    .cm-woo-gutschein-live-overlay-code,
    .cm-woo-gutschein-live-overlay-for,
    .cm-woo-gutschein-live-overlay-from,
    .cm-woo-gutschein-live-overlay-amount {
      font-size: 9px !important;
    }

    .cm-woo-gutschein-live-overlay-amount-words {
      font-size: 5px !important;
    }

    .cm-woo-gutschein-live-overlay-message-line {
      font-size: 8px !important;
    }
  }
}


/* A9 (04.08.2026, Manu: "Vorschaubild im Warenkorb zu klein"): Die Gutschein-
   Karte ist Querformat — bei Divis kleiner Thumbnail-Breite unlesbar. Gilt
   bewusst für alle Cart-Positionen (einheitliches Bild im Warenkorb).
   !important nötig, weil Divi die Breite selbst mit hoher Spezifität setzt. */
.woocommerce-cart table.cart td.product-thumbnail img {
  width: 130px !important;
  max-width: 130px !important;
  height: auto !important;
}
@media (max-width: 767px) {
  .woocommerce-cart table.cart td.product-thumbnail img {
    width: 110px !important;
    max-width: 110px !important;
  }
}

/* A10 (04.08.2026): Erklärblock stufenweise Einlösung unter der Kaufbox */
.cm-woo-gutschein-einloese-info {
  margin: 0 0 25px;
  padding: 14px 16px;
  background: #f4f9f9;
  border: 1px solid #d5e7e7;
  border-radius: 10px;
}
.cm-woo-gutschein-einloese-info__title {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 8px;
  color: #005761;
}
.cm-woo-gutschein-einloese-info__list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: #444444;
}
.cm-woo-gutschein-einloese-info__list li { margin: 0 0 6px; }

/* BM Gutscheine MVP v0.6.5 */
.cm-woo-gutschein-redeem-panel__note--disabled {
  margin-top: 0;
}

.cm-woo-gutschein-redeem-panel__row--disabled {
  justify-content: flex-start;
}

/* Produktvorschau-Lightbox (zeigt das gerenderte GD-Karten-Bild als Muster) */
.cm-woo-gutschein-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.cm-woo-gutschein-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  cursor: pointer;
}
.cm-woo-gutschein-lightbox__content {
  position: relative;
  max-width: 94vw;
  max-height: 92vh;
}
.cm-woo-gutschein-lightbox__img {
  display: block;
  max-width: 94vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .55);
  background: #ffffff;
}
.cm-woo-gutschein-lightbox__spinner {
  color: #ffffff;
  font-family: Poppins, Arial, sans-serif;
  font-size: 15px;
  text-align: center;
  padding: 40px 24px;
}
.cm-woo-gutschein-lightbox__close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #005761;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}
.cm-woo-gutschein-lightbox__close:hover,
.cm-woo-gutschein-lightbox__close:focus {
  background: #00464e;
}
@media (max-width: 767px) {
  .cm-woo-gutschein-lightbox__close { top: -14px; right: -8px; }
}
