/* ==========================================================================
   Reusable components — buttons, inputs, cards, header, footer, nav, badges
   ========================================================================== */

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 1rem 2rem;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: var(--fs-sm);
  line-height: 1;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn-primary {
  background: var(--mint);
  color: var(--ink);
  box-shadow: var(--shadow-mint);
}
.btn-primary:hover { background: var(--mint-600); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(1,215,166,.34); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--white);
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-secondary:hover { border-color: var(--mint); background: var(--mint-050); }

.btn-ghost {
  color: var(--mint-700);
  padding: 0.5rem 0;
  text-underline-offset: 4px;
}
.btn-ghost:hover { text-decoration: underline; }

.btn-block { width: 100%; }
.btn-sm { padding: .625rem 1.25rem; font-size: var(--fs-xs); }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none !important; }

/* Inputs --------------------------------------------------------------------- */
/* position: relative is set defensively on every field wrapper — cheap
   insurance so that if a custom dropdown/panel is ever added inside a .field,
   it has a sane positioned ancestor to anchor against instead of falling back
   to <body> (see the /book dropdown-positioning diagnosis). */
.field { display: flex; flex-direction: column; gap: var(--sp-2); position: relative; min-width: 0; }
.field label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-700);
}
.field .hint { font-size: var(--fs-xs); color: var(--ink-400); }

.input, .select, .textarea {
  min-height: 56px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: var(--white);
  padding: 0 var(--sp-4);
  font-size: 1rem;
  width: 100%;
  min-width: 0;
}
.textarea { min-height: 120px; padding: var(--sp-4); resize: vertical; line-height: 1.6; }

.select {
  appearance: none;
  padding-inline-end: 3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%235A7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.125rem center;
  cursor: pointer;
}
.select:disabled { background-color: var(--surface-2); color: var(--ink-400); cursor: not-allowed; }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 4px var(--mint-050);
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: var(--red);
  background: var(--red-050);
}
.field .error-message {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--red);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.field .error-message svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Two-up field row — shared by every form on the site (contact, driver
   signup, review, booking wizard). Single column by default; only becomes a
   2-column row with the --2up or --date-time modifier, and only ≥600px, so
   short related fields (first/last name, email/phone) sit side by side
   without ever cramming a field below 280px wide (§A4). */
.field-row { display: grid; grid-template-columns: 1fr; gap: 1.25rem; min-width: 0; }
@media (min-width: 600px) {
  .field-row--2up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row--date-time { grid-template-columns: 1fr 1.2fr; }
}

/* Google Places autocomplete dropdown — shared by any page with an
   address field wired to address-autocomplete.js (booking wizard, home hero
   quote form). Google appends .pac-container directly to <body> and
   positions it itself via getBoundingClientRect() of the focused input —
   our CSS only controls its appearance and stacking, never its position. */
.pac-container {
  z-index: var(--z-autocomplete) !important;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-body), system-ui, sans-serif;
  margin-top: 4px;
  background: var(--white);
}
.pac-item { padding: 12px 14px; font-size: .95rem; cursor: pointer; border-top: 1px solid var(--line); }
.pac-item:first-child { border-top: 0; }
.pac-item:hover, .pac-item-selected { background: var(--mint-050); }
.pac-item-query { color: var(--ink); font-weight: 600; }
.pac-icon { display: none; }
.pac-logo::after { margin: 6px 8px; }

.checkbox-row { display: flex; align-items: flex-start; gap: var(--sp-3); }
.checkbox-row input[type="checkbox"], .checkbox-row input[type="radio"] {
  width: 20px; height: 20px; margin-top: 2px; accent-color: var(--mint-700); flex-shrink: 0;
}

/* Cards ----------------------------------------------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-pad { padding: var(--sp-6); }

/* Badges -------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: .25rem .75rem;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.badge-mint { background: var(--mint-050); color: var(--mint-700); }
.badge-amber { background: var(--amber-050); color: #8A5A00; }
.badge-green { background: #E7F6EC; color: var(--green); }
.badge-red { background: var(--red-050); color: var(--red); }

/* Header / nav ----------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.page-home .site-header {
  background: transparent;
  border-bottom-color: transparent;
  transition: background var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}
.page-home .site-header.is-scrolled {
  background: var(--white);
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.site-header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink);
}
.logo span { color: var(--mint-700); }

.main-nav { display: flex; align-items: center; gap: var(--sp-6); }
.main-nav ul { display: flex; gap: var(--sp-5); align-items: center; }
.main-nav a {
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--ink-700);
  position: relative;
  padding-block: var(--sp-2);
}
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 2px;
  background: var(--mint);
  transition: right var(--dur-fast) var(--ease-out);
}
.main-nav a:hover::after { right: 0; }

.header-phone {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
  color: var(--ink);
}
@media (min-width: 1200px) {
  .header-phone { display: inline-flex; }
}

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
}
@media (max-width: 960px) {
  .main-nav > ul, .header-cta { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* Mega dropdown */
