/* css-header-stacked.css - styles that only matter on: the "stacked" header layout (Preferences → Header → Layout).
 * Linked from sections/header.liquid only while that layout is chosen. */

/* ---- Service strip: tabs and the branch card -----------------------------*/
.hdr-svc { display: block; background: var(--surface); border-bottom: 1px solid var(--line); }

/* The one-line fold-away shown on a phone, off the home page (see the snippet). */
.hdr-svc__toggle { display: none; }

.hdr-svc__inner { display: flex; align-items: center; min-height: 3.4rem; padding-block: 0.35rem; }

/* Tabs at the start, the branch card pushed to the end edge. */
.hdr-svc .service-tabs { width: 100%; }

.hdr-svc .service-tabs__branch { margin-inline-start: auto; }

/* The strip, the band and the menu row are for a desktop width; below 60rem the
 * compact bar of the default layout (menu button, wordmark) is what shows. */
.hdr-band,
.hdr-navrow { display: none; }

@media (min-width: 60.01rem) {
  .site-header--stacked .site-header__inner { display: none; }

  /* ---- Accent band -------------------------------------------------------- */
  .hdr-band {
    display: block;
    background: var(--accent);
    color: var(--accent-contrast, #fff);
  }

  .hdr-band__inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(1rem, 2vw, 1.75rem);
    padding-block: 0.9rem;
  }

  /* The logo sits on a light plaque, so any uploaded mark reads on the green. */
  .hdr-band__brand {
    align-self: stretch;
    min-width: 8.5rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-lg, 1rem);
    background: var(--surface);
    color: var(--ink);
  }
  .hdr-band__brand .brand__img { max-height: 4.25rem; }

  .hdr-band__main { display: grid; gap: 0.75rem; min-width: 0; }

  .hdr-band__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    min-width: 0;
  }

  /* Row one: links and the highlight. */
  .hdr-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem clamp(1rem, 2vw, 1.75rem);
    min-width: 0;
    font-size: 0.88rem;
    font-weight: 600;
  }

  .hdr-links__link { color: inherit; text-decoration: none; white-space: nowrap; }
  .hdr-links__link:hover,
  .hdr-links__link[aria-current] { color: inherit; text-decoration: underline; text-underline-offset: 0.25em; }

  .hdr-links__promo { display: inline-flex; align-items: center; gap: 0.45rem; }

  .hdr-tools { display: flex; align-items: center; gap: 0.5rem; flex: none; }

  /* The switchers are built for the light utility bar; on the band they take its colors. */
  .hdr-band .switcher > summary {
    border-color: rgb(255 255 255 / 0.35);
    background: transparent;
    color: inherit;
  }

  /* Row two: search, then the icons. */
  .hdr-search {
    position: relative;
    flex: 1 1 auto;
    max-width: 40rem;
  }

  .hdr-search__icon {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 1.1rem;
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    pointer-events: none;
  }

  .hdr-search__input {
    width: 100%;
    height: 3rem;
    padding: 0 1.25rem;
    padding-inline-start: 2.9rem;
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 0.95rem;
  }
  .hdr-search__input:focus-visible { outline: 0; border-color: color-mix(in srgb, var(--accent) 35%, #fff); box-shadow: 0 0 0 3px rgb(255 255 255 / 0.35); }

  .hdr-icons { display: flex; align-items: center; gap: 0.75rem; margin-inline-start: auto; flex: none; }

  .hdr-icons__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background: rgb(255 255 255 / 0.16);
    color: inherit;
  }
  .hdr-icons__btn:hover { background: rgb(255 255 255 / 0.26); color: inherit; }

  .hdr-icons__count {
    position: absolute;
    top: -0.2rem;
    inset-inline-end: -0.2rem;
    min-width: 1.15rem;
    padding: 0.15rem 0.3rem;
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
  }

  .hdr-phone {
    display: grid;
    gap: 0.1rem;
    margin-inline-start: 0.5rem;
    padding-inline-start: 1rem;
    border-inline-start: 1px solid rgb(255 255 255 / 0.3);
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
  }
  .hdr-phone:hover { color: inherit; }
  .hdr-phone__label { font-size: 0.75rem; opacity: 0.85; }
  .hdr-phone__num { font-family: var(--font-display); font-size: 1.05rem; }

  /* ---- Menu row (inside the pinned header) -------------------------------- */
  .hdr-navrow { display: block; }

  .hdr-navrow__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 3.75rem;
  }

  /* `.site-header .nav` is hidden by the phone rules in theme.css; here it is the page's menu. */
  .hdr-navrow .nav { display: flex; }
  .hdr-navrow .nav__link { font-size: 1rem; }
}

@media (max-width: 60rem) {
  .site-header--stacked .site-header__inner { display: grid; }

  /* Phone: where the order comes from first, full width, then the services as
   * equal tabs beneath it. The strip scrolls away; the bar below it stays. */
  .hdr-svc__inner { padding-block: 0.6rem; }

  .hdr-svc[data-ready] .hdr-svc__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem var(--gutter, 1rem);
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
  }

  .hdr-svc__toggle > svg:first-child { flex: none; color: var(--accent); }

  .hdr-svc__sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .hdr-svc__caret { flex: none; transition: transform 0.18s var(--ease, ease); }

  .hdr-svc.is-open .hdr-svc__caret { transform: rotate(180deg); }

  .hdr-svc[data-ready]:not(.is-open) .hdr-svc__inner { display: none; }

  .hdr-svc .service-tabs { flex-wrap: wrap; gap: 0.5rem; }

  .hdr-svc .service-tabs__branch {
    order: -1;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .hdr-svc .service-tabs__form { flex: 1 1 0; }

  .hdr-svc .service-tab { width: 100%; justify-content: center; padding-block: 0.65rem; }
  .hdr-svc .service-tab.is-active { padding-block: calc(0.65rem - 1px); }
}
