/* ==============================================================
   style.css – Peanuts Fanshop
   Design-Tokens oben als CSS-Variablen, Rest baut darauf auf.
   ============================================================== */

:root {
  --sky: #D7E8EF;
  --paper: #FBF8F1;
  --ink: #201D18;
  --doghouse: #B4472C;
  --doghouse-dark: #9C3C22;
  --mustard: #E8A93E;
  --mustard-dark: #D99A2B;
  --grass: #7A9B76;
  --radius-panel: 4px;
  --border-width: 2px;
  --max-width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: 'Public Sans', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

h1, h2, h3, .brand {
  font-family: 'Fredoka', system-ui, sans-serif;
}

a { color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------------- Header / Hamburger-Menü ---------------- */
.site-header {
  background: var(--paper);
  border-bottom: var(--border-width) solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.brand {
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.brand-mark { color: var(--doghouse); font-size: 1.5rem; line-height: 0; }

/* Hamburger-Button bleibt bei JEDER Breite sichtbar (Wunsch: Desktop = Mobile) */
.nav-toggle {
  background: none;
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-panel);
  width: 44px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.nav-toggle .bar { display: block; width: 22px; height: 2px; background: var(--ink); }

.site-nav {
  position: absolute;
  top: calc(100% + 2px);
  right: 1.25rem;
  background: var(--paper);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-panel);
  display: flex;
  flex-direction: column;
  min-width: 200px;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.site-nav[data-open="true"] {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
.site-nav a {
  padding: 0.75rem 1rem;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(32,29,24,0.12);
}
.site-nav a:last-child { border-bottom: none; }
.site-nav a:hover, .site-nav a:focus-visible { background: var(--sky); }
.nav-home { color: var(--doghouse); }

/* ---------------- Hero + Sprechblasen-Suche ---------------- */
.hero { padding: 3rem 1.25rem 4rem; }
.hero-inner { max-width: var(--max-width); margin: 0 auto; text-align: center; }
.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}
.hero-sub {
  max-width: 42ch;
  margin: 0 auto 2rem;
  color: rgba(32,29,24,0.75);
}

.search-bubble {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background: var(--paper);
  border: var(--border-width) solid var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.35rem 0.35rem 1.25rem;
}
.search-bubble::after {
  content: "";
  position: absolute;
  left: 2.5rem;
  bottom: -0.6rem;
  width: 1.1rem;
  height: 1.1rem;
  background: var(--paper);
  border-right: var(--border-width) solid var(--ink);
  border-bottom: var(--border-width) solid var(--ink);
  transform: rotate(45deg);
}
.search-bubble input {
  flex: 1;
  border: none;
  background: none;
  font-size: 1rem;
  font-family: inherit;
  padding: 0.6rem 0.5rem;
  outline: none;
}
.search-bubble button {
  border: none;
  background: var(--doghouse);
  color: var(--paper);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
}
.search-bubble button:hover { background: var(--doghouse-dark); }

.search-results {
  max-width: 480px;
  margin: 2rem auto 0;
  text-align: left;
  background: var(--paper);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-panel);
  padding: 1rem 1.25rem;
}
.search-list { list-style: none; margin: 0; padding: 0; }
.search-list li { padding: 0.5rem 0; border-bottom: 1px solid rgba(32,29,24,0.12); }
.search-list li:last-child { border-bottom: none; }
.search-list a { text-decoration: none; font-weight: 500; }
.search-list a:hover { color: var(--doghouse); }
.search-status { margin: 0; color: rgba(32,29,24,0.75); }

/* ---------------- Kategorien / Produkte ---------------- */
section.categories, section.featured {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}
h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }

.category-grid, .product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--paper);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-panel);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.category-card:hover, .category-card:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}
.category-name { font-family: 'Fredoka', system-ui, sans-serif; font-weight: 600; font-size: 1.05rem; }
.category-desc { font-size: 0.9rem; color: rgba(32,29,24,0.7); }

.product-card {
  background: var(--paper);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-panel);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.product-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border: 1px solid rgba(32,29,24,0.15);
  border-radius: 2px;
}
.product-card h3 { font-size: 1rem; margin: 0; }
.product-card p { margin: 0; font-size: 0.9rem; color: rgba(32,29,24,0.75); }
.product-card .price { font-weight: 600; color: var(--doghouse); }

.btn {
  align-self: flex-start;
  margin-top: 0.25rem;
  background: var(--mustard);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: var(--border-width) solid var(--ink);
}
.btn:hover { background: var(--mustard-dark); }

