/*
 * Headers, How It Works dropdown, mobile menu overlay.
 * Figma: Site header · Desktop (22:52), Site header · Mobile (69:68),
 * Nav dropdown · How It Works (207:18), Nav overlay · Mobile 390 (101:864),
 * landing Header (352:5).
 *
 * The full desktop bar (logo, 8 links, phone, button) needs about 1,060px,
 * so the header switches to the mobile bar below 1100px instead of the
 * general 980px tablet breakpoint.
 */

.jsds-header {
  position: relative;
  z-index: 100;
  background: var(--jsds-surface-white);
}

.jsds-header a {
  text-decoration: none;
}

.jsds-header .jsds-logo {
  display: block;
  flex: 0 0 auto;
  line-height: 0;
}

.jsds-header .jsds-logo img {
  width: auto;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

/* ---------- Desktop bar ---------- */

.jsds-header__bar--desktop,
.jsds-header--landing .jsds-header__bar {
  border-bottom: 1px solid var(--jsds-border-default);
  background: var(--jsds-surface-white);
}

.jsds-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 84px;
}

.jsds-header__bar--desktop .jsds-logo,
.jsds-header--landing .jsds-logo {
  width: 82px;
  height: 60px;
}

.jsds-header__nav {
  flex: 1 1 auto;
  min-width: 0;
}

.jsds-header .jsds-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.jsds-nav__item {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.jsds-header .jsds-nav__link {
  display: block;
  padding: 30px 0; /* full-height hover target in the 84px bar */
  font: 600 16px/1.3 var(--jsds-font-body);
  color: var(--jsds-ink-900);
  white-space: nowrap;
}

/* Active item in brand red, per the Figma component note */
.jsds-header .jsds-nav__link[aria-current="page"],
.jsds-header .jsds-nav__link:hover,
.jsds-header .jsds-nav__link:focus-visible {
  color: var(--jsds-brand-red);
}

.jsds-header .jsds-nav__link:focus-visible,
.jsds-header .jsds-header__phone:focus-visible,
.jsds-dropdown__link:focus-visible,
.jsds-overlay a:focus-visible,
.jsds-overlay button:focus-visible,
.jsds-header__menu:focus-visible {
  outline: var(--jsds-focus-ring);
  outline-offset: 2px;
}

.jsds-overlay a:focus-visible,
.jsds-overlay button:focus-visible {
  outline-color: var(--jsds-surface-white);
}

.jsds-header__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  flex: 0 0 auto;
}

.jsds-header .jsds-header__phone {
  font: 400 13px/1.4 var(--jsds-font-mono);
  color: var(--jsds-ink-900);
  white-space: nowrap;
}

/* ---------- Landing header ---------- */
/*
 * Figma: landing Header 352:5 (copy 352:215), browser-inspected [B]:
 * row, space-between, padding 12/120, white, 1px bottom border/default,
 * 85px tall. Logo 82x60. Actions: row, gap 22, phone Label/16 SemiBold
 * ink/900, Button Primary M. No navigation. Vertical centring is [I]
 * (from the layer positions).
 */
.jsds-header--landing .jsds-header__actions {
  gap: 22px;
}

.jsds-header .jsds-header__phone--landing {
  font: 600 16px/1.3 var(--jsds-font-body);
  color: var(--jsds-ink-900);
}

.jsds-header .jsds-header__phone--landing:hover {
  color: var(--jsds-brand-red); /* not designed; matches nav link hover */
}

/* ---------- Dropdown ---------- */

.jsds-dropdown {
  position: absolute;
  top: 100%;
  left: -24px;
  width: 320px;
  padding: 20px 24px;
  border-top: 3px solid var(--jsds-brand-red);
  background: var(--jsds-surface-white);
  box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.12);
  visibility: hidden;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;
}

.jsds-nav__item--has-sub:hover > .jsds-dropdown,
.jsds-nav__item--has-sub:focus-within > .jsds-dropdown,
.jsds-nav__item--has-sub.is-open > .jsds-dropdown {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}