.has-dropdown { position: relative; }
.mega-dropdown {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-dropdown);
  width: 640px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-5);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  opacity: 0;
  visibility: hidden;
  translate: 0 8px;
  transition: opacity var(--dur-fast) var(--ease-out), translate var(--dur-fast) var(--ease-out);
}
.has-dropdown:hover .mega-dropdown,
.has-dropdown:focus-within .mega-dropdown {
  opacity: 1; visibility: visible; translate: 0 0;
}
.mega-dropdown a {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--sp-3);
  border-radius: var(--r-md);
}
.mega-dropdown a:hover { background: var(--surface); }
.mega-dropdown .service-name { font-weight: 700; color: var(--ink); }
.mega-dropdown .service-summary { font-size: var(--fs-xs); color: var(--ink-500); font-weight: 400; }

/* Mobile nav overlay */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: var(--white);
  transform: translateX(100%);
  transition: transform var(--dur-med) var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav-header { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-5) var(--gutter); border-bottom: 1px solid var(--line); }
.mobile-nav-body { padding: var(--sp-5) var(--gutter); flex: 1; }
.mobile-nav-body ul { display: flex; flex-direction: column; }
.mobile-nav-body a { display: block; padding: var(--sp-4) 0; font-size: 1.125rem; font-weight: 700; border-bottom: 1px solid var(--line); }
.mobile-nav-footer { padding: var(--sp-5) var(--gutter); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--sp-3); }

/* CSS-only fallback toggle (no-JS) */
.nav-checkbox { position: absolute; opacity: 0; pointer-events: none; }
.nav-checkbox:checked ~ .mobile-nav { transform: translateX(0); }

/* Footer -------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--mint-050); }
.footer-cta-band {
  background: var(--mint);
  color: var(--ink);
  padding-block: var(--sp-7);
}
.footer-cta-band .container { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); flex-wrap: wrap; }
.footer-main { padding-block: var(--sp-8); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: var(--sp-6); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 { color: var(--white); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; margin-bottom: var(--sp-4); }
.footer-col ul { display: flex; flex-direction: column; gap: var(--sp-3); }
.footer-col a { color: rgba(232,251,245,.75); font-size: var(--fs-sm); }
.footer-col a:hover { color: var(--mint); }
.footer-legal {
  border-top: 1px solid rgba(232,251,245,.12);
  padding-block: var(--sp-5);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--sp-3);
  font-size: var(--fs-xs);
  color: rgba(232,251,245,.6);
}
.footer-legal a { color: rgba(232,251,245,.75); }
.social-row { display: flex; gap: var(--sp-3); }
.social-row a {
  width: 36px; height: 36px;
  border-radius: var(--r-pill);
  background: rgba(232,251,245,.08);
  display: flex; align-items: center; justify-content: center;
}
.social-row svg { width: 18px; height: 18px; fill: currentColor; }

/* Breadcrumbs ----------------------------------------------------------------- */
.breadcrumbs { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--ink-400); flex-wrap: wrap; }
.breadcrumbs a { color: var(--ink-500); }
.breadcrumbs a:hover { color: var(--mint-700); }
.breadcrumbs .sep { color: var(--ink-400); }

/* Flash messages -------------------------------------------------------------- */
.flash { border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-5); font-weight: 600; display: flex; gap: var(--sp-3); align-items: flex-start; }
.flash-success { background: #E7F6EC; color: #1E6E3D; }
.flash-error { background: var(--red-050); color: var(--red); }
.flash-info { background: var(--mint-050); color: var(--mint-700); }

/* Accordion (FAQ) --------------------------------------------------------------- */
.accordion-item { border-bottom: 1px solid var(--line); }
.accordion-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-5) 0;
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.accordion-item summary::-webkit-details-marker { display: none; }
.accordion-item summary .chev { flex-shrink: 0; transition: transform var(--dur-fast) var(--ease-out); }
.accordion-item[open] summary .chev { transform: rotate(180deg); }
.accordion-item .accordion-body { padding-bottom: var(--sp-5); color: var(--ink-500); max-width: 65ch; }

/* Star rating ------------------------------------------------------------------- */
.stars { display: inline-flex; gap: 2px; color: var(--amber); }
.stars svg { width: 16px; height: 16px; fill: currentColor; }

/* Trust row --------------------------------------------------------------------- */
.trust-row { display: flex; gap: var(--sp-5); flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-700); }
.trust-item svg { width: 20px; height: 20px; color: var(--mint-700); flex-shrink: 0; }

