/*
 * components.css — sitewide shared chrome
 *
 * Contains the canonical CSS for top-nav, footer, and skip-link.
 * Linked by every page (index.html + 4 legal pages).
 *
 * Per /review 2026-05-06 user course-correction (after v0.10.12 visual feedback):
 * top-nav + footer are global components, identical sitewide. Visual unification
 * is asserted by tests/legal-pages.spec.js drift-detect across all 5 pages.
 */

/* === Self-hosted Poppins ====================================================
 * Five weights covering every page (300/400/500/600/700). Latin subset only —
 * unicode-range U+0000-00FF + symbols. Covers German umlauts (ä/ö/ü/ß), em-
 * dashes, smart quotes, currency symbols.
 *
 * Per /review 2026-05-06 follow-up: localize external sources. Removes the
 * Google Fonts dependency that was leaking fan IPs to Google on every page
 * load, plus eliminates the LG München I 2022 case-law risk on the Impressum
 * (where loading Google Fonts arguably required its own consent gate).
 */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/poppins-300-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/poppins-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/poppins-500-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/poppins-600-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/poppins-700-latin.woff2') format('woff2');
}

/* Alpine x-cloak — hide elements with x-cloak until Alpine has hydrated.
 * Used by the cart-badge so it doesn't flash visible before $store.cart loads. */
[x-cloak] { display: none !important; }

/* === Skip-to-content link (a11y) ============================================
 * First focusable element on every page. Hidden until focused, then visible
 * top-left as a blue pill.
 */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  /* v0.10.25 (B3): white-on-blue (#467ff7) was ~3.7:1, fails WCAG AA
     normal text. Switched to white-on-navy (~12:1) which is well above
     AA. Brand accent preserved via the focus outline. */
  background: var(--navy);
  color: var(--white);
  padding: 0.6rem 1rem;
  border-radius: 0 0 4px 0;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 10000;
  transition: top 0.15s;
}
.skip-link:focus { top: 0; outline: 2px solid var(--white); outline-offset: -4px; }

/* === Top-nav (sitewide canonical) ==========================================
 * Fixed, blurred white background with bottom border. Brand left, links + right
 * group flush right.
 *
 * z-index 100 — below overlays (cart drawer 201, banner 1000) but above content.
 */
nav.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav-brand {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--navy);
  text-decoration: none;
}
.nav-brand span { color: var(--blue); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  /* Push nav-links + nav-right flush right while brand stays flush left.
   * Without this the flex space-between scatters the three children. */
  margin-left: auto;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  text-decoration: none;
  transition: color 0.3s;
}
.nav-links a:hover { color: var(--blue); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--navy);
  margin: 4px 0;
  transition: all 0.3s;
}

/* === Nav Right Group (hamburger + cart) === */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
@media (min-width: 641px) {
  .nav-right { margin-left: 2rem; }
}

/* === Nav Cart Icon ==========================================================
 * Always visible. On home, button toggles the cart drawer via $store.cart.
 * On legal pages, components.js stubs the cart store so toggle navigates home.
 */
.nav-cart {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray);
  padding: 6px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}
.nav-cart:hover { color: var(--blue); }
.nav-cart:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}
.nav-cart--filled { color: var(--navy); }
.nav-cart-badge {
  position: absolute;
  top: 2px;
  right: 0;
  background: var(--blue);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
  box-shadow: 0 0 0 2px var(--white);
  pointer-events: none;
  animation: badge-pop 0.18s ease-out;
}
@keyframes badge-pop {
  0% { transform: scale(0.5); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* === Mobile nav (≤640px) ==================================================== */
@media (max-width: 640px) {
  .nav-links { display: none; }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    padding: 1rem clamp(1.25rem, 4vw, 3rem);
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open a {
    display: block;
    padding: 0.75rem 0;
    min-height: 44px;
    line-height: 1.8;
  }
}

/* === Footer (sitewide canonical) ==========================================
 * White surface, top border, gray text + blue hover. 5 legal links in 2
 * clusters separated by | divider. Cookie-Einstellungen behavior differs by
 * page (button on home re-opens consent banner; anchor on legal pages scrolls
 * to /datenschutz#cookies) but visuals are identical.
 *
 * Legal pages use class="legal-footer". Home also uses class="legal-footer"
 * for the same look. The class name is historical; semantics apply sitewide.
 */
footer.legal-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem clamp(1.25rem, 4vw, 2rem);
  background: var(--white);
  text-align: center;
}

.legal-footer-meta {
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 1rem;
}
/* Match .legal-footer-links styling: no underline by default, color shift on
 * hover. Per /review 2026-05-06 follow-up: all footer links should look identical. */
.legal-footer-meta a {
  color: var(--gray);
  text-decoration: none;
  transition: color 0.2s;
}
.legal-footer-meta a:hover { color: var(--blue); }

.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem 1rem;
  font-size: 0.85rem;
}
.legal-footer-links a {
  color: var(--gray);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.2rem;
  cursor: pointer;
  transition: color 0.2s;
}
.legal-footer-links a:hover { color: var(--blue); }

.legal-footer-divider {
  color: var(--gray-dim);
  user-select: none;
}

@media (max-width: 640px) {
  .legal-footer-divider { display: none; }
  .legal-footer-links {
    flex-direction: column;
    gap: 0;
  }
  .legal-footer-links a {
    padding: 0.75rem 1rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