/* Esc closes it even while the pointer or focus is still inside */
.jsds-nav__item--has-sub.is-closed > .jsds-dropdown {
  visibility: hidden;
  opacity: 0;
}

.jsds-header .jsds-dropdown__list { /* beats Divi .et-l--header ul */
  margin: 0;
  padding: 0;
  list-style: none;
}

.jsds-header .jsds-dropdown__list li {
  margin: 0;
  padding: 0;
}

.jsds-header .jsds-dropdown__link {
  display: block;
  padding: 12px 0;
  font: 600 16px/1.3 var(--jsds-font-body);
  color: var(--jsds-ink-900);
}

.jsds-header .jsds-dropdown__link:hover,
.jsds-header .jsds-dropdown__link[aria-current="page"] {
  color: var(--jsds-brand-red);
}

/* ---------- Mobile bar ---------- */

.jsds-header__bar--mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid var(--jsds-border-default);
  background: var(--jsds-surface-white);
}

.jsds-header__bar--mobile .jsds-logo {
  width: 63px;
  height: 46px;
}

.jsds-header .jsds-header__menu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0 -11px 0 0; /* keep the 22px bars on the 20px gutter */
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.jsds-header__menu-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jsds-header__menu-bars span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--jsds-ink-900);
}

@media (max-width: 1099px) {
  .jsds-header__bar--desktop {
    display: none;
  }

  .jsds-header__bar--mobile {
    display: flex;
  }
}

/*
 * Landing header on mobile (<= 767px): no Figma frame. Assumption, based on
 * the Site header · Mobile bar (69:68) for size only: 64px bar, 20px
 * gutter, 63x46 logo. Logo + phone; the button is dropped because logo,
 * phone and a 184px button do not fit in 350px, and landing heroes carry
 * the quote form directly below. 768-1099px keeps the desktop layout
 * (it fits; there is no nav to collapse).
 */
@media (max-width: 767px) {
  .jsds-header--landing .jsds-header__inner {
    height: 64px;
    gap: 16px;
  }

  .jsds-header .jsds-header__phone--landing {
    display: inline-flex;
    align-items: center;
    min-height: 44px; /* touch target */
  }

  .jsds-header--landing .jsds-logo {
    width: 63px;
    height: 46px;
  }

  .jsds-header--landing .jsds-header__cta {
    display: none;
  }
}

/* ---------- Slim landing header ---------- */
/*
 * Figma: "Landing header (slim)" 42:853 / 76:2441, MCP 2026-11-24 (exact):
 * white, 1px bottom border/default, no padding; 1200 wrap, space-between,
 * items centred, gap 24. Logo 71x52. Actions: row, gap 20, items centred:
 * phone IBM Plex Mono 17/1.4 ink/900, Button Primary M (52px, so the bar
 * is 52 tall). Mobile (390): bar 96 tall, 20px gutter, logo centred, phone
 * over the button in a left-aligned column, gap 20.
 */
/* Figma's border is inside the 52px frame: drawn over the bar, not under it */
.jsds-header--slim .jsds-header__bar {
  position: relative;
  border-bottom: 0;
}

.jsds-header--slim .jsds-header__bar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--jsds-border-default);
  pointer-events: none;
}

.jsds-header--slim .jsds-header__inner {
  gap: 24px;
  justify-content: space-between;
  height: 52px;
}

.jsds-header--slim .jsds-logo {
  width: 71px;
  height: 52px;
}

.jsds-header--slim .jsds-header__actions {
  gap: 20px;
}

.jsds-header.jsds-header--slim .jsds-header__phone--landing {
  font: 400 17px/1.4 var(--jsds-font-mono);
  color: var(--jsds-ink-900);
}

.jsds-header.jsds-header--slim .jsds-header__phone--landing:hover {
  color: var(--jsds-brand-red);
}

