/* ============ Shop-Template – Basis ============
 * Einfache, klare Farbpalette (bewusst ohne Farbverläufe):
 *   Blau       #2563EB  – Marke, Links, primäre Aktionen
 *   Weiß       #FFFFFF  – Karten, Flächen
 *   Hellgrau   #E5E7EB  – Rahmen/Trennlinien
 *   Grün       #22C55E  – ausschließlich Kauf-/Zum-Shop-Buttons
 *   Dunkelgrau #111827  – Fließtext
 */
:root {
  --brand: #2563EB;
  --brand-2: #2563EB;
  --brand-grad: #2563EB;
  --buy: #22C55E;
  --buy-hover: #16A34A;
  --text: #111827;
  --text-soft: #6B7280;
  --bg: #F9FAFB;
  --card: #FFFFFF;
  --line: #E5E7EB;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(17, 24, 39, .06);
  --shadow-hover: 0 6px 20px rgba(17, 24, 39, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

h1 { font-size: 1.7rem; line-height: 1.25; }
h2 { font-size: 1.3rem; }

/* ============ Header ============ */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.logo { display: inline-flex; flex-shrink: 0; }
.logo img { height: 38px; width: auto; }

.search-form {
  flex: 1;
  display: flex;
  max-width: 520px;
  margin-left: auto;
}
.search-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 9px 14px;
  font: inherit;
  background: var(--bg);
}
.search-form input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.search-form button {
  border: none;
  background: var(--brand-grad);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
}

.nav-toggle { display: none; }

.cat-nav { border-top: 1px solid var(--line); background: var(--card); }
.cat-nav > .container > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cat-nav li { position: relative; }
.cat-nav a {
  display: block;
  padding: 10px 12px;
  color: var(--text-soft);
  font-weight: 500;
  font-size: .92rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.cat-nav a:hover { color: var(--brand); text-decoration: none; border-bottom-color: var(--brand); }

/* Aufklapp-Menü der Unterkategorien (reines CSS, per Hover/Fokus) */
.cat-nav .subnav {
  display: none;
  list-style: none;
  margin: 0;
  padding: 4px;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  min-width: 210px;
  flex-direction: column;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  box-shadow: var(--shadow-hover);
}
.cat-nav li.has-sub:hover > .subnav,
.cat-nav li.has-sub:focus-within > .subnav { display: flex; }
.cat-nav .subnav a { padding: 8px 12px; border-bottom: none; border-radius: 6px; white-space: normal; }
.cat-nav .subnav a:hover { background: var(--bg); border-bottom-color: transparent; }

@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .search-form { order: 3; flex-basis: 100%; max-width: none; }
  .nav-toggle {
    display: block;
    margin-left: auto;
    border: 1px solid var(--line);
    background: var(--card);
    border-radius: 8px;
    font-size: 1.2rem;
    padding: 4px 12px;
    cursor: pointer;
  }
  .cat-nav { display: none; }
  .cat-nav.open { display: block; }
  .cat-nav > .container > ul { flex-direction: column; }
  /* Unterkategorien mobil eingerückt statt als Overlay */
  .cat-nav .subnav {
    display: flex;
    position: static;
    box-shadow: none;
    border: none;
    padding: 0 0 4px 16px;
    min-width: 0;
  }
}

/* ============ Hero / Startseite ============ */
.hero {
  background: var(--brand-grad);
  color: #fff;
  border-radius: var(--radius);
  padding: 40px 32px;
  margin: 24px 0;
}
.hero h1 { margin: 0 0 8px; font-size: 2rem; }
.hero p { margin: 0; opacity: .92; max-width: 640px; }

/* "Über den Shop" */
.about-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin: 32px 0;
}
.about-box h2 { margin: 0 0 12px; }
.lead-bold { font-weight: 700; margin: 0 0 12px; }
.about-text p { margin: 0 0 12px; color: var(--text-soft); }
.about-categories {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.about-categories li a {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}
.about-categories li a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

/* "Beliebteste Kategorien" mit seitlichen Bannerplätzen */
.popular-section-layout {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 960px) {
  .popular-section-layout { grid-template-columns: 1fr; }
  .popular-section-layout .ad-banner-rail { display: none; }
}
.ad-banner-rail { display: flex; flex-direction: column; gap: 20px; }
.ad-banner--tall { min-height: 340px; }

/* "Beliebteste Kategorien" – runde Bilder, Name zentriert darunter, feste 2x3-Anordnung */
.popular-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 16px;
  margin: 16px 0 32px;
  text-align: center;
}
@media (max-width: 720px) {
  .popular-cat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .popular-cat-grid { grid-template-columns: 1fr; }
}
.popular-cat-card {
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.popular-cat-card:hover { text-decoration: none; }
.popular-cat-image {
  display: block;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: #F9FAFB;
  transition: box-shadow .15s, transform .15s;
}
.popular-cat-card:hover .popular-cat-image { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.popular-cat-image img { width: 100%; height: 100%; object-fit: cover; }
.popular-cat-image--icon { display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.popular-cat-name {
  font-size: 1.05rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* "Worauf achten" Tipps */
.tips-box { margin: 32px 0; }
.tips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 860px) {
  .tips-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .tips-grid { grid-template-columns: 1fr; }
}
.tip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tip:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.tip-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.tip h3 { margin: 0; font-size: 1.02rem; }
.tip p { margin: 0; color: var(--text-soft); font-size: .9rem; line-height: 1.5; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin: 16px 0 32px;
}
.category-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s;
  overflow: hidden;
}
.category-tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.tile-main { display: flex; flex-direction: column; color: var(--text); font-weight: 600; }
.tile-main:hover { text-decoration: none; }
.cat-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #F9FAFB;
  overflow: hidden;
}
.cat-image img { width: 100%; height: 100%; object-fit: contain; padding: 10px; box-sizing: border-box; }
.tile-label { padding: 4px 18px 0; }
.category-tile .cat-icon { font-size: 1.6rem; padding: 16px 18px 0; }
.category-tile .cat-count { display: block; font-size: .82rem; font-weight: 400; color: var(--text-soft); }
.tile-subs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px; }
.tile-subs a {
  font-size: .8rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text-soft);
}
.tile-subs a:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }

