/* Site chrome: header/nav, footer, floating WhatsApp CTA. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(240, 241, 242, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: var(--border-width) solid var(--color-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  height: var(--header-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0; /* let it shrink below its content width instead of wrapping (flex default is min-width:auto) */
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-slate-900);
}
.brand:hover { color: var(--color-slate-900); }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-slate-900);
  color: var(--color-accent-bright);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
/* Truncates rather than wraps at narrow widths — a wrapped company name
   would grow past the header's fixed height and collide with the CTA. */
.brand-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.brand-name-sub {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  flex-shrink: 0; /* the CTA/toggle must stay full-size — .brand truncates instead */
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-slate-800);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-accent-deep);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-account {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  margin-left: var(--space-2);
  padding: 0 var(--space-4);
  border-left: var(--border-width) solid var(--color-border);
  border-radius: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-slate-900);
  white-space: nowrap;
  transition: color 0.15s ease;
}
.nav-account svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-account:hover { color: var(--color-accent-deep); }
@media (max-width: 480px) {
  .nav-account { padding: 0 var(--space-2); margin-left: 0; border-left: 0; }
  .nav-account-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* The primary CTA stays visible at every width (unlike WhatsApp, which
   hides below 900px) — but "Request a Quote" plus the brand plus the
   hamburger don't all fit on a narrow phone, so the label shortens instead
   of forcing the brand name to truncate down to nothing. */
.nav-cta-label-short { display: none; }
@media (max-width: 480px) {
  .nav-cta-label-full { display: none; }
  .nav-cta-label-short { display: inline; }
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  color: var(--color-slate-900);
}
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 900px) {
  /* Always laid out (never display:none) so open/close can transition —
     closed state is opacity/transform/visibility only, not display, since
     display can't be animated. `visibility` still removes it from tab
     order and hit-testing when closed (paired with pointer-events below). */
  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-5);
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    padding: var(--space-6) var(--space-5) var(--space-7);
    border-bottom: var(--border-width) solid var(--color-border);
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  }
  .nav-links a { font-size: var(--text-md); }
  .nav-cta .btn-secondary { display: none; }
  .nav-toggle { display: inline-flex; }

  .site-header.is-open .nav-links {
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
}

/* ---- Footer ---- */

.site-footer {
  background: var(--color-slate-900);
  color: var(--color-slate-400);
  /* Extra bottom clearance: the fixed .whatsapp-float sits bottom-right at
     every width, and .footer-bottom's right-aligned tagline would otherwise
     end up directly underneath it (short-page problem, not just mobile). */
  padding: var(--space-8) 0 var(--space-9);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-7);
  margin-bottom: var(--space-7);
}

@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.site-footer h4 {
  color: var(--color-text-on-ink);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.site-footer .brand { color: var(--color-text-on-ink); }
.site-footer .brand-mark { background: var(--color-accent-bright); color: var(--color-slate-900); }
.footer-tagline { margin-top: var(--space-4); max-width: 26rem; }

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer-links a { color: var(--color-slate-400); font-size: var(--text-sm); }
.footer-links a:hover { color: var(--color-accent-bright); }

.footer-bottom {
  border-top: var(--border-width) solid rgba(240, 241, 242, 0.12);
  padding-top: var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-slate-400);
}

/* ---- Floating WhatsApp CTA ---- */

.whatsapp-float {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: #1f8a4c;
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.whatsapp-float:hover { background: #196e3c; color: #fff; }
.whatsapp-float svg { width: 20px; height: 20px; flex-shrink: 0; }

@media (max-width: 520px) {
  .whatsapp-float span { display: none; }
  .whatsapp-float { padding: 0.85rem; }
}
