/* =============================================================
   Ritter GmbH – KFZ-Meisterbetrieb
   Gemeinsames Stylesheet für alle Seiten.
   Aufbau:  1) Tokens  2) Base  3) Header/Nav  4) Sektionen
            5) Komponenten  6) Footer  7) Chatbot-Slot  8) Responsive
   ============================================================= */

/* ---------- 1) DESIGN-TOKENS ---------- */
:root {
  --anthrazit:   #1c1f23;   /* Haupt-Textfarbe / dunkle Flächen */
  --anthrazit-2: #2a2e34;
  --grau-bg:     #f4f5f6;   /* helle Sektionsflächen */
  --grau-line:   #e2e4e7;   /* Trennlinien */
  --grau-text:   #5d636b;   /* Fließtext gedämpft */
  --weiss:       #ffffff;
  --akzent:      #b21f24;   /* Mercedes-/AMG-Rot als Signalfarbe (CTA, Nummern) */
  --akzent-dark: #8d171b;

  --ff-display: "Oswald", "Arial Narrow", Arial, sans-serif; /* schmale, kraftvolle Headlines */
  --ff-body:    "Barlow", "Segoe UI", Helvetica, Arial, sans-serif;

  --maxw: 1180px;
  --pad-x: clamp(1.1rem, 4vw, 3rem);
  --section-y: clamp(3.5rem, 8vw, 6.5rem);
  --radius: 4px;
  --shadow: 0 10px 30px rgba(28,31,35,.10);
  --t: .25s ease;
}

/* ---------- 2) BASE / RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ff-body);
  color: var(--anthrazit);
  line-height: 1.65;
  background: var(--weiss);
  font-size: 17px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--t); }
h1, h2, h3, h4 { font-family: var(--ff-display); font-weight: 600; line-height: 1.08; margin: 0 0 .5em; letter-spacing: .01em; }
p { margin: 0 0 1.1em; }
ul { margin: 0 0 1.1em; padding-left: 1.2em; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-x); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* sichtbarer Tastatur-Fokus für Barrierefreiheit */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--akzent); outline-offset: 2px;
}

/* ---------- 3) HEADER / NAVIGATION ---------- */
.topbar {
  background: var(--anthrazit);
  color: #c9ccd1;
  font-size: .82rem;
  letter-spacing: .03em;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 38px; }
.topbar a:hover { color: var(--weiss); }
.topbar .social a { margin-left: .9rem; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--weiss);
  border-bottom: 1px solid var(--grau-line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 84px; gap: 1.5rem; }
.logo img { height: 50px; width: auto; }

.main-nav ul { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  font-family: var(--ff-display);
  text-transform: uppercase;
  font-size: .95rem;
  letter-spacing: .04em;
  padding: .4rem 0;
  position: relative;
  color: var(--anthrazit);
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--akzent); transition: width var(--t);
}
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { width: 100%; }
.main-nav a[aria-current="page"] { color: var(--akzent); }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; padding: 8px;
}
.nav-toggle span { display: block; height: 3px; background: var(--anthrazit); margin: 5px 0; border-radius: 2px; transition: var(--t); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- 4) PAGE-HEADER (Unterseiten-Titelband) ---------- */
.page-head {
  background: var(--anthrazit);
  color: var(--weiss);
  padding: clamp(2.4rem, 6vw, 4rem) 0;
}
.page-head h1 {
  text-transform: uppercase; font-size: clamp(2rem, 5vw, 3rem); margin: 0;
}
.page-head .crumbs { color: #9aa0a8; font-size: .9rem; margin-top: .4rem; }
.page-head .crumbs a:hover { color: var(--weiss); }

/* ---------- HERO (Startseite) ---------- */
.hero {
  position: relative; min-height: clamp(440px, 70vh, 620px);
  display: flex; align-items: center;
  color: var(--weiss);
  background: var(--anthrazit-2) center/cover no-repeat;
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,22,25,.82) 0%, rgba(20,22,25,.45) 60%, rgba(20,22,25,.25) 100%); }
.hero .container { position: relative; z-index: 2; }
.hero .kicker { text-transform: uppercase; letter-spacing: .12em; font-family: var(--ff-display); color: var(--akzent); font-size: 1rem; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); text-transform: uppercase; max-width: 16ch; }
.hero p { max-width: 56ch; color: #dfe1e4; font-size: 1.1rem; }

/* ---------- 5) SEKTIONEN ---------- */
.section { padding-block: var(--section-y); }
.section--alt { background: var(--grau-bg); }
.section--dark { background: var(--anthrazit); color: var(--weiss); }
.section--dark .lead, .section--dark p { color: #cfd2d6; }

/* nummerierte Sektion (01 / 02 …) – echtes Reihenfolge-Element wie im Original */
.numbered { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.2rem, 4vw, 3rem); align-items: start; }
.numbered .num {
  font-family: var(--ff-display); font-weight: 600;
  font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1;
  color: var(--akzent); opacity: .9;
}
.eyebrow { text-transform: uppercase; letter-spacing: .1em; color: var(--grau-text); font-size: .85rem; font-family: var(--ff-display); margin-bottom: .3rem; }
.section h2 { text-transform: uppercase; font-size: clamp(1.7rem, 4vw, 2.6rem); }
.section h2 .sub { display: block; color: var(--grau-text); font-weight: 400; text-transform: none; font-size: .8em; }
.section .lead { max-width: 70ch; }

/* zweispaltige Inhalt+Bild-Reihe */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; object-fit: cover; }

