/* ==========================================================================
   Superior Locksmith — Header, navigation, footer
   ========================================================================== */

/* ---------- Utility strip ---------- */
.utility-bar {
  background: var(--ink-950);
  color: var(--text-invert-soft);
  font-size: var(--fs-small);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.utility-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  min-height: 42px;
  padding-block: 0.35rem;
}

.utility-bar__note {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.utility-bar__note svg { width: 15px; height: 15px; color: var(--brand); flex: none; }

.utility-bar a {
  color: var(--text-invert-soft);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

.utility-bar a:hover { color: var(--brand); }

.utility-bar__links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.social-row { display: flex; align-items: center; gap: 0.4rem; }

.social-row a {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}

.social-row a:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--ink-950);
}

.social-row svg { width: 15px; height: 15px; }

/* ---------- Main header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--t-base) var(--ease);
}

.site-header.is-stuck { box-shadow: var(--shadow-sm); }

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  min-height: var(--header-h);
}

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  text-decoration: none;
  margin-right: auto;
}

.brand img { width: 218px; height: 48px; object-fit: contain; }

/* ---------- Primary nav ---------- */
.primary-nav { display: flex; align-items: center; }

.primary-nav > ul {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
}

.primary-nav > ul > li { position: relative; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.008em;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--r-sm);
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.nav-link:hover { color: var(--ink-700); background: var(--surface); }

.nav-link[aria-current="page"],
.nav-link.is-active { color: var(--ink-900); }

.nav-link[aria-current="page"]::after,
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0.85rem; right: 0.85rem;
  bottom: -1px;
  height: 3px;
  background: var(--brand);
  border-radius: 2px 2px 0 0;
}

.nav-link__chevron {
  width: 11px; height: 11px;
  flex: none;
  transition: transform var(--t-fast) var(--ease);
}

.nav-link[aria-expanded="true"] .nav-link__chevron { transform: rotate(180deg); }

/* ---------- Dropdowns ---------- */
.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 300px;
  padding: 0.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease),
              visibility var(--t-fast);
}

.dropdown--areas {
  left: auto; right: 0;
  min-width: 700px;
  padding: 1.15rem;
}

.no-js .nav-item:hover > .dropdown,
.no-js .nav-item:focus-within > .dropdown,
.nav-item.is-open > .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 0.55rem 0.7rem;
  font-size: 0.9375rem;
  color: var(--text-body);
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.dropdown a:hover,
.dropdown a:focus-visible { background: var(--surface); color: var(--ink-900); }

.dropdown__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.1rem 0.5rem;
}

.dropdown__label {
  display: block;
  grid-column: 1 / -1;
  padding: 0.25rem 0.7rem 0.5rem;
  font-family: var(--font-heading);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
}

.dropdown__foot {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
}

.dropdown__foot a {
  font-family: var(--font-heading);
  font-weight: 650;
  color: var(--ink-800);
}

/* Keep both panels inside the header, with an unbroken pointer path. */
.site-header__inner { position: relative; }
.primary-nav { align-self: stretch; }
.primary-nav > ul { align-items: stretch; }
.primary-nav > ul > li { display: flex; align-items: center; }
.primary-nav > ul > .nav-item { position: static; }
.dropdown {
  top: calc(100% - 1px);
  left: 50%;
  right: auto;
  width: min(800px, calc(100vw - 48px));
  min-width: 0;
  padding: 1.25rem;
  border-top: 3px solid var(--brand);
  border-radius: 0 0 var(--r-md) var(--r-md);
  max-height: calc(100dvh - 150px);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translate(-50%, -6px);
}
.no-js .nav-item:hover > .dropdown,
.no-js .nav-item:focus-within > .dropdown,
.nav-item.is-open > .dropdown { transform: translate(-50%, 0); }
.dropdown--services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 0.75rem;
  width: min(580px, calc(100vw - 48px));
}
.dropdown ul { list-style: none; }
.dropdown a {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0.65rem 0.75rem;
  line-height: 1.35;
  font-size: 0.875rem;
}
.dropdown a:hover, .dropdown a:focus-visible {
  background: var(--surface-warm);
  color: var(--ink-950);
}
.dropdown__grid { gap: 1rem; align-items: start; }
.dropdown--areas { width: min(1040px, calc(100vw - 48px)); }
.dropdown--areas .dropdown__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
.dropdown--areas .dropdown__grid > div:first-child { grid-column: span 2; }
.dropdown--areas .dropdown__grid > div:first-child ul { column-count: 2; column-gap: 0.75rem; }
.dropdown--areas li { break-inside: avoid; }
.dropdown--areas .dropdown__label { min-height: 3.2rem; }
.dropdown__label {
  color: var(--ink-800);
  font-size: 0.7rem;
  min-height: 2rem;
  margin: 0 0 0.35rem;
  padding: 0.25rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
.dropdown__foot { margin-top: 0.35rem; padding-top: 0.6rem; }
.dropdown__foot a { justify-content: space-between; font-weight: 700; }
.dropdown__foot a::after { content: "→"; margin-left: 1rem; }
.nav-link[aria-expanded="true"] { background: var(--surface-warm); }
.nav-link:focus-visible { outline: 2px solid var(--ink-800); outline-offset: 3px; }

/* ---------- Header call block ---------- */
.header-call {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  flex: none;
  padding: 0.5rem 1.1rem 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.header-call:hover { border-color: var(--brand-deep); background: var(--surface-warm); }

.header-call__icon {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  flex: none;
  background: var(--brand);
  color: var(--ink-950);
  border-radius: var(--r-sm);
}

.header-call__icon svg { width: 17px; height: 17px; }

.header-call__text { display: flex; flex-direction: column; line-height: 1.25; }

.header-call__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.header-call__number {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}

/* ---------- Mobile toggle ---------- */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  flex: none;
  background: var(--brand);
  color: var(--ink-950);
  border-radius: var(--r-sm);
}

.nav-toggle__bars {
  position: relative;
  width: 20px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: background var(--t-fast) var(--ease);
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--t-base) var(--ease), top var(--t-base) var(--ease);
}

