/* ═══════════════════════════════════════════════════════════════════
   EXCLUSIVE CAR CARE — SHARED HEADER
   Single source of truth for the site header.
   Linked by every page; loaded AFTER each page's inline <style> block
   so its rules win the cascade for any duplicated selectors.
   Mobile-first: built to fit a 320px viewport with no horizontal scroll.
═══════════════════════════════════════════════════════════════════ */

/* Defensive: ensure html/body cannot be wider than the viewport.
   Combined with the existing body { overflow-x: hidden } on each page
   this prevents the "horizontal sliding" reported on mobile. */
html, body {
  max-width: 100%;
  overflow-x: clip;
}

/* ─────────────────────────────────────────────
   HEADER SHELL
───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(26, 26, 26, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border, #3A3A3A);
  padding: 0.6rem 0;
}

/* Tighter horizontal padding on mobile so all four items
   (logo, phone, Book Now, menu) fit without overflow. */
.site-header > .container {
  padding-left: clamp(0.75rem, 3vw, 2.5rem);
  padding-right: clamp(0.75rem, 3vw, 2.5rem);
}

.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.4rem, 2vw, 1rem);
  flex-wrap: nowrap;
  min-width: 0;
}

/* ─────────────────────────────────────────────
   LOGO
───────────────────────────────────────────── */
.site-header .logo-area {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  /* Cap logo width responsively so it never crowds the right cluster */
  max-width: clamp(110px, 32vw, 200px);
}

.site-header .logo-img {
  width: 100%;
  height: clamp(48px, 11vw, 80px);
  object-fit: contain;
  object-position: left center;
  display: block;
}

/* ─────────────────────────────────────────────
   RIGHT-SIDE CLUSTER (phone + book + menu toggle)
───────────────────────────────────────────── */
.site-header .header-cta {
  display: flex;
  align-items: center;
  gap: clamp(0.35rem, 1.6vw, 1rem);
  flex-shrink: 0;
  min-width: 0;
}

/* ─────────────────────────────────────────────
   PHONE ICON
───────────────────────────────────────────── */
.site-header .header-phone {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-header .header-phone a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #9FD326);
  width: 38px;
  height: 38px;
  border-radius: var(--radius, 6px);
  transition: background 0.15s;
}

.site-header .header-phone a:hover {
  background: rgba(159, 211, 38, 0.08);
}

.site-header .header-phone svg {
  fill: var(--accent, #9FD326);
  stroke: var(--accent, #9FD326);
  width: 22px;
  height: 22px;
  display: block;
}

/* ─────────────────────────────────────────────
   BOOK NOW BUTTON (mobile-tight modifier)
   Targets the header-cta button specifically so the rest of
   the site's .btn / .btn--primary styles are untouched.
───────────────────────────────────────────── */
.site-header .header-cta .btn,
.site-header .header-cta .btn--primary {
  font-size: clamp(0.72rem, 2.4vw, 0.95rem);
  padding: clamp(0.55em, 1.6vw, 0.85em) clamp(0.85em, 3vw, 2em);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
  /* Drop the heavy glow shadow on mobile — it can amplify visual width */
  box-shadow: none;
}

@media (min-width: 900px) {
  .site-header .header-cta .btn,
  .site-header .header-cta .btn--primary {
    box-shadow: 0 4px 20px rgba(159, 211, 38, 0.25);
  }
}

/* ─────────────────────────────────────────────
   DESKTOP NAV (hidden < 900px)
───────────────────────────────────────────── */
.site-header .site-nav {
  display: none;
}

@media (min-width: 900px) {
  .site-header .site-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .site-header .site-nav a {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--body-muted, #b8b8b8);
    padding: 0.4em 0.75em;
    border-radius: var(--radius, 6px);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
  }

  .site-header .site-nav a:hover,
  .site-header .site-nav a.active {
    color: var(--heading, #9FD326);
    background: rgba(159, 211, 38, 0.07);
  }
}

/* ─────────────────────────────────────────────
   MOBILE MENU (HAMBURGER) BUTTON
───────────────────────────────────────────── */
.site-header .mobile-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.site-header .mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--body-muted, #b8b8b8);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s, background 0.15s;
}

.site-header .mobile-menu-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background: var(--accent, #9FD326);
}
.site-header .mobile-menu-btn.open span:nth-child(2) {
  opacity: 0;
}
.site-header .mobile-menu-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background: var(--accent, #9FD326);
}

@media (min-width: 900px) {
  .site-header .mobile-menu-btn {
    display: none;
  }
}

/* ─────────────────────────────────────────────
   MOBILE NAV DRAWER (sits below header-inner)
───────────────────────────────────────────── */
.site-header .mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--bg-deep, #1a1a1a);
  border-top: 1px solid var(--border, #3A3A3A);
  padding: 1rem 0;
}

.site-header .mobile-nav.open {
  display: flex;
}

.site-header .mobile-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--body-muted, #b8b8b8);
  padding: 0.75rem clamp(1.25rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--border, #3A3A3A);
  transition: color 0.15s, background 0.15s;
}

.site-header .mobile-nav a:last-child {
  border-bottom: none;
}

.site-header .mobile-nav a:hover {
  color: var(--heading, #9FD326);
  background: rgba(159, 211, 38, 0.05);
}

@media (min-width: 900px) {
  .site-header .mobile-nav {
    display: none !important;
  }
}

/* ─────────────────────────────────────────────
   EXTRA-NARROW SAFETY (≤ 360px)
   On the smallest phones, give the right cluster a touch more room
   by trimming the logo cap further.
───────────────────────────────────────────── */
@media (max-width: 360px) {
  .site-header .logo-area {
    max-width: 105px;
  }
  .site-header .logo-img {
    height: 46px;
  }
  .site-header .header-cta {
    gap: 0.3rem;
  }
}
