/*
 * Smile Savers legacy-site header treatment — site-wide.
 * The existing WordPress navigation remains authoritative; JavaScript adds
 * helper classes so the rules do not depend on brittle theme class names.
 */
body.ss-site-header-theme {
  --ss-header-ink: #142536;
  --ss-header-muted: #536a79;
  --ss-header-line: #dce5ea;
  --ss-header-pale: #f5f8fa;
  --ss-header-paper: #ffffff;
  --ss-header-accent: #0d6d93;
  --ss-header-rainbow: linear-gradient(90deg,#19bfd4 0%,#397de3 18%,#9656c9 36%,#ef84af 54%,#f4554e 70%,#ff9400 85%,#efcb26 100%);
}

/* Root shell: change transparent/overlay variants into the clean white header. */
body.ss-site-header-theme :is(.ss-global-header,.ss-global-header-shell),
body.ss-site-header-theme header:has(a[href*="/smilestudio"]):has(a[href*="/privacy-policy"]) {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  color: var(--ss-header-ink) !important;
  background: var(--ss-header-paper) !important;
  background-image: none !important;
  border-top: 2px solid #152330 !important;
  border-bottom: 1px solid var(--ss-header-line) !important;
  box-shadow: 0 5px 18px rgba(30,51,68,.055) !important;
  isolation: isolate;
  z-index: 1000 !important;
}

body.ss-site-header-theme :is(.ss-global-header,.ss-global-header-shell)::before,
body.ss-site-header-theme header:has(a[href*="/smilestudio"]):has(a[href*="/privacy-policy"])::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: -2px;
  height: 2px;
  background: #152330;
  pointer-events: none;
}

/* Neutralise transparent-header typography without touching page content. */
body.ss-site-header-theme :is(.ss-global-header,.ss-global-header-shell) :where(a,button,span),
body.ss-site-header-theme header:has(a[href*="/smilestudio"]):has(a[href*="/privacy-policy"]) :where(a,button,span) {
  text-shadow: none !important;
}

body.ss-site-header-theme :is(.ss-global-header,.ss-global-header-shell) a {
  color: var(--ss-header-ink) !important;
}

/* Slim utility strip. */
body.ss-site-header-theme :is(.ss-global-utility-row,.ss-global-utility-row > *, .ss-global-utility-row + .ss-global-utility-row),
body.ss-site-header-theme .ss-global-header .ss-global-utility-items {
  background: var(--ss-header-pale) !important;
  background-image: none !important;
}

body.ss-site-header-theme .ss-global-utility-row {
  min-height: 32px !important;
  border-bottom: 1px solid var(--ss-header-line) !important;
  box-shadow: none !important;
}

