/* ============================================================
   GRILLSHOP.CH — DESIGN SYSTEM v2.0
   Enterprise-Grade E-Commerce Design Tokens
   ============================================================ */

/* ── 1. CSS CUSTOM PROPERTIES (Design Tokens) ────────────── */
:root {
  /* ── Color Palette ── */
  /* Primary: Warm Copper — evokes fire, craftsmanship, premium */
  --color-primary-50:  #FFF7ED;
  --color-primary-100: #FFEDD5;
  --color-primary-200: #FED7AA;
  --color-primary-300: #FDBA74;
  --color-primary-400: #FB923C;
  --color-primary-500: #fa5f0f;
  --color-primary-600: #fa5f0f;
  --color-primary-700: #e0540d;
  --color-primary-800: #9A3412;
  --color-primary-900: #7C2D12;

  /* Neutral: Warm Grays — sophisticated, not cold */
  --color-neutral-0:   #FFFFFF;
  --color-neutral-50:  #FAFAF9;
  --color-neutral-100: #F5F5F4;
  --color-neutral-200: #E7E5E4;
  --color-neutral-300: #D6D3D1;
  --color-neutral-400: #A8A29E;
  --color-neutral-500: #78716C;
  --color-neutral-600: #57534E;
  --color-neutral-700: #44403C;
  --color-neutral-800: #292524;
  --color-neutral-900: #1C1917;
  --color-neutral-950: #0C0A09;

  /* Accent: Golden Amber — fire glow, premium warmth */
  --color-accent-400: #FBBF24;
  --color-accent-500: #F59E0B;
  --color-accent-600: #D97706;

  /* Semantic Colors */
  --color-success:  #16A34A;
  --color-warning:  #F59E0B;
  --color-error:    #DC2626;
  --color-info:     #2563EB;

  /* ── Typography ── */
  --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Font Sizes — Fluid (clamp) */
  --text-xs:   clamp(0.694rem, 0.66rem + 0.17vw, 0.8rem);
  --text-sm:   clamp(0.833rem, 0.78rem + 0.27vw, 1rem);
  --text-base: clamp(1rem, 0.93rem + 0.36vw, 1.25rem);
  --text-lg:   clamp(1.2rem, 1.1rem + 0.5vw, 1.563rem);
  --text-xl:   clamp(1.44rem, 1.3rem + 0.7vw, 1.953rem);
  --text-2xl:  clamp(1.728rem, 1.52rem + 1.04vw, 2.441rem);
  --text-3xl:  clamp(2.074rem, 1.77rem + 1.52vw, 3.052rem);
  --text-4xl:  clamp(2.488rem, 2.05rem + 2.19vw, 3.815rem);
  --text-5xl:  clamp(2.986rem, 2.37rem + 3.08vw, 4.768rem);

  /* Line Heights */
  --leading-none:    1;
  --leading-tight:   1.15;
  --leading-snug:    1.3;
  --leading-normal:  1.5;
  --leading-relaxed: 1.625;
  --leading-loose:   2;

  /* Font Weights */
  --font-light:    300;
  --font-regular:  400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;
  --font-black:    900;

  /* Letter Spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight:   -0.025em;
  --tracking-normal:   0;
  --tracking-wide:     0.025em;
  --tracking-wider:    0.05em;
  --tracking-widest:   0.1em;

  /* ── Spacing (8px base) ── */
  --space-1:  0.25rem;  /* 4px */
  --space-2:  0.5rem;   /* 8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* ── Layout ── */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1280px;
  --container-2xl: 1440px;
  --container-max: 1600px;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);

  /* ── Border Radius ── */
  --radius-sm:   0.25rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-2xl:  1.5rem;
  --radius-full: 9999px;

  /* ── Shadows (warm-tinted) ── */
  --shadow-xs:  0 1px 2px 0 rgba(28, 25, 23, 0.05);
  --shadow-sm:  0 1px 3px 0 rgba(28, 25, 23, 0.1), 0 1px 2px -1px rgba(28, 25, 23, 0.1);
  --shadow-md:  0 4px 6px -1px rgba(28, 25, 23, 0.1), 0 2px 4px -2px rgba(28, 25, 23, 0.1);
  --shadow-lg:  0 10px 15px -3px rgba(28, 25, 23, 0.1), 0 4px 6px -4px rgba(28, 25, 23, 0.1);
  --shadow-xl:  0 20px 25px -5px rgba(28, 25, 23, 0.1), 0 8px 10px -6px rgba(28, 25, 23, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(28, 25, 23, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(28, 25, 23, 0.06);
  --shadow-glow: 0 0 20px rgba(249, 115, 22, 0.3);

  /* ── Transitions ── */
  --ease-out:    cubic-bezier(0.33, 1, 0.68, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast:   150ms;
  --duration-normal: 250ms;
  --duration-slow:   400ms;

  /* ── Z-Index Scale ── */
  --z-base:     0;
  --z-elevated: 10;
  --z-sticky:   100;
  --z-overlay:  200;
  --z-modal:    300;
  --z-toast:    400;
  --z-max:      999;

  /* ── Header ── */
  --header-height: 72px;
  --header-height-mobile: 64px;
}

/* ── 2. RESET & BASE ─────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Scoped reset — nur unsere Custom-Elemente, nicht Astra's Wrapper */
.announcement-bar, .announcement-bar *,
.header, .header *,
.hero, .hero *,
.trust-bar, .trust-bar *,
.footer, .footer *,
.mobile-nav, .mobile-nav *,
main#main-content, main#main-content * {
  margin: 0;
  padding: 0;
}

/* Scoped base styles — nur innerhalb Custom-Elementen */
.header,
.footer,
.hero,
.trust-bar,
.announcement-bar,
.mobile-nav,
main#main-content {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--color-neutral-800);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.header img, .header svg,
.footer img, .footer svg,
.hero img, .hero svg,
.trust-bar img, .trust-bar svg,
.announcement-bar img, .announcement-bar svg,
.mobile-nav img, .mobile-nav svg,
main#main-content img, main#main-content svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.header a, .footer a, .hero a,
.trust-bar a, .announcement-bar a,
.mobile-nav a, main#main-content a {
  color: inherit;
  text-decoration: none;
}

