/* ==========================================================================
   Pressure By Sal — design tokens, reset, shared layout & components
   ========================================================================== */

:root {
  --color-navy: #113F59;
  --color-steel: #284C5F;
  --color-blue: #1456C8;
  --color-aqua: #19C3D6;
  --color-signal: #B8D62F;
  --color-charcoal: #151A12;
  --color-mist: #EEF3F8;
  --color-white: #FFFFFF;
  --color-black: #000000;

  --surface: var(--color-white);
  --color-bg: var(--color-mist);
  --color-text: var(--color-navy);
  --color-text-muted: var(--color-steel);
  --color-border: #D7E0E8;
  --color-primary: var(--color-blue);
  --color-on-primary: var(--color-white);
  --color-accent: var(--color-signal);
  /* Signal lime is only 1.5:1 on mist/white, so lime *text* on light
     surfaces uses deeper shades of the same hue: -lg for large headings
     (WCAG AA 3:1), the plain token for small text (4.5:1). Fills, bars and
     navy bands keep --color-signal. */
  --color-accent-text-lg: #6E8C00;
  --color-accent-text: #587200;

  --font-display: 'Righteous', 'Righteous Fallback', sans-serif;
  --font-body: 'Inter', 'Inter Fallback', sans-serif;
}

[data-theme="dark"] {
  --surface: var(--color-charcoal);
  --color-bg: var(--color-navy);
  --color-text: var(--color-white);
  --color-text-muted: #AEBFCB;
  --color-border: var(--color-steel);
  --color-primary: var(--color-aqua);
  /* White on aqua is 2.1:1; navy on aqua is 5.2:1. */
  --color-on-primary: var(--color-navy);
  --color-accent: var(--color-signal);
  --color-accent-text-lg: var(--color-signal);
  --color-accent-text: var(--color-signal);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); background: var(--color-bg); color: var(--color-text); line-height: 1.5; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }
.section--alt { background: var(--surface); }
.section--tight { padding: 40px 0; }
.on-dark { background: var(--color-navy); color: var(--color-white); }
[data-theme="dark"] .on-dark { background: var(--color-charcoal); }
/* The global `p { color: var(--color-text-muted) }` rule below targets <p>
   directly, so it wins over .on-dark's inherited white — without this, any
   plain <p> in a dark hero band (booking.html/contact.html's subhead) is
   near-invisible muted grey on navy. */
.on-dark p { color: var(--color-white); }

h1, h2, h3 { font-family: var(--font-display); margin: 0 0 16px; line-height: 1.15; }
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
p { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent-text-lg); }
.on-dark .text-accent { color: var(--color-signal); }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 700; color: var(--color-primary); margin-bottom: 8px; }
.on-dark .eyebrow { color: var(--color-aqua); }
.section-subhead { max-width: 560px; }
.divider-chrome { height: 3px; width: 48px; background: var(--color-accent); margin: 12px 0 20px; border-radius: 2px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--color-white); color: var(--color-navy); padding: 12px 16px; z-index: 1000; }
.skip-link:focus { left: 16px; top: 16px; }

.btn { display: inline-block; padding: 14px 28px; border-radius: 12px; font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.85rem; border: none; cursor: pointer; }
.btn--primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn--outline { border: 1px solid var(--color-border); color: var(--color-text); background: transparent; }
.btn--on-brand { background: var(--color-white); color: var(--color-navy); }
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--color-border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo-lockup { display: flex; align-items: center; }
.logo-img--dark { display: none; }
[data-theme="dark"] .logo-img--light { display: none; }
[data-theme="dark"] .logo-img--dark { display: block; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.header-phone { display: flex; align-items: center; gap: 6px; color: var(--color-text); text-decoration: none; font-weight: 600; white-space: nowrap; }
.header-phone-icon { flex: 0 0 auto; }

@media (max-width: 520px) {
  /* Icon-only on narrow viewports so the number can't wrap onto a second
     line and break the header's height — text stays in the DOM (screen
     readers still announce it via the link) rather than swapped for a
     phone emoji, which renders inconsistently per OS/browser font. */
  .header-phone-text {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}
.pill-toggle { border: 1px solid var(--color-border); background: transparent; color: var(--color-text); border-radius: 20px; padding: 6px 12px; font-size: 0.8rem; }
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--color-text); }
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav a { color: var(--color-text); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.site-nav-cta { background: var(--color-primary); color: var(--color-on-primary) !important; padding: 8px 16px; border-radius: 10px; }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav { position: fixed; top: 72px; left: 0; right: 0; background: var(--surface); flex-direction: column; align-items: flex-start; padding: 16px 24px; border-bottom: 1px solid var(--color-border); transform: translateY(-150%); transition: transform 0.2s ease; }
  .site-nav.is-open { transform: translateY(0); }
}

