/* The vehicle band (templates/parts/_band.html): the one place a shopper sets the vehicle, on a full-width bar under a
   site's header, drawn only from the --parts-* tokens (tokens.css; the band's own are --parts-band-*). Two states,
   orbitalparts.ca's: asking, the heading beside the row; set (.kit-band--set), a car disc, "Shopping for" over the
   vehicle and the Parts that fit, Change and Clear buttons, the row hidden until Change reveals it under a rule. Both
   wear the band's own colours (--parts-band-set-* default to --parts-band-*, Greg 2026-10-25: Go must not repaint the
   bar), and every tint on the bar is the band's ink mixed thin, so the buttons read on a light band as on a dark one.
   The row (Greg 2026-10-28, prototype A): three joined tabs on the left (Select your vehicle, Describe it, VIN; the band has no heading besides), the
   picked one filled with the band's ink, and the picked tab's form on the rest of the row; every panel is one 44px
   field tall, so the row keeps its height whichever tab is picked, and a miss's line sits beside its field inside it.
   Each cascade field is a native select plus the kit-ymm-field skin (kit-ymm-field.js): band.js marks the form .is-live
   once it has mounted them, so without a script the selects show, with one the skin. Without a script the tabs cannot
   switch, so @media (scripting: none) drops them and stacks the three forms, each usable, and opens the row under a set
   vehicle (Change cannot); a browser that runs scripts draws the tabs from the first paint, with no jump when band.js
   mounts. What is closed is drawn .is-off (a site's reset may hide [hidden] with !important, which no kit rule can
   undo), and band.js turns it into the hidden attribute. On a phone the tabs take a row of their own and the panel the next.
   The container is the parts pages' (--parts-max wide, --parts-gut each side), and the band stacks over the page so
   an open list hangs past it.
   Every rule sits in @layer kit, between a site's base and site layers (tokens.css). */
@layer base, kit, site;