/* Value strip ------------------------------------------------------------------- */
.value-strip { background: var(--mint-050); padding-block: var(--sp-5); }
.value-strip ul { display: flex; justify-content: center; gap: var(--sp-8); flex-wrap: wrap; }
.value-strip li { display: flex; align-items: center; gap: var(--sp-2); font-weight: 700; color: var(--ink); font-size: var(--fs-sm); }
.value-strip svg { width: 20px; height: 20px; color: var(--mint-700); }

/* Section heading helper --------------------------------------------------------- */
.eyebrow { display: inline-block; color: var(--mint-700); font-weight: 700; font-size: var(--fs-sm); letter-spacing: .04em; text-transform: uppercase; margin-bottom: var(--sp-3); }
.section-head { max-width: 640px; margin-bottom: var(--sp-7); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { color: var(--ink-500); margin-top: var(--sp-3); }

/* Skip-to-content reveal handled in base.css */

/* Cookie consent banner -------------------------------------------------------- */
.cookie-consent {
  position: fixed;
  left: var(--sp-4); right: var(--sp-4); bottom: var(--sp-4);
  z-index: var(--z-cookie);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.cookie-consent-inner {
  max-width: var(--container);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
}
.cookie-consent p { font-size: var(--fs-sm); color: var(--ink-500); margin: 0; }

/* Lightbox ----------------------------------------------------------------------- */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(12,31,41,.92);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-6);
}
.lightbox-img { max-width: 90vw; max-height: 85vh; border-radius: var(--r-md); }
.lightbox-close {
  position: absolute; top: var(--sp-5); right: var(--sp-5);
  color: var(--white); width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill); background: rgba(255,255,255,.1);
}
.lightbox-close:hover { background: rgba(255,255,255,.2); }
.lightbox-nav {
  position: absolute; top: 50%; translate: 0 -50%;
  color: var(--white); width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill); background: rgba(255,255,255,.1);
}
.lightbox-nav:hover { background: rgba(255,255,255,.2); }
.lightbox-prev { left: var(--sp-5); }
.lightbox-next { right: var(--sp-5); }
@media (max-width: 600px) { .lightbox-prev { left: var(--sp-2); } .lightbox-next { right: var(--sp-2); } }

/* Responsive images (§B4) --------------------------------------------------------
   Every image on the site sits inside a fixed-aspect-ratio .media box, so a
   missing/broken file leaves a neutral surface-2 block instead of a
   collapsed section or a torn-icon placeholder (§B5). */
.media {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); background: var(--surface-2); margin: 0;
}
.media::before { content: ""; display: block; }
.media--16x9::before  { padding-block-start: 56.25%; }
.media--4x3::before   { padding-block-start: 75%; }
.media--3x2::before   { padding-block-start: 66.67%; }
.media--1x1::before   { padding-block-start: 100%; }
.media--16x10::before { padding-block-start: 62.5%; }
.media--191x100::before { padding-block-start: 52.36%; }
.media > picture, .media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: var(--surface-2);
}
.media img { transition: transform .5s cubic-bezier(.2,.7,.3,1); }
.media img.is-broken { opacity: 0; } /* onerror hides the <img>, leaving the surface-2 background */
.card .media, .card-hover .media { border-radius: inherit; } /* no double-rounded mismatch inside a card */

/* Interactive image cards get a subtle zoom on hover; skipped entirely under
   prefers-reduced-motion (§B4). */
.media-hover:hover img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) {
  .media img { transition: none; }
  .media-hover:hover img { transform: none; }
}

.media-caption { font-size: var(--fs-sm); color: var(--ink-500); margin-top: var(--sp-2); }

/* Service tile card — shared by the home services grid and the /services hub -- */
.service-tile { position: relative; text-align: left; }
.service-tile-img { margin-bottom: var(--sp-4); margin-inline: calc(var(--sp-6) * -1); margin-block-start: calc(var(--sp-6) * -1); width: calc(100% + var(--sp-6) * 2); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.service-tile-arrow {
  position: absolute; bottom: var(--sp-6); right: var(--sp-6);
  opacity: 0; transform: translateX(-6px);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  color: var(--mint-700);
}
.service-tile:hover .service-tile-arrow { opacity: 1; transform: translateX(0); }

/* Photo gallery grid — home "team in action" strip, service-page galleries -- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.gallery-grid a { display: block; border-radius: var(--r-lg); }
@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }

/* Reveal state (JS adds .is-visible on ScrollTrigger; without JS everything is visible) */
[data-reveal] { opacity: 1; }
.js [data-reveal] { opacity: 0; transform: translateY(20px); }
.js [data-reveal].is-visible { opacity: 1; transform: translateY(0); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
