/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(18, 18, 18, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  transition: background-color .3s ease, box-shadow .3s ease, height .3s ease;
}

body.home .site-header:not(.scrolled) {
  background: rgba(18, 18, 18, 0.72);
  box-shadow: none;
}

.site-header.scrolled {
  background: rgba(18, 18, 18, 0.98);
  box-shadow: var(--shadow-md);
  height: 72px;
}

html {
  scroll-behavior: smooth;
}

:target,
#lead-form,
.form-card,
[id] {
  scroll-margin-top: calc(var(--header-height) + 32px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.logo img {
  height: 52px;
  width: auto;
  transition: height .3s ease;
}

.site-header.scrolled .logo img { height: 44px; }

/* Desktop nav */
.main-nav ul {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a.nav-link {
  display: inline-block;
  padding: 10px 14px;
  color: var(--white);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 6px;
  position: relative;
  transition: color .2s ease, background-color .2s ease;
}

.main-nav a.nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 2px;
  background: var(--fire-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.main-nav a.nav-link:hover::after,
.main-nav a.nav-link.active::after {
  transform: scaleX(1);
}

.main-nav a.nav-link.active { color: var(--white); font-weight: 600; }

/* Dropdown */
.nav-item { position: relative; }

.dropdown-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  z-index: 1100;
}

.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 10px 14px;
  font-size: 0.92rem;
  color: var(--charcoal);
  border-radius: 6px;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus-visible {
  background: var(--light-gray);
  color: var(--fire-red);
}

.header-cta { display: flex; align-items: center; gap: 14px; }

.header-phone {
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-phone svg { color: var(--fire-red); flex: 0 0 auto; }

/* Mobile toggle */
.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: none;
  background: rgba(255,255,255,.12);
  border-radius: 6px;
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--white);
  transition: transform .3s ease, opacity .3s ease, top .3s ease;
}

.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle span:nth-child(3) { top: 29px; }

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 22px;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  top: 22px;
  transform: rotate(-45deg);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(23,23,23,.98);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  padding: 24px;
  transform: translateX(100%);
  transition: transform .35s ease;
  overflow-y: auto;
}

.mobile-menu.open { transform: translateX(0); }

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.mobile-menu-head img { height: 44px; }

.menu-close {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.25);
  background: transparent;
  color: var(--white);
  border-radius: 6px;
  font-size: 1.4rem;
  line-height: 1;
}

.mobile-menu nav ul { display: flex; flex-direction: column; gap: 4px; }

.mobile-menu nav > ul > li > a {
  display: block;
  padding: 14px 8px;
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.mobile-menu nav > ul > li > a.active { color: var(--fire-red); }

.mobile-submenu { padding-left: 16px; }

.mobile-submenu a {
  display: block;
  padding: 10px 8px;
  color: #b8b8b8;
  font-size: 0.98rem;
}

.mobile-menu .btn { margin-top: 28px; }

.mobile-contact {
  margin-top: 36px;
  color: #b8b8b8;
  font-size: 0.92rem;
  display: grid;
  gap: 10px;
}

.mobile-contact a { color: var(--white); font-weight: 600; }

@media (max-width: 991px) {
  .main-nav,
  .header-cta .header-phone,
  .header-cta .btn { display: none; }
  .nav-toggle { display: block; }
}

/* Body scroll lock */
body.menu-open { overflow: hidden; }