/* ---------- 6) KOMPONENTEN ---------- */
.btn {
  display: inline-block; cursor: pointer;
  font-family: var(--ff-display); text-transform: uppercase; letter-spacing: .06em;
  font-size: .92rem; padding: .85rem 1.8rem; border: 0; border-radius: var(--radius);
  background: var(--akzent); color: var(--weiss); transition: background var(--t), transform var(--t);
}
.btn:hover { background: var(--akzent-dark); transform: translateY(-2px); }
.btn--ghost { background: transparent; border: 2px solid currentColor; color: var(--weiss); }
.btn--ghost:hover { background: var(--weiss); color: var(--anthrazit); }
.btn--dark { background: var(--anthrazit); }
.btn--dark:hover { background: #000; }

/* Karten-Raster (Leistungen, Team, Features) */
.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card { background: var(--weiss); border: 1px solid var(--grau-line); border-radius: var(--radius); overflow: hidden; transition: transform var(--t), box-shadow var(--t); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .card-body { padding: 1.4rem 1.5rem; }
.card h3 { text-transform: uppercase; font-size: 1.15rem; margin-bottom: .4rem; }
.card .num-tag { color: var(--akzent); font-family: var(--ff-display); font-size: 1.1rem; }

/* Team-Karten */
.team-card { text-align: center; }
.team-card img { width: 100%; aspect-ratio: 370/514; object-fit: cover; background: var(--grau-bg); }
.team-card h3 { margin: 1rem 0 .15rem; font-size: 1.1rem; }
.team-card .role { color: var(--grau-text); font-size: .9rem; text-transform: uppercase; letter-spacing: .03em; }

/* Feature-Liste (Über Uns) */
.feature { border-left: 3px solid var(--akzent); padding-left: 1.2rem; margin-bottom: 1.8rem; }
.feature h3 { text-transform: uppercase; font-size: 1.05rem; }

/* Bewertungen */
.reviews-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.reviews-head .score { font-family: var(--ff-display); font-size: 2.4rem; color: var(--akzent); }
.stars { color: #f5a623; letter-spacing: 2px; font-size: 1.1rem; }
.review-card { background: var(--weiss); border: 1px solid var(--grau-line); border-radius: var(--radius); padding: 1.4rem; }
.review-card .author { font-weight: 600; margin-top: .8rem; display: block; }

/* Leistungs-Detailseite: Sidebar + Inhalt */
.with-side { display: grid; grid-template-columns: 260px 1fr; gap: clamp(1.5rem,4vw,3rem); align-items: start; }
.with-side > div:first-child { position: sticky; top: 100px; align-self: start; }
.side-nav { border: 1px solid var(--grau-line); border-radius: var(--radius); overflow: hidden; }
.side-nav h4 { background: var(--anthrazit); color: var(--weiss); margin: 0; padding: .9rem 1.1rem; font-size: .95rem; text-transform: uppercase; }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav li { border-top: 1px solid var(--grau-line); }
.side-nav a { display: block; padding: .7rem 1.1rem; font-size: .95rem; }
.side-nav a:hover, .side-nav a[aria-current="page"] { background: var(--grau-bg); color: var(--akzent); }

/* Info-/Kontakt-Boxen */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.info-box h3 { text-transform: uppercase; font-size: 1rem; color: var(--akzent); }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td { text-align: left; padding: .55rem 0; border-bottom: 1px solid var(--grau-line); }
.hours-table th { font-weight: 600; font-family: var(--ff-body); }

/* Kontaktformular */
.form-row { display: grid; gap: 1rem; margin-bottom: 1rem; }
.form-row.two { grid-template-columns: 1fr 1fr; }
.field label { display: block; font-size: .9rem; margin-bottom: .3rem; font-weight: 600; }
.field input, .field textarea {
  width: 100%; padding: .8rem .9rem; border: 1px solid var(--grau-line);
  border-radius: var(--radius); font: inherit; background: var(--weiss);
}
.field textarea { min-height: 150px; resize: vertical; }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--grau-text); margin-bottom: 1.2rem; }
.form-note { font-size: .9rem; margin-top: .8rem; }
.form-note.ok { color: #1d7a3a; }
.form-note.err { color: var(--akzent); }

.map-embed { width: 100%; aspect-ratio: 16/7; border: 0; border-radius: var(--radius); }

/* ---------- 7) FOOTER ---------- */
.site-footer { background: var(--anthrazit); color: #b9bdc3; padding-block: clamp(2.5rem,6vw,4rem); font-size: .95rem; }
.site-footer a:hover { color: var(--weiss); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2rem; }
.site-footer h4, .site-footer h5 { color: var(--weiss); text-transform: uppercase; font-size: 1rem; margin-bottom: .9rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .5rem; }
.site-footer .logo-foot img { height: 46px; margin-bottom: 1rem; }
.footer-bottom { border-top: 1px solid #34383f; margin-top: 2.5rem; padding-top: 1.4rem; font-size: .85rem; color: #8d929a; }

/* ---------- 8) AMG CHATBOT (Phase 2) ---------- */
#amg-chatbot-slot {
  position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem);
  z-index: 180;
}
.amg-launcher {
  display: inline-flex; align-items: center; gap: .55rem;
  background: var(--akzent); color: var(--weiss);
  font-family: var(--ff-display); text-transform: uppercase; letter-spacing: .04em;
  padding: .8rem 1.3rem; border-radius: 999px; box-shadow: var(--shadow);
  cursor: pointer; border: none; user-select: none;
  transition: background var(--t), transform var(--t);
}
.amg-launcher:hover { background: var(--akzent-dark); transform: scale(1.04); }
.amg-launcher .dot { width: 9px; height: 9px; border-radius: 50%; background: #7CFC9B; box-shadow: 0 0 0 3px rgba(124,252,155,.25); }
/* Chat-Fenster */
.amg-window {
  position: absolute; bottom: calc(100% + .75rem); right: 0;
  width: min(360px, calc(100vw - 2rem));
  background: #fff; border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  display: flex; flex-direction: column; overflow: hidden;
  animation: amg-slide-in .18s ease;
}
.amg-window[hidden] { display: none; }
@keyframes amg-slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.amg-header {
  background: var(--akzent); color: var(--weiss);
  padding: .72rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--ff-display); font-size: .88rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.amg-header-info { display: flex; align-items: center; gap: .5rem; }
.amg-close {
  background: none; border: none; color: var(--weiss);
  font-size: 1rem; cursor: pointer; padding: .2rem .45rem;
  border-radius: 4px; line-height: 1;
}
.amg-close:hover { background: rgba(255,255,255,.2); }
.amg-messages {
  overflow-y: auto; padding: .85rem;
  display: flex; flex-direction: column; gap: .5rem;
  min-height: 160px; max-height: 300px;
}
.amg-msg {
  max-width: 87%; padding: .55rem .85rem;
  border-radius: 12px; font-size: .9rem; line-height: 1.55;
}
.amg-msg--bot {
  background: #f4f5f6; color: var(--anthrazit);
  align-self: flex-start; border-bottom-left-radius: 4px;
}
.amg-msg--bot a { color: var(--akzent); text-decoration: underline; }
.amg-msg--user {
  background: var(--akzent); color: var(--weiss);
  align-self: flex-end; border-bottom-right-radius: 4px;
}
/* Tipp-Indikator */
.amg-typing { display: flex; align-items: center; gap: 4px; padding: .6rem .85rem; }
.amg-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #9aa0a8;
  animation: amg-bounce .9s infinite ease-in-out;
}
.amg-typing span:nth-child(2) { animation-delay: .18s; }
.amg-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes amg-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}
/* Schnellfragen-Chips */
.amg-chips { display: flex; flex-wrap: wrap; gap: .35rem; align-self: flex-start; max-width: 100%; }
.amg-chip {
  background: none; border: 1px solid var(--akzent); color: var(--akzent);
  border-radius: 999px; padding: .28rem .75rem; font-size: .82rem;
  cursor: pointer; font-family: var(--ff-body);
  transition: background var(--t), color var(--t);
}
.amg-chip:hover { background: var(--akzent); color: var(--weiss); }
/* Eingabe */
.amg-form {
  display: flex; gap: .4rem; padding: .5rem;
  border-top: 1px solid var(--grau-line);
}
.amg-input {
  flex: 1; border: 1px solid var(--grau-line); border-radius: 999px;
  padding: .45rem .9rem; font-size: .9rem; font-family: var(--ff-body);
  outline: none; color: var(--anthrazit); background: #fff;
}
.amg-input:focus { border-color: var(--akzent); }
.amg-send {
  background: var(--akzent); color: var(--weiss); border: none;
  border-radius: 50%; width: 34px; height: 34px; flex-shrink: 0;
  cursor: pointer; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t);
}
.amg-send:hover { background: var(--akzent-dark); }
/* Datenschutz-Hinweis */
.amg-privacy {
  font-size: .72rem; color: #9aa0a8; text-align: center;
  padding: .32rem .8rem; margin: 0;
  border-top: 1px solid var(--grau-line);
}
.amg-privacy a { color: var(--akzent); }

