/* =====================================================================
   SOLIPANEL v9 — disciplined colour accents and procurement refinements
   Additions only. v8.css remains the structural baseline.
   ===================================================================== */
:root {
  --v9-blue: #1F6FEB;
  --v9-blue-soft: #EAF1FE;
  --v9-brass: #B8894B;
  --v9-brass-soft: #F7EFE2;
  --v9-green: #1E7F5C;
}

/* ---------- Search everywhere ---------- */
.v8-icon-search { cursor: pointer; }
.v8-quick-search { position: relative; }
.v9-search-suggest {
  position: absolute; z-index: 1200; top: calc(100% + 7px); left: 0; right: 0;
  max-height: 360px; overflow: auto; background: #fff; border: 1px solid var(--v8-line-strong);
  box-shadow: 0 18px 46px rgba(7,27,45,.16); padding: 6px;
}
.v9-search-suggest[hidden] { display: none; }
.v9-suggest-head { padding: 9px 10px 5px; color: var(--v8-muted-2); font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.v9-suggest-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 10px; color: var(--v8-navy); text-decoration: none; border-radius: 3px; }
.v9-suggest-row:hover { background: var(--v9-blue-soft); color: var(--v8-navy); }
.v9-suggest-row strong { font-size: 12.5px; font-weight: 650; }
.v9-suggest-row span { color: var(--v8-muted-2); font-size: 10.5px; text-align: right; }
.v9-suggest-empty { padding: 14px 12px; color: var(--v8-muted); font-size: 12px; }

