/* ── Top Bar ─────────────────────────────────────────────────────── */
.top-bar {
  background: #F3F1EC;            /* slightly warmer than porcelain */
  border-bottom: 1px solid rgba(31,38,35,0.08);
  padding: 9px 0;
}
.top-bar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.top-bar__left,
.top-bar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--color-graphite);
}
.top-bar__left svg,
.top-bar__right svg { flex-shrink: 0; color: var(--color-graphite); }
.top-bar__phone {
  color: var(--color-ink);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.top-bar__phone-label {
  color: var(--color-graphite);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10.5px;
}
.top-bar__divider {
  width: 1px;
  height: 14px;
  background: rgba(31,38,35,0.2);
  margin: 0 6px;
}
.top-bar__search {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-graphite);
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.top-bar__search:hover { color: var(--color-emerald); }

/* ── Site Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-porcelain);
  border-bottom: 1px solid rgba(31,38,35,0.08);
  transition: box-shadow 0.25s ease;
}
.site-header.is-scrolled {
  box-shadow: 0 2px 20px rgba(13,72,48,0.07);
}
.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  height: 76px;
  width: 100%;
  padding-left: 40px;
  padding-right: 40px;
  gap: 24px;
}

/* ── Logo ────────────────────────────────────────────────────────── */
.site-header__logo {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
/* Belt-and-suspenders: the logo must never be hidden or collapsed,
   regardless of width. (The real bug — the grid track collapsing to
   0 width — is fixed via grid-template-columns below; this guards
   against any future display/visibility/opacity regression too.) */
.site-header__logo { display: flex !important; visibility: visible !important; opacity: 1 !important; flex-shrink: 0; min-width: 0; }
.site-header__logo-link { display: flex !important; align-items: center; flex-shrink: 0; }

/* CTA link duplicated inside the mobile nav drawer — only ever shown
   there when the header's own CTA button is hidden (≤520px, see below) */
.main-nav__mobile-cta { display: none; }
.site-header__logo-img {
  max-height: 60px;
  width: auto;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  /* min-width here forces the IMG itself wider than its natural render
     size, which can distort it at small max-height — the "don't let the
     logo shrink" guarantee belongs on the .site-header__logo container
     (flex-shrink:0, min-width:0 above), not on the image's own box. */
}
@media (max-width: 480px) {
  .site-header__logo-img { max-height: 38px; }
}
.site-header__logo-text {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-emerald);
  line-height: 1;
}
.site-header__logo-text span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--color-graphite);
  font-family: var(--font-body);
  margin-top: 3px;
}
/* ── Nav ─────────────────────────────────────────────────────────── */
.main-nav { display: flex; justify-content: center; }
.main-nav__list {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav__item { position: relative; }
.main-nav__link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 13px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s;
}
.main-nav__link:hover { color: var(--color-emerald); }

/* Hover underline (active item keeps its own permanent underline below) */
.main-nav__item:not(.main-nav__item--active) > .main-nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 13px;
  width: 0;
  height: 1.5px;
  background: var(--color-gold);
  transition: width .25s ease;
}
.main-nav__item:not(.main-nav__item--active) > .main-nav__link:hover::after {
  width: calc(100% - 26px);
}

/* Active item — gold underline */
.main-nav__item--active > .main-nav__link {
  color: var(--color-ink);
  font-weight: 500;
}
.main-nav__item--active > .main-nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 13px;
  right: 13px;
  height: 2px;
  background: var(--color-gold);
  border-radius: 1px;
}

/* Caret */
.main-nav__caret {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  margin-left: 2px;
  flex-shrink: 0;
  opacity: 0.6;
}