@media (max-width: 767px) {
  .jsds-header--slim .jsds-header__inner {
    height: 96px;
    gap: 24px;
  }

  .jsds-header--slim .jsds-logo {
    width: 71px;
    height: 52px;
  }

  .jsds-header--slim .jsds-header__actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .jsds-header.jsds-header--slim .jsds-header__phone--landing {
    display: block;
    min-height: 0;
  }

  .jsds-header--slim .jsds-header__cta {
    display: inline-flex;
  }
}

/*
 * Slim header, compact on mobile: Figma "Header" 43:34 (Ship on a J&S
 * Truck · Mobile, MCP 2026-11-24, exact): 46px, padding 0/16, white, 1px
 * bottom border/default, space-between: logo 63x46, phone IBM Plex Mono
 * 14/1.4 ink/900. No button: the hero below holds the quote form.
 */
@media (max-width: 767px) {
  .jsds-header--slim-compact .jsds-container.jsds-header__inner {
    height: 46px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .jsds-header--slim-compact .jsds-logo {
    width: 63px;
    height: 46px;
  }

  .jsds-header--slim-compact .jsds-header__actions {
    flex-direction: row;
    align-items: center;
  }

  .jsds-header.jsds-header--slim-compact .jsds-header__phone--landing {
    font-size: 14px;
  }

  .jsds-header--slim-compact .jsds-header__cta {
    display: none;
  }
}

/* ---------- Mobile menu overlay ---------- */

/* Moved to <body> by jsds-nav.js so no stacking context can cover it */
.jsds-overlay {
  --jsds-on-dark-strong: #efe9ea; /* overlay text; raw value in Figma */
  position: fixed;
  inset: 0;
  z-index: 100000; /* above Divi's fixed header and the admin bar */
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--jsds-surface-dark-photo);
  color: var(--jsds-surface-white);
}

.jsds-overlay[hidden] {
  display: none;
}

.jsds-overlay a {
  text-decoration: none;
}

.jsds-overlay .jsds-logo {
  display: block;
  line-height: 0;
}

.jsds-overlay .jsds-logo img {
  width: auto;
  height: 100%;
  object-fit: contain;
}

.jsds.jsds-overlay ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.jsds.jsds-overlay li {
  margin: 0;
  padding: 0;
}

.jsds-overlay__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--jsds-border-default);
  background: var(--jsds-surface-white);
}

.jsds-overlay__top .jsds-logo {
  width: 49px;
  height: 36px;
}

.jsds-overlay .jsds-overlay__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 36px;
  margin-right: -8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--jsds-ink-900);
  font: 700 34px/1.06 var(--jsds-font-display);
  cursor: pointer;
}

/* The quote step pages (/step3/ to /step5/) also load the plugin's
   quote-steps.min.css: button { color: #fff !important } and, up to
   device-width 991, button { width: 100% !important }. Keep the menu and
   close buttons at their own size and colour there. */
.jsds-header button.jsds-header__menu,
.jsds-overlay button.jsds-overlay__close {
  width: 44px !important;
}

.jsds-overlay button.jsds-overlay__close {
  color: var(--jsds-ink-900) !important;
}

.jsds-overlay__primary {
  padding: 12px 20px 8px;
}

.jsds-overlay__item + .jsds-overlay__item {
  border-top: 1px solid var(--jsds-border-warm);
}

.jsds-overlay .jsds-overlay__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  color: var(--jsds-surface-white);
  font: 700 26px/1.06 var(--jsds-font-display);
}

.jsds-overlay__chev {
  font: 400 22px/1.5 var(--jsds-font-body);
}

.jsds-overlay__sub {
  margin: -4px 0 16px !important;
  padding: 12px 0 0 16px !important;
  border-left: 2px solid var(--jsds-ink-500);
}

.jsds-overlay .jsds-overlay__sublink {
  display: block;
  padding: 12px 0;
  color: var(--jsds-on-dark-strong);
  font: 400 20px/1.5 var(--jsds-font-body);
}

