/* Catalogue nav: one extra type row inside the existing mega menu. */
.mega-menu { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.mega-type-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 42px;
  padding: 6px 18px;
  border-bottom: 1px solid var(--v8-line);
  background: #fff;
  overflow-x: auto;
  scrollbar-width: none;
}
.mega-type-bar::-webkit-scrollbar { display: none; }
.mega-type-bar > span { flex: 0 0 auto; margin-right: 5px; color: var(--v8-muted-2); font-size: 9px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.mega-type-bar a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--v8-line);
  color: var(--v8-muted);
  font-size: 11px;
  white-space: nowrap;
}
.mega-type-bar a:hover { border-color: var(--type-accent, var(--v8-navy)); color: var(--v8-navy); }
.mega-type-bar a i { color: var(--type-accent, var(--v8-steel)); font-size: 11px; }
.mega-type-bar a b { color: var(--v8-muted-2); font-size: 9.5px; font-weight: 600; }
.mega-type-bar .mega-type-all { border-color: var(--v8-navy); background: var(--v8-navy); color: #fff; font-weight: 650; }
.mobile-type-strip { display: none; }

/* =====================================================================
   SOLIPANEL Catalogue 2.0 — sticky facet rail + dense product results
   Loaded after v8/v9/v10. All selectors are scoped to .sp-* so the rest of
   the site keeps its existing visual system.
   ===================================================================== */

.sp-cat-head {
  padding: 30px 0 26px;
  background: #fff;
  border-bottom: 1px solid var(--v8-line);
}
.sp-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--v8-muted-2);
  font-size: 11.5px;
}
.sp-breadcrumb a { color: var(--v8-muted); }
.sp-breadcrumb a:hover { color: var(--v8-navy); }
.sp-breadcrumb span { color: var(--v8-line-strong); }
.sp-cat-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 40px;
  align-items: end;
}
.sp-eyebrow {
  display: inline-block;
  margin-bottom: 9px;
  color: var(--v8-steel);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
}
.sp-cat-heading h1 {
  margin: 0 0 8px;
  color: var(--v8-navy);
  font-size: clamp(28px, 3.1vw, 42px);
  line-height: 1.06;
  letter-spacing: -.045em;
}
.sp-cat-heading p {
  max-width: 760px;
  margin: 0;
  color: var(--v8-muted);
  font-size: 13.5px;
  line-height: 1.6;
}
.sp-cat-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  padding-left: 24px;
  border-left: 1px solid var(--v8-line);
}
.sp-cat-meta div { text-align: right; }
.sp-cat-meta strong {
  display: block;
  color: var(--v8-navy);
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.04em;
}
.sp-cat-meta span { display: block; margin-top: 5px; color: var(--v8-muted-2); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.sp-cat-meta a { color: var(--v8-steel); font-size: 11.5px; font-weight: 650; text-align: right; }
.sp-cat-meta a i { margin-left: 5px; font-size: 10px; }
.sp-cat-search {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  max-width: 760px;
  height: 52px;
  margin-top: 24px;
  border: 1px solid var(--v8-line-strong);
  background: #fff;
}
.sp-cat-search > i { text-align: center; color: var(--v8-muted-2); }
.sp-cat-search input { min-width: 0; height: 50px; border: 0; outline: 0; padding: 0 8px; color: var(--v8-ink); font-size: 14px; }
.sp-cat-search button { align-self: stretch; border: 0; padding: 0 24px; background: var(--v8-navy); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.sp-cat-search button:hover { background: var(--v8-steel); }

.sp-cat-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 34px;
  padding-top: 28px;
  padding-bottom: 72px;
}
.sp-filter-side {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 112px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--v8-line);
  background: #fff;
  overflow: hidden;
}
.sp-filter-head {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--v8-line);
  background: var(--v8-surface);
}
.sp-filter-kicker { display: block; color: var(--v8-muted-2); font-size: 9px; font-weight: 750; letter-spacing: .14em; }
.sp-filter-head strong { display: block; margin-top: 2px; color: var(--v8-navy); font-size: 13px; }
.sp-filter-clear { color: var(--v8-steel); font-size: 11px; text-decoration: underline; white-space: nowrap; }
.sp-filter-close {
  display: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--v8-line);
  background: #fff;
  color: var(--v8-muted);
  cursor: pointer;
}
.sp-facet-form {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.sp-facet-block { border-bottom: 1px solid var(--v8-line); }
.sp-facet-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border: 0;
  background: #fff;
  color: var(--v8-navy);
  font-family: inherit;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}