.v9-search-panel { position: fixed; inset: 0; z-index: 2000; background: rgba(4,16,28,.62); backdrop-filter: blur(5px); }
.v9-search-panel[hidden] { display: none; }
.v9-search-panel-inner { width: min(720px, calc(100% - 32px)); margin: 90px auto 0; background: #fff; padding: 28px; border-radius: 6px; box-shadow: 0 30px 90px rgba(0,0,0,.25); }
.v9-search-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.v9-search-panel-head span { color: var(--v8-navy); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.v9-search-panel-head button { width: 36px; height: 36px; border: 1px solid var(--v8-line); background: #fff; color: var(--v8-muted); cursor: pointer; }
.v9-search-form { position: relative; display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; min-height: 54px; border: 1px solid var(--v8-navy); background: #fff; }
.v9-search-form > i { color: var(--v9-blue); text-align: center; }
.v9-search-form input { height: 52px; border: 0; outline: 0; font-size: 15px; padding: 0 8px; }
.v9-search-form button { align-self: stretch; border: 0; background: var(--v8-navy); color: #fff; padding: 0 24px; font-size: 12px; font-weight: 700; cursor: pointer; }
.v9-search-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; font-size: 11px; color: var(--v8-muted-2); }
.v9-search-quick a { padding: 5px 9px; border: 1px solid var(--v8-line); color: var(--v8-navy); text-decoration: none; }
.v9-search-quick a:hover { border-color: var(--v9-blue); color: var(--v9-blue); }
body.search-open { overflow: hidden; }

/* ---------- Colour accents, used sparingly ---------- */
.v8-kicker { color: var(--v9-blue); }
.v8-link, .v8-footer-contact, .v8-footer a:hover { color: var(--v9-blue); }
.v8-chip:has(input:checked) { background: var(--v9-blue); border-color: var(--v9-blue); }
.v8-facet-toggle b { background: var(--v9-blue); }
.v8-active-chip { border-color: rgba(31,111,235,.38); background: var(--v9-blue-soft); }
.v8-active-chip i { color: var(--v9-blue); }
.v8-brand-card.is-new::after { color: var(--v8-brass); border-color: rgba(184,137,75,.45); background: var(--v9-brass-soft); }
.v8-product-flag { background: var(--v9-brass-soft); color: #7b5622; }
.v8-rfq-btn b { background: var(--v9-blue); }
.v8-stat strong { color: var(--v8-navy); }
.v8-stat strong::after { content: ""; display: block; width: 26px; height: 2px; margin-top: 8px; background: var(--v9-blue); }

/* ---------- Model index: equal tiles, no ragged grid ---------- */
.v8-model-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 7px; align-items: stretch; }
.v8-model-links a {
  height: 58px; padding: 8px 10px; border: 1px solid var(--v8-line); background: var(--v8-surface);
  color: var(--v8-muted); font-size: 11.5px; line-height: 1.3; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.v8-model-links a:hover { border-color: var(--v9-blue); color: var(--v8-navy); background: #fff; }
.v8-model-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 7px; }
.v8-model-strip a {
  height: 56px; padding: 8px 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.3;
}

/* ---------- Product card quantity ---------- */
.v8-card-qty { display: inline-flex; align-items: center; height: 30px; border: 1px solid var(--v8-line-strong); background: #fff; }
.v8-card-qty button { width: 26px; height: 28px; border: 0; background: #fff; color: var(--v8-muted); font-size: 13px; cursor: pointer; }
.v8-card-qty button:hover { color: var(--v9-blue); }
.v8-card-qty input { width: 34px; height: 28px; border: 0; border-left: 1px solid var(--v8-line); border-right: 1px solid var(--v8-line); text-align: center; font-size: 11px; font-weight: 650; color: var(--v8-navy); -moz-appearance: textfield; }
.v8-card-qty input::-webkit-outer-spin-button, .v8-card-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* Product card action row: keep SKU truncating, quantity + RFQ always on one line */
.v8-product-foot { justify-content: flex-start; flex-wrap: nowrap; }
.v8-product-sku { flex: 1 1 auto; min-width: 0; }
.v8-card-qty, .v8-add { flex: 0 0 auto; }

/* ---------- Contact clock ---------- */
.v8-clock-card { border-top: 2px solid var(--v9-blue); }
.v8-clock-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.v8-clock-head h3 { margin: 0; }
.v8-clock-zone { margin: 3px 0 0; color: var(--v8-muted-2); font-size: 10.5px; letter-spacing: .04em; }
.v8-clock-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--v9-green); box-shadow: 0 0 0 4px rgba(30,127,92,.10); }
.v8-clock-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 14px 0 5px; }
.v8-clock-main strong { color: var(--v8-navy); font-size: 25px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.v8-clock-main span { color: var(--v8-muted); font-size: 11.5px; }
.v8-clock-status { margin: 0; color: var(--v8-muted); font-size: 11.5px; }
.v8-clock-status.is-open { color: var(--v9-green); }

/* ---------- Mobile search / spacing refinements ---------- */
@media (max-width: 900px) {
  .v9-search-panel-inner { margin-top: 64px; padding: 20px; }
  .v9-search-form { grid-template-columns: 40px minmax(0,1fr); }
  .v9-search-form button { grid-column: 1 / -1; min-height: 42px; }
  .v8-card-qty { margin-left: auto; }
  .v8-product-foot { align-items: center; }
  .v8-clock-main strong { font-size: 21px; }
}
@media (max-width: 640px) {
  .v8-model-links { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .v8-clock-card { order: -1; }
}

/* Filters are intentionally closed until requested, so the product grid is
   the first thing a buyer sees. The button and active chips remain visible. */
.v8-facets:not(.is-open) + .v8-facet-actions { display: none; }
@media (min-width: 901px) {
  .v8-facets { display: none; }
  .v8-facets.is-open { display: grid; }
}
.v8-paste-line { display: inline-flex; align-items: center; gap: 7px; margin-left: 10px; padding: 8px 0; border: 0; background: none; color: var(--v8-muted); font: inherit; font-size: 12px; cursor: pointer; }
.v8-paste-line:hover { color: var(--v9-blue); }
.v8-icon-search { border: 0; background: transparent; color: var(--v8-navy); padding: 0; }
.v8-icon-search:hover { color: var(--v9-blue); }

/* Mobile drawer stacking fix: v8.css pins the branded header at z-index 60,
   which leaves the drawer underneath the 1000-level backdrop and makes every
   tap land on the dark overlay instead of the menu links. */
@media (max-width: 900px) {
  .site-header.v8-header { z-index: 1001; }
  .main-nav { z-index: 1002; }
  .nav-backdrop { z-index: 1000; }
  .main-nav:not(.catalogue-active) .mega-menu { display: none !important; }
  .main-nav.catalogue-active .mega-menu { display: block !important; pointer-events: auto !important; }
}

/* ---------- Mobile catalogue drawer: scroll to the last item ---------- */
@media (max-width: 900px) {
  .main-nav {
    top: 62px;
    bottom: 0;
    height: auto;
    max-height: none;
  }
  .main-nav.catalogue-active {
    padding: 0 !important;
    overflow: hidden !important;
  }
  .main-nav.catalogue-active > ul {
    height: 100% !important;
    display: flex !important;
    min-height: 0;
  }
  .main-nav.catalogue-active .nav-catalogue {
    display: flex !important;
    flex-direction: column;
    height: 100% !important;
    min-height: 0;
  }
  .main-nav.catalogue-active .mega-menu {
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column;
    height: auto !important;
    min-height: 0;
  }
  .mobile-catalogue {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
  }
  .mobile-catalogue-brands,
  .mobile-catalogue-panels {
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }
  .mobile-all-brands {
    margin-bottom: 18px;
  }
}

/* ---------- Mobile numeric inputs: prevent browser auto-zoom ---------- */
@media (max-width: 900px) {
  .v8-card-qty {
    height: 34px;
  }
  .v8-card-qty input {
    width: 44px;
    height: 32px;
    font-size: 16px;
    line-height: 32px;
  }
  .v8-card-qty button {
    height: 32px;
    width: 30px;
  }
  .v8-rfq-line input[type="number"],
  .v8-field input[type="number"],
  input[type="number"] {
    font-size: 16px;
  }
}

/* ---------- Long model names: equal tiles, no clipped text ---------- */
@media (max-width: 900px) {
  .v8-model-links {
    grid-auto-rows: minmax(64px, auto);
  }
  .v8-model-links a {
    height: auto;
    min-height: 64px;
    -webkit-line-clamp: 3;
  }
}

/* ---------- Hard mobile drawer geometry (must beat legacy 100vh/inset) ---------- */
@media (max-width: 900px) {
  .main-nav {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 62px !important;
    bottom: 0 !important;
    width: 100% !important;
    height: calc(100vh - 62px) !important;
    height: calc(100dvh - 62px) !important;
    max-height: none !important;
    padding: 12px 20px calc(28px + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: translate3d(100%, 0, 0);
    visibility: hidden;
    pointer-events: none;
  }
  .main-nav.open {
    transform: translate3d(0, 0, 0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .main-nav.catalogue-active {
    padding: 0 !important;
    overflow: hidden !important;
  }
  .main-nav.catalogue-active > ul {
    height: 100% !important;
    min-height: 0;
    display: flex !important;
    flex-direction: column;
  }
  .main-nav.catalogue-active .nav-catalogue {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column;
    height: auto !important;
    min-height: 0;
  }
  .main-nav.catalogue-active .mega-menu {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column;
    height: auto !important;
    min-height: 0;
    overflow: hidden !important;
  }
  .main-nav.catalogue-active .mobile-catalogue {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column;
    height: auto !important;
    min-height: 0;
    overflow: hidden;
  }
  .main-nav.catalogue-active .mobile-catalogue-brands,
  .main-nav.catalogue-active .mobile-catalogue-panels {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
  }
  .main-nav.catalogue-active .mobile-all-brands {
    margin-bottom: 12px;
  }
}

/* ---------- Floating contact: real WhatsApp + email ---------- */
.v8-float-stack { position: fixed; right: 16px; bottom: 16px; z-index: 46; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.v8-float-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 15px; border-radius: 22px; color: #fff; font-size: 12.5px; font-weight: 650; letter-spacing: .01em; text-decoration: none; box-shadow: 0 10px 26px rgba(8, 26, 46, .22); transition: transform .18s ease, box-shadow .18s ease; }
.v8-float-btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(8, 26, 46, .28); }
.v8-float-btn svg { width: 20px; height: 20px; flex: 0 0 auto; fill: currentColor; }
.v8-float-btn span { white-space: nowrap; }
.v8-float-wa { background: #25D366; }
.v8-float-wa:hover { background: #1fbd5a; }
.v8-float-email { background: #0C2340; }
.v8-float-email:hover { background: #14365f; }
@media (max-width: 640px) {
  .v8-float-stack { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); gap: 9px; }
  .v8-float-btn { width: 46px; height: 46px; padding: 0; justify-content: center; }
  .v8-float-btn span { display: none; }
  .v8-float-btn svg { width: 22px; height: 22px; }
}
