/* ---------- Design tokens ---------- */
:root {
  --color-primary: #0b5cab;
  --color-primary-dark: #084a89;
  --color-accent: #ffb703;
  --color-ink: #14213d;
  --color-body: #3a4557;
  --color-bg: #ffffff;
  --color-bg-alt: #f4f7fb;
  --color-border: #e1e7f0;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(20, 33, 61, 0.08);
  --max-width: 1120px;

  /* Footer is intentionally always-dark, independent of light/dark page theme */
  --footer-bg: #0f1b30;
  --footer-heading: #ffffff;
  --footer-text: #c3cbdb;
  --footer-link: #cfe0f7;

  font-size: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-ink: #eef2fb;
    --color-body: #c3cbdb;
    --color-bg: #10151f;
    --color-bg-alt: #161d2b;
    --color-border: #26304a;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* Fallback if JS hasn't measured the sticky header yet; main.js overrides with the exact height. */
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-body);
  background: var(--color-bg);
  line-height: 1.5;
}

h1, h2, h3 {
  color: var(--color-ink);
  line-height: 1.2;
  margin: 0 0 .5em;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

a { color: var(--color-primary); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: .75rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: .85rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  padding: .85rem 1.25rem;
}

.logo {
  order: 1;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
  margin-right: auto;
}
.logo span { color: var(--color-primary); }

/* Desktop phone + CTA cluster; hidden on mobile in favor of the nav drawer's own actions */
.header-actions {
  order: 2;
  display: none;
  align-items: center;
  gap: 1rem;
}

.call-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  color: var(--color-ink);
  font-weight: 700;
  white-space: nowrap;
}
.call-btn svg { width: 18px; height: 18px; fill: var(--color-primary); flex-shrink: 0; }

.header-actions .nav-cta {
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  padding: .6rem 1.1rem;
  white-space: nowrap;
}

.nav-toggle {
  order: 3;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-ink);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav {
  order: 4;
  flex-basis: 100%;
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  border-top: 1px solid transparent;
}
.primary-nav.open {
  max-height: 400px;
  border-top-color: var(--color-border);
}
.primary-nav.no-anim { transition: none; }
.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: .5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.primary-nav a {
  display: block;
  padding: .6rem .25rem;
  color: var(--color-ink);
  text-decoration: none;
  font-weight: 600;
}
.nav-mobile-actions {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: .5rem 0 1rem;
}
.nav-mobile-actions .call-link {
  text-align: center;
  padding: .6rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-ink);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.nav-mobile-actions .nav-cta {
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  padding: .75rem;
}

