/* Mahlwerk - Produktseite mobil (08.09.2026). Wird nur auf Produktseiten nach mobile.css geladen.
   Zweck: Preis und Titel vor der Galerie, kompaktere Galerie, feste Kaufleiste, kompakteres Cookie-Banner.
   Nur <= 782 px; Desktop bleibt unveraendert. Erklaerung in inc/pdp-mobile.php. */

/* -- Angebotsdarstellung im Preisblock (alle Breiten; Markup aus inc/performance.php, 08.09.2026):
      "Angebotspreis" klein in Kupfer, grosser Preis, dezente Rabatt-Pille, darunter "Statt <alter Preis>" und der
      Pflichthinweis zum niedrigsten Preis der letzten 30 Tage. Ruhig, kein Rot, kein Badge-Geschrei. -- */
.single-product .bw-sp-price-wrap { row-gap: 5px !important; column-gap: 12px !important; }
.single-product .bw-sp-price-wrap .bw-price-tag {
  flex: 0 0 100%; font-family: var(--bw-font-sans, "DM Sans", sans-serif); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: #c8956c; line-height: 1;
}
.single-product .bw-sp-price-wrap .bw-price-save {
  display: inline-flex; align-items: center; align-self: center; padding: 4px 9px 3px;
  border: 1px solid rgba(200, 149, 108, .55); border-radius: 999px; color: #c8956c;
  font-family: var(--bw-font-sans, "DM Sans", sans-serif); font-size: 12px; font-weight: 700; letter-spacing: .04em; line-height: 1;
}
.single-product .bw-sp-price-wrap .bw-price-old {
  flex: 0 0 100%; font-family: var(--bw-font-sans, "DM Sans", sans-serif); font-size: .92rem; font-weight: 400;
  color: rgba(255, 255, 255, .6); line-height: 1.3; margin-top: 2px;
}
.single-product .bw-sp-price-wrap .bw-price-old del {
  color: rgba(255, 255, 255, .78); text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: rgba(255, 255, 255, .5);
}
.single-product .bw-sp-price-wrap .bw-price-note {
  flex: 0 0 100%; font-family: var(--bw-font-sans, "DM Sans", sans-serif); font-size: 11px; line-height: 1.35;
  color: rgba(255, 255, 255, .4); margin-top: -3px;
}
@media (max-width: 782px) {
  .single-product .bw-sp-price-wrap .bw-price-tag { font-size: 10.5px; }
  .single-product .bw-sp-price-wrap .bw-price-old { font-size: .88rem; }
}

