/* CarHifi-Berlin — responsive overrides.
   Base styles are inline in the templates; this file only adjusts layout at breakpoints,
   keyed off the [data-screen-label] section attributes. */

/* ---------- contact rows (footer-style subtle icon hover) ---------- */
.chb-contact-ic { transition: border-color .18s ease, background .18s ease; }
.chb-contact-row:hover .chb-contact-ic { background: #f7f6f1 !important; }

html { -webkit-text-size-adjust: 100%; }
img { max-width: 100%; }

/* ---------- mobile nav (button injected by mobile-nav.js, hidden on desktop) ---------- */
.chb-burger { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; border: none; border-radius: 8px; background: none; cursor: pointer; flex-shrink: 0; padding: 0; }
.chb-mobile-menu { position: fixed; inset: 0; z-index: 9998; background: #fbfaf6; padding: 18px 24px 28px 24px; display: none; flex-direction: column; overflow-y: auto; }
.chb-mobile-menu.open { display: flex; }
.chb-mm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.chb-mm-close { width: 40px; height: 40px; border: none; border-radius: 8px; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.chb-mm-nav { display: flex; flex-direction: column; }
.chb-mm-nav a { font-size: 17px; color: #374151; text-decoration: none; padding: 16px 2px; border-bottom: 1px solid #ecebe4; font-family: 'Public Sans', -apple-system, sans-serif; }
.chb-mm-nav a.chb-mm-active { color: #17422e; font-weight: 700; }
.chb-mm-cta { margin-top: 24px; display: flex; align-items: center; justify-content: center; background: #17422e; color: #ffffff; font-size: 15px; font-weight: 600; padding: 15px; border-radius: 10px; text-decoration: none; font-family: 'Public Sans', -apple-system, sans-serif; }

/* ---------- sticky mobile CTA bar (markup lives in the page template) ---------- */
.chb-sticky-cta { display: none; }
@media (max-width: 700px) {
  .chb-sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; display: flex; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)) 14px; background: rgba(251, 250, 246, 0.97); border-top: 1px solid #e7e4dc; box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08); }
  .chb-sticky-cta a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 13px; border-radius: 10px; text-decoration: none; font-family: 'Public Sans', -apple-system, sans-serif; }
  .chb-sc-tel { background: #ffffff; border: 1px solid #d8d5cc; color: #1f2937; }
  .chb-sc-book { background: #17422e; color: #ffffff; }
}

/* ============ ≤1180px — compact desktop / tablet landscape ============ */
@media (max-width: 1180px) {
  header[data-screen-label],
  footer[data-screen-label],
  section[data-screen-label] { padding-left: 36px !important; padding-right: 36px !important; }

  section[data-screen-label="Hero"] { padding-left: 0 !important; padding-right: 0 !important; }
  section[data-screen-label="Hero"] > div:nth-child(3) { padding-left: 36px !important; padding-right: 36px !important; }
  section[data-screen-label="Hero"] > div:last-child { margin-left: 36px !important; margin-right: 36px !important; }

  section[data-screen-label="Warum CarHifi-Berlin"],
  section[data-screen-label="Kontakt"],
  section[data-screen-label="Werte"],
  section[data-screen-label="CTA"] { margin-left: 36px !important; margin-right: 36px !important; }

  /* card grids become self-packing */
  section[data-screen-label="Leistungen"] > div:last-child { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important; }
  section[data-screen-label="Projekte"] > div:last-child,
  section[data-screen-label="Projekt-Archiv Grid"] > div,
  section[data-screen-label="Ähnliche Projekte"] > div:last-child { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important; }
  section[data-screen-label="Kundenstimmen"] > div:nth-child(2) { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important; }
  section[data-screen-label="Service Leistungen"] > div,
  section[data-screen-label="Zahlen"] > div,
  section[data-screen-label="Werkstatt"] > div:last-child { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important; }
  section[data-screen-label="Werte"] > div:last-child { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important; }
}

/* ============ ≤1080px — tablet ============ */
@media (max-width: 1080px) {
  header[data-screen-label="Header"] { gap: 12px; }
  header[data-screen-label="Header"] nav { display: none !important; }
  header[data-screen-label="Header"] > a:first-child { margin-right: auto; }
  header[data-screen-label="Header"] > a[href*="Termin"] { display: none !important; }
  .chb-burger { display: flex; }

  section[data-screen-label="Leistungen Suche"] > div:nth-child(2) { grid-template-columns: repeat(2, 1fr) !important; }

  section[data-screen-label="Buchung Inhalt"] { grid-template-columns: 1fr !important; }
  section[data-screen-label="Buchung Inhalt"] > div:last-child { position: static !important; }
  section[data-screen-label="Kontakt Inhalt"] { grid-template-columns: 1fr !important; }
  section[data-screen-label="Galerie"] { grid-template-columns: 1fr !important; }
  section[data-screen-label="Über uns Kopf"] { grid-template-columns: 1fr !important; gap: 24px !important; }

  section[data-screen-label="Warum CarHifi-Berlin"] > div:last-child { grid-template-columns: repeat(2, 1fr) !important; }
  section[data-screen-label="Prozess"] > div:last-child { grid-template-columns: 1fr 1fr !important; row-gap: 36px; }
  section[data-screen-label="Prozess"] > div:last-child > div:nth-child(even) { display: none !important; }
  section[data-screen-label="Kontakt"] { grid-template-columns: 1fr !important; }
  footer[data-screen-label="Footer"] > div:first-child { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ============ ≤900px — small tablet ============ */
@media (max-width: 900px) {
  section[data-screen-label="Hero"] > div:nth-child(2) { background: rgba(237, 235, 230, 0.9) !important; }
  section[data-screen-label="Hero"] h1 { font-size: 40px !important; }
  section[data-screen-label="Hero"] h1 + div { font-size: 28px !important; }
  section[data-screen-label="Hero"] > div:last-child { grid-template-columns: 1fr 1fr !important; row-gap: 14px; padding: 18px 14px !important; }
  section[data-screen-label="Hero"] > div:last-child > div { border-right: none !important; justify-content: flex-start !important; }

  section[data-screen-label="Leistungen Liste"] div[id] { grid-template-columns: 1fr !important; }
  section[data-screen-label="FAQ"] > div:last-child { grid-template-columns: 1fr !important; }
  section[data-screen-label="Leistungen Liste"] div[id] > div:last-child { border-left: none !important; padding-left: 0 !important; border-top: 1px solid #ecebe4; padding-top: 18px; }
  section[data-screen-label="CTA"] { flex-direction: column; align-items: flex-start !important; }
}

/* ============ ≤760px — large phones ============ */
@media (max-width: 760px) {
  section[data-screen-label="Buchung Inhalt"] div:has(> button) { grid-template-columns: 1fr 1fr !important; }
  section[data-screen-label="Buchung Inhalt"] div:has(> label) { grid-template-columns: 1fr !important; }
  section[data-screen-label="Kontakt Inhalt"] div:has(> label) { grid-template-columns: 1fr !important; }
  section[data-screen-label="Galerie"] h3 + div { grid-template-columns: 1fr !important; }
  /* booking progress: 2×2 grid, no connector lines */
  section[data-screen-label="Buchung Kopf"] > div { display: grid !important; grid-template-columns: 1fr 1fr; gap: 18px 10px !important; }
  section[data-screen-label="Buchung Kopf"] > div > div > *:not(button) { display: none !important; }
}

/* ============ ≤700px — phones ============ */
@media (max-width: 700px) {
  .chb-bg { padding: 0 !important; }
  .chb-shell { border-radius: 0 !important; }

  header[data-screen-label],
  footer[data-screen-label],
  section[data-screen-label] { padding-left: 20px !important; padding-right: 20px !important; }
  section[data-screen-label="Hero"] { padding-left: 0 !important; padding-right: 0 !important; }
  section[data-screen-label="Hero"] > div:nth-child(3) { padding: 44px 20px 80px 20px !important; }
  section[data-screen-label="Hero"] > div:nth-child(3) > div:last-child { flex-wrap: wrap; }
  section[data-screen-label="Hero"] > div:last-child { margin-left: 20px !important; margin-right: 20px !important; }
  section[data-screen-label="Warum CarHifi-Berlin"],
  section[data-screen-label="Kontakt"],
  section[data-screen-label="Werte"],
  section[data-screen-label="CTA"] { margin-left: 20px !important; margin-right: 20px !important; }

  section[data-screen-label] h1 { font-size: 32px !important; }
  section[data-screen-label="Hero"] h1 { font-size: 34px !important; }
  section[data-screen-label="Hero"] h1 + div { font-size: 24px !important; }

  section[data-screen-label="Leistungen Suche"] > div:first-child { flex-direction: column; align-items: stretch !important; }
  section[data-screen-label="Leistungen Suche"] > div:nth-child(2) { grid-template-columns: 1fr !important; }
  section[data-screen-label="Leistungen"] > div:last-child { grid-template-columns: repeat(2, 1fr) !important; }
  section[data-screen-label="Leistungen"] > div:last-child > div { padding: 22px 12px 18px 12px !important; }
  section[data-screen-label="Kundenstimmen"] > div:first-child > :last-child { flex-wrap: wrap; }
  section[data-screen-label="Kontakt"] > div:nth-child(2) > div:last-child { flex-wrap: wrap; justify-content: center; }
  header[data-screen-label="Header"] img { height: 38px !important; }
}

/* ============ ≤560px — small phones ============ */
@media (max-width: 560px) {
  section[data-screen-label="Warum CarHifi-Berlin"] > div:last-child { grid-template-columns: 1fr !important; }
  section[data-screen-label="Prozess"] > div:last-child { grid-template-columns: 1fr !important; }
  footer[data-screen-label="Footer"] > div:first-child { grid-template-columns: 1fr !important; gap: 22px !important; }
  footer[data-screen-label="Footer"] > div:last-child { flex-wrap: wrap; gap: 8px; }
  section[data-screen-label="Projekte"] > div:first-child,
  section[data-screen-label="Vorher Nachher"] > div:first-child { flex-wrap: wrap; gap: 14px; }
  section[data-screen-label="Buchung Inhalt"] div:has(> button) { grid-template-columns: 1fr !important; }
}