.header button, .footer button, .hero button,
.trust-bar button, .mobile-nav button,
main#main-content button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.header ul, .header ol,
.footer ul, .footer ol,
.hero ul, .hero ol,
.mobile-nav ul, .mobile-nav ol,
main#main-content ul, main#main-content ol {
  list-style: none;
}

/* Scoped focus + selection styles */
.header :focus-visible,
.footer :focus-visible,
.hero :focus-visible,
main#main-content :focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.header ::selection,
.footer ::selection,
.hero ::selection,
main#main-content ::selection {
  background: var(--color-primary-100);
  color: var(--color-primary-900);
}

/* Smooth scrolling (harmlos, global ok) */
html {
  scroll-behavior: smooth;
}

/* ── 3. UTILITY CLASSES ──────────────────────────────────── */

/* Container */
.container {
  width: 100%;
  max-width: var(--container-2xl);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: var(--container-xl);
}

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

/* Section Spacing */
.section {
  padding-block: clamp(3rem, 2rem + 5vw, 6rem);
}

.section--sm {
  padding-block: clamp(2rem, 1.5rem + 2.5vw, 3rem);
}

.section--lg {
  padding-block: clamp(4rem, 3rem + 5vw, 8rem);
}

/* ── 4. TYPOGRAPHY STYLES ────────────────────────────────── */
.heading-display {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-neutral-950);
}

.heading-1 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-neutral-900);
}

.heading-2 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--color-neutral-900);
}

.heading-3 {
  font-family: var(--font-body);
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  color: var(--color-neutral-900);
}

.heading-4 {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
  color: var(--color-neutral-800);
}

.subheading {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-primary-600);
}

.body-lg {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-neutral-600);
}

.body-sm {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-neutral-500);
}

/* ── 5. COMPONENT BASE STYLES ────────────────────────────── */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: 1;
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-out);
  white-space: nowrap;
  user-select: none;
}

.btn--primary {
  background: var(--color-primary-600);
  color: var(--color-neutral-0);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn--primary:hover {
  background: var(--color-primary-700);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn--secondary {
  background: var(--color-neutral-0);
  color: var(--color-neutral-800);
  border: 1.5px solid var(--color-neutral-300);
}

.btn--secondary:hover {
  border-color: var(--color-neutral-400);
  background: var(--color-neutral-100);
  box-shadow: var(--shadow-sm);
}

.btn--ghost {
  background: transparent;
  color: var(--color-neutral-700);
}

.btn--ghost:hover {
  background: var(--color-neutral-100);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  letter-spacing: var(--tracking-wide);
}

.badge--sale {
  background: var(--color-error);
  color: var(--color-neutral-0);
}

.badge--new {
  background: var(--color-primary-600);
  color: var(--color-neutral-0);
}

.badge--bestseller {
  background: var(--color-accent-500);
  color: var(--color-neutral-900);
}

/* Card Base */
.card {
  background: var(--color-neutral-0);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  border: 1px solid var(--color-neutral-200);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--color-neutral-300);
  transform: translateY(-2px);
}

/* Stars Rating */
.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--color-accent-500);
}

.stars svg {
  width: 16px;
  height: 16px;
}

/* Price */
.price {
  font-weight: var(--font-bold);
  color: var(--color-neutral-900);
  font-size: var(--text-lg);
}

.price--old {
  text-decoration: line-through;
  color: var(--color-neutral-400);
  font-weight: var(--font-regular);
  font-size: var(--text-sm);
}

.price--sale {
  color: var(--color-error);
}

/* Divider */
.divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary-500), var(--color-accent-500));
  border-radius: var(--radius-full);
  border: none;
}

/* ── 6. ANIMATIONS ───────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Intersection Observer — reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 100ms; }
.reveal--delay-2 { transition-delay: 200ms; }
.reveal--delay-3 { transition-delay: 300ms; }
.reveal--delay-4 { transition-delay: 400ms; }

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
