/* Header search bar. Loaded after shop.css; extends the Clean drop store system, no new colors.
   Phone: the bar row (wordmark, Shop, bag), then a full-width search row under it. Scrolling down
   slides the search row away behind the bar (a search icon takes its place); scrolling up or
   focusing it brings it back. Desktop (1000px+): wordmark left, a big search field as the centre of
   one 72px row, bag right, and the departments in a slim second row.

   --hdr-total is the full pinned height; sticky offsets elsewhere use it so nothing slides under. */

:root { --hdr-total: 112px; --hs-h: 48px; }

/* ---------- the field ---------- */
.hsearch { position: relative; grid-area: search; min-width: 0; }
.hs-field { position: relative; display: block; }
.hs-input {
  display: block; width: 100%; height: var(--hs-h); padding: 0 96px 0 48px;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--white);
  font-size: 16px; font-weight: 500; letter-spacing: 0; color: var(--ink);
  -webkit-appearance: none; appearance: none; text-overflow: ellipsis;
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.hs-input::-webkit-search-cancel-button, .hs-input::-webkit-search-decoration { -webkit-appearance: none; }
.hs-input::placeholder { color: var(--meta); font-weight: 400; }
.hs-input:hover { border-color: var(--meta); }
.hs-input:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.hs-icon {
  position: absolute; left: 15px; top: 50%; width: 22px; height: 22px; margin-top: -11px;
  color: var(--ink); pointer-events: none;
}

/* the rotating "Search for <term>" overlay: decorative; the input keeps its label and placeholder */
.hs-ph { display: none; }
.js .hs-ph {
  position: absolute; left: 48px; right: 96px; top: 1px; bottom: 1px; display: flex; align-items: center;
  gap: .32em; overflow: hidden; pointer-events: none; font-size: 16px; line-height: 24px; color: var(--meta);
}
.hs-ph-lead { flex: none; white-space: nowrap; }
.hs-term-clip { min-width: 0; flex: 0 1 auto; overflow: hidden; height: 24px; }
.hs-term {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-weight: 700;
}
.js .hs-has-ph .hs-input::placeholder { color: transparent; }   /* the overlay stands in for it */
.hs-filled .hs-ph, .hs-filled .hs-input::placeholder { visibility: hidden; }

/* trailing controls */
.hs-clear, .hs-go { position: absolute; top: 50%; display: grid; place-items: center; border-radius: 3px; }
.hs-clear { right: 52px; width: 36px; height: 36px; margin-top: -18px; color: var(--meta); display: none; }
.hs-clear svg { width: 18px; height: 18px; }
.hs-filled .hs-clear { display: grid; }
.hs-clear:active { opacity: .6; }
.hs-go {
  right: 5px; height: calc(var(--hs-h) - 12px); width: 40px; margin-top: calc((var(--hs-h) - 12px) / -2);
  background: var(--ink); color: var(--white);
  transition: background-color var(--t-fast), transform 140ms var(--ease-out);
}
.hs-go svg { width: 20px; height: 20px; }
.hs-go:active { transform: scale(.96); }
.hs-go-label { display: none; }