/* ---------- COOKIE-BANNER ---------- */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 200;
  background: var(--anthrazit); color: #e7e9ec; border-radius: var(--radius);
  padding: 1rem 1.2rem; box-shadow: var(--shadow);
  display: flex; gap: 1rem; align-items: center; justify-content: center; flex-wrap: wrap;
  font-size: .92rem; max-width: 760px; margin-inline: auto;
}
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-banner[hidden] { display: none; }

/* Scroll-to-top */
.to-top {
  position: fixed; right: clamp(1rem,3vw,2rem); bottom: calc(clamp(1rem,3vw,2rem) + 64px);
  z-index: 80; width: 44px; height: 44px; border-radius: 50%;
  background: var(--anthrazit-2); color: #fff; border: 0; cursor: pointer;
  display: grid; place-items: center; opacity: 0; pointer-events: none; transition: var(--t);
}
.to-top.show { opacity: .9; pointer-events: auto; }

/* ---------- 9) RESPONSIVE ---------- */
@media (max-width: 960px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .with-side { grid-template-columns: 1fr; }
  .with-side > div:first-child { position: static; }
  .side-nav { position: static; }
}
@media (max-width: 760px) {
  /* mobile Navigation */
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--weiss); border-bottom: 1px solid var(--grau-line);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: var(--t);
  }
  .main-nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .main-nav ul { flex-direction: column; gap: 0; padding: .5rem var(--pad-x) 1rem; }
  .main-nav li { border-top: 1px solid var(--grau-line); }
  .main-nav a { display: block; padding: .9rem 0; }

  .split, .numbered, .info-grid, .grid--2, .form-row.two { grid-template-columns: 1fr; }
  .numbered .num { font-size: 2.6rem; }
  .split .img-col { order: -1; } /* Bild auf Mobil zuerst */
  .topbar .container { font-size: .75rem; }
}
@media (max-width: 460px) {
  .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

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

/* ---------- Ergänzung 2026-10: Überzeile innerhalb der H1 der Startseite (Darstellung wie zuvor als eigener Absatz) ---------- */
.hero h1 .kicker { display: block; font-size: 1rem; font-weight: 400; line-height: 1.65; max-width: none; margin: 0 0 1.1rem; }