/* ============ Produkt-Grid ============ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s;
}
.product-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; }
.card-image {
  aspect-ratio: 4 / 3;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-image.has-photo { background: #ffffff; }
.card-image img { width: 100%; height: 100%; object-fit: contain; padding: 10px; box-sizing: border-box; }
.image-placeholder { font-size: 2.6rem; opacity: .7; }
.card-body { padding: 12px 14px 14px; }
.card-brand {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-soft);
}
.card-title { margin: 2px 0 10px; font-size: .98rem; font-weight: 600; line-height: 1.35; }
.card-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card-price { font-weight: 700; font-size: 1.05rem; color: var(--brand); }
.card-shop { font-size: .8rem; color: var(--text-soft); }
.card-cta {
  display: inline-block;
  margin-top: 10px;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  background: var(--buy);
  padding: 7px 14px;
  border-radius: 8px;
}
.card-link:hover .card-cta { text-decoration: none; background: var(--buy-hover); }

/* Einleitungstext & Unterkategorie-Chips auf Kategorieseiten */
.category-intro {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 0 0 18px;
  color: var(--text-soft);
  line-height: 1.6;
  box-shadow: var(--shadow);
}
.subcat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.subcat-chips a {
  font-size: .85rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
}
.subcat-chips a:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }

/* ============ Listing mit Filter-Sidebar ============ */
.listing-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 24px;
  align-items: start;
  margin: 20px 0;
}
@media (max-width: 860px) {
  .listing-layout { grid-template-columns: 1fr; }
}

