/*stormforce header (.sf-head) - fully self-contained markup and styles; legacy stylesheets and nav JS have no selectors that reach it. */

/* deferred.min.css force-fixes header[role=banner] with !important; pin it back into flow. */
html header[role="banner"] {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  height: auto !important;
  width: auto !important;
}

/* sf-head sits in normal flow; kill the legacy fixed-nav body offset regardless of the template's menu-dependent inline padding. */
html body {
  padding-top: 0 !important;
}

html .sf-head {
  position: relative;
  z-index: 1030;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  font-family: Roboto, sans-serif;
}
html .sf-head__top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin: 0 auto;
  padding: 0 20px;
  height: 96px;
}
/* Logo hangs over both bars, Precision-style; shrinks into the blue bar when stuck. */
html .sf-head__logo {
  position: absolute;
  top: 8px;
  left: 20px;
  z-index: 6;
  transition: top 0.2s ease;
}
html .sf-head__logo img {
  height: 100px;
  width: auto;
  display: block;
  transition: height 0.2s ease;
}
html .sf-head--stuck .sf-head__logo {
  top: 99px;
}
html .sf-head--stuck .sf-head__logo img {
  height: 45px;
}
html .sf-head__burger,
html .sf-head__micons,
html .sf-head__ratings {
  display: none;
}

/* ---- Blue menu bar ---- */
html .sf-head__bar {
  background: #0054a6;
  height: 51px;
}
html .sf-head__menu {
  list-style: none;
  margin: 0 auto;
  padding: 0 12px;
}
html .sf-head__menu > li {
  position: relative;
  list-style: none;
  margin: 0;
}
html .sf-head__menu > li > a {
  display: block;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  padding: 15px 16px;
  text-decoration: none;
}
html .sf-head__menu > li > a:hover,
html .sf-head__menu > li.sf-open > a {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}
html .sf-caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  vertical-align: middle;
  border-top: 4px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}
/* Own submenu (.sf-sub), untouched by the thrice-bound bs.dropdown JS and its backdrops. */
html .sf-head__menu .sf-sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  margin: 0;
  list-style: none;
  background: #ffffff;
  border: 0;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  padding: 6px 0;
  min-width: 220px;
}
html .sf-head__menu > li.sf-open > .sf-sub {
  display: block;
}
html .sf-head__menu .sf-sub > li {
  list-style: none;
  margin: 0;
}
html .sf-head__menu .sf-sub > li > a {
  display: block;
  padding: 8px 18px;
  font-size: 14px;
  color: #0054a6;
  text-decoration: none;
  white-space: nowrap;
}
html .sf-head__menu .sf-sub > li > a:hover {
  background: #edf3fa;
  color: #003d78;
}

