/* === BB-Preview Allgemeine Stile === */
.bbp-preview-wrapper {
  max-width: none;
  line-height: 1.6;
  width: 100%;
  box-sizing: border-box;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

/* Eingabeformular für Bootsnamen / Schriftgruppen */
.bbp-font-selection-form {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}
.bbp-font-selection-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}
.bbp-bootname-input {
  /* Gilt auch für Kennzeichen-Input durch Beibehaltung der Klasse */
  font-size: 1.2rem;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
  margin-bottom: 15px;
}

.bbp-fontstyle-button-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.bbp-fontstyle-preview-button {
  background-color: #4a6a8a;
  border: 1px solid #3e5a78;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(17% - 5px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  color: white;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease;
  text-align: center;
}
.bbp-fontstyle-preview-button:hover {
  background-color: #5a7a9a;
  transform: translateY(-1px);
}
.bbp-fontstyle-preview-button img {
  width: auto;
  height: 25px;
  margin-top: 4px;
  object-fit: contain;
}
.bbp-fontstyle-preview-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  color: white;
}
.bbp-fontstyle-preview-button.active {
  background-color: #2f7f9f;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5) inset,
    0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Fehlermeldungen und Hinweise */
.bbp-error-message {
  color: #721c24;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 10px 15px;
  margin-bottom: 15px;
  border-radius: 4px;
}
.bbp-info,
.bbp-info-inline {
  font-size: 0.9em;
  color: #0c5460;
  background-color: #d1ecf1;
  border: 1px solid #bee5eb;
  padding: 10px 15px;
  margin-bottom: 15px;
  border-radius: 4px;
}

/* Container für Hinweistext und Merkliste-Button */
.bbp-table-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  margin-bottom: 10px;
}
.bbp-table-footer-actions .bbp-einheiten-hinweis {
  font-size: 0.8em !important; /* ANGEPASST: Feste Größe mit !important */
  color: #555;
  text-align: left;
  margin: 0;
  margin-right: 8px;
  flex-shrink: 1;
  min-width: 0;
}

/* Styling für den Merkliste-Button (Stern) */
.bbp-merkliste-button {
  background-color: transparent !important;
  border: none !important;
  padding: 5px;
  cursor: pointer;
  line-height: 1;
  color: inherit;
  flex-shrink: 0;
}

.bbp-merkliste-button .dashicons,
.bbp-merkliste-button .dashicons:before {
  color: #f0ad4e !important;
  font-size: 24px;
  vertical-align: middle;
  background-color: transparent !important;
}

.bbp-merkliste-button:hover .dashicons,
.bbp-merkliste-button:hover .dashicons:before,
.bbp-merkliste-button:focus .dashicons,
.bbp-merkliste-button:focus .dashicons:before {
  color: #eea236 !important;
}

/* Vorschau-Item Layout */
.bbp-product-preview-item {
  margin-bottom: 30px;
  padding-bottom: 20px;
}
.bbp-font-display-header {
  background-color: #334e68;
  color: #ffffff;
  padding: 8px 12px;
  margin-bottom: 5px;
  border-radius: 4px 4px 0 0;
}
.bbp-font-info {
  font-size: 1em;
  font-weight: bold;
}
.bbp-preview-image {
  display: block;
  max-width: 100%;
  max-height: 100px;
  margin-bottom: 15px;
  margin-top: 10px;
  background-color: #ffffff !important;
}

/* Größentabelle */
.bbp-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.bbp-custom-table {
  border-collapse: collapse;
  font-size: 0.8em;
  width: 100%;
  min-width: 550px;
}
.bbp-custom-table th,
.bbp-custom-table td {
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
  border: 1px solid #ddd;
}
.bbp-custom-table thead th.bbp-table-header {
  background-color: #e9ecef;
  color: #212529;
  font-weight: bold;
  font-size: 1.1em;
  white-space: normal;
  padding: 10px;
}
.bbp-table-row-header th {
  background-color: #f8f9fa;
  font-weight: bold;
}
.bbp-table-heading {
  background-color: #f8f9fa;
  font-weight: bold;
  text-align: left !important;
  padding-left: 10px !important;
  min-width: 80px;
}
.bbp-white-space-row td {
  height: 8px;
  background-color: transparent;
  border: none;
}

