/* ═══════════════════════════════════════════════════════════════
   SpectrumSprouts — Universal Site Header  v3.0
   Premium redesign — all selectors prefixed ss-
   Fixes: dropdown gap bug, Donate hidden, container misalign,
          mobile scroll trigger, sticky shrink animation
═══════════════════════════════════════════════════════════════ */

/* ── Global: clip horizontal overflow without breaking sticky ─ */
html { overflow-x: clip; }

/* ── CSS tokens ─────────────────────────────────────────────── */
:root {
  --ss-blue:    #2563EB;
  --ss-blue-dk: #1D4ED8;
  --ss-teal:    #0D9488;
  --ss-rose:    #E11D48;
  --ss-text:    #0F172A;
  --ss-text-2:  #475569;
  --ss-text-3:  #94A3B8;
  --ss-border:  rgba(226, 232, 240, 0.9);
  --ss-shadow:  0 8px 32px rgba(15, 23, 42, 0.1);
  --ss-ease:    cubic-bezier(0.4, 0, 0.2, 1);
  --ss-r:       10px;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER SHELL
═══════════════════════════════════════════════════════════════ */
.ss-header {
  position: sticky;
  top: 0;
  z-index: 800;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--ss-border);
  transition: box-shadow 0.25s var(--ss-ease);
}
.ss-header.ss-scrolled {
  box-shadow: var(--ss-shadow);
}

/* 3-px gradient accent bar at very top */
.ss-hbar {
  height: 3px;
  background: linear-gradient(90deg, #2563EB 0%, #6366F1 28%, #0D9488 60%, #0EA5E9 100%);
  flex-shrink: 0;
}

/* Inner layout container */
.ss-hwrap {
  display: flex;
  align-items: center;
  height: 72px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  gap: 0;
  transition: height 0.28s var(--ss-ease);
}
.ss-header.ss-scrolled > .ss-hwrap {
  height: 62px;
}

/* ═══════════════════════════════════════════════════════════════
   LOGO
═══════════════════════════════════════════════════════════════ */
.ss-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 28px;
}
.ss-logo-img {
  height: 38px;
  width: auto;
  display: block;
  transition: height 0.28s var(--ss-ease);
}
.ss-header.ss-scrolled > .ss-hwrap .ss-logo-img {
  height: 32px;
}

/* ═══════════════════════════════════════════════════════════════
   DESKTOP NAVIGATION
═══════════════════════════════════════════════════════════════ */
.ss-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

/* Shared style for nav links AND dropdown triggers */
.ss-na {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ss-text-2);
  padding: 7px 11px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  white-space: nowrap;
  line-height: 1;
  transition: color 0.14s, background 0.14s;
  position: relative;
}
.ss-na:hover {
  color: var(--ss-blue);
  background: #EFF6FF;
}
.ss-na.ss-active {
  color: var(--ss-blue);
  background: #EFF6FF;
}
/* Underline indicator for active link */
.ss-na.ss-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  background: var(--ss-blue);
  border-radius: 2px;
}

/* Chevron inside dropdown triggers */
.ss-chev {
  transition: transform 0.22s var(--ss-ease);
  flex-shrink: 0;
  opacity: 0.55;
}
.ss-nd.ss-m-open .ss-chev,
.ss-nb[aria-expanded="true"] .ss-chev {
  transform: rotate(180deg);
  opacity: 0.9;
}

/* Dropdown container (Locations) */
.ss-nd {
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   LOCATIONS DROPDOWN  (positioned inside .ss-nd)
═══════════════════════════════════════════════════════════════ */
.ss-drp {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 300px;
  background: #fff;
  border: 1px solid var(--ss-border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.05);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s var(--ss-ease), transform 0.18s var(--ss-ease),
              visibility 0s linear 0.18s;
  z-index: 910;
}
.ss-drp.ss-m-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: all;
  transition: opacity 0.18s var(--ss-ease), transform 0.18s var(--ss-ease),
              visibility 0s;
}

/* Keep dropdown on screen when near right edge */
.ss-nd:last-of-type .ss-drp {
  left: auto;
  right: 0;
}

.ss-drp-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ss-text-3);
  padding: 6px 10px 4px;
  display: block;
}
.ss-drp-a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.12s;
  color: var(--ss-text);
}
.ss-drp-a:hover {
  background: #F8FAFC;
}
.ss-drp-ic {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.ss-drp-txt {
  display: flex;
  flex-direction: column;
}
.ss-drp-txt strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ss-text);
  line-height: 1.25;
}
.ss-drp-txt em {
  font-size: 11.5px;
  color: #64748B;
  font-style: normal;
  font-weight: 400;
  margin-top: 1px;
}