.sp-facet-title span { margin-left: auto; color: var(--v8-muted-2); font-size: 9.5px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.sp-facet-title i { color: var(--v8-muted-2); font-size: 13px; transition: transform .18s; }
.sp-facet-block.is-collapsed .sp-facet-title i { transform: rotate(180deg); }
.sp-facet-body { padding: 0 16px 15px; }
.sp-facet-block.is-collapsed .sp-facet-body { display: none; }
.sp-facet-search {
  position: relative;
  display: flex;
  align-items: center;
  height: 34px;
  margin-bottom: 9px;
  border: 1px solid var(--v8-line);
  background: var(--v8-surface);
}
.sp-facet-search i { width: 30px; color: var(--v8-muted-2); font-size: 11px; text-align: center; }
.sp-facet-search input { flex: 1; min-width: 0; height: 32px; border: 0; outline: 0; padding: 0 8px 0 0; background: transparent; color: var(--v8-ink); font-size: 11.5px; }
.sp-check-list { display: flex; flex-direction: column; gap: 1px; max-height: 220px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.sp-model-list { max-height: 250px; }
.sp-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 3px 4px;
  color: var(--v8-muted);
  font-size: 11.5px;
  line-height: 1.35;
  cursor: pointer;
}
.sp-check:hover { background: var(--v8-surface); color: var(--v8-navy); }
.sp-check input { flex: 0 0 auto; width: 13px; height: 13px; margin: 0; accent-color: var(--v8-navy); cursor: pointer; }
.sp-check span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-check .sp-count { margin-left: auto; color: var(--v8-muted-2); font-size: 10px; font-variant-numeric: tabular-nums; }
.sp-check.is-empty { opacity: .4; cursor: default; }
.sp-check.is-empty input { cursor: default; }
.sp-check.sp-colour-check span:nth-child(2) { display: inline-flex; align-items: center; gap: 7px; }
.sp-colour-dot { width: 11px; height: 11px; flex: 0 0 auto; border: 1px solid rgba(7,24,43,.16); border-radius: 50%; background: var(--swatch, #8B95A1); }
.sp-inline-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; max-height: none; }
.sp-inline-checks .sp-check span:nth-child(2) { white-space: normal; }
.sp-mini-title { margin: 11px 0 4px; color: var(--v8-muted-2); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sp-facet-hint { margin: 8px 0 0; color: var(--v8-muted-2); font-size: 10px; line-height: 1.45; }

.sp-type-list { display: flex; flex-direction: column; gap: 3px; }
.sp-type-row {
  display: grid;
  grid-template-columns: 15px 28px minmax(0,1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 2px 4px;
  color: var(--v8-muted);
  font-size: 11.5px;
  cursor: pointer;
}
.sp-type-row:hover { background: var(--v8-surface); color: var(--v8-navy); }
.sp-type-row input { width: 13px; height: 13px; margin: 0; accent-color: var(--v8-navy); }
.sp-type-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-left: 2px solid var(--type-accent, var(--v8-steel));
  background: var(--v8-surface);
  color: var(--type-accent, var(--v8-steel));
  font-size: 12px;
}
.sp-type-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-type-row .sp-count { color: var(--v8-muted-2); font-size: 10px; }
.sp-type-row.is-empty { opacity: .4; cursor: default; }

.sp-photo-toggle {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--v8-line);
  cursor: pointer;
}
.sp-photo-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sp-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--v8-line-strong);
  transition: background .18s;
}
.sp-toggle-track span {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.16);
  transition: transform .18s;
}
.sp-photo-toggle input:checked + .sp-toggle-track { background: var(--v8-navy); }
.sp-photo-toggle input:checked + .sp-toggle-track span { transform: translateX(16px); }
.sp-photo-toggle strong { display: block; color: var(--v8-navy); font-size: 12px; }
.sp-photo-toggle small { display: block; margin-top: 2px; color: var(--v8-muted-2); font-size: 10px; }

