/* Layout: header, hero, sections shell, footer, sticky bar, widgets, modal */

/* ---- Header ---- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(11, 37, 69, 0.06);
  transition: box-shadow var(--duration-base) var(--ease-standard),
              background-color var(--duration-base) var(--ease-standard);
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1360px;
  gap: 1.25rem;
}
.site-branding { display: flex; align-items: center; gap: 0.625rem; flex-shrink: 0; }
.site-branding .site-logo-img { height: 36px; width: 36px; object-fit: contain; }
.site-branding .brand-name { line-height: 1; white-space: nowrap; }
.site-branding .brand-name-main {
  display: block;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-navy);
  font-size: 0.9375rem;
  text-transform: uppercase;
}
.site-branding .brand-name-sub {
  display: block;
  margin-top: 2px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--color-teal);
  font-size: 0.5625rem;
  text-transform: uppercase;
}
@media (min-width: 640px) {
  .site-branding .brand-name-main { font-size: 1.0625rem; }
  .site-branding .brand-name-sub { font-size: 0.625rem; }
}

.primary-nav { display: none; min-width: 0; }
.primary-nav ul { display: flex; align-items: center; gap: 1.35rem; flex-wrap: nowrap; }
.primary-nav a {
  font-weight: 600; font-size: 0.85rem; color: var(--color-slate-700);
  position: relative; padding-block: 0.25rem;
  white-space: nowrap;
  transition: color var(--duration-fast) var(--ease-standard);
}
.primary-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
  background: var(--color-teal); transition: right var(--duration-base) var(--ease-standard);
}
.primary-nav a:hover { color: var(--color-navy); }
.primary-nav a:hover::after { right: 0; }

.header-actions { display: flex; align-items: center; gap: 0.65rem; flex-shrink: 0; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--color-slate-200);
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 18px; height: 2px; background: var(--color-navy);
  position: relative; transition: transform var(--duration-fast) var(--ease-standard), opacity var(--duration-fast);
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  position: fixed; inset: var(--header-height) 0 0 0; z-index: 480;
  background: #fff; padding: 1.5rem;
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: opacity var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard), visibility var(--duration-base);
  overflow-y: auto;
}
.mobile-nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.mobile-nav ul { display: flex; flex-direction: column; gap: 0.25rem; }
.mobile-nav a { display: block; padding: 0.9rem 0.25rem; font-weight: 700; font-size: 1.05rem; color: var(--color-navy); border-bottom: 1px solid var(--color-slate-100); }

/* 8 nav items need real room to stay on one line without wrapping —
   with the header CTAs removed there's less to fit, so this can sit at a
   more typical tablet/desktop breakpoint than before. */
@media (min-width: 1024px) {
  .primary-nav { display: block; }
  .nav-toggle, .mobile-nav { display: none; }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  /* Fallback if no hero image is set in Phelix Settings — .hero-bg sits
     on top of this once an image is configured. */
  background: linear-gradient(160deg, var(--color-navy) 0%, var(--color-navy-soft) 55%, #123a63 100%);
  overflow: hidden;
  color: #fff;
}
/* Full-bleed background photo + left-to-right navy gradient overlay,
   matching the reference site: heavily darkened behind the text column,
   fading out so the photo reads clearly on the right. */
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(11,37,69,0.92) 0%, rgba(11,37,69,0.78) 50%, rgba(11,37,69,0.4) 100%);
}
.hero .container { position: relative; z-index: 2; }
.hero-grid { display: grid; gap: 3rem; align-items: center; }
.hero-copy .badge-emergency { margin-bottom: 1.5rem; }
.hero-copy h1 { font-size: var(--fs-h1); color: #fff; margin-bottom: 1.25rem; }
.hero-copy h1 em { font-style: normal; color: #7fd9cd; }
.hero-copy p.lede { font-size: 1.125rem; color: var(--text-on-dark-muted); max-width: 46ch; margin-bottom: 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 2.5rem; }
.hero-points { display: flex; flex-direction: column; gap: 0.75rem; }
.hero-points li { display: flex; align-items: center; gap: 0.65rem; font-size: 0.95rem; color: var(--text-on-dark-muted); }
.hero-points svg { flex: none; color: #7fd9cd; }

.hero-panel {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(10px);
}
.hero-panel .stat-big { font-size: 3rem; font-weight: 800; color: #fff; }
.hero-panel .stat-label { color: var(--text-on-dark-muted); font-weight: 600; margin-top: 0.25rem; }
.hero-panel img { width: 100%; border-radius: var(--radius-md); margin-top: 1.5rem; aspect-ratio: 3/4; object-fit: cover; object-position: center top; }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; }
}

/* ---- Stat strip ---- */
.stat-strip { background: var(--color-navy); padding-block: 2.5rem; }
.stat-strip .container { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); text-align: center; }
.stat-strip .stat-value { font-size: 1.9rem; font-weight: 800; color: #fff; }
.stat-strip .stat-label { color: var(--text-on-dark-muted); font-size: 0.85rem; font-weight: 600; margin-top: 0.2rem; }

/* ---- Footer ---- */
.site-footer { background: var(--color-navy-dark); color: var(--text-on-dark-muted); padding-block: 3.5rem 2rem; }
.footer-grid { display: grid; gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-brand .brand-name { color: #fff; font-weight: 800; font-size: 1.1rem; margin-bottom: 0.75rem; }
.footer-brand p { max-width: 32ch; font-size: 0.9rem; }
.footer-col h4 { color: #fff; font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col a { font-size: 0.9rem; transition: color var(--duration-fast); }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: 0.8rem; }
@media (min-width: 780px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }

/* ---- Sticky mobile bottom bar ---- */
.mobile-sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 460;
  display: flex; gap: 0.6rem;
  padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-slate-200);
  box-shadow: 0 -8px 24px rgba(11,37,69,0.08);
}
.mobile-sticky-bar .btn { flex: 1; }
@media (min-width: 780px) { .mobile-sticky-bar { display: none; } }

/* ---- WhatsApp floating widget ---- */
.whatsapp-fab {
  position: fixed; right: 1.1rem; bottom: calc(4.75rem + env(safe-area-inset-bottom));
  z-index: 470;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.45);
  transition: transform var(--duration-fast) var(--ease-standard);
}
.whatsapp-fab:hover { transform: scale(1.08); }
@media (min-width: 780px) { .whatsapp-fab { bottom: 1.5rem; } }

/* ---- Appointment modal ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(8, 20, 38, 0.6);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity var(--duration-base) var(--ease-standard), visibility var(--duration-base);
  padding: 0;
}
.modal-overlay.is-open { opacity: 1; visibility: visible; }
.modal-panel {
  background: #fff; width: 100%; max-width: 560px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 92dvh; overflow-y: auto;
  padding: 2rem;
  transform: translateY(24px);
  transition: transform var(--duration-slow) var(--ease-standard);
}
.modal-overlay.is-open .modal-panel { transform: translateY(0); }
.modal-close { position: absolute; top: 1.25rem; right: 1.25rem; width: 36px; height: 36px; border-radius: 50%; background: var(--color-slate-100); display: flex; align-items: center; justify-content: center; }
@media (min-width: 640px) {
  .modal-overlay { align-items: center; padding: 1.5rem; }
  .modal-panel { border-radius: var(--radius-lg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