body.ss-site-header-theme .ss-global-utility-items {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

body.ss-site-header-theme .ss-global-utility-items > li > a,
body.ss-site-header-theme .ss-global-utility-row > a {
  color: #203546 !important;
  font-family: system-ui,-apple-system,"Segoe UI",Arial,sans-serif !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: .015em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  padding-top: 9px !important;
  padding-bottom: 9px !important;
}

body.ss-site-header-theme .ss-global-utility-items > li > a:hover,
body.ss-site-header-theme .ss-global-utility-items > li > a:focus-visible,
body.ss-site-header-theme .ss-global-utility-row > a:hover,
body.ss-site-header-theme .ss-global-utility-row > a:focus-visible {
  color: var(--ss-header-accent) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

/* Contact and consultation row. */
body.ss-site-header-theme .ss-global-contact-row {
  color: var(--ss-header-muted) !important;
  background: var(--ss-header-paper) !important;
  background-image: none !important;
  min-height: 62px !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.ss-site-header-theme .ss-global-email-link {
  color: #516a7b !important;
  font-family: system-ui,-apple-system,"Segoe UI",Arial,sans-serif !important;
  font-size: 12px !important;
  font-weight: 450 !important;
  line-height: 1.4 !important;
  text-decoration: none !important;
  white-space: nowrap;
}

body.ss-site-header-theme .ss-global-email-link:hover,
body.ss-site-header-theme .ss-global-email-link:focus-visible {
  color: var(--ss-header-accent) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

body.ss-site-header-theme .ss-global-consultation-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 39px !important;
  padding: 9px 20px !important;
  color: #162c3f !important;
  background: #fff !important;
  background-image: none !important;
  border: 1px solid #9ec5da !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  font-family: Georgia,"Times New Roman",serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  text-transform: none !important;
  white-space: nowrap;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease !important;
}

body.ss-site-header-theme .ss-global-consultation-link:hover,
body.ss-site-header-theme .ss-global-consultation-link:focus-visible {
  color: #102a3c !important;
  border-color: #4c9cbd !important;
  box-shadow: 0 6px 16px rgba(36,101,127,.12) !important;
  transform: translateY(-1px) !important;
}

/* Main navigation: retain the theme's menu mechanics, only refine the surface. */
body.ss-site-header-theme :is(.ss-global-primary-row,.ss-global-primary-row > *),
body.ss-site-header-theme .ss-global-primary-items {
  color: var(--ss-header-ink) !important;
  background: var(--ss-header-paper) !important;
  background-image: none !important;
}

body.ss-site-header-theme .ss-global-primary-row {
  min-height: 40px !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}

body.ss-site-header-theme .ss-global-primary-items {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

body.ss-site-header-theme .ss-global-primary-items > li > a,
body.ss-site-header-theme .ss-global-primary-row > a {
  color: #162b3d !important;
  font-family: system-ui,-apple-system,"Segoe UI",Arial,sans-serif !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1.25 !important;
  letter-spacing: .015em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  padding-top: 11px !important;
  padding-bottom: 11px !important;
  border-radius: 5px !important;
}

body.ss-site-header-theme .ss-global-primary-items > li > a:hover,
body.ss-site-header-theme .ss-global-primary-items > li > a:focus-visible,
body.ss-site-header-theme .ss-global-primary-items > li.current-menu-item > a,
body.ss-site-header-theme .ss-global-primary-items > li.current_page_item > a,
body.ss-site-header-theme .ss-global-primary-row > a:hover,
body.ss-site-header-theme .ss-global-primary-row > a:focus-visible {
  color: #0d5d7d !important;
  background: #eef6fa !important;
  text-decoration: none !important;
}

/* Dropdown panels remain legible after transparent-header rules are removed. */
body.ss-site-header-theme .ss-global-primary-row :is(ul ul,.sub-menu),
body.ss-site-header-theme .ss-global-header :is(ul ul,.sub-menu) {
  color: var(--ss-header-ink) !important;
  background: #fff !important;
  border: 1px solid var(--ss-header-line) !important;
  border-radius: 8px !important;
  box-shadow: 0 14px 34px rgba(20,43,61,.14) !important;
}

body.ss-site-header-theme .ss-global-primary-row :is(ul ul,.sub-menu) a,
body.ss-site-header-theme .ss-global-header :is(ul ul,.sub-menu) a {
  color: #20384a !important;
  background: transparent !important;
  text-shadow: none !important;
}

/* Keep the theme's mobile visibility logic; only polish its controls. */
body.ss-site-header-theme .ss-global-header :is(.menu-toggle,.navbar-toggle,.mobile-menu-toggle,button[aria-label*="menu" i]) {
  color: #163144 !important;
  background: #fff !important;
  border: 1px solid #cfdae0 !important;
  border-radius: 8px !important;
  box-shadow: 0 5px 14px rgba(26,49,67,.09) !important;
}

body.ss-site-header-theme .ss-global-header :is(.menu-toggle,.navbar-toggle,.mobile-menu-toggle,button[aria-label*="menu" i]):focus-visible,
body.ss-site-header-theme .ss-global-header a:focus-visible {
  outline: 3px solid rgba(13,109,147,.24) !important;
  outline-offset: 3px !important;
}

@media (max-width: 900px) {
  body.ss-site-header-theme .ss-global-contact-row {
    min-height: 54px !important;
  }

  body.ss-site-header-theme .ss-global-consultation-link {
    min-height: 37px !important;
    padding: 8px 15px !important;
    font-size: 12px !important;
  }

  body.ss-site-header-theme .ss-global-primary-row :is(ul,.menu) {
    background: #fff !important;
  }
}

@media (max-width: 620px) {
  body.ss-site-header-theme .ss-global-utility-row {
    min-height: 0 !important;
  }

  body.ss-site-header-theme .ss-global-email-link {
    font-size: 11px !important;
  }

  body.ss-site-header-theme .ss-global-consultation-link {
    white-space: normal;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.ss-site-header-theme .ss-global-consultation-link {
    transition: none !important;
  }
}

@media print {
  body.ss-site-header-theme :is(.ss-global-utility-row,.ss-global-contact-row,.ss-global-primary-row) {
    display: none !important;
  }
}