/* ═══════════════════════════════════════════════════════════════
   SERVICES MEGA MENU  (full-width, child of .ss-header)
═══════════════════════════════════════════════════════════════ */
.ss-mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--ss-border);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(15, 23, 42, 0.04);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s var(--ss-ease), transform 0.2s var(--ss-ease),
              visibility 0s linear 0.2s;
  z-index: 900;
}
.ss-mega.ss-m-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: all;
  transition: opacity 0.2s var(--ss-ease), transform 0.2s var(--ss-ease),
              visibility 0s;
}

/* Inner mega content constrained to site width */
.ss-mega > .ss-hwrap {
  height: auto;
  padding-top: 24px;
  padding-bottom: 28px;
  transition: none;
}

/* 2-column grid */
.ss-mega-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
  width: 100%;
}
.ss-mega-col {
  display: flex;
  flex-direction: column;
}

/* Column section header */
.ss-mega-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ss-text-3);
  padding: 0 10px 8px;
  border-bottom: 1px solid #F1F5F9;
  margin-bottom: 6px;
}

/* Mega item link */
.ss-mega-a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 11px;
  text-decoration: none;
  transition: background 0.13s;
  color: var(--ss-text);
}
.ss-mega-a:hover {
  background: #F8FAFC;
}
.ss-mega-a:hover strong {
  color: var(--ss-blue);
}
.ss-mega-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.ss-mega-a span:last-child {
  display: flex;
  flex-direction: column;
}
.ss-mega-a strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ss-text);
  line-height: 1.25;
  transition: color 0.13s;
}
.ss-mega-a em {
  font-size: 11.5px;
  color: #64748B;
  font-style: normal;
  font-weight: 400;
  margin-top: 2px;
  line-height: 1.35;
}

/* "Browse all" footer link */
.ss-mega-all {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ss-blue);
  text-decoration: none;
  padding: 8px 10px;
  margin-top: 4px;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s;
}
.ss-mega-all:hover {
  background: #EFF6FF;
  color: var(--ss-blue-dk);
}

/* ═══════════════════════════════════════════════════════════════
   HEADER ACTION GROUP (right side)
═══════════════════════════════════════════════════════════════ */
.ss-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Phone */
.ss-act-ph {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ss-text-2);
  text-decoration: none;
  padding: 0 4px;
  white-space: nowrap;
  transition: color 0.14s;
}
.ss-act-ph:hover { color: var(--ss-blue); }

/* WhatsApp */
.ss-act-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #16A34A;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 13px;
  border-radius: 9px;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  transition: background 0.14s, transform 0.12s;
}
.ss-act-wa:hover {
  background: #15803D;
  transform: translateY(-1px);
  color: #fff;
}

/* Book Free Call */
.ss-act-book {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #2563EB, #4F46E5);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 17px;
  border-radius: 9px;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.3);
  transition: opacity 0.14s, transform 0.12s;
}
.ss-act-book:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  color: #fff;
}

/* Donate */
.ss-act-donate {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FFF1F2;
  color: var(--ss-rose);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 9px;
  text-decoration: none;
  border: 1px solid #FECDD3;
  white-space: nowrap;
  line-height: 1;
  transition: background 0.14s, color 0.14s;
}
.ss-act-donate:hover {
  background: #FFE4E6;
  color: #BE123C;
}

/* Hamburger — visible only on mobile */
.ss-burger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1.5px solid #E2E8F0;
  border-radius: 9px;
  padding: 8px;
  cursor: pointer;
  color: #334155;
  line-height: 0;
  transition: border-color 0.14s, background 0.14s;
}
.ss-burger:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
}

/* ═══════════════════════════════════════════════════════════════
   OVERLAY
═══════════════════════════════════════════════════════════════ */
.ss-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1099;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ss-ease);
}
.ss-overlay.ss-open {
  opacity: 1;
  pointer-events: all;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE DRAWER
═══════════════════════════════════════════════════════════════ */
.ss-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100vw);
  z-index: 1100;
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.32s var(--ss-ease), visibility 0s linear 0.32s;
  box-shadow: -8px 0 48px rgba(15, 23, 42, 0.15);
}
.ss-drawer.ss-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.32s var(--ss-ease), visibility 0s;
}

/* Drawer header */
.ss-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #F1F5F9;
  background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF9 100%);
  flex-shrink: 0;
}
.ss-drawer-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.ss-drawer-logo img {
  height: 36px;
  width: auto;
}
.ss-drawer-close {
  background: #fff;
  border: 1.5px solid #E2E8F0;
  border-radius: 9px;
  padding: 8px;
  cursor: pointer;
  color: #475569;
  line-height: 0;
  transition: border-color 0.14s, background 0.14s;
}
.ss-drawer-close:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
}

/* Drawer scrollable body */
.ss-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px;
  -webkit-overflow-scrolling: touch;
}