.sp-facet-submit { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #fff; }
.sp-facet-submit .btn { min-height: 38px; flex: 1; justify-content: center; padding: 8px 14px; font-size: 12px; }
.sp-facet-submit a { color: var(--v8-muted); font-size: 11px; text-decoration: underline; }

.sp-results { min-width: 0; }
.sp-result-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--v8-line);
}
.sp-result-bar > div { display: flex; align-items: center; gap: 10px; }
.sp-result-label { color: var(--v8-muted); font-size: 11.5px; }
.sp-result-filtered { display: inline-flex; align-items: center; gap: 5px; color: var(--v8-steel); font-size: 10.5px; }
.sp-result-actions { justify-content: flex-end; }
.sp-result-actions label { color: var(--v8-muted-2); font-size: 10.5px; }
.sp-result-actions select {
  height: 34px;
  min-width: 132px;
  border: 1px solid var(--v8-line-strong);
  background: #fff;
  padding: 0 8px;
  color: var(--v8-ink);
  font-size: 11.5px;
}
.sp-view-link { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px; border: 1px solid var(--v8-line); color: var(--v8-muted); font-size: 10.5px; }
.sp-view-link:hover { border-color: var(--v8-navy); color: var(--v8-navy); }
.sp-active-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 12px 0;
  border-bottom: 1px solid var(--v8-line);
}
.sp-chips-label { color: var(--v8-muted-2); font-size: 9.5px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.sp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid rgba(31,78,117,.28);
  background: #F2F6F9;
  color: var(--v8-navy);
  font-size: 10.5px;
}
.sp-chip b { color: var(--v8-muted-2); font-weight: 600; }
.sp-chip i { color: var(--v8-muted-2); font-size: 9px; }
.sp-chip:hover { border-color: var(--v8-navy); background: #fff; }
.sp-chips-reset { margin-left: auto; color: var(--v8-muted); font-size: 10.5px; text-decoration: underline; }
.sp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px 18px;
  padding-top: 22px;
}
.sp-pagination { margin-top: 44px; }
.sp-empty-state { padding: 80px 20px; border: 1px dashed var(--v8-line-strong); text-align: center; color: var(--v8-muted); }
.sp-empty-state > i { color: var(--v8-line-strong); font-size: 28px; }
.sp-empty-state h3 { margin: 10px 0 8px; color: var(--v8-navy); font-size: 20px; }
.sp-empty-state p { margin: 0 0 18px; font-size: 12.5px; }
.sp-empty-state > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.sp-mobile-toolbar { display: none; }
.sp-filter-backdrop { display: none; }

@media (max-width: 1180px) {
  .sp-cat-shell { grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
  .sp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sp-cat-heading { grid-template-columns: minmax(0, 1fr) 200px; gap: 26px; }
}
@media (max-width: 900px) {
  .mega-type-bar { display: none; }
  .mobile-type-strip {
    display: flex;
    gap: 6px;
    margin: 0 0 14px;
    padding: 0 20px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mobile-type-strip::-webkit-scrollbar { display: none; }
  .mobile-type-strip a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--v8-line);
    background: #fff;
    color: var(--v8-muted);
    font-size: 10.5px;
    white-space: nowrap;
  }
  .mobile-type-strip a i { color: var(--v8-steel); }
  .mobile-type-strip a b { color: var(--v8-muted-2); font-size: 9px; }
  .mobile-type-strip a.is-all { border-color: var(--v8-navy); background: var(--v8-navy); color: #fff; font-weight: 650; }
  .sp-cat-head { padding: 22px 0 20px; }
  .sp-cat-heading { grid-template-columns: 1fr; gap: 14px; }
  .sp-cat-meta { flex-direction: row; align-items: center; justify-content: space-between; padding-left: 0; border-left: 0; border-top: 1px solid var(--v8-line); padding-top: 14px; }
  .sp-cat-meta div { text-align: left; }
  .sp-cat-meta strong { font-size: 27px; }
  .sp-cat-meta a { text-align: right; }
  .sp-cat-search { max-width: none; margin-top: 18px; }
  .sp-cat-search button { padding: 0 16px; }
  .sp-cat-shell { display: block; padding-top: 0; }
  .sp-mobile-toolbar {
    position: sticky;
    top: 68px;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    margin: 0 -20px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--v8-line);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
  }
  .sp-mobile-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--v8-navy);
    background: var(--v8-navy);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
  }
  .sp-mobile-filter-btn b { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #fff; color: var(--v8-navy); font-size: 9px; }
  .sp-mobile-toolbar > span { color: var(--v8-muted); font-size: 11px; }
  .sp-mobile-toolbar > span strong { color: var(--v8-navy); }
  .sp-mobile-toolbar > a { color: var(--v8-steel); font-size: 11px; font-weight: 650; }

  .sp-filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: block;
    background: rgba(4,16,28,.6);
    backdrop-filter: blur(4px);
  }
  .sp-filter-backdrop[hidden] { display: none; }
  .sp-filter-side {
    position: fixed;
    z-index: 1101;
    inset: auto 0 0;
    top: auto;
    height: 82vh;
    height: 82dvh;
    max-height: 760px;
    border: 1px solid var(--v8-line);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -24px 60px rgba(7,24,43,.22);
    transform: translateY(101%);
    transition: transform .28s cubic-bezier(.2,.7,.2,1);
  }
  .sp-filter-side.is-open { transform: translateY(0); }
  .sp-filter-head {
    flex: 0 0 auto;
    border-radius: 18px 18px 0 0;
    padding: max(14px, env(safe-area-inset-top)) 18px 14px;
  }
  .sp-filter-close { display: grid; place-items: center; }
  .sp-facet-form {
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }
  .sp-facet-title { padding: 15px 18px; font-size: 11.5px; }
  .sp-facet-body { padding: 0 18px 16px; }
  .sp-check-list { max-height: 42vh; }
  .sp-model-list { max-height: 38vh; }
  .sp-type-list { gap: 4px; }
  .sp-type-row { min-height: 40px; font-size: 12px; }
  .sp-check { min-height: 34px; font-size: 12px; }
  .sp-facet-submit {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--v8-line);
    background: #fff;
    box-shadow: 0 -10px 18px rgba(255,255,255,.94);
  }
  .sp-facet-submit .btn { min-height: 44px; }
  .sp-result-bar { position: static; padding-top: 12px; }
  .sp-active-chips { margin-bottom: 2px; }
  .sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; padding-top: 18px; }
  .sp-results .v8-product h3 { font-size: 13px; }
  .sp-results .v8-product-foot { gap: 6px; }
  .sp-results .v8-product-sku { font-size: 9.5px; }
  body.sp-filter-open { overflow: hidden; }
}
@media (max-width: 520px) {
  .sp-cat-meta a { max-width: 150px; line-height: 1.35; }
  .sp-result-actions label { display: none; }
  .sp-result-actions { width: 100%; justify-content: space-between; }
  .sp-result-actions select { flex: 1; min-width: 0; }
  .sp-view-link span { display: none; }
  .sp-chips-label { display: none; }
}

