/* ==========================================================================
   Star Smog — Arvin, CA
   Design tokens + system CSS. Blue/white base, red reserved for coupon only,
   gold reserved for star-rating accents. WCAG 2.2 AA throughout.
   ========================================================================== */

:root {
  /* Color tokens */
  --blue-900: #073a63;
  --blue-700: #0a4d82;
  --blue-600: #0a66c2;   /* primary */
  --blue-100: #e8f1fb;
  --blue-50:  #f4f9fd;

  --ink-900: #14181f;
  --ink-700: #3a4250;
  --ink-500: #667085;
  --line: #dde3ea;

  --white: #ffffff;
  --bg: #ffffff;
  --bg-alt: var(--blue-50);

  --coupon-red: #d0342c;     /* coupon accent ONLY */
  --coupon-red-dark: #a3241e;
  --gold: #c98a12;           /* star ratings ONLY */

  --success: #1e7d3c;
  --focus-ring: #0a66c2;

  /* Type */
  --font-body: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;

  /* Layout */
  --maxw: 1160px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(20, 24, 31, 0.08);
  --shadow-md: 0 6px 20px rgba(10, 40, 70, 0.12);
  --shadow-lg: 0 16px 40px rgba(10, 40, 70, 0.18);

  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.5rem; --space-6: 2rem; --space-8: 3rem; --space-10: 4rem; --space-12: 5rem;

  --mobile-bar-h: 64px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  padding-bottom: var(--mobile-bar-h);
}
img { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: underline; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-900); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; color: var(--blue-900); margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; color: var(--ink-700); }
ul, ol { color: var(--ink-700); }
.small { font-size: .85rem; color: var(--ink-500); }

/* ── Focus visibility (WCAG 2.2 AA) ── */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Skip link ── */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--blue-900); color: #fff; padding: .75rem 1.25rem;
  z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ── Layout helpers ── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: var(--space-10) 0; }
.section-alt { background: var(--bg-alt); }
.center { text-align: center; }
.eyebrow { color: var(--blue-600); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .8rem; }
.lede { font-size: 1.1rem; max-width: 640px; }
.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-weight: 700; text-decoration: none; border-radius: var(--radius-sm);
  padding: .85rem 1.4rem; min-height: 44px; border: 2px solid transparent;
  cursor: pointer; font-size: 1rem; transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-900); color: #fff; }
.btn-outline { background: #fff; color: var(--blue-600); border-color: var(--blue-600); }
.btn-outline:hover { background: var(--blue-50); color: var(--blue-900); }
.btn-coupon { background: var(--coupon-red); color: #fff; }
.btn-coupon:hover { background: var(--coupon-red-dark); color: #fff; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ── Header ── */
.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(8px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.25rem; max-width: var(--maxw); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--blue-900); }
.brand-badge { font-size: .68rem; color: var(--blue-600); font-weight: 700; letter-spacing: .04em; }
.main-nav { display: flex; align-items: center; gap: 1.4rem; }
.main-nav a { color: var(--ink-700); text-decoration: none; font-weight: 600; font-size: .95rem; }
.main-nav a[aria-current="page"] { color: var(--blue-600); }
.main-nav a:hover { color: var(--blue-600); }
.header-cta { display: flex; gap: .6rem; align-items: center; }
.nav-toggle {
  display: none; background: none; border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: .5rem .7rem; min-height: 44px; min-width: 44px;
}
.mobile-menu { display: none; }
.mobile-menu.open {
  display: block; position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
  padding: 1rem 1.25rem;
}
.mobile-menu a { display: block; padding: .7rem 0; color: var(--ink-900); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); }
.mobile-menu a:last-child { border-bottom: none; }

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

/* ── Breadcrumb ── */
.breadcrumb-bar { background: var(--blue-50); border-bottom: 1px solid var(--line); }
.breadcrumb { list-style: none; display: flex; gap: .4rem; padding: .6rem 0; margin: 0; font-size: .85rem; flex-wrap: wrap; }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: .4rem; color: var(--ink-500); }
.breadcrumb a { color: var(--blue-700); text-decoration: none; }
.breadcrumb [aria-current="page"] { color: var(--ink-500); }