/* Bestellformular pro Vorschau */
.bbp-product-form {
  margin-top: 15px;
  padding: 15px;
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}
.bbp-bestelltext {
  display: block;
  font-weight: bold;
  margin-bottom: 15px;
  font-size: 1.2em;
}
.bbp-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  align-items: end;
  margin-bottom: 10px;
}
.bbp-form-grid div {
  display: flex;
  flex-direction: column;
}
.bbp-form-grid label {
  margin-bottom: 5px;
  font-weight: normal;
  font-size: 0.8em;
}
.bbp-product-form select,
.bbp-product-form input[type="number"].bbp-qty-input /* Geändert: input[type="number"].bbp-qty-input statt .bbp-qty-input */ {
  width: 100%;
  /*    padding: 10px; */
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 0.95rem;
  height: 40px;
}
.bbp-form-grid-bottom {
  margin-top: 15px;
}
.bbp-add-to-cart-action {
  align-self: flex-end;
}
.bbp-product-form .single_add_to_cart_button.bbp-submit-button {
  background-color: #f29f1f;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 0px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  width: 100%;
  height: 40px;
}
.bbp-product-form .single_add_to_cart_button.bbp-submit-button:hover {
  background-color: #be7200;
}
.bbp-rabatttext {
  font-size: 0.8em;
  color: #555;
  margin-top: 10px;
  text-align: right;
}
.bbp-preview-separator {
  border: none;
  height: 1px;
  background-color: #cccccc;
  margin-top: 45px;
  margin-bottom: 0px;
}

/* === Stile für Standard-Produktoptionen (aus functions.php Logik) === */
.bbp-product-custom-option {
  margin-bottom: 20px;
  padding: 10px 0;
}
.bbp-product-custom-option label strong {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  font-size: 1em;
}
.bbp-product-custom-option select,
.bbp-product-custom-option input[type="text"].bbp-custom-text-input {
  width: 100%;
  max-width: 450px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 0.95rem;
  height: 40px;
}
.bbp-product-config-error {
  color: #721c24;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 10px 15px;
  margin-bottom: 15px;
  border-radius: 4px;
}

/* Responsivität */
@media screen and (max-width: 768px) {
  .bbp-bootname-input {
    max-width: 100%;
  }
  .bbp-fontstyle-button-container {
    justify-content: center;
  }
  .bbp-fontstyle-preview-button {
    width: calc(50% - 5px);
  }
  .bbp-custom-table {
    font-size: 0.8em;
    min-width: 100%;
  }
  .bbp-form-grid {
    grid-template-columns: 1fr;
  }
  .bbp-product-form .single_add_to_cart_button.bbp-submit-button {
    padding: 0px 15px;
  }
  .bbp-bestelltext {
    font-size: 0.9em;
  }
  .bbp-rabatttext {
    font-size: 0.7em;
    text-align: left;
  }

  /* Anpassung für .bbp-table-footer-actions auf Mobilgeräten */
  /* Die flex-direction: column wurde entfernt, um sie nebeneinander zu halten */
  /* Die font-size für .bbp-einheiten-hinweis wird jetzt durch die Basisregel mit !important gesteuert */
}

