/* ============================================================
   CARMAISON — Design-System
   "Das ehrliche Garagengefühl, digital auf Schweizer Premium-Niveau."
   ============================================================ */

/* ---- Tokens ---- */
:root {
  /* Farbpalette (verbindlich) */
  --anthrazit:      #16181D;  /* Showroom-Anthrazit (Primär) */
  --graphit:        #23262E;  /* Surface dunkel */
  --graphit-2:      #2B2F38;  /* leicht erhöht */
  --cognac:         #C8772E;  /* Signatur-Akzent */
  --bernstein:      #E8A85C;  /* Akzent hell */
  --cta:            #D98324;  /* Signal-CTA */
  --cta-hover:      #E8962F;
  --porzellan:      #F7F5F2;  /* heller BG */
  --weiss:          #FFFFFF;
  --tinte:          #14161A;  /* Text dunkel */
  --nebel:          #E7E4DF;  /* Text auf Anthrazit */
  --muted-dark:     #9AA0AB;  /* Sekundärtext auf Dunkel */
  --muted-light:    #5B6470;  /* Sekundärtext auf Hell */
  --tanne:          #2F7D5B;  /* Erfolg/Verfügbar */
  --rost:           #B33A2B;  /* Fehler/Reserviert */
  --hairline-dark:  #33373F;
  --hairline-light: #E4E0DA;

  /* Typografie */
  --font-head: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-sign: "Caveat", cursive;

  /* Spacing (8px-Raster) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-6: 24px; --s-8: 32px; --s-12: 48px; --s-16: 64px; --s-24: 96px;

  /* Radien */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;

  /* Container */
  --container: 1240px;

  /* Schatten */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 8px 24px rgba(20,22,26,.10);
  --shadow-lg: 0 18px 48px rgba(20,22,26,.16);

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--tinte);
  background: var(--porzellan);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.08; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

/* ---- Helpers ---- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
@media (max-width: 600px) { .container { padding-inline: 18px; } }
.tnum { font-variant-numeric: tabular-nums; }
.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; }

.section { padding-block: clamp(56px, 8vw, 112px); }
.section--dark  { background: var(--anthrazit); color: var(--nebel); }
.section--light { background: var(--porzellan); color: var(--tinte); }
.section--white { background: var(--weiss); color: var(--tinte); }

.eyebrow {
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--cognac);
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--cognac); display: inline-block; }

.section-title { font-size: clamp(30px, 4.4vw, 50px); }
.section--dark .section-title { color: var(--weiss); }
.lead { font-size: clamp(17px, 2vw, 20px); color: var(--muted-light); max-width: 62ch; }
.section--dark .lead { color: var(--muted-dark); }

/* ---- Skip-Link ---- */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--cta); color: #fff; padding: 12px 18px; border-radius: var(--r-sm);
  font-weight: 600; transition: top .2s var(--ease);
}
.skip-link:focus { top: 16px; }

/* ---- Fokus ---- */
:focus-visible { outline: 3px solid var(--cognac); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: 16px;
  padding: 14px 24px; border-radius: var(--r-md); min-height: 48px;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--cta); color: #fff; }