/* ── Hero ── */
.hero { background: linear-gradient(180deg, var(--blue-50) 0%, #fff 100%); padding: var(--space-10) 0 var(--space-8); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--space-8); align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { margin-bottom: .5rem; }
.hero .subhead { font-size: 1.15rem; color: var(--ink-700); margin-bottom: 1.4rem; }
.badge-row { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1.2rem 0 0; padding: 0; list-style: none; }
.badge { background: var(--blue-100); color: var(--blue-900); font-size: .8rem; font-weight: 700; padding: .4rem .7rem; border-radius: 999px; }
.hero-media {
  background: var(--blue-100); border: 1px solid var(--line); border-radius: var(--radius-lg);
  aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* ── Trust bar ── */
.trust-bar { background: var(--blue-900); color: #fff; padding: var(--space-4) 0; }
.trust-list { display: flex; gap: var(--space-6); flex-wrap: wrap; list-style: none; margin: 0; padding: 0; justify-content: center; font-size: .92rem; font-weight: 600; }
.trust-list li { display: flex; align-items: center; gap: .5rem; }
.trust-list a { color: #fff; text-decoration: underline; }

/* ── Cards ── */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-6); box-shadow: var(--shadow-sm); height: 100%; }
.card h3 { margin-bottom: .5rem; }
.icon-badge {
  width: 48px; height: 48px; border-radius: 50%; background: var(--blue-100); color: var(--blue-600);
  display: flex; align-items: center; justify-content: center; margin-bottom: 1rem;
}
.icon-badge svg { width: 24px; height: 24px; }
.card-link { font-weight: 700; text-decoration: none; }

/* ── Steps ── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.step { text-align: center; }
.step-num {
  width: 44px; height: 44px; border-radius: 50%; background: var(--blue-600); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; margin: 0 auto .8rem;
}

/* ── Coupon ── */
.coupon-card {
  border: 3px dashed var(--coupon-red); border-radius: var(--radius-lg); background: #fff;
  padding: var(--space-8); text-align: center; box-shadow: var(--shadow-md); position: relative;
}
.coupon-card .price { color: var(--coupon-red); font-family: var(--font-display); font-size: clamp(2.6rem, 8vw, 3.8rem); font-weight: 700; line-height: 1; }
.coupon-card .fine { color: var(--ink-500); font-size: .85rem; }
.coupon-card .cert-fee { font-size: 1rem; color: var(--ink-700); margin-top: -.5rem; }

@media print {
  body * { visibility: hidden; }
  .coupon-print, .coupon-print * { visibility: visible; }
  .coupon-print { position: absolute; top: 0; left: 0; width: 100%; }
  .coupon-card { border-color: #000; box-shadow: none; }
  .coupon-card .price, .coupon-card h2, .coupon-card h3 { color: #000 !important; }
}

/* ── Comparison table ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
thead th { background: var(--blue-50); color: var(--blue-900); font-family: var(--font-display); }
tbody tr:last-child td { border-bottom: none; }

/* ── FAQ ── */
.faq-search { margin-bottom: var(--space-6); }
.faq-search input {
  width: 100%; padding: .9rem 1.1rem; border: 2px solid var(--line); border-radius: var(--radius-sm); font-size: 1rem;
}
.faq-group h2 { margin-top: var(--space-8); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; padding: 1.1rem 2.2rem 1.1rem 0;
  font-weight: 700; font-size: 1.02rem; color: var(--ink-900); cursor: pointer; position: relative; min-height: 44px;
}
.faq-q::after {
  content: "+"; position: absolute; right: .2rem; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; color: var(--blue-600); font-weight: 400;
}
.faq-q[aria-expanded="true"]::after { content: "–"; }
.faq-a { padding: 0 0 1.2rem; display: none; color: var(--ink-700); }
.faq-a[data-open="true"] { display: block; }
.faq-item.hidden { display: none; }

/* ── Reviews ── */
.review-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-5); background: #fff; }
.stars { color: var(--gold); letter-spacing: .1em; font-size: 1.1rem; }
.review-name { font-weight: 700; margin-top: .6rem; }
.review-placeholder { border: 2px dashed var(--line); color: var(--ink-500); }

/* ── Map / contact ── */
.map-frame { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 16/9; }
.map-frame iframe { width: 100%; height: 100%; border: 0; }
.hours-table td:first-child { color: var(--ink-700); }
.hours-table td:last-child { font-weight: 700; text-align: right; }

/* ── CTA banner ── */
.cta-banner { background: var(--blue-900); color: #fff; padding: var(--space-8) 0; text-align: center; }
.cta-banner h2 { color: #fff; }
.cta-banner p { color: #cfe0f2; }

/* ── Footer ── */
.site-footer { background: var(--ink-900); color: #cbd3df; padding: var(--space-10) 0 var(--space-6); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-6); }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-heading { color: #fff; font-weight: 700; margin-bottom: .8rem; font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: #cbd3df; text-decoration: none; font-size: .92rem; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid #2a313d; margin-top: var(--space-8); padding-top: var(--space-5); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem; font-size: .85rem; }
.footer-bottom a { color: #cbd3df; }

/* ── Sticky mobile action bar ── */
.mobile-bar {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--mobile-bar-h); z-index: 150;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.08);
}
@media (min-width: 861px) { .mobile-bar { display: none; } }
.mobile-bar a, .mobile-bar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: .72rem; font-weight: 700; text-decoration: none; border: none; background: none; cursor: pointer;
}
.mobile-bar a:nth-child(1) { color: var(--blue-700); }
.mobile-bar a:nth-child(2) { color: var(--ink-700); }
.mobile-bar button, .mobile-bar a:nth-child(3) { color: var(--coupon-red); }
.mobile-bar svg { width: 22px; height: 22px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,20,35,.55); display: none;
  align-items: center; justify-content: center; z-index: 300; padding: 1.25rem;
}
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius-lg); max-width: 420px; width: 100%; padding: var(--space-8); position: relative; }
.modal-close { position: absolute; top: .8rem; right: .8rem; width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--blue-50); font-size: 1.2rem; cursor: pointer; }

/* ── TODO photo placeholder ── */
.TODO-photo {
  background: repeating-linear-gradient(45deg, var(--blue-50), var(--blue-50) 10px, #fff 10px, #fff 20px);
  border: 1px dashed var(--blue-600); display: flex; align-items: center; justify-content: center;
  color: var(--blue-700); font-size: .8rem; font-weight: 700; text-align: center; padding: 1rem;
  min-height: 160px; border-radius: var(--radius-md);
}

/* ── Scroll reveal ── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ── Visually hidden ── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