/* ---- Stat cards ---- */
html .sf-cards {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
html .sf-cards .sf-card {
  position: relative;
  text-align: center;
  padding: 2px 18px;
}
html .sf-cards .sf-card + .sf-card {
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}
html .sf-card__name {
  margin: 0;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
html .sf-card__phone {
  display: block;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
html .sf-card__phone:hover {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}
html .sf-card__stars {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #ffffff;
  font-size: 14px;
  text-decoration: none;
}
html .sf-card__stars:hover {
  text-decoration: none;
}
html .sf-card__count {
  text-decoration: underline;
}

/* ---- Card dropdown: anchored under its card ---- */
html .sf-card > .dropdown-menu {
  top: 100%;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  margin-top: 6px;
  min-width: 260px;
  max-width: 320px;
  max-height: 62vh;
  overflow-y: auto;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  padding: 6px 0;
}
/* Last two cards open leftward so the menu never leaves the viewport. */
html .sf-cards .sf-card:nth-last-child(-n+2) > .dropdown-menu {
  left: auto !important;
  right: 0 !important;
  transform: none !important;
}
html .sf-card__menu > li > a {
  display: block;
  padding: 8px 18px;
  font-size: 14px;
  color: #0054a6;
  white-space: normal;
  text-align: left;
  text-decoration: none;
}
html .sf-card__menu > li > a:hover {
  background: #edf3fa;
  color: #003d78;
}
html .sf-card__menu > li > span {
  display: block;
  padding: 8px 18px;
  color: #8a97a5;
  text-align: left;
}

/* ---- Desktop / mobile split ---- */
@media only screen and (min-width: 768px) {
  /* Full-blue header, one seamless surface. */
  html .sf-head {
    background: #0054a6;
  }
  /* Header keeps its full height so pinning the bar never makes the page jump. */
  html header[role="banner"] {
    height: 147px !important;
    z-index: 1030;
  }
  /* Scroll effect: only the blue bar stays pinned.*/
  html .sf-head--stuck {
    position: fixed;
    top: -96px;
    left: 0;
    right: 0;
  }

  /* Drawer wrapper is chrome-less on desktop; deferred.min.css hides .collapse, so force it open. */
  html #sf-head-menu {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    overflow: visible !important;
  }
  html .sf-head__drawer-top {
    display: none;
  }
  html .sf-head__menu {
    display: flex;
    justify-content: flex-end;
  }
}
@media only screen and (max-width: 767px) {
  /* Blue top bar; logo left, quick icons + burger clustered right. */
  html .sf-head__top {
    height: auto;
    min-height: 60px;
    padding: 8px 12px;
    background: #0054a6;
    justify-content: flex-start;
    gap: 4px;
  }
  html .sf-head__logo {
    position: static;
    margin-right: auto;
  }
  html .sf-head__micons {
    display: flex;
    align-items: center;
    gap: 2px;
  }
  html .sf-head__micon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 44px;
    color: #ffffff;
    background: transparent;
    border: 0;
    padding: 0;
  }
  html .sf-head__micon:hover,
  html .sf-head__micon:focus {
    color: #ffffff;
  }

  /* ---- Ratings panel (people icon): average + per-area phones/stars ---- */
  html .sf-head.sf-ratings-open .sf-head__ratings {
    display: block;
    position: absolute;
    top: 100%;
    left: 10px;
    right: 10px;
    z-index: 1999;
    background: #f2f4f7;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
    padding: 14px 12px 10px;
    max-height: 70vh;
    overflow-y: auto;
    text-align: center;
  }
  html .sf-head__ratings-avg {
    padding-bottom: 10px;
    border-bottom: 1px solid #d9dee5;
  }
  html .sf-head__ratings-title {
    display: block;
    color: #555555;
    font-size: 15px;
    margin-bottom: 4px;
  }
  html .sf-head__ratings-count {
    display: block;
    margin-top: 4px;
    color: #0054a6;
    font-weight: 600;
    text-decoration: underline;
  }

  /* ---- Star breakdown popover behind the average stars (legacy dropdown parity) ---- */
  html .sf-break-toggle {
    background: transparent;
    border: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  html .sf-head__break {
    display: none;
  }
  html .sf-head.sf-break-open .sf-head__break {
    display: block;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
    padding: 12px 14px;
    margin: 10px auto 4px;
    max-width: 320px;
    text-align: left;
  }
  html .sf-break-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
  }
  html .sf-break-label {
    flex: 0 0 52px;
    color: #0054a6;
    font-size: 13px;
  }
  html .sf-break-bar {
    flex: 1 1 auto;
    height: 12px;
    background: #eeeeee;
    border-radius: 6px;
    overflow: hidden;
  }
  html .sf-break-bar > span {
    display: block;
    height: 100%;
    background: #fdb714;
  }
  html .sf-break-pct {
    flex: 0 0 44px;
    text-align: right;
    color: #0054a6;
    font-size: 13px;
  }
  html .sf-break-all {
    display: block;
    text-align: center;
    margin-top: 8px;
    color: #0054a6;
    text-decoration: underline;
    font-size: 14px;
  }

  /* ---- Sticky top bar on mobile (legacy parity); .sf-head--stuck is toggled by the header script ---- */
  html .sf-head--stuck .sf-head__top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
  }
  html .sf-head--stuck {
    padding-top: 60px; /* placeholder = the bar's min-height so the page doesn't jump */
  }
  html .sf-head--stuck.sf-ratings-open .sf-head__ratings {
    position: fixed;
    top: 60px;
    left: 10px;
    right: 10px;
  }
  html .sf-rating-row {
    padding: 10px 0;
    border-bottom: 1px solid #d9dee5;
  }
  html .sf-rating-row:last-child {
    border-bottom: 0;
  }
  html .sf-rating-row__name {
    display: block;
    color: #333333;
    font-size: 16px;
    font-weight: 700;
  }
  html .sf-rating-row__phone {
    display: block;
    color: #0054a6;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    margin: 2px 0;
  }
  html .sf-rating-row__stars,
  html .sf-rating-row__stars:hover,
  html .sf-rating-row__stars:focus {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #333333;
    text-decoration: none !important;
  }
  html .sf-rating-row__stars span {
    text-decoration: underline;
    font-size: 14px;
  }
  html .sf-head__logo img,
  html .sf-head--stuck .sf-head__logo img {
    height: 44px;
  }
  html .sf-cards {
    display: none;
  }
  html .sf-head__burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 40px;
    padding: 8px 10px;
    background: transparent;
    border: 0;
  }
  html .sf-head__burger span {
    display: block;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
  }
  html .sf-head__bar {
    height: auto;
  }

  /* ---- Expanded menu: full-screen blue drawer (chemwise-style) ---- */
  html .sf-head__drawer.in,
  html .sf-head__drawer.collapsing {
    display: block !important;
    visibility: visible !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: auto !important;
    background: #0054a6;
    z-index: 2000;
    overflow-y: auto;
    transition: none !important;
  }
  html .sf-head__drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
  }
  html .sf-head__drawer-logo {
    display: inline-block;
  }
  html .sf-head__drawer-logo img {
    height: 44px;
    width: auto;
    display: block;
  }
  html .sf-head__drawer-actions {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  html .sf-head__drawer-phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #ffffff;
  }
  html .sf-head__drawer-phone:hover,
  html .sf-head__drawer-phone:focus {
    color: #ffffff;
  }
  html .sf-head__drawer-close {
    width: 44px;
    height: 44px;
    background: transparent;
    border: 0;
    color: #ffffff;
    font-size: 32px;
    line-height: 1;
    padding: 0;
  }

  html .sf-head__menu {
    display: block;
    padding: 8px 0 24px;
  }
  html .sf-head__menu > li > a {
    padding: 14px 24px;
  }
  /* Chemwise-style submenu: full-width white rows with dark text. */
  html .sf-head__menu .sf-sub {
    position: static;
    width: 100%;
    min-width: 0;
    border-radius: 0;
    box-shadow: none;
    background: #ffffff;
    padding: 0;
  }
  html .sf-head__menu .sf-sub > li > a {
    color: #333333;
    font-size: 15px;
    padding: 13px 24px 13px 32px;
    border-bottom: 1px solid #e3e9f0;
    white-space: normal;
  }
  html .sf-head__menu .sf-sub > li:last-child > a {
    border-bottom: 0;
  }
  html .sf-head__menu .sf-sub > li > a:hover {
    background: #edf3fa;
    color: #003d78;
  }
}

/* ---- Neutralize the admin-pasted offset hacks; the static header owns the layout now ---- */
html main[role="main"] > section:first-child > .color-secondary-bg:first-child {
  margin-top: 0 !important;
}
html .review-headings.text-center {
  margin-top: 0 !important;
}