/* Hero */
.hero { padding: 56px 0; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero-eyebrows { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.pill { background: rgba(20, 86, 200, 0.1); border: 1px solid rgba(20, 86, 200, 0.3); color: var(--color-primary); padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.hero-body { max-width: 460px; font-size: 1.05rem; }
.hero-image img { border-radius: 16px; object-fit: cover; width: 100%; height: 420px; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-image img { height: 260px; }
}

/* Services carousel (index.html). Structure mirrors Tire Service Plus's
   css/main.css exactly (scroll-snap, centering padding tied to
   --carousel-card-width, overflow-anchor:none) — home-carousel.js's
   loop-jump math assumes every real card, including the first/last, can
   actually reach true center, which only happens with this exact padding
   formula. Deliberately NOT setting scroll-behavior:smooth or a container-
   level `perspective` here: the JS resets scrollLeft instantly during the
   loop-jump (see js/home-carousel.js), and scroll-behavior:smooth would
   animate that "instant" reset as a visible glide; perspective is applied
   per-card inline by the JS instead (see its own comment), so a second,
   container-level perspective would stack a redundant 3D context on top. */
.services-carousel-wrap {
  --carousel-card-width: 280px;
  position: relative;
  isolation: isolate;
  margin-top: 32px;
}
.services-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overflow-anchor: none;
  gap: 20px;
  padding: 24px calc(50% - (var(--carousel-card-width) / 2)) 24px;
  scrollbar-width: none;
  min-height: 277px;
}
.services-carousel::-webkit-scrollbar { display: none; }
.card { flex: 0 0 280px; background: var(--surface); border: 1px solid var(--color-border); border-radius: 16px; padding: 24px; text-decoration: none; color: var(--color-text); display: block; }
.services-carousel .card {
  flex: 0 0 var(--carousel-card-width);
  scroll-snap-align: center;
  transition: transform 0.1s linear, opacity 0.1s linear, box-shadow 0.15s ease, border-color 0.15s ease;
  will-change: transform;
}
.services-carousel .card:hover { border-color: var(--color-primary); }
.service-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(20, 86, 200, 0.12); margin-bottom: 16px; display: flex; align-items: center; justify-content: center; color: var(--color-primary); }
.card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.card p { font-size: 0.9rem; margin-bottom: 12px; }
.service-price { color: var(--color-primary); font-weight: 700; font-size: 0.85rem; }
.carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 60; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--color-border); background: var(--surface); color: var(--color-text); cursor: pointer; }
.carousel-arrow--prev { left: -8px; }
.carousel-arrow--next { right: -8px; }
.carousel-progress { height: 4px; background: var(--color-border); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.carousel-progress-fill { height: 100%; background: var(--color-accent); width: 0%; transition: width 0.1s linear; }

@media (prefers-reduced-motion: reduce) {
  .services-carousel .card { transition: box-shadow 0.15s ease, border-color 0.15s ease; }
  .carousel-progress-fill { transition: none; }
}

/* about.html plain grid */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 24px; }

/* Why-us */
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.why-list { list-style: none; padding: 0; margin: 20px 0; display: flex; flex-direction: column; gap: 10px; }
.why-list li { padding-left: 28px; position: relative; }
.why-list li::before { content: '✓'; position: absolute; left: 0; color: var(--color-accent); font-weight: 700; }
.why-image img { border-radius: 16px; height: 360px; object-fit: cover; }
@media (max-width: 860px) { .why-grid { grid-template-columns: 1fr; } }

