/*
 Theme Name: TVW Child
 Theme URI: https://textilveredelung-wunstorf.de/
 Description: Child-Theme für Divi (TVW)
 Author: Oinkelman
 Author URI: https://textilveredelung-wunstorf.de/
 Template: Divi
 Version: 1.0.0
 Text Domain: tvw-child
*/

/* TEST: Sichtbarer Beweis, dass Child-CSS aktiv ist */
html:after {
  content: "TVW Child CSS aktiv";
  position: fixed;
  right: 15px;
  bottom: 15px;
  padding: 6px 10px;
  background: #177245;
  color: #fff;
  font: 13px/1.2 monospace;
  z-index: 999999;
  border-radius: 4px;
}

/* ==========================================================
   TVW – KLEINKRAM
   ========================================================== */

.product p.wc-gzd-additional-info {
  text-align: center;
  font-size: .9em;
  margin-bottom: .5rem;
  color: #9a8d84;
}

/* Grid Button */
.woocommerce ul.products li.product .variable-product-button {
    margin-top: 0px !important;
}

.woocommerce ul.products li.product a.button.product_type_variable {
	background-color: #2C3D4C !important;
	color: #ffffff !important;
	padding: 12px 24px !important;
	border-radius: 4px !important;
	text-decoration: none !important;
	display: inline-block !important;
	font-weight: 400 !important;
	border: none !important;
	width: 100% !important;
	font-size: 15px !important;
	font-family: Lato;
	text-align: center !important;
}

.woocommerce ul.products li.product a.button.product_type_variable:hover {
    background-color: #9A8D84 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/*.woocommerce .products .product a.button.product_type_variable::after,
.woocommerce .products .product a.button.product_type_variable::before {
    display: none !important;
    content: none !important;
}*/

/* Spezifische Buttons */
a.button.product_type_variable::after {
    content: "\f553" !important;  /* Kleid-Icon */
    font-family: 'Font Awesome 5 Free' !important;
    font-weight: 900 !important;
    margin-left: 10px !important;
    display: inline-block !important;
    font-size: 14px !important;
}

/* 5er Grid */
.woocommerce ul.products li.product {
    width: 19% !important;
    margin-right: 1% !important;
    margin-bottom: 20px !important;
    float: left !important;
}

/* Jede 5te Kachel ohne right margin */
.woocommerce ul.products li.product:nth-child(5n) {
    margin-right: 0 !important;
}

/* Clearfix */
.woocommerce ul.products::after {
    content: "";
    display: table;
    clear: both;
}

/* Desktop: 5 Spalten */
.woocommerce ul.products li.product {
    width: 19% !important;
    margin-right: 1% !important;
    margin-bottom: 20px !important;
    float: left !important;
}

.woocommerce ul.products li.product:nth-child(5n) {
    margin-right: 0 !important;
}

/* Tablet: 4 Spalten */
@media (max-width: 1200px) {
    .woocommerce ul.products li.product {
        width: 24% !important;
        margin-right: 1.333% !important;
    }
    .woocommerce ul.products li.product:nth-child(5n) {
        margin-right: 1.333% !important;
    }
    .woocommerce ul.products li.product:nth-child(4n) {
        margin-right: 0 !important;
    }
}

/* Tablet: 3 Spalten */
@media (max-width: 992px) {
    .woocommerce ul.products li.product {
        width: 32% !important;
        margin-right: 2% !important;
    }
    .woocommerce ul.products li.product:nth-child(4n) {
        margin-right: 2% !important;
    }
    .woocommerce ul.products li.product:nth-child(3n) {
        margin-right: 0 !important;
    }
}

/* Mobile: 2 Spalten */
@media (max-width: 768px) {
    .woocommerce ul.products li.product {
        width: 49% !important;
        margin-right: 2% !important;
    }
    .woocommerce ul.products li.product:nth-child(3n) {
        margin-right: 2% !important;
    }
    .woocommerce ul.products li.product:nth-child(2n) {
        margin-right: 0 !important;
    }
}

/* Mobile: 1 Spalte */
@media (max-width: 480px) {
    .woocommerce ul.products li.product {
        width: 100% !important;
        margin-right: 0 !important;
    }
}

/* Clearfix */
.woocommerce ul.products::after {
    content: "";
    display: table;
    clear: both;
}

/* TVW: nervige Mini-Dreiecke auf Farb- und Größen-Swatches ausblenden */
.variations_form .variable-items-wrapper .variable-item::before,
.variations_form .variable-items-wrapper .variable-item::after,
.variations_form .woo-variation-items-wrapper .variable-item::before,
.variations_form .woo-variation-items-wrapper .variable-item::after,
.variations_form .swatch::before,
.variations_form .swatch::after,
.variations_form .wvs-attr-item::before,
.variations_form .wvs-attr-item::after,
.variations_form .wvs-arrow {
  content: none !important;
  display: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Produktkacheln im Shop: Hochkant-Darstellung mit gleichmäßigem Layout */
.woocommerce ul.products li.product a img {
  width: 100%;
  height: auto;
  aspect-ratio: auto; /* kein Zwangs-Quadrat */
  object-fit: contain; /* zeigt das gesamte Model */
  background: #fff;
  border-radius: 6px;
}

/* gleiche Kartenhöhe, sauberes Grid */
.woocommerce ul.products li.product {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 540px; /* optional anpassen: 500–600 für deine Models */
}

/* Bildcontainer: begrenzen, ohne zu beschneiden */
.woocommerce ul.products li.product a img {
  max-height: 480px; /* etwas kleiner als min-height */
}

/* optionale visuelle Feinanpassung */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  min-height: 3em;
}

/* --- Hochkant-Bilddarstellung (non-destructive) --- */
.woocommerce ul.products li.product a img {
  object-fit: contain !important; /* zeigt komplettes Model */
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 3 / 4;            /* 3:4 = klassisch hochkant */
  background: #fff;
  border-radius: 6px;
}

/* Bild komplett zeigen, ohne Crop – Container bleibt wie zuvor */
.woocommerce ul.products li.product a img {
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  background: transparent !important;
  border-radius: 6px;
}

.et_pb_shop_0.et_pb_shop {
  background-color: transparent !important;
}


/* Shop/Archiv: Bilder nicht beschneiden, natürliches Seitenverhältnis */
.woocommerce ul.products li.product a img {
  width: 100%;       /* füllt die Kachelbreite */
  height: auto;      /* Höhe aus Ratio, nicht fix */
  object-fit: contain;  /* sicherheitshalber: nicht croppen */
  aspect-ratio: auto;   /* falls Theme was erzwingt, zurücksetzen */
}

/* Falls ein Theme/Plugin quadratische Container erzwingt: auf Auto drehen */
.woocommerce ul.products li.product .woo-entry-image,
.woocommerce ul.products li.product .et_shop_image,
.woocommerce ul.products li.product div.product-thumbnail,
.woocommerce ul.products li.product .product__image,
.woocommerce ul.products li.product .woocommerce-LoopProduct-link .attachment-woocommerce_thumbnail {
  aspect-ratio: auto !important;
}

/*----------------------- GALERIE GEFRICKEL ------------------------------------*/

/* ==========================================================
   TVW – WooCommerce Galerie-Optimierung (Hero + Thumbnails)
   ========================================================== */

/* === Kompaktere Thumbnails unter dem Hero-Bild === */
.woocommerce div.product div.images .flex-control-thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  max-width: 640px;
  margin: 0 auto;
}
.woocommerce div.product div.images .flex-control-thumbs li {
  width: 60px;
  margin: 2px;
}
.woocommerce div.product div.images .flex-control-thumbs li img {
	width: 100%;
	height: auto;
	border-radius: 6px;
	transition: transform 0.2s ease-in-out;
	border: 1px solid #CCC;
}
.woocommerce div.product div.images .flex-control-thumbs li img:hover {
  transform: scale(1.05);
}