/* ===== v11.0.1 hotfix: catalogue contrast + continuous sidebar scroll ===== */

/* "All products" must stay white on navy, including hover/focus */
.mega-type-bar .mega-type-all,
.mega-type-bar .mega-type-all:hover,
.mega-type-bar .mega-type-all:focus-visible {
  background: var(--v8-navy);
  border-color: var(--v8-navy);
  color: #fff;
}

.mobile-type-strip a.is-all:hover,
.mobile-type-strip a.is-all:focus-visible {
  color: #fff;
}

/* Let wheel/trackpad continue from a facet list into the next facet */
.sp-facet-form,
.sp-check-list,
.sp-model-list {
  overscroll-behavior: auto;
}

/* Desktop: one continuous scroll for the whole filter rail.
   No nested scroll trap inside Brand / Model lists. */
@media (min-width: 901px) {
  .sp-check-list,
  .sp-model-list {
    max-height: none;
    overflow: visible;
  }
}

/* ===== v11.0.2: make "All products" always readable ===== */

/* 默认：白底 + 深蓝字，彻底避开蓝底盖住文字 */
.mega-type-bar .mega-type-all,
.mega-type-bar .mega-type-all:link,
.mega-type-bar .mega-type-all:visited {
  background: #fff !important;
  border-color: var(--v8-navy) !important;
  color: var(--v8-navy) !important;
  -webkit-text-fill-color: var(--v8-navy) !important;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--v8-navy);
}

/* 悬停/键盘聚焦：深蓝底 + 白字 */
.mega-type-bar .mega-type-all:hover,
.mega-type-bar .mega-type-all:focus,
.mega-type-bar .mega-type-all:focus-visible {
  background: var(--v8-navy) !important;
  border-color: var(--v8-navy) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

/* ===== v11.0.5: batch filter apply ===== */

/* One Apply action for several selections; highlight the button once the
   buyer has unsaved changes. */
.sp-facet-form.is-dirty .sp-facet-submit .btn {
  box-shadow: 0 0 0 3px rgba(24, 36, 48, .12);
}

/* Desktop rail: keep Apply reachable while scrolling through long facets.
   Mobile already pins it inside the filter sheet below. */
@media (min-width: 901px) {
  .sp-facet-submit {
    position: sticky;
    bottom: 0;
    z-index: 3;
    border-top: 1px solid var(--v8-line);
    box-shadow: 0 -10px 18px rgba(255, 255, 255, .94);
  }
}

/* AJAX apply: keep the button visibly busy while the page is fetched. */
.sp-facet-form.is-loading .sp-facet-submit .btn {
  opacity: .62;
  cursor: progress;
}

/* ---------------------------------------------------------------------
   Mobile Catalogue type strip
   The strip is a direct child of a column flex drawer. Without an explicit
   flex basis it gets squeezed by the scrollable brand list, and the generic
   .main-nav a { width:100% } rule makes every type pill full-width.
   Keep a fixed-height horizontal rail and let each pill size to its content.
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
  .v8-header .main-nav .mobile-type-strip {
    flex: 0 0 38px;
    height: 38px;
    min-height: 38px;
    align-items: center;
    padding: 0 20px 2px;
    margin: 0 0 12px;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .v8-header .main-nav .mobile-type-strip a {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-start;
    min-height: 34px;
    padding: 0 10px;
    font-size: 10.5px;
    line-height: 1.35;
  }
}