/* Gallery */
.before-after-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 32px; }
.before-after-pair h3 { font-size: 1.1rem; margin-bottom: 12px; text-align: center; }
.before-after-images { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.before-after-item { position: relative; border-radius: 12px; overflow: hidden; }
.before-after-item img { width: 100%; height: 180px; object-fit: cover; display: block; }
.before-after-tag { position: absolute; top: 8px; left: 8px; background: rgba(17, 26, 18, 0.75); color: var(--color-white); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 6px; z-index: 1; }
@media (max-width: 860px) { .before-after-grid { grid-template-columns: 1fr; max-width: 420px; margin-left: auto; margin-right: auto; } }

/* CTA band */
.cta-band { background: var(--color-primary); color: var(--color-on-primary); }
.cta-band h2 { color: var(--color-on-primary); margin: 0; }
.cta-band-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }

/* Footer */
.site-footer { background: var(--color-navy); color: var(--color-white); padding: 48px 0 24px; }
[data-theme="dark"] .site-footer { background: var(--color-charcoal); }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.site-footer h2 { color: var(--color-white); font-size: 1rem; }
.site-footer p, .site-footer a { color: rgba(255,255,255,0.75); }
.footer-nav { display: flex; flex-direction: column; gap: 8px; }
.footer-nav a, .hours-list a { text-decoration: none; }
.hours-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.hours-list li { display: flex; justify-content: space-between; font-size: 0.9rem; }
.hours-list li.is-today { color: var(--color-accent); font-weight: 700; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.15); font-size: 0.8rem; }
.footer-legal { display: flex; gap: 16px; }
/* The footer is always dark-styled regardless of the page's own light/dark
   theme, but .pill-toggle's default color is --color-text (navy in light
   theme) — nearly invisible against the navy/charcoal footer background.
   Force it light here specifically. */
.site-footer .pill-toggle { color: var(--color-white); border-color: rgba(255,255,255,0.4); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } }

/* Forms (shared by contact + booking) */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.85rem; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--color-border); background: var(--surface); color: var(--color-text); font-family: inherit; font-size: 0.95rem; }
.field.is-error input, .field.is-error textarea { border-color: #C62828; }
.form-error { color: #C62828; font-weight: 600; margin-bottom: 16px; }

/* Mobile CTA bar + toast */
.mobile-cta-bar { display: none; }
@media (max-width: 700px) {
  .mobile-cta-bar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; z-index: 90; padding-bottom: env(safe-area-inset-bottom, 0); }
  .mobile-cta-btn { flex: 1; text-align: center; padding: 14px; text-decoration: none; font-weight: 700; text-transform: uppercase; font-size: 0.8rem; }
  .mobile-cta-btn--call { background: var(--color-navy); color: var(--color-white); }
  .mobile-cta-btn--book { background: var(--color-primary); color: var(--color-on-primary); }
  /* Reserves space so the fixed bar above never covers real page content
     (e.g. the footer's theme toggle) — without this, anything at the
     bottom of the page sits underneath the bar instead of above it. */
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0)); }
}
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120%); background: var(--color-navy); color: var(--color-white); padding: 14px 24px; border-radius: 10px; z-index: 100; transition: transform 0.2s ease; }
.toast.is-visible { transform: translateX(-50%) translateY(0); }
.toast--error { background: #C62828; }
.toast--success { background: #2E7D32; }

.related-services-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }
.related-services-list a { color: var(--color-primary); text-decoration: none; font-weight: 600; }

/* Add-on toggle grid: shared by contact.html's form and js/booking.js's
   step 3, so it lives here rather than in css/contact.css (which
   booking.html never loads). */
.add-on-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 20px 0; }
.add-on-toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border-radius: 10px; border: 1px solid var(--color-border); background: var(--surface); color: var(--color-text); cursor: pointer; text-align: left; }
.add-on-toggle.is-active { border-color: var(--color-primary); background: rgba(20, 86, 200, 0.08); }
.add-on-label { font-weight: 600; font-size: 0.9rem; }
.add-on-price { color: var(--color-accent-text); font-weight: 700; font-size: 0.85rem; }
