/* =========================================================
   lernhefte.css — Produktseite Lernhefte (Light + Dark)
   ========================================================= */

/* Reset (kompakt) */
*,*::before,*::after { box-sizing: border-box; }
html,body { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; border-radius: 12px; }
button,input,select,textarea { font: inherit; }

/* Farben (Light) */
:root{
  --bg:#f6f7fb;
  --surface:#ffffff;
  --text:#111315;
  --muted:#5e6572;
  --border:#e6e8ec;
  --ok:#16a34a;
  --warn:#ea580c;
  --shadow:0 10px 30px rgba(0,0,0,.08);
}

/* Farben (Dark – systembasiert) */
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0b0c10;
    --surface:#111827;
    --text:#e5e7eb;
    --muted:#9aa0aa;
    --border:#1f2937;
    --ok:#34d399;
    --warn:#fb923c;
    --shadow:0 10px 30px rgba(0,0,0,.55);
  }
}

/* Basis */
body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  line-height:1.6;
}
a{ color:inherit; text-decoration:none; }
.container{ width:min(1180px,92vw); margin:0 auto; }
/* Accordion nur innerhalb des Containers verbreitern */

.sections.accordion{
  margin-inline: auto;
}

/* Header */
header{
  background:var(--surface);
  position:sticky; top:0; z-index:20;
  box-shadow:0 1px 0 var(--border);
}
.bar{ display:flex; align-items:center; justify-content:space-between; padding:12px 0; }
.brand{ display:flex; gap:10px; align-items:center; }
.brand-logo{
  width:36px; height:36px; border-radius:8px;
  background:linear-gradient(135deg,#22d3ee,#0ea5e9);
  box-shadow:0 6px 16px rgba(34,211,238,.35);
}

.feat {
  display: flex;
  flex-direction: column; /* Karten untereinander */
  gap: 14px;              /* Abstand zwischen den Cards */
  padding-left: 12px;     /* Innenabstand links */
}

.card {
  padding: 12px 14px;     /* Innenabstand in der Card */
}

.brand strong{ font-size:16px; }
.trust{ display:flex; gap:18px; color:var(--muted); font-size:13px; }
.trust span{ display:flex; gap:6px; align-items:center; white-space:nowrap; }
.dot{ width:8px; height:8px; border-radius:999px; background:var(--ok); }

/* Hero-Grid */
.hero{ display:grid; grid-template-columns:0.9fr 1.1fr; gap:36px; margin:28px auto; }


@media (max-width:820px){ .hero{ grid-template-columns:1fr; gap:22px; } }

.gallery{ 
  background:var(--surface); 
  padding:18px; 
  border-radius:16px; 
  box-shadow:var(--shadow);
  width: 100%;
   }

.thumbs{ display:flex; gap:10px; margin-top:10px; }
.thumbs img{ width:90px; height:auto; object-fit:cover; cursor:pointer; border:2px solid transparent; }
.thumbs img.active{ border-color:#0ea5e9; }

.panel{ background:var(--surface); padding:22px; border-radius:16px; box-shadow:var(--shadow); }
h1{ margin:0 0 8px; font-size:28px; line-height:1.2; }
.sub{ color:var(--muted); font-size:14px; margin-bottom:14px; }
.rating{ display:flex; gap:8px; align-items:center; margin-bottom:10px; }
.stars{ letter-spacing:2px; color:#f59e0b; }
.price-line{ display:flex; gap:10px; align-items:baseline; margin:8px 0 14px; }
.price{ font-size:28px; font-weight:700; }
.tax,.shipping{ color:var(--muted); font-size:13px; }

/* Varianten & Menge */
.variant-group{ margin:16px 0; }
.variant-label{ font-size:13px; color:var(--muted); margin-bottom:6px; }
.variants{ display:flex; flex-wrap:wrap; gap:10px; }
.variant{
  border:1.5px solid var(--border);
  padding:10px 14px;
  border-radius:12px;
  background:var(--surface);
  cursor:pointer;
  font-weight:600; font-size:14px;
}
.variant[aria-pressed="true"]{ border-color:#0ea5e9; box-shadow:0 0 0 3px rgba(14,165,233,.15); }
.qty{ display:flex; align-items:center; gap:8px; margin:12px 0; }
.qty button{
  width:36px; height:36px;
  border:1px solid var(--border);
  background:var(--surface);
  border-radius:10px;
  font-size:18px; cursor:pointer; color:var(--text);
}
.qty input{
  width:58px; text-align:center; padding:8px 10px;
  border:1px solid var(--border); border-radius:10px;
  font-size:16px; background:var(--surface); color:var(--text);
}

/* CTAs – BEIDE GLEICH (weiß, schwarze Schrift, Ecken 0) */
.cta{ display:flex; gap:10px; align-items:center; margin:14px 0 8px; flex-wrap:wrap; }

/* Einheitlicher Button-Stil */
.btn,
.btn-primary,
.btn-outline{
  appearance:none;
  background:#ffffff;
  color:#111111;
  border:1.5px solid #111111;
  padding:14px 18px;
  font-weight:700; font-size:16px;
  line-height:1;
  cursor:pointer;
  border-radius:0;                 /* keine abgerundeten Ecken */
  transition:transform .15s ease, box-shadow .15s ease;
}
.btn:hover,
.btn-primary:hover,
.btn-outline:hover{
  transform:translateY(-1px);
  box-shadow:inset 0 0 0 2px rgba(0,0,0,.10);
}

/* Blick-ins-Buch (Light) */
.btn-lookinside{
  appearance:none;
  background:#f59e0b;          /* warmes Orange */
  color:#ffffff;
  border:1.5px solid #f59e0b;
  padding:14px 18px;
  font-weight:700; font-size:16px; line-height:1;
  cursor:pointer; border-radius:0;
  transition:background .15s ease, transform .15s ease;
}
.btn-lookinside:hover{ background:#d97706; transform:translateY(-1px); }

/* Einheitlicher Zurück-Button (Rot) */
.btn-back {
  appearance: none;
  background: #dc2626; /* Rot (red-600) */
  color: #ffffff;
  border: 1.5px solid #dc2626;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 0; /* keine abgerundeten Ecken */
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-back:hover {
  background: #b91c1c; /* dunkler beim Hover */
  transform: translateY(-1px);
}


/* Tastaturfokus */
:focus-visible{ outline:3px solid rgba(34,211,238,.55); outline-offset:2px; }

/* Badges & Bullets */
.badges{ display:flex; gap:14px; flex-wrap:wrap; margin:8px 0; }
.badge{
  font-size:12px; color:var(--muted);
  border:1px dashed var(--border);
  padding:8px 10px; border-radius:10px; background:transparent;
}
.tick{ color:var(--ok); font-weight:700; }
.bullets{ margin:14px 0 4px; padding-left:20px; }
.bullets li{ margin:6px 0; }

/* Akkordeon im Kartenstil – wie im Screenshot */
.accordion{ display:grid; grid-template-columns:1fr; gap:10px; margin:24px 0; }

.accordion details{
  background:#f3f4f6;            /* hellgrau (Light) */
  border:1px solid var(--border);
  border-radius:9px;
  box-shadow:none;
  overflow:hidden;
  text-align: left;
    width: 95%;                     /* gewünschte Breite */
}
@media (prefers-color-scheme: dark){
  .accordion details{
    background:#1f2937;          /* grey-800 */
    border-color:#374151;
  }
}

.accordion summary{
  cursor:pointer; list-style:none;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px; font-weight:700; color:var(--text);
}
.accordion summary::-webkit-details-marker{ display:none; }

/* Plus/Minus rechts */
.accordion summary::after{
  content:"+";
  font-size:20px; line-height:1; color:#6b7280; margin-left:12px;
}
.accordion details[open] summary::after{ content:"–"; }

.accordion .content{
  padding:14px 16px;
  border-top:1px solid var(--border);
  background:inherit;
}

/* Karten innerhalb (Feature-Boxen) behalten Look */
.accordion .card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:8px;

}
@media (prefers-color-scheme: dark){
  .accordion .card{
    background:#111827;           /* grey-900 */
    border-color:#374151;
  }
  /* Dark Mode Anpassung */
  .btn-back {
    background: #b91c1c;
    border-color: #b91c1c;
  }
  .btn-back:hover {
    background: #991b1b;
  }

}

/* ============================
   Testimonials (Carousel)
   ============================ */
.testimonial-section{
  margin: 30px 0 20px;
}
.testimonial-section h2{
  margin: 0 0 12px;
  font-size: 20px;
}

.testimonial-carousel-wrapper{
  position: relative;
  padding: 16px 48px;                 /* Platz für Pfeile */
  overflow: hidden;
}

/* Karussell: horizontales Scrollen mit Snap, ohne JS */
.testimonial-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(400px, 95%); /* vorher kleiner, jetzt breiter */
  gap: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.testimonial-carousel::-webkit-scrollbar{ display: none; } /* WebKit */

.testimonial-container{
  display: contents;                /* Karten direkt im Grid */
}

.testimonial-card {
  scroll-snap-align: start;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px; /* etwas mehr Innenabstand */
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.testimonial-card h3{
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.testimonial-card p{
  margin: 0;
  font-size: 14px;
}
.testimonial-card .stars{
  margin-top: 6px;
  color: #f59e0b;
  letter-spacing: 1px;
}

/* Avatar-Badge */
.avatar{
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  text-transform: uppercase;
}
.avatar.red   { background: #ef4444; }
.avatar.blue  { background: #3b82f6; }
.avatar.green { background: #10b981; }
.avatar.orange{ background: #f59e0b; }

/* Pfeile */
.nav-arrow{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  line-height: 34px;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow);
}
.left-arrow  { left: 8px;  }
.right-arrow { right: 8px; }

.nav-arrow:hover{
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.06);
}

/* Pfeile auf sehr kleinen Screens ausblenden (Wischen) */
@media (max-width: 520px){
  .testimonial-carousel-wrapper{ padding: 12px 12px; }
  .nav-arrow{ display: none; }
}

/* Dark Mode */
@media (prefers-color-scheme: dark){
  .testimonial-carousel-wrapper{
    background: #0f172a;             /* leicht abgesetzte Fläche */
    border-color: #243041;
  }
  .testimonial-card{
    background: #1f2937;
    border-color: #374151;
  }
  .nav-arrow{
    background: #111827;
    border-color: #374151;
  }
}


/* Cross-Sell */
.cross{ margin:20px 0; }
.cross h3{ margin:0 0 10px; }
.grid4{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
@media (max-width:920px){ .grid4{ grid-template-columns:1fr 1fr; } }
.product-mini{ background:var(--surface); border:1px solid var(--border); border-radius:14px; overflow:hidden; }
.mini-body{ padding:10px 12px; }
.mini-title{ font-weight:700; font-size:14px; line-height:1.3; }
.mini-price{ font-size:13px; color:var(--muted); margin-top:4px; }

/* Sticky Checkout/CTA (optional, sehr kleine Screens) */
.sticky{
  position:sticky; bottom:0; z-index:15;
  background:rgba(255,255,255,.95);
  backdrop-filter:blur(6px);
  border-top:1px solid var(--border);
}
@media (prefers-color-scheme: dark){
  .sticky{ background:rgba(17,24,39,.9); }
}
.sticky-inner{ display:flex; justify-content:space-between; align-items:center; gap:14px; padding:10px 0; }
.sticky .price{ font-size:20px; }

.sticky-cta{
  display:none;
  position:fixed; left:0; right:0; bottom:0;
  padding:10px 14px; gap:10px;
  background:rgba(255,255,255,.95);
  backdrop-filter:blur(6px);
  border-top:1px solid var(--border);
  z-index:30;
}
.sticky-cta .btn{ flex:1; }
@media (max-width:600px){ .sticky-cta{ display:flex; } }
@media (prefers-color-scheme: dark){
  .sticky-cta{ background:rgba(17,24,39,.9); }
}

/* Dark Mode: Blick-ins-Buch */
@media (prefers-color-scheme: dark){
  .btn-lookinside{
    background:#d97706;     /* satteres Orange im Dark Mode */
    border-color:#d97706;
    color:#ffffff;
  }
  .btn-lookinside:hover{
    background:#b45309;     /* dunkler beim Hover */
  }
}

/* Payment-Badges */
.pay-badges{ display:flex; gap:10px; flex-wrap:wrap; margin:8px 0; }
.pay-badges img{ height:28px; filter:grayscale(0); }
@media (prefers-color-scheme: dark){
  .pay-badges img{ filter:grayscale(0) brightness(.95); }
}

/* Footer */
footer{ margin:40px 0 30px; color:var(--muted); font-size:13px; }
.footer-cta{ display:flex; gap:14px; align-items:center; flex-wrap:wrap; }
.footer-cta .btn{ font-size:14px; padding:10px 14px; }

/* Utilities */
.hide{ display:none !important; }
.muted{ color:var(--muted); }
.center{ text-align:center; }
hr{ border:none; border-top:1px solid var(--border); margin:16px 0; }

/* === Patch: Testimonials breiter + linksbündig, hohe Spezifität === */
.testimonial-section .testimonial-carousel {
  /* Zelle breiter machen – nutzt bis 600px je Karte */
  grid-auto-columns: min(600px, 100%);
  gap: 24px;
}

.testimonial-section .testimonial-carousel-wrapper {
  /* Weniger Seiten-Padding, damit innen mehr Breite übrig bleibt */
  padding: 16px 24px;
}

.testimonial-section .testimonial-card {
  /* Erzwinge volle Zellenbreite und hebe evtl. Theme-Limits auf */
  width: 95%;
  max-width: none;
  text-align: left;             /* kein zentrierter Fließtext */
  padding: 22px;
  box-sizing: border-box;
}

/* Optional: Pfeile etwas schmaler, damit sie weniger Fläche verdecken */
.testimonial-section .nav-arrow {
  width: 32px; height: 32px; line-height: 30px;
}
/* 20% kleiner, Layout um die Galerie bleibt unverändert */
:root { --gallery-scale: .8; }

/* Desktop: Panel-Inhalt vertikal mittig innerhalb der rechten Spalte */
@media (min-width: 821px){
  .panel{
    display: flex;
    flex-direction: column;
    justify-content: center;  /* vertikale Zentrierung */
    align-self: stretch;      /* füllt die gesamte Grid-Zeile */
  }
}

/* Optional: auf Mobile wieder top-ausgerichtet (falls woanders überschrieben wurde) */
@media (max-width: 820px){
  .panel{
    display: block;           /* zurück auf normal */
  }
  
}
/* Gallery-Inhalte zentrieren (ohne Layout zu verändern) */
.gallery{
  display: flex;
  flex-direction: column;
  align-items: center;   /* horizontal zentriert */
}

/* Hauptbild sicher zentrieren & einpassen */
.gallery .gallery-image,
.gallery > img{
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  display: block;
}

/* Thumbs: eine Zeile, mittig; bei Overflow -> horizontale Scrollbar unten */
.thumbs{
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 15px;

  flex-wrap: nowrap;          /* KEIN Umbrechen -> ermöglicht Scrollbar */
  overflow-x: auto;           /* zeigt die Scrollbar bei Bedarf */
  overflow-y: hidden;
  width: 100%;

  -webkit-overflow-scrolling: touch; /* smoother auf iOS */
  scrollbar-width: auto;             /* Firefox */
  scrollbar-gutter: stable both-edges;
}

/* (Optional) Scrollbar minimal stylen – dezent */
.thumbs::-webkit-scrollbar{ height: 10px; }
.thumbs::-webkit-scrollbar-thumb{ background: #c7cbd1; border-radius: 999px; }
.thumbs::-webkit-scrollbar-track{ background: transparent; }

/* Falls du irgendwo (z. B. mobile) wrap aktiviert hattest, hier hart überschreiben */
@media (max-width: 820px){
  .thumbs{ flex-wrap: nowrap; }
}
/* Hauptbild: feiner, schwarzer Rahmen */
.gallery .gallery-image img,
.gallery > img{
  border: 1px solid rgba(0,0,0,.15); /* dezent schwarz */
  border-radius: 12px;               /* wie deine globalen img-Radien */
}

/* Dark Mode: leicht aufhellen, damit der Rahmen sichtbar bleibt */
@media (prefers-color-scheme: dark){
  .gallery .gallery-image img,
  .gallery > img{
    border-color: rgba(255,255,255,.12);
  }
}

/* === No-Sidescroll-Patch (Mobile) ======================= */
html { overflow-x: clip; }
body { overflow-x: hidden; }

/* 1) Container & große Bereiche niemals breiter als Viewport */
.container,
.hero,
.gallery,
.panel,
.testimonial-section,
.testimonial-carousel-wrapper {
  max-width: 100%;
  contain-intrinsic-inline-size: auto; /* iOS-Glitch-Prävention */
}

/* 2) Testimonials: Spaltenbreite an Innenraum koppeln, Gap einkalkulieren */
@media (max-width: 520px){
  .testimonial-section .testimonial-carousel-wrapper{
    padding-inline: 12px;           /* etwas geringer -> mehr Platz, kein Überlauf */
    overflow: clip;                  /* verhindert "Seite schiebbar" */
  }
  .testimonial-section .testimonial-carousel{
    grid-auto-columns: calc(100%);   /* 1 Karte = exakte Innenbreite */
    gap: 16px;                       /* kleineres Gap auf Mobile */
  }
  .testimonial-section .testimonial-card{
    width: 100%;                     /* nicht 95% -> verhindert Restpixel */
    max-width: none;
  }
}

/* 3) Thumbnails: Scrollbar-Gutter kann Breite addieren -> entschärfen */
.thumbs{
  scrollbar-gutter: stable;          /* statt both-edges (verursacht Extra-Breite) */
  padding-inline: 0;                 /* kein zusätzliches Innen-Padding */
  max-width: 100%;
}

/* 4) Buttons/Grids: volle Breite + sicherer Innenabstand, kein Overflow */
@media (max-width: 520px){
  .category-buttons,
  .hero-actions,
  .nav-hero-actions{
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
    margin: 20px auto 0;
    padding-inline: max(6px, env(safe-area-inset-left))
                    max(6px, env(safe-area-inset-right));
    box-sizing: border-box;
  }
  .category-button-yellow,
  .category-button-red,
  .hero-actions > *,
  .nav-hero-actions > *{
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    white-space: normal;
    word-break: break-word;
  }
}

/* 5) Absolute Elemente bleiben im Rahmen */
.testimonial-section .nav-arrow{
  inset-inline-start: auto;          /* nur eine Seite aktiv halten */
  inset-inline-end: 8px;
  max-width: calc(100% - 16px);      /* Sicherheitsgeländer */
}

/* 6) Bilder und Karten: nie überziehen */
img, .card, .mini-body, .product-mini {
  max-width: 100%;
  box-sizing: border-box;
}

/* Falls du einen sticky Header hast: Abstand beim Fokussieren/Anspringen */
.accordion details > summary { scroll-margin-top: 72px; }

/* Verhindert, dass Fokus-Stile ein „Auto-Scroll“ auslösen */
.accordion details > summary:focus { outline-offset: 2px; }

/* Wenn du irgendwo "scroll-behavior: smooth" global gesetzt hast: */
html { scroll-behavior: auto; } /* (nur setzen, wenn nötig) */
.sections.accordion {
  width: 95vw;          /* fast volle Bildschirmbreite */
  max-width: 1280px;    /* optionale Grenze */
  margin: 0 auto;       /* Block mittig ausrichten */
  display: flex;        /* Flexbox für Zentrierung */
  flex-direction: column;
  align-items: center;  /* Details-Elemente mittig */
  gap: 0.75rem;  
}

.sections.accordion details {
  width: 95%;           /* jedes Details-Element selbst auf 95% */
  margin: 0;            /* keine extra Abstände */
  box-sizing: border-box;
}
