/*
 * product-embed.css — Styles fuer den fairlis/category-products-Block im Blog-Beitrag.
 *
 * NUR auf is_singular('post'|'page') mit dem Block geladen (functions.php, has_block).
 * Bewusst NICHT shop.css (5220 Zeilen, Design-Trennung Blog<->Marktplatz + Perf).
 *
 * Alle Regeln sind unter `.fairlis-product-embed` gescopet -> kein Leak in den Blog,
 * kein Leak aus dem Blog in die Karten (ausser vererbte globale CSS-Variablen aus
 * main.css). Die Karussell-/Card-Regeln sind aus shop.css dupliziert (Selektoren
 * .market-home-popular*, .product-card*) — bei Aenderung an shop.css HIER mitpflegen.
 * Vollstaendigkeit wird per visueller Paritaet (Embed vs. Homepage-Karussell)
 * verifiziert, nicht per Zeilen-Abgleich.
 */

/* Vertikaler Rhythmus im Artikel (ersetzt .market-home-section margin-top,
   das hier nicht geladen wird). */
.fairlis-product-embed {
  margin-block: clamp(48px, 6vw, 72px);
  box-sizing: border-box;
  padding: clamp(20px, 4vw, 32px);
  background: var(--c-sand);
  border-radius: var(--radius);
}

/* Breakout aus der schmalen Artikel-Textspalte auf die Medien-/Hero-Breite —
   NUR auf Desktop (>980px). Begründung der Breakpoint-Wahl:
   - >980px: .entry-content ist links-bündig (margin:0, base rule single.css:157) und
     teilt die LINKE Kante mit .single-body__inner (max 1092px) → reines Anheben der
     Breite genügt, kein Zentrier-Hack. Das Karussell zeigt hier 4,2 Karten → in der
     648px-Textspalte wären die Bilder ~halb so groß wie auf der Startseite.
     min(1092px, 100vw-40px) reproduziert die responsive Breite von .single-body__inner
     (40px = 20px-Container-Gutter je Seite). Bilder dann ~249px (Startseite: 284px),
     rechte Kante = Hero-Bild-Kante, kein Überstand über den Artikel.
   - ≤980px: .entry-content ist zentriert (margin:0 auto, single.css:894) UND das
     Karussell zeigt nur 2,2/1,7 Karten → Bilder ohnehin groß. Kein Breakout (würde
     wegen der dann zentrierten Textspalte rechts überlaufen). Identischer Breakpoint
     wie der Karussell-Item-Width-Switch (980px) → konsistent. */
@media (min-width: 981px) {
  .fairlis-product-embed {
    width: min(1092px, calc(100vw - 40px));
    max-width: none;
  }
}

/* ---------- Carousel: Header + Nav-Buttons ---------- */
.fairlis-product-embed .market-home-popular__header {
  display: flex;
  align-items: center;
  /* Mit Ueberschrift: H2 links, Prev/Next-Nav rechts (wie Homepage-Sektion). */
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(20px, 2.5vh, 28px);
}

/* Kicker-Label ueber der Ueberschrift — macht das Produkt-Modul erkennbar.
   Doppel-Klassen-Selektor schlaegt .entry-content p { margin:0 0 24px } (Blog-Leak,
   da der Kicker ein <p> im .entry-content ist). */
.fairlis-product-embed .fairlis-product-embed__kicker {
  margin: 0 0 6px;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-muted);
}

/* Ueberschrift = Anzeige-Kategoriename (display_name), wie der H1 der Kategorieseiten.
   Playfair wie die Homepage-Sektion, etwas kleiner fuer den In-Artikel-Kontext.
   margin:0 weil die H2 im Flex-Header sitzt (kein Bottom-Margin noetig). */
.fairlis-product-embed .market-home-section__title {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(22px, 1.2rem + 1vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  padding: 0; /* .entry-content h2 { padding-top: 12px } neutralisieren (Blog-Leak) */
  color: var(--c-text);
}

/* Blog-Dekor-Dash (.entry-content h2::before, 32x1px) im Embed unterdruecken. */
.fairlis-product-embed .market-home-section__title::before {
  content: none;
}

.fairlis-product-embed .market-home-popular__nav {
  display: flex;
  gap: 8px;
}

.fairlis-product-embed .market-home-popular__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--c-sand);
  background: transparent;
  cursor: pointer;
  color: var(--c-text);
  transition: background 0.15s, border-color 0.15s;
}

.fairlis-product-embed .market-home-popular__btn:hover:not(:disabled) {
  background: var(--c-sand);
  border-color: var(--c-text);
}

