/* ============================================================
   bimoki Mobile Fixes — Audit-Round 1 (2026-05-18)
   Wird in functions.php nach cups-style enqueued.
   ============================================================ */

/* ------------------------------------------------------------
   1) Announcement-Bar: echter CSS-Marquee statt abgeschnittenem
      Flex-Center auf Mobile.
   ------------------------------------------------------------ */
@media screen and (max-width: 600px) {
  .announcement-bar {
    padding: 7px 0;
    /* margin: 0 -16px aus style.css beibehalten -> bar geht voll bis Viewport-Rand */
    overflow: hidden;
  }
  .announcement-bar__track {
    justify-content: flex-start;
    white-space: nowrap;
    width: max-content;
    padding-left: 100%;
    animation: bimoki-announcement-scroll 18s linear infinite;
    will-change: transform;
  }
  .announcement-bar:hover .announcement-bar__track,
  .announcement-bar:focus-within .announcement-bar__track {
    animation-play-state: paused;
  }
  @keyframes bimoki-announcement-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
  }
}

/* User-Preference: reduced motion -> kein Scroll, sondern Wrap */
@media screen and (max-width: 600px) and (prefers-reduced-motion: reduce) {
  .announcement-bar__track {
    animation: none;
    padding-left: 0;
    width: auto;
    flex-wrap: wrap;
    white-space: normal;
    justify-content: center;
    gap: 4px 10px;
    line-height: 1.3;
  }
}

/* ------------------------------------------------------------
   2) Trust-Bar (Startseite, 4 Trust-Items)
   Bug: Zweite `.cups-trust-bar`-Definition (Zeile 5754, Footer-Variante
   mit `__item`) überschreibt die Grid-Definition (Zeile 2591) per
   Cascade, daher horizontaler Flex auf Mobile -> Items rauschen rechts/links raus.
   Fix: Spezifischer Selektor via :has(.cups-trust-item) stellt Grid wieder her.
   ------------------------------------------------------------ */
.cups-trust-bar:has(.cups-trust-item) {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  margin: 0 -16px 80px;
  padding: 0;
  justify-content: stretch;
}
@media screen and (max-width: 768px) {
  .cups-trust-bar:has(.cups-trust-item) {
    grid-template-columns: repeat(2, 1fr);
    margin: 0 -16px 60px;
  }
  .cups-trust-bar:has(.cups-trust-item) .cups-trust-item:nth-child(2) {
    border-right: none;
  }
  .cups-trust-bar:has(.cups-trust-item) .cups-trust-item:nth-child(1),
  .cups-trust-bar:has(.cups-trust-item) .cups-trust-item:nth-child(2) {
    border-bottom: 1px solid #e5e5e5;
  }
}

/* ------------------------------------------------------------
   3) Home-Tiles ("Unsere Kollektionen"): Tiles werden 280px breit obwohl
   Grid-Slot nur 174.5px (Aspect-Ratio + Auto-Width-Bug). Hart capen.
   ------------------------------------------------------------ */
@media screen and (max-width: 600px) {
  .home-tiles__grid {
    overflow: hidden;
  }
  .home-tile {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  /* Mugs ueberlappten Tile-Titel — Container hochsetzen, Mugs verkleinern, Animation aus */
  .home-tile__products {
    bottom: 48%;
    padding: 14px;
  }
  .home-tile__product {
    width: 34%;
    max-width: 80px;
    animation: none !important;
  }
  /* Title-Bereich groesser fuer 2-zeilige Namen */
  .home-tile__overlay {
    padding: 14px 12px;
    background: linear-gradient(180deg, transparent 30%, rgba(26,53,72,0.85) 65%) !important;
  }
  .home-tile--dark .home-tile__overlay {
    background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.80) 65%) !important;
  }
}

/* ------------------------------------------------------------
   4b) Produkt-FAQ + Hub-FAQ konsistent zur FAQ-Page stylen
   Bug: .cups-product-faq nutzt Native ▶ Marker, FAQ-Page nutzt
   schoenes "+" mit Rotation. Style angleichen.
   ------------------------------------------------------------ */