@media screen and (max-width: 599px) {
  .is-layout-constrained > .bbp-preview-wrapper {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .bbp-bestelltext {
    font-size: 0.8em;
  }
  /* Die font-size für .bbp-einheiten-hinweis wird jetzt durch die Basisregel mit !important gesteuert */
  .bbp-table-footer-actions .bbp-einheiten-hinweis {
    font-size: 0.75em !important; /* ANGEPASST: Feste Größe mit !important */
  }
  /* === Stile für Mengen-Buttons === */
  /* === Stile für Mengen-Buttons === */
  /* === Stile für Mengen-Buttons === */
  /* === Stile für Mengen-Buttons === */
}

.bbp-quantity-wrapper {
  display: flex !important; /* Erzwinge Flex-Container */
  flex-direction: row !important; /* Erzwinge horizontale Ausrichtung */
  align-items: center !important; /* Vertikale Zentrierung der Items */
  vertical-align: middle;
  height: 40px;
  box-sizing: border-box; /* Stelle sicher, dass Padding/Border die Höhe nicht beeinflussen */
}

.bbp-quantity-wrapper input[type="number"].bbp-qty-input {
  width: 60px !important;
  min-width: 60px !important; /* Verhindere, dass es kleiner wird */
  text-align: center !important;
  border-left: none !important;
  border-right: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  -moz-appearance: textfield !important;
  height: 100% !important;
  padding: 1px 5px !important; /* Padding angepasst für bessere Textzentrierung */
  box-sizing: border-box !important;
  flex-grow: 0 !important; /* Verhindere, dass das Input-Feld wächst */
  flex-shrink: 0 !important; /* Verhindere, dass das Input-Feld schrumpft */
}
.bbp-quantity-wrapper
  input[type="number"].bbp-qty-input::-webkit-outer-spin-button,
.bbp-quantity-wrapper
  input[type="number"].bbp-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

.bbp-qty-btn {
  background-color: #e0e0e0;
  border: 1px solid #ccc;
  color: #333;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  height: 100% !important;
  width: 35px !important;
  min-width: 35px !important; /* Verhindere, dass es kleiner wird */
  padding: 0 !important;
  text-align: center;
  user-select: none;
  transition: background-color 0.15s ease-in-out;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-grow: 0 !important; /* Verhindere, dass Buttons wachsen */
  flex-shrink: 0 !important; /* Verhindere, dass Buttons schrumpfen */
}
.bbp-qty-btn:hover {
  background-color: #d0d0d0;
}
.bbp-qty-btn:active {
  background-color: #c0c0c0;
}

.bbp-qty-minus {
  border-top-left-radius: 4px !important;
  border-bottom-left-radius: 4px !important;
  border-right: none !important;
}

.bbp-qty-plus {
  border-top-right-radius: 4px !important;
  border-bottom-right-radius: 4px !important;
  border-left: none !important;
}

/* === BB-Preview Grafik-Konfigurator Stile === */

.bbp-grafik-konfigurator-ui-wrapper {
  margin-top: 20px;
  padding: 20px;
  background-color: #f8f9fa; /* Heller Hintergrund, ähnlich zu .bbp-font-selection-form */
  border: 1px solid #dee2e6; /* Etwas hellerer Rand als #e0e0e0 */
  border-radius: 4px;
}

.bbp-grafik-konfigurator-ui-wrapper h4 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 1.3em;
  color: #333;
  border-bottom: 1px solid #ced4da;
  padding-bottom: 10px;
}

.bbp-config-row {
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center; /* Zentriert Elemente auf der Querachse */
}

.bbp-config-row label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  color: #495057;
  flex-basis: 100%; /* Label nimmt volle Breite ein für klare Struktur */
}

/* Höhenwahl spezifisch */
.bbp-grafik-hoehe-wahl .bbp-hoehe-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.bbp-hoehe-btn {
  background-color: #6c757d; /* Sekundärfarbe, ähnlich zu bestehenden Buttons */
  color: white;
  border: 1px solid #5a6268;
  border-radius: 4px;
  padding: 0; /* Padding wird durch width/height gesteuert */
  width: 38px; /* Feste Breite */
  height: 38px; /* Feste Höhe, passend zu Inputs */
  font-size: 1.5rem;
  line-height: 36px; /* Vertikale Zentrierung des Textes */
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
  flex-shrink: 0; /* Verhindert Schrumpfen */
}
.bbp-hoehe-btn:hover {
  background-color: #5a6268;
}
.bbp-hoehe-btn:active {
  background-color: #545b62;
}

.bbp-hoehe-slider {
  flex-grow: 1;
  height: 20px; /* Höhe des Sliders selbst */
  margin: 0 5px; /* Kleiner Abstand */
  accent-color: #4a6a8a; /* Haupt-Akzentfarbe des Plugins */
}
/* Spezifische Stile für Browser-Slider-Daumen (optional, für bessere Optik) */
.bbp-hoehe-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #4a6a8a;
  cursor: pointer;
  border-radius: 50%;
}
.bbp-hoehe-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #4a6a8a;
  cursor: pointer;
  border-radius: 50%;
  border: none;
}

.bbp-hoehe-input {
  width: 70px; /* Breite für das Zahlenfeld */
  padding: 8px 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
  text-align: right;
  height: 38px; /* Gleiche Höhe wie Buttons */
  box-sizing: border-box;
  -moz-appearance: textfield; /* Firefox: Pfeile ausblenden */
}
.bbp-hoehe-input::-webkit-outer-spin-button,
.bbp-hoehe-input::-webkit-inner-spin-button {
  -webkit-appearance: none; /* Chrome, Safari, Edge, Opera: Pfeile ausblenden */
  margin: 0;
}

.bbp-unit {
  margin-left: 5px;
  font-size: 0.9em;
  color: #495057;
}

/* Farbauswahl und andere Selects im Konfigurator */
.bbp-grafik-farbe-wahl select,
.bbp-grafik-konfigurator-ui-wrapper .bbp-product-attribute-select {
  /* Allgemeiner für alle Selects im Konfigurator */
  width: 100%;
  max-width: 350px; /* Begrenzung der Breite für bessere Lesbarkeit */
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 0.95rem;
  height: 40px; /* Standardhöhe für Formularfelder */
  background-color: #fff;
}