.empty-state {
  color: rgba(32,29,24,0.7);
  background: var(--paper);
  border: 1px dashed rgba(32,29,24,0.4);
  border-radius: var(--radius-panel);
  padding: 1rem 1.25rem;
}
.empty-state code { background: rgba(32,29,24,0.08); padding: 0.1rem 0.35rem; border-radius: 3px; }

/* ---------------- Produkt-Detailseite ---------------- */
.product-detail {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 1rem;
}
@media (min-width: 720px) {
  .product-detail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
.product-detail-media img {
  width: 100%;
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-panel);
  object-fit: cover;
  aspect-ratio: 1 / 1;
}
.product-detail-media-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: var(--border-width) dashed rgba(32,29,24,0.4);
  border-radius: var(--radius-panel);
  color: rgba(32,29,24,0.6);
}
.product-detail-info h1 { font-size: 1.75rem; margin: 0 0 0.5rem; }
.product-detail-price { font-size: 1.3rem; font-weight: 600; color: var(--doghouse); margin: 0 0 1rem; }
.product-detail-desc { color: rgba(32,29,24,0.85); margin: 0 0 1.25rem; }
.product-detail-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.btn-large { font-size: 1.05rem; padding: 0.75rem 1.5rem; }
.product-detail-note { font-size: 0.85rem; color: rgba(32,29,24,0.65); margin-top: 0.75rem; }

.related-products { margin-top: 3.5rem; }
.related-products h2 { font-size: 1.3rem; margin-bottom: 1.25rem; }

/* ---------------- Karussell (beworbene Produkte) ---------------- */
.carousel-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
}
.carousel {
  position: relative;
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-panel);
  background: var(--paper);
  overflow: hidden;
}
.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}
.carousel-slide {
  flex: 0 0 100%;
  position: relative;
}
.carousel-slide a { display: block; text-decoration: none; color: inherit; }
.carousel-slide img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  display: block;
}
.carousel-caption {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: var(--paper);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-panel);
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  font-size: 0.95rem;
  max-width: calc(100% - 2rem);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--paper);
  border: var(--border-width) solid var(--ink);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-prev { left: 0.75rem; }
.carousel-next { right: 0.75rem; }
.carousel-btn:hover { background: var(--mustard); }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  background: var(--paper);
  border-top: 1px solid rgba(32,29,24,0.15);
}
.carousel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.carousel-dot[aria-selected="true"] { background: var(--doghouse); border-color: var(--doghouse); }

@media (min-width: 640px) {
  .carousel-slide img { aspect-ratio: 21 / 6; }
}

/* ---------------- Listing-Seiten (Kategorie/Charakter) ---------------- */
.listing-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  text-decoration: none;
  font-weight: 500;
  color: var(--doghouse);
}
.back-link:hover { text-decoration: underline; }
.listing-page h1 { font-size: 1.9rem; margin: 0 0 0.5rem; }
.listing-intro { color: rgba(32,29,24,0.75); margin: 0 0 1.5rem; max-width: 60ch; }

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.chip {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: var(--border-width) solid var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
}
.chip:hover, .chip:focus-visible { background: var(--sky); }
.chip-active { background: var(--mustard); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}
.pagination a {
  text-decoration: none;
  font-weight: 600;
  color: var(--doghouse);
}
.pagination a:hover { text-decoration: underline; }
.pagination-status { color: rgba(32,29,24,0.7); font-size: 0.9rem; }

/* ---------------- Rechtstext-Seiten (Impressum/Datenschutz) ---------------- */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
.legal-inner h1 { font-size: 2rem; margin-bottom: 1.5rem; }
.legal-inner h2 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }
.legal-inner p { margin: 0 0 0.5rem; color: rgba(32,29,24,0.85); }
.legal-inner ul { margin: 0 0 1rem; padding-left: 1.25rem; color: rgba(32,29,24,0.85); }
.legal-inner li { margin-bottom: 0.4rem; }
.legal-note {
  margin-top: 2.5rem;
  padding: 1rem 1.25rem;
  background: var(--paper);
  border: 1px dashed rgba(32,29,24,0.4);
  border-radius: var(--radius-panel);
  font-size: 0.9rem;
  color: rgba(32,29,24,0.75);
}

/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 2rem 1.25rem;
  margin-top: 2rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}
.disclosure { font-size: 0.85rem; color: rgba(251,248,241,0.75); max-width: 60ch; margin: 0; }
.footer-nav { display: flex; gap: 1rem; }
.footer-nav a { text-decoration: none; font-size: 0.9rem; }
.footer-nav a:hover { color: var(--mustard); }

/* ---------------- Zugänglichkeit ---------------- */
:focus-visible { outline: 3px solid var(--doghouse); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