@layer kit {

.kit-band { position: relative; z-index: 20; background: var(--parts-band-bg); color: var(--parts-band-ink); border-bottom: 4px solid var(--parts-band-edge); font-family: var(--parts-font); }
/* while a vehicle answer is fetched in place (parts.js), the band dims; opacity only, so nothing moves */
.kit-band[aria-busy="true"] .kit-band__in { opacity: .6; transition: opacity .15s; }
.kit-band *, .kit-band *::before, .kit-band *::after { box-sizing: border-box; }
.kit-band__in { max-width: var(--parts-max); margin: 0 auto; padding: 16px var(--parts-gut); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }

/* set: the band's own colours by default (--parts-band-set-*), the vehicle named, the three buttons; the form (Change) under a rule */
.kit-band--set { background: var(--parts-band-set-bg); color: var(--parts-band-set-ink); border-bottom-color: var(--parts-band-set-edge); }
.kit-band__current { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.kit-band__car { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: color-mix(in srgb, currentColor 12%, transparent); }
.kit-band__now { flex: 1 1 auto; display: flex; flex-direction: column; margin: 0; line-height: 1.2; }
.kit-band__now-label { font: 400 13px/1.4 var(--parts-mono); } /* the band's ink at full strength: no word through an opacity */
.kit-band__now strong { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.kit-band__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.kit-band__btn {
  display: inline-flex; align-items: center; justify-content: center; height: 44px; min-width: 96px; margin: 0; padding: 0 18px;
  border-radius: var(--parts-radius); font: 600 15px/1 var(--parts-font); text-decoration: none; white-space: nowrap; cursor: pointer;
}
/* Parts that fit: the bar's colours swapped (its ink as the fill, its background as the words), so it reads on any band */
.kit-band__btn--light { background: var(--parts-band-set-ink); color: var(--parts-band-set-bg); border: 0; }
.kit-band__btn--light:hover { background: color-mix(in srgb, var(--parts-band-set-ink) 85%, var(--parts-band-set-bg)); }
.kit-band__btn--ghost { background: transparent; color: inherit; border: 1px solid color-mix(in srgb, currentColor 45%, transparent); }
.kit-band__btn--ghost:hover, .kit-band__btn--ghost[aria-expanded="true"] { border-color: currentColor; background: color-mix(in srgb, currentColor 8%, transparent); }

/* the row: the tabs, then the picked tab's panel, one field tall whatever the tab; under a set vehicle, a rule above it */
.kit-band__row { flex: 1 1 640px; min-width: 0; display: flex; align-items: center; gap: 16px; }
.kit-band__row.is-off, .kit-band__row[hidden] { display: none; }
.kit-band--set .kit-band__row { flex-basis: 100%; padding-top: 12px; border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); }

/* the tabs: three joined boxes, the picked one filled with the band's ink */
.kit-band__tabs { flex: none; display: flex; height: 44px; border: 1px solid color-mix(in srgb, currentColor 45%, transparent); border-radius: var(--parts-radius); overflow: hidden; }
.kit-band__tab {
  margin: 0; padding: 0 16px; height: 100%; background: transparent; color: inherit; border: 0; border-radius: 0;
  font: 600 15px/1 var(--parts-font); white-space: nowrap; cursor: pointer;
}
.kit-band__tab + .kit-band__tab { border-left: 1px solid color-mix(in srgb, currentColor 45%, transparent); }
.kit-band__tab:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.kit-band__tab[aria-selected="true"] { background: var(--parts-band-ink); color: var(--parts-band-bg); }
.kit-band--set .kit-band__tab[aria-selected="true"] { background: var(--parts-band-set-ink); color: var(--parts-band-set-bg); }

.kit-band__panels { flex: 1 1 auto; min-width: 0; }
.kit-band__panel { height: 44px; margin: 0; display: flex; align-items: center; gap: 12px; min-width: 0; }
.kit-band__panel.is-off, .kit-band__panel[hidden] { display: none; }

/* Describe it and VIN: the field, its miss line beside it, View */
.kit-band__input {
  flex: 1 1 200px; min-width: 0; height: 44px; margin: 0; padding: 0 12px;
  background: var(--parts-bg); color: var(--parts-ink); border: 1px solid var(--parts-border); border-radius: var(--parts-radius);
  font: 400 16px/42px var(--parts-font);
}
.kit-band__input::placeholder { color: var(--parts-ink-soft); opacity: 1; }
.kit-band__input--vin { text-transform: uppercase; letter-spacing: .04em; font-family: var(--parts-mono); }
.kit-band__input--vin::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--parts-font); }
.kit-band__input[aria-invalid="true"] { border: 2px solid var(--parts-red); }
.kit-band__missed {
  flex: 0 1 auto; min-width: 0; margin: 0; padding-left: 10px; border-left: 3px solid var(--parts-red);
  color: inherit; font: 600 14px/20px var(--parts-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* a field: the select, or the skin's button wearing it; the panel hangs under it */
.kit-band .kit-ymm-field { position: relative; flex: 1 1 120px; min-width: 0; }
.kit-band .kit-ymm-field[hidden] { display: none; }
.kit-band select, .kit-band .kit-ymm-field__button {
  position: relative; display: block; width: 100%; height: 44px; margin: 0; padding: 0 36px 0 12px;
  background: var(--parts-bg); color: var(--parts-ink); border: 1px solid var(--parts-border); border-radius: var(--parts-radius);
  font: 400 16px/42px var(--parts-font); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; -webkit-appearance: none; appearance: none;
}
/* a field not yet open (Make before a Year): its words at full contrast, told apart by a dashed rule, never faded */
.kit-band select:disabled, .kit-band .kit-ymm-field__button:disabled { border-style: dashed; border-color: var(--parts-ink); cursor: default; }
.kit-band__form:not(.is-live) .kit-ymm-field__button, .kit-band__form:not(.is-live) .kit-ymm-field__panel { display: none; }
.kit-band__form.is-live select { display: none; }
.kit-band .kit-ymm-field__button--empty { color: var(--parts-ink-soft); }
/* the chevron: down, the open gray and up while the list is open */
.kit-band .kit-ymm-field__button::after {
  content: ""; position: absolute; top: 50%; right: 14px; width: 7px; height: 7px; margin-top: -5px;
  border: solid var(--parts-ink-soft); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.kit-band .kit-ymm-field__button[aria-expanded="true"] { border-color: var(--parts-band-field-open); }
.kit-band .kit-ymm-field__button[aria-expanded="true"]::after { margin-top: -1px; border-color: var(--parts-band-field-open); transform: rotate(225deg); }
.kit-band .kit-ymm-field__panel {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1;
  max-height: min(320px, 50vh); overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 4px 0;
  background: var(--parts-bg); border: 1px solid var(--parts-band-field-open); border-radius: var(--parts-radius); box-shadow: var(--parts-card-shadow);
}
.kit-band .kit-ymm-field__panel[hidden] { display: none; }
.kit-band .kit-ymm-field__option {
  display: block; width: 100%; margin: 0; padding: 8px 12px; background: none; color: var(--parts-ink);
  border: 0; border-radius: 0; font: 400 16px/22px var(--parts-font); text-align: left; cursor: pointer;
}
.kit-band .kit-ymm-field__option:hover, .kit-band .kit-ymm-field__option:focus-visible { background: var(--parts-accent-wash-strong); outline: none; }
.kit-band .kit-ymm-field__option[aria-selected="true"] { color: var(--parts-ink); font-weight: 700; }

.kit-band__go {
  flex: none; height: 44px; min-width: 96px; margin: 0; padding: 0 18px; background: var(--parts-band-go); color: var(--parts-band-go-ink);
  border: 0; border-radius: var(--parts-radius); font: 600 15px/1 var(--parts-font); cursor: pointer;
}
.kit-band__go:hover { background: var(--parts-band-go-hover); }
.kit-band :is(a, button, select, input):focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.kit-band .kit-band__tab:focus-visible { outline-offset: -5px; }
.kit-band__panel[aria-busy="true"] { opacity: .7; }

/* a phone: the heading over the row, the tabs a row of three, the panel under them and free to wrap, Go full width under
   the cascade; the set row tighter, its three buttons a row */
@media (max-width: 599.98px) {
  .kit-band__row { flex-basis: 100%; flex-wrap: wrap; gap: 12px; }
  .kit-band__tabs { flex: 1 1 100%; }
  .kit-band__tab { flex: 1 1 0; min-width: 0; padding: 0 6px; font-size: 14px; line-height: 1.1; white-space: normal; }
  .kit-band__panels { flex: 1 1 100%; }
  .kit-band__panel { height: auto; flex-wrap: wrap; }
  .kit-band__input { flex: 1 1 0; }
  .kit-band__missed { order: 3; flex-basis: 100%; white-space: normal; }
  /* Year and Make share one line, half each; Model takes the next line whole and shows once both are picked (the form's
     has-make, _band.html and band.js); Position, Submodel and Go are whole lines (Greg 2026-10-26) */
  .kit-band .kit-ymm-field, .kit-band__form .kit-band__go { flex-basis: 100%; }
  .kit-band .kit-ymm-field--year, .kit-band .kit-ymm-field--make { flex: 1 1 calc(50% - 6px); }
  .kit-band__form:not(.has-make) .kit-ymm-field--model { display: none; }
  .kit-band__current { gap: 12px; }
  .kit-band__car { width: 40px; height: 40px; }
  .kit-band__car svg { width: 24px; height: 24px; }
  .kit-band__now strong { font-size: 19px; }
  .kit-band__actions { width: 100%; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
  .kit-band__btn { min-width: 0; padding: 0 10px; }
}

/* no script: the tabs cannot switch, so they go and the three forms stack, each usable; the row shows under a set
   vehicle too, since Change cannot open it */
@media (scripting: none) {
  .kit-band__tabs, .kit-band__change { display: none; }
  .kit-band__row.is-off { display: flex; }
  .kit-band__panels { display: flex; flex-direction: column; gap: 12px; }
  .kit-band__panel { height: auto; flex-wrap: wrap; }
  .kit-band__panel.is-off { display: flex; }
}

}