.cups-product-faq details,
.cups-hub-faq details,
.pillar-faq details {
  border: 1px solid #f0ece6;
  border-radius: 10px;
  background: #faf7f4;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.cups-product-faq details:hover,
.cups-hub-faq details:hover,
.pillar-faq details:hover {
  border-color: #e5dfd6;
}
.cups-product-faq details[open],
.cups-hub-faq details[open],
.pillar-faq details[open] {
  border-color: #E05D84;
  background: #fff;
}
.cups-product-faq summary,
.cups-hub-faq summary,
.pillar-faq summary {
  list-style: none !important;
  cursor: pointer;
  padding: 16px 52px 16px 20px;
  position: relative;
  user-select: none;
  transition: background 0.15s ease;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #1A3548;
}
.cups-product-faq summary:hover,
.cups-hub-faq summary:hover,
.pillar-faq summary:hover {
  background: rgba(224,93,132,0.04);
}
.cups-product-faq summary::-webkit-details-marker,
.cups-hub-faq summary::-webkit-details-marker,
.pillar-faq summary::-webkit-details-marker {
  display: none;
}
.cups-product-faq summary::marker,
.cups-hub-faq summary::marker,
.pillar-faq summary::marker {
  display: none;
  content: "";
}
.cups-product-faq summary::after,
.cups-hub-faq summary::after,
.pillar-faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  font-weight: 300;
  color: #c8a96a;
  transition: transform 0.25s ease, color 0.25s ease;
  line-height: 1;
}
.cups-product-faq details[open] summary::after,
.cups-hub-faq details[open] summary::after,
.pillar-faq details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
  color: #E05D84;
}
.cups-product-faq details > div,
.cups-product-faq details > p,
.cups-hub-faq details > div,
.cups-hub-faq details > p,
.pillar-faq details > div,
.pillar-faq details > p {
  padding: 0 20px 16px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #444;
}
/* h3 inside summary darf keine eigenen Margins haben (sonst doppelte Box-Hoehe) */
.cups-product-faq summary h3,
.cups-hub-faq summary h3,
.pillar-faq summary h3 {
  display: inline;
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}

/* ------------------------------------------------------------
   10) Wunschliste: doppelte Heading ("Wunschliste" + "Meine Wunschliste")
   Die H1 vom Theme zeigt "Wunschliste", YITH-Plugin haengt nochmal eine
   H2 "Meine Wunschliste" daneben dran. Plugin-H2 verstecken.
   ------------------------------------------------------------ */
.wishlist-title h2 {
  display: none;
}

/* ------------------------------------------------------------
   9) Cart-Page: einsamer Doppelpunkt + verlassener X-Remove-Button
   Bug: `.product-thumbnail` hat kein data-title aber ::before
   rendert ": " standalone -> seltsamer Doppelpunkt im Layout.
   Bug 2: .product-remove TD nimmt eigene Zeile ueber volle Breite.
   ------------------------------------------------------------ */
@media screen and (max-width: 768px) {
  .shop_table_responsive tr.cart_item td.product-thumbnail::before,
  .shop_table_responsive tr.cart_item td.product-remove::before {
    display: none !important;
  }
  .shop_table_responsive tr.cart_item td.product-remove {
    text-align: right;
    padding: 8px 12px 0 !important;
  }
  .shop_table_responsive tr.cart_item td.product-remove a.remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.04);
    font-size: 18px;
    line-height: 1;
    color: #666;
    text-decoration: none;
    margin: 0;
  }
  .shop_table_responsive tr.cart_item td.product-remove a.remove:hover {
    background: rgba(224,93,132,0.1);
    color: #E05D84;
  }
  .shop_table_responsive tr.cart_item td.product-thumbnail {
    text-align: center;
    padding: 0 12px 8px !important;
  }
  .shop_table_responsive tr.cart_item td.product-thumbnail img {
    width: 96px !important;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
  }
}

/* ------------------------------------------------------------
   4) WC Produkt-Tabs (Beschreibung / Infos / Versand & Material):
   Tab-Texte werden rechts abgeschnitten weil 3 Tabs ca. 444px breit
   sind, viewport aber 361px Content. Fix: horizontal scrollbar
   und non-shrinking items mit gleichmaessigem Whitespace.
   ------------------------------------------------------------ */
@media screen and (max-width: 600px) {
  .woocommerce-tabs ul.tabs,
  .woocommerce-tabs .tabs,
  .wc-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    margin: 0 -16px 0;
    padding: 0 16px;
    border-bottom: 1px solid #e5e5e5;
  }
  .woocommerce-tabs ul.tabs li,
  .woocommerce-tabs .tabs li,
  .wc-tabs li {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 12px 16px;
  }
  .woocommerce-tabs ul.tabs li a,
  .wc-tabs li a {
    white-space: nowrap;
  }
}