/* Flyout */
.main-nav__flyout {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  background: var(--color-porcelain);
  border: 1px solid rgba(13,72,48,0.1);
  border-top: 2px solid var(--color-emerald);
  box-shadow: 0 12px 32px rgba(13,72,48,0.1);
  list-style: none;
  padding: 6px 0;
  z-index: 200;
  border-radius: 0 0 4px 4px;
}
.main-nav__item--has-children:hover > .main-nav__flyout { display: block; }
.main-nav__flyout .main-nav__link {
  font-size: 12.5px;
  padding: 10px 18px;
}
.main-nav__flyout .main-nav__link:hover {
  background: var(--color-emerald-mist);
  color: var(--color-emerald);
}
.main-nav__flyout--nested { top: 0; left: 100%; }

/* ── Actions ─────────────────────────────────────────────────────── */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-shrink: 0;
}
.header-phone {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-emerald);
  white-space: nowrap;
  transition: opacity 0.2s;
}
.header-phone:hover { opacity: 0.75; }
.header-phone__icon { flex-shrink: 0; }

.cta-button--primary {
  background: var(--color-emerald);
  color: var(--color-porcelain);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 26px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.cta-button--primary:hover { background: #165c3a; color: var(--color-porcelain); }
.cta-button--primary .btn-arrow { font-size: 14px; transition: transform 0.2s; }
.cta-button--primary:hover .btn-arrow { transform: translateX(3px); }

/* ── Mobile Toggle ───────────────────────────────────────────────── */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.mobile-toggle__bar {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--color-emerald);
  border-radius: 1px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.mobile-toggle[aria-expanded="true"] .mobile-toggle__bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.mobile-toggle[aria-expanded="true"] .mobile-toggle__bar:nth-child(2) { opacity: 0; }
.mobile-toggle[aria-expanded="true"] .mobile-toggle__bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ── Mobile Backdrop ─────────────────────────────────────────────── */
.mobile-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.28);
  z-index: 98;
}
.mobile-menu-backdrop.is-active { display: block; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .site-header__inner { gap: 16px; }
  .main-nav__link { padding: 8px 10px; font-size: 12.5px; }
}
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .mobile-toggle { display: flex; }
  /* Logo gets its own natural (auto) size so it can never be squeezed to
     0 width by the actions column; actions takes the flexible remainder
     and is allowed to shrink via min-width:0 below. */
  .site-header__inner { grid-template-columns: auto 1fr; }
  .site-header__actions { min-width: 0; justify-content: flex-end; overflow: hidden; }

  /* Drawer itself: moved here from the 768px block below — the hamburger
     is clickable from 1024px down, but the drawer previously only had
     styling ≤768px, so between ~769–1024px the toggle set .is-open with
     nothing visually happening (confirmed broken at e.g. 820px). */
  .main-nav.is-open {
    display: flex;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(300px, 85vw);
    background: var(--color-porcelain);
    flex-direction: column;
    padding: 80px 24px 32px;
    z-index: 200;
    overflow-y: auto;
    box-shadow: -4px 0 32px rgba(0,0,0,0.14);
    justify-content: flex-start;
    align-items: flex-start;
  }
  .main-nav.is-open .main-nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }
  .main-nav.is-open .main-nav__link {
    font-size: 15px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(13,72,48,0.07);
    width: 100%;
  }
}
/* Below this, logo (150px) + gap + CTA + gap + hamburger no longer all
   fit on one line (measured collision point ≈503px) — hide the header
   CTA and rely on the one inside the mobile nav drawer instead, so the
   logo and hamburger always have room and nothing overflows. */
@media (max-width: 520px) {
  .site-header__actions .cta-button--primary { display: none; }
  .main-nav.is-open .main-nav__mobile-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 14px 26px;
    background: var(--color-emerald);
    color: var(--color-porcelain);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 2px;
    white-space: nowrap;
  }
}
@media (max-width: 768px) {
  .top-bar__left { display: none; }
  .site-header__inner { height: 64px; padding: 0 20px; }
  .header-phone .header-phone__label { display: none; }
}

/* ── Sticky main header ── */
.hdr-sticky {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--color-porcelain);
  transition: box-shadow 0.25s ease;
}
