/* =========================================================
   Header
   Top utility bar (warm dark) + main bar with logo + Fitment Finder + actions.
   The Fitment Finder is the signature: persistent on every page.
   ========================================================= */
.mz-utility {
  background: var(--paper-ink);
  color: var(--ink-on-dark);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: var(--t-xs);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
}
.mz-utility .mz-utility__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  height: 32px;
}
.mz-utility__list { display: flex; align-items: center; gap: var(--s-5); list-style: none; margin: 0; padding: 0; }
.mz-utility__list > li { display: flex; align-items: center; }
.mz-utility a { color: var(--ink-on-dark); opacity: 0.78; }
.mz-utility a:hover { opacity: 1; border-bottom-color: transparent; }
.mz-utility__dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: var(--s-2); transform: translateY(-1px); }
.mz-utility__account { display: inline-flex; align-items: center; gap: var(--s-2); }
.mz-utility__account svg { width: 14px; height: 14px; }
.mz-utility__sep { width: 1px; height: 14px; background: rgba(255,255,255,0.18); }
.mz-utility__socials { display: inline-flex; align-items: center; gap: var(--s-4); }
.mz-utility__socials a { display: inline-flex; align-items: center; gap: var(--s-2); }
.mz-utility__socials svg { width: 14px; height: 14px; color: #25D366; }
.mz-utility__shipping { display: inline-flex; align-items: center; gap: var(--s-2); }
.mz-utility__truck { width: 14px; height: 14px; flex-shrink: 0; }
.mz-utility__flag { width: 18px; height: 12px; flex-shrink: 0; border-radius: 1px; box-shadow: 0 0 0 1px rgba(255,255,255,0.15); }

.mz-header {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.mz-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-6);
  height: 72px;
}
@media (max-width: 900px) {
  .mz-header__inner {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "logo actions"
      "fitment fitment";
    height: auto;
    row-gap: var(--s-3);
    column-gap: var(--s-4);
    padding: var(--s-3) 0;
  }
  .mz-header__inner > .mz-logo     { grid-area: logo; }
  .mz-header__inner > .mz-fitment  { grid-area: fitment; }
  .mz-header__inner > .mz-actions  { grid-area: actions; justify-self: end; }
}
.mz-logo {
  display: inline-flex; align-items: center; gap: var(--s-3);
  border: 0;
  max-width: 220px;
  min-width: 0;
  flex-shrink: 0;
}
.mz-logo__img,
.mz-logo img {
  display: block;
  height: 44px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

/* Dual logo — theme-aware switching.
   .mz-logo img ha specificità (0,1,1); serve almeno (0,2,0) per vincere. */
.mz-logo .mz-logo__img--dark { display: none; }

[data-theme="dark"] .mz-logo .mz-logo__img--light { display: none; }
[data-theme="dark"] .mz-logo .mz-logo__img--dark  { display: block; }

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .mz-logo .mz-logo__img--light { display: none; }
  [data-theme="auto"] .mz-logo .mz-logo__img--dark  { display: block; }
}
.mz-logo__mark {
  width: 32px; height: 32px;
  background: var(--brand);
  color: #fff;
  display: grid; place-items: center;
  font: 700 14px/1 var(--ff-mono);
  letter-spacing: 0;
  border-radius: var(--r-1);
}
.mz-logo__word {
  font: 800 18px/1 var(--ff-ui);
  letter-spacing: var(--tr-tight);
}

/* Fitment Finder â€” the signature element */
.mz-fitment {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  align-items: stretch;
  height: 44px;
  background: var(--ctl-bg);
  border: 1px solid var(--ctl-border);
  border-radius: var(--r-2);
  overflow: hidden;
  transition: border-color var(--d-1) var(--ease);
}
/* Header variant: tighter selects, input takes the rest, icon-only submit */
.mz-fitment--header {
  grid-template-columns: 150px 150px minmax(0, 1fr) auto;
}
.mz-fitment--header .mz-fitment__select {
  padding-right: var(--s-6);
}
.mz-fitment--header .mz-fitment__submit { padding: 0 var(--s-4); }
.mz-fitment--header .mz-fitment__submit-label {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.mz-fitment--header .mz-fitment__submit svg { width: 16px; height: 16px; }
.mz-fitment:hover, .mz-fitment:focus-within { border-color: var(--ink-1); }
.mz-fitment__field {
  position: relative;
  border-right: 1px solid var(--border);
}
.mz-fitment__field:last-of-type { border-right: 0; }
.mz-fitment__select,
.mz-fitment__input {
  appearance: none;
  -webkit-appearance: none;
  width: 100%; height: 100%;
  background: transparent;
  border: 0;
  padding: 0 var(--s-7) 0 var(--s-4);
  font: 500 var(--t-sm)/1 var(--ff-ui);
  color: var(--ink-1);
}
.mz-fitment__select { cursor: pointer; }
.mz-fitment__field::after {
  content: "";
  position: absolute; right: 14px; top: 50%;
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.mz-fitment__field--input::after { display: none; }
.mz-fitment__input { font-family: var(--ff-mono); letter-spacing: 0.02em; padding-right: var(--s-4); }
.mz-fitment__input::placeholder { color: var(--ink-4); }
.mz-fitment__submit {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 0 var(--s-5);
  background: var(--brand);
  color: #fff;
  border: 0;
  font: 600 var(--t-sm)/1 var(--ff-ui);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--d-1) var(--ease);
}
.mz-fitment__submit:hover { background: var(--brand-ink); }
.mz-fitment__submit svg { width: 14px; height: 14px; }

/* Responsive â€” switch from grid to flex-wrap on small screens. Grid was
   fighting auto-flow against the form's leading hidden input; flex-wrap with
   explicit widths is unambiguous and avoids nth-child / area-name pitfalls. */
@media (max-width: 720px) {
  .mz-fitment {
    display: flex;
    flex-wrap: wrap;
    height: auto;
  }
  .mz-fitment > input[type="hidden"] { display: none !important; }
  .mz-fitment__field {
    flex: 1 1 50%;
    min-width: 0;
    height: 44px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .mz-fitment__field + .mz-fitment__field { /* second select */
    border-right: 0;
  }
  .mz-fitment__field--input {
    flex: 1 1 100%;
    border-right: 0;
  }
  .mz-fitment__submit {
    flex: 1 1 100%;
    height: 44px;
    justify-content: center;
    padding: 0;
  }
  .mz-hero__finder .mz-fitment__field,
  .mz-hero__finder .mz-fitment__submit { height: 48px; }
}
@media (max-width: 420px) {
  .mz-fitment__field {
    flex: 1 1 100%;
    border-right: 0;
  }
}
/* Header actions */
.mz-actions { display: flex; align-items: center; gap: var(--s-2); }
.mz-actions__item {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--s-2);
  height: 40px; padding: 0 var(--s-3);
  border: 1px solid transparent;
  border-radius: var(--r-2);
  font: 500 var(--t-sm)/1 var(--ff-ui);
  color: var(--ink-1);
  transition: border-color var(--d-1) var(--ease), background var(--d-1) var(--ease);
}
.mz-actions__item:hover { border-color: var(--border-strong); }
.mz-actions__item svg { width: 18px; height: 18px; }
.mz-actions__count {
  font: 600 10px/1 var(--ff-mono);
  background: var(--brand);
  color: #fff;
  padding: 3px 5px;
  border-radius: 999px;
  letter-spacing: 0;
}
.mz-actions__count--hidden { display: none; }