.filters .filter-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.filter-box summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.filter-box summary::-webkit-details-marker { display: none; }
.filter-box summary::after { content: ' ▾'; color: var(--text-soft); }

/* Werbebanner-Platz auf Kategorieseiten, gleiche Optik wie die Filter-Box */
.ad-banner {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 16px;
  padding: 16px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}
.ad-banner-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-soft);
}
.ad-banner-text {
  color: var(--text-soft);
  font-size: .9rem;
  font-weight: 500;
}
.filters label {
  display: block;
  margin: 14px 0 4px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-soft);
}
.filters select,
.filters input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}
.price-range { display: flex; align-items: center; gap: 8px; }
.filters .btn { margin-top: 16px; }

.listing-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.listing-head h1 { margin: 0; }
.result-count { color: var(--text-soft); font-size: .9rem; }

.empty-state {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-soft);
}

/* ============ Buttons ============ */
.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { text-decoration: none; filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text-soft); border: 1px solid var(--line); }
.btn-ghost:hover { text-decoration: none; color: var(--brand); border-color: var(--brand); }
/* Kauf-Button: führt direkt zum Angebot im Partnershop */
.btn-buy, .btn-shop { background: var(--buy); color: #fff; white-space: nowrap; }
.btn-buy:hover, .btn-shop:hover { text-decoration: none; background: var(--buy-hover); }

/* ============ Produktdetail ============ */
.breadcrumb { font-size: .85rem; color: var(--text-soft); margin: 16px 0; }
.breadcrumb a { color: var(--text-soft); }

.product-detail {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 32px;
}
@media (max-width: 860px) {
  .product-detail { grid-template-columns: 1fr; }
}
.detail-image {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.detail-image img { width: 100%; height: 100%; object-fit: contain; }
.detail-image .image-placeholder { font-size: 4.5rem; }
.detail-info h1 { margin: 0 0 4px; }
.detail-brand { color: var(--text-soft); margin: 0 0 12px; }
.detail-description { color: var(--text); }
.best-price { font-size: 1.15rem; margin: 14px 0; }
.best-price strong { color: var(--buy); font-size: 1.5rem; }

.offers-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.offers-table th, .offers-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.offers-table tr:last-child td { border-bottom: none; }
.offers-table th { background: var(--bg); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); }
.offer-price { font-weight: 700; white-space: nowrap; }
.offer-best .offer-price { color: var(--buy); }
.badge-best {
  display: inline-block;
  background: var(--buy);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  border-radius: 20px;
  padding: 2px 10px;
  margin-left: 8px;
  vertical-align: middle;
}
.offers-note { font-size: .8rem; color: var(--text-soft); margin-top: 10px; }

.table-scroll { overflow-x: auto; }

/* ============ Pagination ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 28px 0;
  color: var(--text-soft);
  font-size: .92rem;
}
.pagination a {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 14px;
  font-weight: 600;
}
.pagination a:hover { text-decoration: none; border-color: var(--brand); }

/* ============ Footer ============ */
.site-footer {
  margin-top: 48px;
  background: var(--card);
  border-top: 1px solid var(--line);
}
.footer-inner { padding: 28px 16px; }
.affiliate-note { font-size: .8rem; color: var(--text-soft); max-width: 820px; }
.footer-nav { display: flex; gap: 18px; margin: 12px 0; }
.footer-nav a { color: var(--text-soft); font-size: .9rem; }
.copyright { font-size: .8rem; color: var(--text-soft); margin: 0; }

/* ============ Inhaltsseiten (Impressum/Datenschutz) ============ */
.content-page { max-width: 780px; margin: 24px auto; }
.content-page h1 { margin-top: 8px; }
.content-page h2 { margin-top: 28px; }

/* ============ Meldungen ============ */
.flash {
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: .95rem;
}
.flash-success { background: #e7f7ef; color: #14684b; border: 1px solid #b5e6d0; }
.flash-error { background: #fdecec; color: #9c2121; border: 1px solid #f3c2c2; }