.jsds.jsds-overlay .jsds-overlay__secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  padding: 16px 20px 20px;
}

.jsds-overlay .jsds-overlay__secondary a {
  display: block;
  color: var(--jsds-on-dark-strong);
  font: 600 14px/1.3 var(--jsds-font-body);
}

.jsds-overlay__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px 24px;
  border-top: 1px solid var(--jsds-border-warm);
}

.jsds-overlay .jsds-overlay__hours {
  margin: 0;
  color: var(--jsds-on-dark-strong);
  font: 400 13px/1.4 var(--jsds-font-body);
  text-transform: uppercase;
}

.jsds-overlay .jsds-overlay__phone {
  color: var(--jsds-surface-white);
  font: 700 26px/1.06 var(--jsds-font-display);
}

/* Lock page scroll while the overlay is open */
html.jsds-menu-open,
html.jsds-menu-open body {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .jsds-dropdown {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
 * Quote header (Figma 16:35 desktop 52px, 17:59 mobile 42px): /step2/.
 * Markup: template-parts/components/header-quote.php via header-steps.php.
 * Link colours set by class to beat quote-steps.min.css "body a".
 * ------------------------------------------------------------------------ */

.jsds-qheader {
  position: relative;
  z-index: 10;
  background: var(--jsds-surface-white);
  border-bottom: 1px solid var(--jsds-border-default);
  font-family: var(--jsds-font-body);
}

.jsds-qheader__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.jsds-qheader__bar--desktop {
  max-width: calc(var(--jsds-container) + 2 * var(--jsds-gutter));
  height: 51px; /* 52 with the border */
  margin: 0 auto;
  padding: 0 var(--jsds-gutter);
}

.jsds-qheader__bar--mobile {
  display: none;
  height: 41px; /* 42 with the border */
  padding: 0 16px;
}

.jsds-qheader .jsds-logo,
.jsds-qheader .jsds-logo img {
  display: block;
}

.jsds-qheader__bar--desktop .jsds-logo img {
  width: 71px;
  height: 52px;
  margin-bottom: -1px; /* Figma: the logo sits over the bottom border */
}

.jsds-qheader__bar--mobile .jsds-logo img {
  width: 57px;
  height: 42px;
  margin-bottom: -1px;
}

.jsds-qheader p.jsds-qheader__dispatch {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 0;
  font: 400 14px/1.5 var(--jsds-font-body);
  color: var(--jsds-ink-500);
}

.jsds-qheader a.jsds-qheader__phone {
  font: 400 17px/1.4 var(--jsds-font-mono);
  color: var(--jsds-ink-900);
  text-decoration: none;
}

.jsds-qheader__number {
  min-width: 51px;
  font: 400 12px/1.4 var(--jsds-font-mono);
  color: var(--jsds-ink-500);
}

.jsds-qheader a.jsds-qheader__call {
  font: 400 14px/1.4 var(--jsds-font-body);
  color: var(--jsds-ink-900);
  text-decoration: none;
}

.jsds-qheader a.jsds-qheader__phone:hover,
.jsds-qheader a.jsds-qheader__call:hover {
  color: var(--jsds-brand-red);
}

.jsds-qheader a:focus-visible {
  outline: var(--jsds-focus-ring);
  outline-offset: 2px;
}

/* /step2/ Theme Builder body layout keeps Divi's default section padding
   (4% desktop, 50px up to 980px), which steps 3 to 5 set to 0. Figma has the
   Result content (its own 40px / 20px top padding) right under the header. */
body.jsds-quote-header-page .et-l--body .et_pb_section {
  padding-top: 0;
  padding-bottom: 0;
}

@media (max-width: 767px) {
  .jsds-qheader__bar--desktop {
    display: none;
  }

  .jsds-qheader__bar--mobile {
    display: flex;
  }
}