.btn--primary:hover { background: var(--cta-hover); }
.btn--ghost { background: transparent; color: var(--weiss); border: 1.5px solid rgba(231,228,223,.35); }
.btn--ghost:hover { border-color: var(--bernstein); color: var(--bernstein); }
.btn--ghost-dark { background: transparent; color: var(--tinte); border: 1.5px solid var(--hairline-light); }
.btn--ghost-dark:hover { border-color: var(--cognac); color: var(--cognac); }
.btn--lg { padding: 17px 30px; font-size: 17px; min-height: 56px; }
.btn--block { width: 100%; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background-color .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-solid {
  background: rgba(22,24,29,.92); backdrop-filter: blur(12px);
  border-bottom-color: var(--hairline-dark);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 76px; }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 23px; letter-spacing: .02em; color: #fff; display: inline-flex; align-items: baseline; }
.brand .dot { color: var(--cognac); }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  color: var(--nebel); font-size: 15px; font-weight: 500; padding: 10px 14px; border-radius: var(--r-sm);
  position: relative; transition: color .2s var(--ease);
}
.main-nav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px;
  background: var(--cognac); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: #fff; }
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav-dd { position: relative; }
.nav-dd > a { display: inline-flex; align-items: center; gap: 5px; }
.nav-dd > a svg { width: 14px; height: 14px; }
.nav-dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px;
  background: var(--graphit); border: 1px solid var(--hairline-dark); border-radius: var(--r-md);
  padding: 8px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .2s var(--ease);
}
.nav-dd:hover .nav-dd-menu, .nav-dd:focus-within .nav-dd-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dd-menu a { display: block; padding: 11px 14px; font-size: 14px; }
.nav-dd-menu a::after { display: none; }
.nav-dd-menu a:hover { background: var(--graphit-2); }
.nav-dd-menu a strong { display: block; color: #fff; font-weight: 600; margin-bottom: 2px; }
.nav-dd-menu a span { color: var(--muted-dark); font-size: 12.5px; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-phone { color: var(--nebel); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; padding: 8px; }
.header-phone svg { width: 17px; height: 17px; color: var(--cognac); }
.header-phone:hover { color: var(--bernstein); }
.nav-toggle { display: none; width: 46px; height: 46px; border-radius: var(--r-sm); color: #fff; }
.nav-toggle svg { width: 26px; height: 26px; }

/* Mobile nav */
.mobile-nav {
  position: fixed; inset: 0; z-index: 99; background: var(--anthrazit);
  padding: 100px 24px 40px; display: flex; flex-direction: column; gap: 4px;
  transform: translateX(100%); transition: transform .35s var(--ease); visibility: hidden;
}
.mobile-nav.is-open { transform: translateX(0); visibility: visible; }
.mobile-nav a { color: var(--nebel); font-family: var(--font-head); font-size: 24px; font-weight: 600; padding: 14px 0; border-bottom: 1px solid var(--hairline-dark); }
.mobile-nav .btn { margin-top: 20px; }

@media (max-width: 980px) {
  .main-nav, .header-phone { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
}

/* ============================================================
   TRUST-BAR
   ============================================================ */
.trust-strip { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; }
.trust-item { display: inline-flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 500; color: var(--nebel); }
.trust-item svg { width: 18px; height: 18px; color: var(--bernstein); flex: none; }

/* ============================================================
   CARDS — Fahrzeug / USP
   ============================================================ */
.grid { display: grid; gap: 24px; }
.usp-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .usp-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px) { .usp-grid { grid-template-columns: 1fr; } }

.usp-card {
  background: var(--graphit); border: 1px solid var(--hairline-dark); border-radius: var(--r-lg);
  padding: 28px; transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.usp-card:hover { transform: translateY(-5px); border-color: var(--cognac); }
.usp-icon {
  width: 52px; height: 52px; border-radius: var(--r-md); display: grid; place-items: center;
  background: rgba(200,119,46,.14); color: var(--cognac); margin-bottom: 18px;
}
.usp-icon svg { width: 26px; height: 26px; }
.usp-card h3 { font-size: 19px; color: #fff; margin-bottom: 8px; }
.usp-card p { font-size: 15px; color: var(--muted-dark); }

/* Fahrzeug-Karte */
.veh-grid { grid-template-columns: repeat(3,1fr); }
@media (max-width: 900px) { .veh-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { .veh-grid { grid-template-columns: 1fr; } }
.veh-card {
  background: var(--graphit); border: 1px solid var(--hairline-dark); border-radius: var(--r-lg);
  overflow: hidden; transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.veh-card:hover { transform: translateY(-5px); border-color: var(--cognac); box-shadow: var(--shadow-lg); }
.veh-media { position: relative; aspect-ratio: 4/3; background: var(--graphit-2); overflow: hidden; }
.veh-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.veh-card:hover .veh-media img { transform: scale(1.05); }
.veh-badge {
  position: absolute; top: 12px; left: 12px; font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 6px;
}
.badge--avail { background: rgba(47,125,91,.92); color: #fff; }
.badge--new   { background: rgba(200,119,46,.95); color: #fff; }
.veh-body { padding: 18px 20px 22px; }
.veh-name { font-size: 18px; color: #fff; margin-bottom: 4px; }
.veh-sub { font-size: 13.5px; color: var(--muted-dark); margin-bottom: 14px; }
.veh-price { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--bernstein); margin-bottom: 14px; }
.veh-specs { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px 14px; padding-top: 14px; border-top: 1px solid var(--hairline-dark); }
.veh-spec { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-dark); }
.veh-spec svg { width: 15px; height: 15px; color: var(--cognac); flex: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--anthrazit); color: var(--nebel); padding-block: 72px 32px; border-top: 1px solid var(--hairline-dark); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid var(--hairline-dark); }
@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 520px) { .footer-top { grid-template-columns: 1fr; } }
.footer-brand .brand { font-size: 26px; margin-bottom: 16px; }
.footer-brand p { font-size: 14.5px; color: var(--muted-dark); max-width: 34ch; margin-bottom: 18px; }
.footer-contact { display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.footer-contact a, .footer-contact span { display: inline-flex; align-items: center; gap: 9px; color: var(--nebel); }
.footer-contact svg { width: 16px; height: 16px; color: var(--cognac); flex: none; }
.footer-contact a:hover { color: var(--bernstein); }
.footer-col h4 { font-family: var(--font-body); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-dark); margin-bottom: 16px; font-weight: 600; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 14.5px; color: var(--nebel); }
.footer-col a:hover { color: var(--bernstein); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; padding-top: 28px; font-size: 13px; color: var(--muted-dark); }
.footer-bottom .legal { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-bottom a:hover { color: var(--bernstein); }

/* ============================================================
   STICKY MOBILE-AKTIONSBAR
   ============================================================ */
.mobile-bar { display: none; }
@media (max-width: 720px) {
  .mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
    background: var(--hairline-dark); border-top: 1px solid var(--hairline-dark);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-bar a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; font-weight: 600; font-size: 15px; }
  .mobile-bar svg { width: 18px; height: 18px; }
  .mobile-bar .mb-call { background: var(--graphit); color: #fff; }
  .mobile-bar .mb-eval { background: var(--cta); color: #fff; }
  body { padding-bottom: 0; }
}

/* ============================================================
   COOKIE-CONSENT
   ============================================================ */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 150;
  max-width: 440px; background: var(--graphit); color: var(--nebel);
  border: 1px solid var(--hairline-dark); border-radius: var(--r-lg); padding: 22px 24px;
  box-shadow: var(--shadow-lg); transform: translateY(140%); transition: transform .4s var(--ease);
}
.consent.is-visible { transform: translateY(0); }
.consent h4 { font-size: 16px; color: #fff; margin-bottom: 8px; }
.consent p { font-size: 13.5px; color: var(--muted-dark); margin-bottom: 16px; }
.consent p a { color: var(--bernstein); text-decoration: underline; }
.consent-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.consent-actions .btn { min-height: 42px; padding: 10px 18px; font-size: 14px; flex: 1; }
@media (max-width: 720px) { .consent { bottom: 78px; } }

/* ============================================================
   TWEAKS-PANEL (vanilla)
   ============================================================ */
.cm-tweaks {
  position: fixed; top: 18px; right: 18px; z-index: 1000; width: 300px; max-width: calc(100vw - 36px);
  background: #1b1e24; color: var(--nebel); border: 1px solid var(--hairline-dark); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45); font-family: var(--font-body);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98); transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
}
.cm-tweaks.is-open { opacity: 1; visibility: visible; transform: none; }
.cm-tweaks-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--hairline-dark); cursor: grab; }
.cm-tweaks-head h3 { font-family: var(--font-head); font-size: 15px; color: #fff; }
.cm-tweaks-close { width: 28px; height: 28px; border-radius: 8px; color: var(--muted-dark); display: grid; place-items: center; }
.cm-tweaks-close:hover { background: var(--graphit-2); color: #fff; }
.cm-tweaks-close svg { width: 18px; height: 18px; }
.cm-tweaks-body { padding: 16px 18px 20px; max-height: 70vh; overflow-y: auto; }
.cm-tw-group { margin-bottom: 20px; }
.cm-tw-group:last-child { margin-bottom: 0; }
.cm-tw-label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-dark); margin-bottom: 10px; }
.cm-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--anthrazit); border: 1px solid var(--hairline-dark); border-radius: 10px; padding: 4px; }
.cm-seg button { padding: 9px 6px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted-dark); transition: all .15s var(--ease); }
.cm-seg button:hover { color: #fff; }
.cm-seg button.is-on { background: var(--cognac); color: #fff; }
.cm-tw-row { margin-bottom: 12px; }
.cm-tw-row:last-child { margin-bottom: 0; }
.cm-tw-row > span { display: block; font-size: 13px; color: var(--muted-dark); margin-bottom: 6px; }
.cm-select { width: 100%; font-family: inherit; font-size: 14px; padding: 10px 12px; border-radius: 8px; background: var(--anthrazit); color: var(--nebel); border: 1px solid var(--hairline-dark); }
.cm-select:focus { outline: none; border-color: var(--cognac); }
.cm-tweaks-foot { padding: 0 18px 18px; }
.cm-reset { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--hairline-dark); color: var(--muted-dark); font-size: 13px; font-weight: 600; }
.cm-reset:hover { color: #fff; border-color: var(--muted-dark); }

/* ============================================================
   SCROLL-REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ============================================================
   MAGIC UI — vanilla-adaptiert (Quelle: magicui.design via MCP)
   ============================================================ */
@property --mu-beam-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

/* Border Beam — wandernder Lichtstrahl entlang des Rahmens */
.mu-beam { position: relative; }
.mu-beam::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.6px;
  background: conic-gradient(from var(--mu-beam-angle), transparent 0 70%, var(--cognac) 82%, var(--bernstein) 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: mu-beam-spin 7s linear infinite; pointer-events: none; z-index: 2;
}
@keyframes mu-beam-spin { to { --mu-beam-angle: 360deg; } }

/* Animated Grid Pattern — subtiles Raster mit Radial-Maske + langsamem Drift */
.mu-grid { position: relative; isolation: isolate; }
.mu-grid::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(231,228,223,.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(231,228,223,.07) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask: radial-gradient(ellipse 80% 75% at 50% 0%, #000 35%, transparent 72%);
  mask: radial-gradient(ellipse 80% 75% at 50% 0%, #000 35%, transparent 72%);
  animation: mu-grid-drift 26s linear infinite;
}
.mu-grid > * { position: relative; z-index: 1; }
@keyframes mu-grid-drift { to { background-position: 46px 46px, 46px 46px; } }

/* Shimmer — Glanz-Sweep auf opt-in Buttons (.btn--shine) */
.btn--shine { position: relative; overflow: hidden; }
.btn--shine::after {
  content: ""; position: absolute; top: 0; left: -80%; width: 55%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.38), transparent);
  transform: skewX(-20deg); animation: mu-shine 5s ease-in-out infinite; pointer-events: none;
}
@keyframes mu-shine { 0%, 62% { left: -80%; } 88%, 100% { left: 140%; } }

@media (prefers-reduced-motion: reduce) {
  .mu-beam::after, .mu-grid::before, .btn--shine::after { animation: none; }
  .btn--shine::after { display: none; }
}