/* Flat drawer links */
.ss-da {
  display: flex;
  align-items: center;
  padding: 13px 10px;
  font-size: 15px;
  font-weight: 600;
  color: #1E293B;
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.12s, color 0.12s;
  border-bottom: 1px solid #F8FAFC;
}
.ss-da:last-of-type { border-bottom: none; }
.ss-da:hover {
  background: #F8FAFC;
  color: var(--ss-blue);
}
.ss-da.ss-active {
  color: var(--ss-blue);
  background: #EFF6FF;
}

/* Accordion group */
.ss-da-grp {
  border-bottom: 1px solid #F1F5F9;
  margin-bottom: 2px;
}

/* Accordion trigger */
.ss-da-trg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 10px;
  font-size: 15px;
  font-weight: 600;
  color: #1E293B;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  border-radius: 10px;
  transition: background 0.12s, color 0.12s;
}
.ss-da-trg:hover {
  background: #F8FAFC;
  color: var(--ss-blue);
}

/* Chevron in accordion */
.ss-da-chev {
  flex-shrink: 0;
  transition: transform 0.25s var(--ss-ease);
  color: var(--ss-text-3);
}
.ss-da-grp.ss-expanded .ss-da-chev {
  transform: rotate(180deg);
}

/* Accordion subcontent */
.ss-da-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s var(--ss-ease);
}
.ss-da-grp.ss-expanded .ss-da-sub {
  max-height: 1000px;
}

/* Section label inside sub */
.ss-da-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ss-text-3);
  padding: 10px 10px 4px;
  display: block;
}

/* Item inside sub */
.ss-da-sub-a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  font-size: 14px;
  font-weight: 600;
  color: #1E293B;
  text-decoration: none;
  border-radius: 9px;
  transition: background 0.12s, color 0.12s;
}
.ss-da-sub-a:hover {
  background: #F8FAFC;
  color: var(--ss-blue);
}

/* Small gradient icon */
.ss-da-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* Drawer footer */
.ss-drawer-foot {
  padding: 14px 16px 24px;
  border-top: 1px solid #F1F5F9;
  background: #FAFAFA;
  flex-shrink: 0;
}
.ss-df-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #1E293B;
  text-decoration: none;
  padding: 12px;
  background: #F1F5F9;
  border-radius: 10px;
  margin-bottom: 10px;
  transition: background 0.14s;
}
.ss-df-phone:hover { background: #E2E8F0; }

.ss-df-btns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.ss-df-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #16A34A;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 11px 8px;
  border-radius: 9px;
  text-decoration: none;
  text-align: center;
  transition: background 0.14s;
}
.ss-df-wa:hover { background: #15803D; color: #fff; }
.ss-df-book {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563EB, #4F46E5);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 11px 8px;
  border-radius: 9px;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.14s;
}
.ss-df-book:hover { opacity: 0.88; color: #fff; }
.ss-df-donate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #FFF1F2;
  color: var(--ss-rose);
  font-size: 13px;
  font-weight: 700;
  padding: 11px 8px;
  border-radius: 9px;
  text-decoration: none;
  text-align: center;
  border: 1px solid #FECDD3;
  transition: background 0.14s;
}
.ss-df-donate:hover { background: #FFE4E6; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
═══════════════════════════════════════════════════════════════ */

/* Hide phone text above 1100px but below 1200px */
@media (max-width: 1200px) {
  .ss-act-ph-txt { display: none; }
}
/* Hide phone icon entirely below 1100px */
@media (max-width: 1100px) {
  .ss-act-ph { display: none; }
}
/* At 900px: collapse nav, show hamburger, shrink WA */
@media (max-width: 900px) {
  .ss-nav { display: none; }
  .ss-burger { display: inline-flex; }
  .ss-act-wa-txt { display: none; }
  .ss-act-wa { padding: 8px 10px; }
  .ss-act-book { font-size: 12.5px; padding: 8px 13px; }
}
/* Below 640px: hide WhatsApp and Donate from header */
@media (max-width: 640px) {
  .ss-act-wa { display: none; }
  .ss-act-donate { display: none; }
}
/* Below 440px: hide Book too (drawer has everything) */
@media (max-width: 440px) {
  .ss-act-book { display: none; }
}

/* Mega menu: single column on tablet */
@media (max-width: 768px) {
  .ss-mega-grid { grid-template-columns: 1fr; }
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ss-header,
  .ss-hwrap,
  .ss-logo-img,
  .ss-drawer,
  .ss-overlay,
  .ss-mega,
  .ss-drp,
  .ss-da-sub,
  .ss-act-wa,
  .ss-act-book {
    transition: none !important;
    transform: none !important;
  }
  .ss-drawer { visibility: visible; }
}