.fairlis-product-embed .market-home-popular__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.fairlis-product-embed .market-home-popular__btn:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: 2px;
}

/* ---------- Carousel: Track + Items ---------- */
.fairlis-product-embed .market-home-popular__track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  list-style: none;
  margin: 0;
  padding: 0;
}

.fairlis-product-embed .market-home-popular__track::-webkit-scrollbar {
  display: none;
}

.fairlis-product-embed .market-home-popular__item {
  flex: 0 0 calc((100% - 3 * 16px) / 4.2);
  min-width: 0;
  scroll-snap-align: start;
}

/* Visually-hidden Live-Region-Status (clip-path-Variante laut a11y-rules). */
.fairlis-product-embed .market-home-popular__sr-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- "Alle ansehen"-Link (neue Regel, nicht in shop.css) ---------- */
.fairlis-product-embed .market-home-popular__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px; /* Touch-Target */
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--c-text);
  text-decoration: none;
}

.fairlis-product-embed .market-home-popular__more:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.fairlis-product-embed .market-home-popular__more:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: 2px;
}

.fairlis-product-embed .market-home-popular__more-arrow {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.fairlis-product-embed .market-home-popular__more:hover .market-home-popular__more-arrow,
.fairlis-product-embed .market-home-popular__more:focus-visible .market-home-popular__more-arrow {
  transform: translate(2px, -2px);
}

/* ---------- Product Card: Layout / Typo / Media ---------- */
.fairlis-product-embed .product-card {
  position: relative; /* PFLICHT — sonst bricht das absolute Sale-Badge aus */
  text-align: left;
}

.fairlis-product-embed .product-card__media {
  display: block;
  overflow: hidden;
  background: #f5f5f5;
  border: 1px solid var(--border-softer);
  border-radius: 8px;
  aspect-ratio: 4 / 5;
}

.fairlis-product-embed .product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  color: transparent;
}

.fairlis-product-embed .product-card__placeholder {
  width: 100%;
  height: 100%;
  background: var(--c-paper);
}

.fairlis-product-embed .product-card__media img.product-card__variant-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fairlis-product-embed .product-card__merchant {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--c-text);
}

.fairlis-product-embed .product-card__merchant a {
  text-decoration: none;
  color: inherit;
}

.fairlis-product-embed .product-card__merchant a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.fairlis-product-embed .product-card__title {
  margin: 4px 0 0;
  font-family: inherit;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.35;
  font-size: 14px;
  color: var(--c-muted);
}

.fairlis-product-embed .product-card__title a {
  text-decoration: none;
  color: inherit;
}

.fairlis-product-embed .product-card__title a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.fairlis-product-embed .product-card__price {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.fairlis-product-embed .product-card__price del {
  color: var(--c-muted);
  font-weight: 400;
  font-size: 12px;
}

.fairlis-product-embed .product-card__price ins {
  text-decoration: none;
}

/* PAngV-Sternchen am Preis. */
.fairlis-product-embed .price-asterisk {
  font-size: 0.85em;
  vertical-align: super;
  margin-left: 2px;
  font-weight: 400;
  color: var(--c-muted);
  line-height: 1;
}

/* ---------- Product Card: Sale-Badge + Sustainability ---------- */
.fairlis-product-embed .product-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 4px 10px;
  background: var(--c-text);
  color: var(--c-bg, #fff);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  line-height: 1;
}

.fairlis-product-embed .product-card__sustain-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  font-size: 11px;
  line-height: 1.2;
  color: #2d6a4f;
}

.fairlis-product-embed .product-card__sustain-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.fairlis-product-embed .product-card__sustain-item svg {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
}

.fairlis-product-embed .product-card__sustain-item--more {
  color: var(--c-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .fairlis-product-embed .market-home-popular__nav {
    display: none; /* Prev/Next auf Mobile aus — Touch-Scroll */
  }

  .fairlis-product-embed .market-home-popular__item {
    flex: 0 0 calc((100% - 16px) / 2.2);
  }

  .fairlis-product-embed .market-home-popular__track {
    mask-image: linear-gradient(to right, #000 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent 100%);
  }
}

@media (max-width: 560px) {
  .fairlis-product-embed .market-home-popular__item {
    flex: 0 0 calc((100% - 12px) / 1.7);
  }

  .fairlis-product-embed .product-card__title {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fairlis-product-embed .market-home-popular__track {
    scroll-behavior: auto;
  }
  .fairlis-product-embed .market-home-popular__more-arrow {
    transition: none;
  }
}