/* Optionaler Grafiktext */
.bbp-grafik-text-wahl input[type="text"].bbp-grafik-customtext-input {
  width: 100%;
  max-width: 450px;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 0.95rem;
  height: 40px;
}

/* Spiegelung Checkbox */
.bbp-grafik-spiegelung-wahl {
  gap: 8px; /* Abstand zwischen Checkbox und Label */
}
.bbp-grafik-spiegelung-wahl
  input[type="checkbox"].bbp-grafik-spiegelung-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px; /* Leichte Anpassung für vertikale Ausrichtung mit Label */
  accent-color: #4a6a8a;
}
.bbp-grafik-spiegelung-wahl label {
  font-weight: normal; /* Normales Gewicht für Checkbox-Label */
  margin-bottom: 0; /* Kein unterer Rand, da inline mit Checkbox */
  flex-basis: auto; /* Label nimmt nur benötigten Platz ein */
}

/* Anzeige von Maßen und Preis */
.bbp-grafik-anzeige-werte {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px dashed #ced4da;
  flex-direction: column; /* Untereinander für bessere Lesbarkeit */
  align-items: flex-start;
}
.bbp-grafik-anzeige-werte p {
  margin: 0 0 8px 0;
  font-size: 1em;
  color: #212529;
}
.bbp-grafik-anzeige-werte p span {
  font-weight: bold;
}

.bbp-grafik-final-price {
  font-size: 1.4em;
  font-weight: bold;
  color: #28a745; /* Grüne Farbe für Preis, oder deine Theme-Akzentfarbe */
}
.bbp-grafik-final-price .woocommerce-Price-amount.amount {
  color: inherit !important; /* Stellt sicher, dass die Farbe übernommen wird */
}

/* Responsivität für kleinere Bildschirme */
@media screen and (max-width: 768px) {
  .bbp-grafik-konfigurator-ui-wrapper {
    padding: 15px;
  }
  .bbp-config-row label {
    font-size: 0.95em;
  }
  .bbp-grafik-hoehe-wahl .bbp-hoehe-controls {
    flex-wrap: wrap; /* Erlaube Umbruch bei sehr kleinen Bildschirmen */
  }
  .bbp-hoehe-slider {
    min-width: 150px; /* Mindestbreite für den Slider */
  }
  .bbp-grafik-farbe-wahl select,
  .bbp-grafik-text-wahl input[type="text"].bbp-grafik-customtext-input {
    max-width: 100%; /* Volle Breite auf kleinen Screens */
  }
}

@media screen and (max-width: 480px) {
  .bbp-grafik-hoehe-wahl .bbp-hoehe-controls {
    gap: 8px;
  }
  .bbp-hoehe-btn {
    width: 34px;
    height: 34px;
    font-size: 1.3rem;
    line-height: 32px;
  }
  .bbp-hoehe-input {
    width: 60px;
    height: 34px;
    font-size: 0.9rem;
  }
  .bbp-grafik-final-price {
    font-size: 1.3em;
  }
}

.woocommerce-product-gallery .wp-post-image, /* Gängiger Selektor */
.woocommerce-product-gallery__image > figure > img, /* Für Strukturen wie deine mit figure */
.ct-product-gallery-container .ct-media-container img.wp-post-image /* Spezifischer für deine Struktur */ {
    /* Wichtig: Transition auf die transform-Eigenschaft anwenden,
       damit Änderungen an transform animiert werden. */
    transition: transform 0.3s ease-in-out;
    /* Optional: transform-origin setzen, falls die Spiegelung nicht zentriert wirkt */
    /* transform-origin: center center; */
}

/* Die Klasse fügt nur noch die Transformation hinzu. Die Transition ist schon auf dem Element. */
img.bbp-image-mirrored {
    transform: scaleX(-1);
}

/* Stile für Initialisierungs- und Fehlerzustände des JS-Konfigurators */
.bbp-grafik-initializing .bbp-grafik-final-price::before,
.bbp-grafik-error .bbp-grafik-final-price::before {
  content: "Preis wird geladen...";
  font-style: italic;
  font-size: 0.8em;
  color: #6c757d;
}
.bbp-grafik-error .bbp-grafik-final-price::before {
  content: "Preis konnte nicht geladen werden.";
  color: #dc3545;
}