.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

/* ---------- Mobile off-canvas ---------- */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
}

.mobile-nav.is-open { display: block; }

.mobile-nav__scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 16, 28, 0.55);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}

.mobile-nav.is-open .mobile-nav__scrim { opacity: 1; }

.mobile-nav__panel {
  position: absolute;
  top: 0; right: 0;
  width: min(420px, 90vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--t-slow) var(--ease-out);
}

.mobile-nav.is-open .mobile-nav__panel { transform: translateX(0); }

.mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.mobile-nav__head img { width: 180px; height: 40px; object-fit: contain; }

.mobile-nav__close {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
}

.mobile-nav__close svg { width: 18px; height: 18px; }

.mobile-nav__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1.25rem 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav__body > ul { list-style: none; }

.mobile-nav__body > ul > li { border-bottom: 1px solid var(--line); }

.mobile-nav__body > ul > li > a,
.m-acc__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  width: 100%;
  padding: 1rem 0;
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 650;
  color: var(--text);
  text-align: left;
  text-decoration: none;
}

.m-acc__trigger svg { width: 14px; height: 14px; flex: none; transition: transform var(--t-base) var(--ease); }
.m-acc__trigger[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Height animation uses max-height against a JS-measured content height
   (--panel-h). The grid-template-rows fr technique collapses to zero in an
   auto-height container, so it is not used here. Without JavaScript the
   panels stay open, which keeps every link reachable. */
.m-acc__panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--t-base) var(--ease);
}

.m-acc__panel.is-open {
  max-height: var(--panel-h, 100rem);
}

.no-js .m-acc__panel { max-height: none; }

.m-acc__panel ul { list-style: none; padding-bottom: 0.75rem; }

.m-acc__panel a {
  display: block;
  padding: 0.55rem 0 0.55rem 0.9rem;
  font-size: 0.9375rem;
  color: var(--text-body);
  text-decoration: none;
  border-left: 2px solid var(--line);
}

.m-acc__panel a:hover { color: var(--ink-900); border-left-color: var(--brand); }

.mobile-nav__foot {
  flex: none;
  padding: 1.25rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  gap: 0.75rem;
}

.mobile-nav__foot .btn { width: 100%; }

.mobile-nav__address {
  font-size: var(--fs-small);
  color: var(--text-muted);
  line-height: 1.55;
}

body.nav-open { overflow: hidden; }

@media (max-width: 1080px) {
  .primary-nav, .header-call { display: none; }
  .nav-toggle { display: inline-flex; }
  .utility-bar__note { display: none; }
}

@media (max-width: 640px) {
  .brand img { width: 176px; height: 39px; }
  .utility-bar { display: none; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--ink-950);
  color: var(--text-invert-soft);
}

.footer-cta {
  background: var(--ink-900);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  padding-block: clamp(2rem, 1.4rem + 2vw, 3rem);
}

.footer-cta__text h2 {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem);
  color: var(--text-invert);
}

.footer-cta__text p { margin-top: 0.4rem; color: var(--text-invert-soft); }

.footer-cta__actions { display: flex; gap: 0.75rem; flex: none; flex-wrap: wrap; }

.footer-main {
  display: grid;
  grid-template-columns: 1.55fr 1fr 1fr 1.25fr;
  gap: clamp(2rem, 1rem + 3vw, 3.5rem);
  padding-block: clamp(3rem, 2rem + 3vw, 4.5rem);
}

.footer-brand img { width: 230px; height: 51px; object-fit: contain; }

.footer-brand p {
  margin-top: 1.15rem;
  font-size: var(--fs-small);
  line-height: 1.7;
  max-width: 38ch;
}

.footer-col h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-invert);
  margin-bottom: 1.15rem;
}

.footer-col ul { list-style: none; display: grid; gap: 0.6rem; }

.footer-col a {
  font-size: 0.9375rem;
  color: var(--text-invert-soft);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

.footer-col a:hover { color: var(--brand); }

.footer-contact dl { display: grid; gap: 1.1rem; }

.footer-contact dt {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.2rem;
}

.footer-contact dd {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-invert-soft);
}

.footer-contact dd a { color: inherit; text-decoration: none; }
.footer-contact dd a:hover { color: var(--brand); }

.footer-contact .is-phone {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--text-invert);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
  padding-block: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: var(--fs-small);
  color: rgba(255, 255, 255, 0.55);
}

.footer-bottom nav { display: flex; gap: var(--sp-5); flex-wrap: wrap; }
.footer-bottom a { color: inherit; text-decoration: none; }
.footer-bottom a:hover { color: var(--brand); }

@media (max-width: 1080px) {
  .footer-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .footer-cta__inner { flex-direction: column; align-items: flex-start; }
  .footer-main { grid-template-columns: minmax(0, 1fr); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