/* ---------- the dropdown ---------- */
.hs-panel {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  max-height: min(72dvh, 460px); overflow-y: auto; overscroll-behavior: contain;
  padding: var(--s3) var(--s4) var(--s4); background: var(--white);
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 16px 32px -16px rgba(17, 17, 17, .18);
}
.hs-expanded .hs-panel, html:not(.js) .hsearch:focus-within .hs-panel { display: block; }
.hs-block + .hs-block { margin-top: var(--s4); }
.hs-head { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
.hs-title { font-size: var(--t-sm); font-weight: 600; color: var(--meta); }
.hs-link {
  font-size: var(--t-sm); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-thickness: 1px; text-decoration-color: #BDBDBD; padding: 6px 0 6px 12px;
}
.hs-rows { margin-top: var(--s1); }
.hs-row {
  display: flex; align-items: center; gap: var(--s3); min-height: 44px; margin: 0 calc(var(--s2) * -1);
  padding: 0 var(--s2); border-radius: var(--r); font-size: var(--t-base); font-weight: 500;
}
.hs-row svg { width: 18px; height: 18px; color: var(--meta); flex: none; }
.hs-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-row.is-active { background: var(--wash); }
.hs-chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.hs-chip { display: inline-flex; align-items: center; }
.hs-chip.is-active { border-color: var(--ink); background: var(--wash); }
.hs-chip:active { transform: scale(.96); }

@media (prefers-reduced-motion: no-preference) {
  .hs-expanded .hs-panel { animation: hs-in 180ms var(--ease-out); }
  @keyframes hs-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}

/* reduced motion: no rotating overlay; the static "Search Chiefs, Mizzou, ..." placeholder stays */
@media (prefers-reduced-motion: reduce) {
  .js .hs-ph { display: none; }
  .js .hs-has-ph .hs-input::placeholder { color: var(--meta); }
}

/* ---------- phone + tablet: bar row, then the search row ---------- */
@media (max-width: 999.98px) {
  .site-header { background: transparent; border-bottom: 0; pointer-events: none; }
  .header-inner {
    position: relative; isolation: isolate; height: auto;
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; column-gap: var(--s1);
    grid-template-rows: var(--hdr) auto;
    grid-template-areas: "brand shop open bag" "search search search search"; align-items: center;
  }
  .header-inner > * { pointer-events: auto; }
  /* the bar row's own white ground (full bleed), above the search row so that can tuck behind it */
  .header-inner::before {
    content: ""; position: absolute; z-index: 1; top: 0; left: calc(50% - 50vw); width: 100vw; height: var(--hdr);
    background: var(--white); border-bottom: 1px solid transparent; pointer-events: auto;
    transition: border-color 200ms var(--ease-out);
  }
  .brand, .header-shop, .hs-open, .bag-btn { position: relative; z-index: 2; height: var(--hdr); }
  .brand { grid-area: brand; height: 44px; align-self: center; }
  .header-shop { grid-area: shop; height: 44px; align-self: center; }
  .hs-open { grid-area: open; display: none; height: 44px; align-self: center; }
  .bag-btn { grid-area: bag; height: 44px; align-self: center; }
  .hsearch {
    z-index: 0; padding: 0 0 var(--s2); transform: none;
    transition: transform 240ms var(--ease-out), visibility 0s;
  }
  .hsearch::before {
    content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: calc(50% - 50vw); width: 100vw;
    background: var(--white); border-bottom: 1px solid var(--line);
  }
  .hsearch .hs-field { padding-top: 0; }
  .hs-panel {
    left: calc(var(--gut) * -1); right: calc(var(--gut) * -1); top: calc(100% - var(--s2) + 1px);
    border-width: 0 0 1px; border-radius: 0; padding: var(--s3) var(--gut) var(--s4);
    max-height: calc(100dvh - var(--hdr-total) - var(--s4));
  }
  .site-header.is-condensed .header-inner::before { border-bottom-color: var(--line); }
  .site-header.is-condensed .hsearch { transform: translateY(-100%); visibility: hidden; transition: transform 240ms var(--ease-out), visibility 0s 240ms; }
  .site-header.is-condensed .hs-open { display: grid; }
  .site-header.is-condensed .hs-open + .bag-btn { margin-left: 0; }
}
@media (max-width: 999.98px) and (prefers-reduced-motion: reduce) {
  .hsearch, .site-header.is-condensed .hsearch { transition: none; }
}
@media (max-width: 999.98px) and (hover: hover) {
  .hs-go:hover { background: var(--ink-hover); }
}

/* ---------- desktop: the search field is the centre of the header ---------- */
@media (min-width: 1000px) {
  :root { --hdr-total: 112px; --hs-h: 54px; }
  .header-inner {
    height: 72px; display: grid; align-items: center; column-gap: var(--s6);
    grid-template-rows: none;
    grid-template-columns: minmax(max-content, 1fr) minmax(0, 760px) minmax(max-content, 1fr);
    grid-template-areas: "brand search bag";
  }
  .brand { grid-area: brand; margin-right: 0; justify-self: start; }
  .header-shop, .hs-open { display: none; }
  .bag-btn { grid-area: bag; margin-right: -10px; justify-self: end; }
  .hsearch { width: 100%; }
  .hs-input { padding: 0 150px 0 56px; font-size: 17px; border-color: var(--line-strong); }
  .hs-icon { left: 18px; width: 24px; height: 24px; margin-top: -12px; }
  .js .hs-ph { left: 56px; right: 150px; font-size: 17px; }
  .hs-clear { right: 108px; }
  .hs-go { width: 92px; gap: 6px; grid-auto-flow: column; justify-content: center; right: 6px;
           height: calc(var(--hs-h) - 12px); margin-top: calc((var(--hs-h) - 12px) / -2); }
  .hs-go-label { display: inline; font-size: var(--t-ui); font-weight: 700; }
  .hs-go svg { width: 18px; height: 18px; }
  .hs-go:hover { background: var(--ink-hover); }
  .hs-panel { padding: var(--s4) var(--s5) var(--s5); top: calc(100% + 8px); }
  .hs-chip { height: 38px; padding: 0 16px; font-size: var(--t-ui); }
  .hs-row:hover { background: var(--wash); }
  .header-sub { border-top: 0; }
  .header-sub .wrap { display: block; }
  .header-sub .nav-main { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0 0 0 -10px; min-width: 0; }
  .header-sub .header-link { height: 40px; font-size: var(--t-ui); }
  .header-sub .header-link[aria-current="page"] { text-underline-offset: 8px; }
  .site-header { padding-bottom: 0; }
  .site-header .header-sub { height: 40px; }
  /* sticky summary panels sit under the taller header */
  html .bag-page .bag-foot, html .receipt { top: calc(var(--hdr-total) + 24px); }
}
@media (max-width: 999.98px) {
  .header-sub { display: none; }
}