/* ---------- Hero ---------- */
.hero {
  background-image:
    linear-gradient(160deg, rgba(11, 92, 171, .90) 0%, rgba(8, 74, 137, .94) 100%),
    url('../assets/images/hero-windshield-900.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  padding: 3.5rem 0;
}
.hero-inner { display: flex; }
.hero-copy { width: 100%; }
.hero h1 { color: #fff; }
.hero p { color: #dce8f8; font-size: 1.05rem; max-width: 40ch; }

/* ---------- Trust strip ---------- */
.trust-strip {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}
.trust-strip-inner {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  padding: 1.1rem 1.25rem;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 600;
  font-size: .9rem;
  color: var(--color-ink);
}
.trust-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Sections ---------- */
.section { padding: 3rem 0; }
.section-alt { background: var(--color-bg-alt); }
.section-lede { max-width: 60ch; }

/* ---------- Service cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(11, 92, 171, .1);
  margin-bottom: .75rem;
}
.card-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card h3 { margin-bottom: .35rem; }
.card p { margin: 0; font-size: .95rem; }

/* ---------- Hours & Locations ---------- */
.hours-locations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.hours-card, .location-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.hours-table {
  width: 100%;
  border-collapse: collapse;
}
.hours-table th, .hours-table td {
  text-align: left;
  padding: .4rem 0;
  font-weight: 400;
  border-bottom: 1px solid var(--color-border);
  font-size: .95rem;
}
.hours-table th { color: var(--color-ink); font-weight: 600; }
.hours-table tr:last-child th,
.hours-table tr:last-child td { border-bottom: none; }
.hours-note { font-size: .85rem; margin: .75rem 0 0; }
address { font-style: normal; }

/* ---------- Map card ---------- */
.map-card {
  margin-top: 1.25rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.map-card-copy h3 { margin-bottom: .35rem; }
.map-card-copy p { margin-bottom: .75rem; }
.map-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
}
.map-links a { font-weight: 600; text-decoration: none; }
.map-links a:hover { text-decoration: underline; }
.map-visual { width: 100%; }
.map-embed {
  position: relative;
  width: 100%;
  padding-bottom: 55%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.map-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(0.15) contrast(1.02);
}
@media (prefers-color-scheme: dark) {
  .map-embed iframe { filter: invert(90%) hue-rotate(180deg) grayscale(0.2) contrast(0.95); }
}
:root[data-theme="dark"] .map-embed iframe { filter: invert(90%) hue-rotate(180deg) grayscale(0.2) contrast(0.95); }
:root[data-theme="light"] .map-embed iframe { filter: grayscale(0.15) contrast(1.02); }
.map-attribution { font-size: .75rem; margin: .4rem 0 0; opacity: .75; }

/* ---------- Contact form ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
  align-items: start;
}
.contact-form { max-width: 640px; }
.form-row { margin-bottom: 1rem; }
.form-row-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
label {
  display: block;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: .35rem;
  font-size: .95rem;
}
input, select, textarea {
  width: 100%;
  padding: .7rem .8rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-weight: 400;
  font-size: .9rem;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: .15rem;
  accent-color: var(--color-primary);
}
.captcha-disclosure {
  font-size: .8rem;
  opacity: .75;
  margin: .75rem 0 0;
}
.captcha-disclosure a { color: inherit; text-decoration: underline; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; font-weight: 600; }
.form-status[data-state="success"] { color: #1a7f37; }
.form-status[data-state="error"] { color: #c92a2a; }
#submitBtn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Contact side panel ---------- */
.contact-side {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.contact-side h3 { margin-bottom: .5rem; }
.contact-side > p:not(.contact-side-item) { font-size: .95rem; }
.contact-side-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .6rem;
}
.contact-side-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-side-item a { font-weight: 600; text-decoration: none; color: var(--color-ink); }
.contact-side hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.25rem 0;
}
.contact-side .hours-table { font-size: .9rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 2.5rem 0 1.5rem;
  margin-top: 2rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: flex-start;
}
.footer-brand { color: var(--footer-heading); font-weight: 700; font-size: 1.1rem; margin-bottom: .25rem; }
.site-footer a { color: var(--footer-link); }
.social-links { display: flex; gap: .75rem; }
.social-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}
.social-icon svg { width: 18px; height: 18px; fill: #fff; }
.copyright { margin-top: 1.5rem; font-size: .85rem; opacity: .8; }

/* ---------- Breakpoints ---------- */
@media (min-width: 640px) {
  .form-row-split { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-strip-inner { flex-direction: row; justify-content: center; gap: 2.5rem; }
}

@media (min-width: 860px) {
  .header-actions { display: flex; }
  .nav-toggle { display: none; }
  .nav-mobile-actions { display: none; }
  .primary-nav {
    order: 2;
    flex-basis: auto;
    flex: 1;
    max-height: none;
    overflow: visible;
    border-top: none;
  }
  .primary-nav ul {
    flex-direction: row;
    align-items: center;
    gap: 1.75rem;
    padding: 0;
  }
  .header-actions { order: 3; }
  .hero {
    padding: 6rem 0;
    background-image:
      linear-gradient(160deg, rgba(11, 92, 171, .85) 0%, rgba(8, 74, 137, .90) 100%),
      url('../assets/images/hero-windshield-1920.jpg');
  }
  .hero-copy { max-width: 600px; }
  h1 { font-size: 2.6rem; }
  h2 { font-size: 2rem; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .card-grid--compact { grid-template-columns: repeat(2, 1fr); }
  .hours-locations-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: minmax(0, 640px) 1fr; }
  .contact-form { max-width: none; }
  .map-card { flex-direction: row; align-items: stretch; }
  .map-card-copy { flex: 0 0 34%; align-self: center; }
  .map-visual { flex: 1; align-self: stretch; display: flex; flex-direction: column; }
  .map-embed { flex: 1; padding-bottom: 0; height: auto; min-height: 340px; }
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }
}