/* === Basis-Fix für Pfeil-Positionierung === */
.woocommerce div.product div.images {
  position: relative;
  overflow: visible;
}
.woocommerce div.product div.images .woocommerce-product-gallery__image {
  position: relative;
  z-index: 1;
}

/* === Hero-Navigation – edle, eckig-runde Pfeile === */
.tvw-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 300;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease-in-out;
  backdrop-filter: blur(3px);
}
.tvw-arrow:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #2C3D4C;
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-50%) scale(1.08);
}
.tvw-arrow-left {
  left: 12px;
}
.tvw-arrow-right {
  right: 12px;
}

/* === Responsive – kleinere Pfeile auf Mobilgeräten === */
@media (max-width: 768px) {
  .tvw-arrow {
    width: 34px;
    height: 34px;
    font-size: 1.4rem;
  }
  .tvw-arrow-left { left: 6px; }
  .tvw-arrow-right { right: 6px; }
}

/* === TVW Emergency Overlay-Fix === */
.woocommerce div.product div.images,
.woocommerce div.product div.images .woocommerce-product-gallery__image,
.pswp,
.pswp__bg {
  z-index: auto !important;
  pointer-events: auto !important;
  position: relative !important;
}

/* TVW ReadMore – robust, ohne -webkit-line-clamp-Zwang */
.tvw-readmore{
  --lines: 3;                    /* Default-Zeilen; per data-lines/--lines änderbar */
  position: relative;
}

.tvw-readmore .tvw-readmore-inner{
  overflow: hidden;
  transition: max-height .25s ease;
}

/* dezenter Fade, solange gekürzt */
.tvw-readmore:not(.is-expanded) .tvw-readmore-fade{
  content: "";
  position: absolute;
  pointer-events: none;
  left: 0; right: 0; bottom: 0;
  height: 2.6em;                 /* ~Höhe der letzten Zeilenregion */
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,.9));
}

.tvw-readmore-toggle{
  display: inline-block;
  margin-top: 8px;
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  background: none;
  border: none;
  color: #2c3d4c;
  text-decoration: underline;
  padding: 4px 0;
}