@media (max-width: 782px) {

  /* -- Reihenfolge: Marke, Titel, Bewertung, Preis, MwSt-Hinweis, DANN Galerie, dann Kurztext, Kaufform, Zusicherungen -- */
  body.single-product .bw-sp-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }
  body.single-product .bw-sp-details {
    display: contents !important;
  }
  body.single-product .bw-sp-details > * { order: 20; }
  body.single-product .bw-sp-details > .bw-sp-category { order: 1 !important; margin: 6px 0 2px !important; }
  body.single-product .bw-sp-details > .bw-sp-title { order: 2 !important; margin: 0 0 6px !important; font-size: 1.32rem !important; line-height: 1.25 !important; }
  body.single-product .bw-sp-details > .bw-sp-rating { order: 3 !important; margin: 0 0 8px !important; }
  body.single-product .bw-sp-details > .bw-sp-price-wrap { order: 4 !important; margin: 0 !important; }
  body.single-product .bw-sp-details > .bw-sp-vat-note { order: 5 !important; margin: 2px 0 0 !important; }
  body.single-product .bw-sp-grid > .bw-sp-gallery { order: 6 !important; margin: 12px 0 16px !important; }
  body.single-product .bw-sp-details > .bw-sp-short-desc { order: 7 !important; margin: 0 0 12px !important; }
  body.single-product .bw-sp-details > .bw-sp-cart-form { order: 8 !important; }
  body.single-product .bw-sp-details > .bw-sp-assure { order: 9 !important; }
  body.single-product .bw-sp-details > .product_meta { order: 10 !important; }

  /* -- Galerie kompakter: Bildbuehne max. 62vw, Hoehe gepinnt gegen Layoutspruenge vor dem Slider-Start -- */
  body.single-product .bw-sp-gallery {
    aspect-ratio: auto !important;
    height: calc(62vw + 122px) !important;
    max-height: calc(62vw + 122px) !important;
    overflow: hidden !important;
  }
  body.single-product .bw-sp-gallery .woocommerce-product-gallery__image img {
    width: 100% !important;
    height: auto !important;
    max-height: 62vw !important;
    object-fit: contain !important;
    padding: 8px !important;
  }
  body.single-product .bw-sp-gallery .woocommerce-product-gallery__image {
    max-height: 62vw !important;
  }
  body.single-product .bw-sp-gallery .flex-control-thumbs {
    padding: 0 12px 10px !important;
  }
  /* 22.10.2026 produkt-02: Produkte mit nur einem Bild haben keine Thumbnail-Leiste – die 122 px dafür
     standen als leere Fläche unter dem Bild. 43 px = Kartenpolster oben/unten + Rahmen (Klasse aus inc/pdp-mobile.php). */
  body.single-product.bw-pdp-one-image .bw-sp-gallery {
    height: calc(62vw + 43px) !important;
    max-height: calc(62vw + 43px) !important;
  }

  /* -- Feste Kaufleiste (wird per Skript eingehaengt, sobald der Kaufknopf aus dem Bild gescrollt ist) -- */
  .bw-buybar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9990;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(15, 15, 18, 0.96);
    border-top: 1px solid rgba(200, 149, 108, 0.4);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transform: translateY(110%);
    transition: transform .25s ease;
  }
  .bw-buybar.is-on { display: flex; transform: none; }
  .bw-buybar__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
  .bw-buybar__price { font-weight: 700; font-size: 18px; color: #f4f4f5; white-space: nowrap; }
  .bw-buybar__uvp { font-size: 11px; color: rgba(244, 244, 245, 0.55); white-space: nowrap; }
  .bw-buybar__uvp del { text-decoration: line-through; text-decoration-color: rgba(244, 244, 245, 0.45); }
  .bw-buybar__uvp:empty { display: none; }
  .bw-buybar__btn {
    flex: 1 1 auto;
    min-height: 46px;
    display: flex; align-items: center; justify-content: center;
    background: #c8956c; color: #1a1410;
    font-family: "DM Sans", system-ui, sans-serif;
    font-weight: 700; font-size: 14px; letter-spacing: .02em;
    border: 0; border-radius: 10px; padding: 0 14px;
    cursor: pointer;
  }
  .bw-buybar__btn:active { background: #bc885e; }
  body.single-product.bw-has-buybar { padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important; }
  /* 22.10.2026 produkt-07: Nach-oben-Knopf steckte halb hinter der Kaufleiste (66 px) – solange sie steht, darüber */
  html body.single-product.bw-has-buybar:not(#a):not(#b) .bw-back-to-top { bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }

  /* -- Cookie-Banner: noch kompakter (Vorstufe in mobile.css, Block BW-P19) -- */
  html body #cmplz-cookiebanner-container .cmplz-cookiebanner.banner-1 {
    padding: 12px 14px calc(11px + env(safe-area-inset-bottom, 0px)) !important;
  }
  html body #cmplz-cookiebanner-container .cmplz-cookiebanner.banner-1 .cmplz-message {
    font-size: 12px !important; line-height: 1.35 !important; margin: 0 0 9px !important;
  }
  html body #cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-message .bw-cmplz-lead {
    font-size: 13px !important; margin: 0 0 3px !important;
  }
  html body #cmplz-cookiebanner-container .cmplz-cookiebanner.banner-1 .cmplz-buttons .cmplz-accept,
  html body #cmplz-cookiebanner-container .cmplz-cookiebanner.banner-1 .cmplz-buttons .cmplz-deny {
    min-height: 42px !important;
  }
  html body #cmplz-cookiebanner-container .cmplz-cookiebanner.banner-1 .cmplz-buttons .cmplz-view-preferences {
    min-height: 28px !important;
  }
  html body #cmplz-cookiebanner-container .cmplz-cookiebanner.banner-1 .cmplz-documents {
    margin: 6px 0 0 !important;
  }
}
