/* Shared product filter panel - core/includes/_product_filters.html
   Plain, quiet sidebar: caps section headings, inline counts, generous rows. */

.kk-filter-panel {
  background: #fff;
  border-right: 1px solid #e8eaed;
  padding: 20px 20px 32px 4px;
  font-size: 14px;
  color: #202124;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  position: sticky;
  top: 90px;
  transition: opacity .15s ease;
  text-transform: none;
}

@media (min-width: 992px) {
  .dark-mode .kk-filter-panel {
    background: #0b0f19;
    border-right: 1px solid #1e293b;
    padding: 20px 20px 32px 4px;
    font-size: 14px;
    color: #e2e8f0;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    position: sticky;
    top: 90px;
    transition: opacity .15s ease;
    text-transform: none;
  }
}
/* The site forces uppercase globally; the sidebar reads better as written. */
.kk-filter-panel * { text-transform: none !important; }

.kk-panel-busy { opacity: .5; pointer-events: none; }

/* The phone sheet says "Filter" / "Apply"; the desktop popup spells them out
   and adds Reset Filter. One set of markup, swapped by width. */
.kk-title-long,
.kk-heading-icon,
.kk-filter-reset { display: none; }

/* Off-canvas controls: trigger is sticky-fixed on mobile; hidden on desktop. */
.kk-filter-trigger,
.kk-filter-backdrop,
.kk-filter-close { display: none; }

/* ── Mobile-only: Sticky floating FILTERS pill at bottom ── */
@media (max-width: 991px) {
  .kk-filter-trigger {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    /* Fixed at bottom center, above the mobile bottom nav (62px) */
    position: fixed !important;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 9000 !important;

    /* Pill styling */
    padding: 13px 28px !important;
    border-radius: 999px !important;
    border: none !important;
    background: #0f172a !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0.4px !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    box-shadow: 0 6px 24px rgba(10, 15, 30, 0.35), 0 2px 6px rgba(0,0,0,0.12) !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease !important;
    /* Make sure margin/placement from other styles don't interfere */
    margin: 0 !important;
  }
  .kk-filter-trigger:active {
    transform: translateX(-50%) scale(0.96) !important;
    box-shadow: 0 3px 12px rgba(10, 15, 30, 0.25) !important;
  }
  /* Dark mode variant keeps same dark pill look */
  .dark-mode .kk-filter-trigger {
    background: #1e293b !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0,0,0,0.2) !important;
    border: 1px solid #334155 !important;
  }
}

/* The theme's own "Filter" bar duplicates the panel, which is always visible
   on desktop. It stays available on mobile, where the panel is a drawer. */
@media (min-width: 992px) {
  .bb-pro-list-top .bb-bl-btn,
  .bb-pro-list-top .btn-filter { display: none; }
}

.kk-filter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 4px;
}

.kk-filter-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .2px;
}

.kk-filter-clear {
  font-size: 13px;
  color: #1a73e8;
  text-decoration: none;
  font-weight: 500;
}

.kk-filter-clear:hover { text-decoration: underline; }

/* Active selections, each removable on its own. */
.kk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

.kk-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e8f0fe;
  color: #174ea6;
  border: none;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

.kk-chip:hover { background: #d2e3fc; }

/* ---- Groups ---------------------------------------------------------- */

.kk-group { border-top: 1px solid #f1f3f4; padding: 14px 0; }
.kk-group:first-of-type { border-top: none; padding-top: 0; }

.kk-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.kk-group-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase !important;
  color: #202124;
}

.kk-caret {
  width: 9px;
  height: 9px;
  border-right: 2px solid #5f6368;
  border-bottom: 2px solid #5f6368;
  transform: rotate(45deg);
  transition: transform .15s ease;
  margin-right: 2px;
}

.kk-group-open > .kk-group-head .kk-caret { transform: rotate(-135deg); }

.kk-group-body { display: none; padding-top: 12px; }
.kk-group-open > .kk-group-body { display: block; }

/* ---- Options --------------------------------------------------------- */

.kk-options {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
}

.kk-option { margin: 0; }

.kk-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  line-height: 1.35;
  margin: 0;
  font-weight: 400;
}

.kk-check input {
  flex: 0 0 auto;
  margin-top: 2px;
  width: 15px;
  height: 15px;
  accent-color: #1a73e8;
  cursor: pointer;
}

.kk-option-label { flex: 1 1 auto; min-width: 0; color: #3c4043; }
.kk-option-count { flex: 0 0 auto; color: #80868b; font-size: 13px; }

.kk-check:hover .kk-option-label { color: #1a73e8; }

/* ---- Search within a long facet -------------------------------------- */

.kk-search { position: relative; margin-bottom: 10px; }

.kk-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #dadce0;
  border-radius: 999px;
  font-size: 13px;
  outline: none;
  background: #fff;
}

.kk-search-input:focus { border-color: #1a73e8; }

.kk-no-match { color: #80868b; font-size: 13px; margin: 6px 0 0; }

/* ---- Price ------------------------------------------------------------ */

.kk-or {
  display: flex;
  align-items: center;
  text-align: center;
  color: #80868b;
  font-size: 13px;
  margin: 12px 0;
}

.kk-or::before,
.kk-or::after { content: ""; flex: 1; border-bottom: 1px solid #f1f3f4; }
.kk-or span { padding: 0 10px; }

.kk-sub-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase !important;
  color: #5f6368;
  margin-bottom: 8px;
}

.kk-price-row { display: flex; align-items: center; gap: 8px; }
.kk-dash { color: #9aa0a6; }

.kk-input,
.kk-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  outline: none;
  color: #3c4043;
}

.kk-input:focus,
.kk-select:focus { border-color: #1a73e8; }

/* The theme hides every <select> and draws its own dropdown from main.js.
   That copy is not redrawn when the panel is refreshed after a filter, so the
   Sort By box is kept as the browser's own select instead. */
#filter-panel select.kk-select {
  display: block !important;
  /* inherit, not visible: the closed panel is visibility:hidden, and a
     forced "visible" let this one box show through it, floating over the
     product grid on a phone. */
  visibility: inherit !important;
  appearance: auto;
}

.kk-apply {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: #1a73e8;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

/* ---- Shop layout: sidebar + grid, full width --------------------------- */

/* Bootstrap's .container caps at ~1320px, which wasted most of a wide screen
   and squeezed the grid next to the panel. A two-track CSS grid gives the
   sidebar a fixed width and hands every remaining pixel to the products.
   minmax(0, 1fr) is the important half: without the 0 minimum, the products
   track refuses to shrink below its content and the cards overflow. */
.kk-shop-container {
  width: 100%;
  max-width: 2000px;
  margin: 0 auto;
  padding-left: 28px;
  padding-right: 28px;
}

.kk-shop-layout {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.kk-shop-sidebar { min-width: 0; }

@media (max-width: 991px) {
  .kk-shop-layout { display: block !important; gap: 0 !important; }
  .kk-shop-sidebar { width: 100% !important; height: auto !important; min-height: auto !important; margin-bottom: 6px !important; padding-bottom: 0 !important; }
  .kk-shop-container { padding-left: 15px; padding-right: 15px; }
}

/* ---- The product grid beside the panel -------------------------------- */

/* Grid columns are flex items, and a flex item defaults to min-width:auto -
   it will not shrink below its content. Beside a 3-column filter panel that
   makes wide cards (250px images, long names) overflow and overlap their
   neighbours. Allowing them to shrink is the fix. */
#product-results .row { display: flex; flex-wrap: wrap; }

#product-results [class*="col-"] {
  min-width: 0;
  float: none;
}

/* Nothing inside a card may force the column wider than its share. */
#product-results .bb-pro-box,
#product-results .bb-pro-img { max-width: 100%; }

/* Long product names wrap completely without ellipsis dots */
#product-results .bb-pro-title,
#product-results .bb-pro-title a,
#product-results h4,
#product-results h5,
.bb-pro-box .bb-pro-contact h4.bb-pro-title a,
.bb-pro-box-2 .bb-pro-contact h4.bb-pro-title a {
  white-space: normal !important;
  text-overflow: clip !important;
  overflow: visible !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  line-height: 1.35 !important;
  display: block !important;
}

/* ---- Even card sizes -------------------------------------------------- */

/* Product photos come in every shape (1472x1200, 1200x1200, 767x580...), and
   the card image class is styled in some templates but not others, so cards
   ended up different heights and the grid looked ragged.
   One image box, one aspect, everywhere the filter panel is used. */

#product-results [class*="col-"] { display: flex; }

#product-results .bb-pro-box {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 80%;
}

#product-results .bb-pro-img { width: 100%; }

#product-results .inner-img {
  display: block;
  width: 100%;
  height: 260px;
  overflow: hidden;
  background: #f5f6f7;
}

/* !important is deliberate: some templates set height inline on the <img>
   (style="height:250px"), and an inline style beats any class selector. */
#product-results .inner-img img,
#product-results .fixed-card-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

/* The caption grows so every card in a row ends at the same line. */
#product-results .bb-pro-contact,
#product-results .bb-pro-box > *:last-child { margin-top: auto; }

/* ---- Density: use the width a big screen actually has ------------------ */

/* Bootstrap stops at 4-up. On a 1600px+ monitor that leaves a lot of empty
   space, so the grid goes to 5-up and then 6-up. Scoped to the product cards
   so the pagination row is untouched. */
@media (min-width: 1600px) {
  #product-results .bb-product-box { flex: 0 0 20%; max-width: 20%; }
}

@media (min-width: 1900px) {
  #product-results .bb-product-box { flex: 0 0 16.6666%; max-width: 16.6666%; }
}

/* ---- Content under the grid ------------------------------------------- */

.kk-listing-seo {
  margin-top: 40px;
  padding: 28px 0 8px;
  border-top: 1px solid #e8eaed;
  color: #3c4043;
}

/* ---- About Section (_listing_seo.html) Design Engine ---- */
.kk-listing-seo {
  margin-top: 36px;
  padding: 24px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  transition: all 0.3s ease;
  width: 100%;
}

.kk-listing-seo * { text-transform: none !important; }

.kk-seo-heading {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kk-seo-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: #184890;
  border-radius: 4px;
  flex-shrink: 0;
}

.kk-seo-text {
  font-size: 0.94rem;
  line-height: 1.65;
  color: #475569;
  margin-bottom: 20px;
  max-width: 950px;
}

.kk-seo-links { margin-bottom: 18px; }

.kk-seo-links-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase !important;
  letter-spacing: 0.6px;
  color: #184890;
  margin-bottom: 10px;
}

.kk-seo-links ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.kk-seo-links ul li {
  margin: 0;
}

.kk-seo-links a {
  display: inline-block;
  padding: 7px 16px;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.kk-seo-links a:hover {
  border-color: #184890;
  color: #184890;
  background: #f0f5fa;
  transform: translateY(-1px);
}

/* Global Dark Mode Rules for About Section (Desktop & Mobile) */
.dark-mode .kk-listing-seo {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
}

.dark-mode .kk-seo-heading {
  color: #f8fafc !important;
}

.dark-mode .kk-seo-heading::before {
  background: #3b82f6 !important;
}

.dark-mode .kk-seo-text {
  color: #e2e8f0 !important;
}

.dark-mode .kk-seo-links-label {
  color: #60a5fa !important;
}

.dark-mode .kk-seo-links a {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
  box-shadow: none !important;
}

.dark-mode .kk-seo-links a:hover {
  background: #184890 !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25) !important;
}

/* ---- Results block while a filter request is in flight ---------------- */

/* On some pages the results block sits directly inside a Bootstrap .row,
   which is a flex container - without this it shrink-wraps to its content and
   the grid collapses into a narrow column. */
#product-results {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  transition: opacity .15s ease;
}
.kk-results-busy { opacity: .45; pointer-events: none; }

.kk-result-count {
  color: #5f6368;
  font-size: 14px;
  margin-bottom: 14px;
}

/* ---- Mobile: slide-in drawer ------------------------------------------ */

/* Hide mobile actions on desktop */
.kk-mobile-actions {
  display: none !important;
}

@media (max-width: 991px) {

  /* ---- Trigger Button: now handled by the global sticky rule above ---- */
  /* (no inline placement here — the fixed positioning from the global block applies) */

  /* ---- Backdrop ---- */
  .kk-filter-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.55) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100050 !important;
  }
  .kk-filter-backdrop[hidden] { display: none; }

  /* ---- Close × Button ---- */
  .kk-filter-close {
    display: block;
    background: #f1f5f9;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #475569;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.18s ease;
  }
  .kk-filter-close:active { background: #e2e8f0; }

  /* ---- Main Panel ---- */
  .kk-filter-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 88vh !important;
    z-index: 100055 !important;
    padding: 0 !important;
    border-top: none !important;
    border-right: none !important;
    border-radius: 24px 24px 0 0 !important;
    box-shadow: 0 -8px 48px rgba(10, 15, 30, 0.2) !important;
    transform: translateY(100%) !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0.38s !important;
    display: flex;
    flex-direction: column;
    background: #ffffff !important;
    overflow: hidden;
  }

  /* Drag handle pill at top */
  .kk-filter-panel::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #d1d9e6;
    border-radius: 99px;
    margin: 14px auto 0;
    flex-shrink: 0;
  }

  .kk-filter-panel.kk-filter-open,
  .bb-shop-sidebar-open .kk-filter-panel {
    transform: translateY(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* ---- Form Layout ---- */
  .kk-filter-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(88vh - 20px);
    overflow: hidden;
    padding-bottom: 0;
  }

  /* ---- Header Row ---- */
  .kk-filter-head {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 18px 20px 16px !important;
    margin-bottom: 0 !important;
    border-bottom: 1.5px solid #f1f5f9;
    width: 100%;
    flex-shrink: 0;
  }

  .kk-filter-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    margin: 0;
    letter-spacing: -0.2px;
  }

  .kk-filter-clear {
    position: absolute;
    left: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.18s ease;
  }
  .kk-filter-clear:hover { color: #184890; }

  /* ---- Scrollable Body ---- */
  .kk-filter-scroll-body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 20px 24px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .kk-filter-scroll-body::-webkit-scrollbar { width: 3px; }
  .kk-filter-scroll-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 99px;
  }

  /* ---- Group sections ---- */
  .kk-group {
    border-top: 1.5px solid #f1f5f9 !important;
    padding: 18px 0 !important;
    position: relative;
    overflow: visible !important;
  }
  .kk-group:first-of-type {
    border-top: none !important;
    z-index: 50 !important;
  }

  .kk-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    margin-bottom: 14px;
  }

  .kk-group-name {
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: -0.1px !important;
    text-transform: none !important;
    color: #0f172a !important;
  }

  /* Hide caret arrows on mobile for cleaner look */
  .kk-caret { display: none !important; }

  /* Always show group body on mobile */
  .kk-group-body {
    display: block !important;
    padding-top: 0 !important;
    position: relative;
    overflow: visible !important;
  }

  /* Sort By select styling */
  .kk-group .select {
    position: relative;
    width: 100%;
    z-index: 60;
  }

  .kk-group .custom-select {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 11px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }
.dark-mode .kk-group .custom-select {
    background: #0f172a !important;
    color: #f1f5f9 !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 11px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }
  .kk-group .custom-select::after {
    content: "\ea4e";
    font-family: "remixicon" !important;
    font-size: 18px !important;
    color: #64748b;
    margin-left: auto;
    transition: transform 0.2s ease;
  }

  .kk-group .custom-select.active::after {
    transform: rotate(180deg);
  }

  .kk-group .select-options {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15) !important;
    z-index: 999999 !important;
    padding: 6px !important;
    list-style: none !important;
    max-height: 220px !important;
    overflow-y: auto !important;
  }

  .kk-group .select-options li {
    padding: 10px 14px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
  }

  .kk-group .select-options li:hover {
    background: #f1f5f9 !important;
    color: #184890 !important;
  }

  /* ---- Chip Pills (Categories, Brands etc.) ---- */
  .kk-options {
    display: flex !important;
    flex-wrap: wrap;
    gap: 9px;
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: none !important;
    overflow: visible !important;
  }

  .kk-option { margin: 0; }

  .kk-check {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 8px 18px !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  }
  .kk-check:active { transform: scale(0.96); }

  /* Hide checkbox visually — the pill is the control */
  .kk-check input[type="checkbox"],
  .kk-check input[type="radio"] {
    display: none !important;
  }

  /* Selected state — filled dark pill */
  .kk-check:has(input:checked) {
    background: #0f172a !important;
    border-color: #0f172a !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18) !important;
  }

  .kk-option-label {
    display: inline-block;
    pointer-events: none;
  }

  /* Hide counts for cleaner pill look on mobile */
  .kk-option-count { display: none !important; }

  /* ---- Sort select ---- */
  .kk-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    font-size: 14px;
    background: #f8fafc;
    outline: none;
    color: #0f172a;
    font-weight: 500;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
  }
  .kk-select:focus { border-color: #184890; }

  /* ---- Price range inputs ---- */
  .kk-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
  }

  .kk-input {
    flex: 1;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    font-size: 14px;
    background: #f8fafc;
    outline: none;
    color: #0f172a;
    font-weight: 500;
    text-align: center;
  }
  .kk-input:focus { border-color: #184890; background: #fff; }

  .kk-dash { color: #94a3b8; font-size: 18px; font-weight: 300; }

  .kk-sub-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase !important;
    color: #94a3b8;
    margin-bottom: 10px;
  }

  /* ---- Active filter chips at top ---- */
  .kk-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 16px;
  }

  .kk-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f5fa;
    color: #184890;
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
  }
  .kk-chip:active { background: #dbeafe; }

  /* ---- Search inside group ---- */
  .kk-search { margin-bottom: 12px; }
  .kk-search-input {
    width: 100%;
    padding: 10px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    font-size: 14px;
    outline: none;
    background: #f8fafc;
    color: #0f172a;
  }
  .kk-search-input:focus { border-color: #184890; background: #fff; }

  /* ---- No match text ---- */
  .kk-no-match { color: #94a3b8; font-size: 13px; margin: 8px 0 0; }

  /* ---- Availability toggle ---- */
  .kk-group:last-of-type .kk-check {
    width: 100%;
    border-radius: 14px !important;
    padding: 14px 18px !important;
    justify-content: flex-start;
    gap: 12px;
  }
  .kk-group:last-of-type .kk-check input[type="checkbox"] {
    display: inline-block !important;
    width: 18px !important;
    height: 18px !important;
    accent-color: #0f172a;
    flex-shrink: 0;
  }

  /* ---- Bottom Action Row ---- */
  .kk-mobile-actions {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom)) !important;
    border-top: 1.5px solid #f1f5f9;
    background: #ffffff;
    width: 100%;
    margin-top: auto;
    flex-shrink: 0;
  }

  .kk-mobile-cancel {
    flex: 0 0 auto;
    background: none;
    border: none;
    font-size: 15.5px;
    font-weight: 600;
    color: #475569;
    padding: 14px 20px;
    cursor: pointer;
    text-align: center;
    transition: color 0.18s ease;
    border-radius: 14px;
    letter-spacing: -0.1px;
  }
  .kk-mobile-cancel:active { background: #f8fafc; }

  .kk-mobile-apply {
    flex: 1;
    background: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 999px !important;
    padding: 15px 24px;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.2);
    transition: all 0.22s ease;
    letter-spacing: -0.1px;
  }
  .kk-mobile-apply:active {
    background: #1e293b;
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
  }

} /* end @media (max-width: 991px) */

/* ==========================================================================
   FILTER PANEL — DARK MODE OVERRIDES
   ========================================================================== */

/* ---- Panel scrollbar ---- */
.dark-mode .kk-filter-panel::-webkit-scrollbar { width: 4px; }
.dark-mode .kk-filter-panel::-webkit-scrollbar-track { background: #0b0f19; }
.dark-mode .kk-filter-panel::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 99px;
}

/* ---- Header ---- */
.dark-mode .kk-filter-title {
  color: #f1f5f9 !important;
}
.dark-mode .kk-filter-clear {
  color: #60a5fa !important;
}
.dark-mode .kk-filter-head {
  border-bottom-color: #1e293b !important;
}

/* ---- Close button (mobile) ---- */
.dark-mode .kk-filter-close {
  background: #1e293b !important;
  color: #94a3b8 !important;
}
.dark-mode .kk-filter-close:active {
  background: #273549 !important;
}

/* ---- Group separators ---- */
.dark-mode .kk-group {
  border-top-color: #1e293b !important;
}

/* ---- Group heading (CATEGORY, BRAND, SIZE...) ---- */
.dark-mode .kk-group-name {
  color: #94a3b8 !important;
}

/* ---- Caret arrow ---- */
.dark-mode .kk-caret {
  border-right-color: #4b5563;
  border-bottom-color: #4b5563;
}

/* ---- Option labels & counts ---- */
.dark-mode .kk-option-label {
  color: #cbd5e1 !important;
}
.dark-mode .kk-option-count {
  color: #64748b !important;
}
.dark-mode .kk-check:hover .kk-option-label {
  color: #60a5fa !important;
}

/* ---- Checkbox accent ---- */
.dark-mode .kk-check input {
  accent-color: #60a5fa;
}

/* ---- Sort select ---- */
.dark-mode .kk-input,
.dark-mode .kk-select {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
.dark-mode .kk-input:focus,
.dark-mode .kk-select:focus {
  border-color: #60a5fa !important;
  background: #273549 !important;
}

/* ---- Or divider ---- */
.dark-mode .kk-or {
  color: #4b5563;
}
.dark-mode .kk-or::before,
.dark-mode .kk-or::after {
  border-bottom-color: #1e293b;
}

/* ---- Price sub-label ---- */
.dark-mode .kk-sub-label {
  color: #4b5563 !important;
}
.dark-mode .kk-dash {
  color: #4b5563 !important;
}

/* ---- Active chip tags ---- */
.dark-mode .kk-chip {
  background: #1e3a5f;
  color: #93c5fd;
  border: 1px solid #2563eb;
}
.dark-mode .kk-chip:hover { background: #1a3a6b; }

/* ---- Search within group ---- */
.dark-mode .kk-search-input {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
.dark-mode .kk-search-input::placeholder {
  color: #4b5563 !important;
}
.dark-mode .kk-search-input:focus {
  border-color: #60a5fa !important;
}

/* ---- No match text ---- */
.dark-mode .kk-no-match {
  color: #4b5563 !important;
}

/* ══════════════════════════════════════════════════════════
   📱 MOBILE FILTER DRAWER — LIGHT MODE (white sheet)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .kk-filter-panel {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 88vh !important;
    z-index: 100055 !important;
    padding: 0 !important;
    border-top: none !important;
    border-right: none !important;
    border-radius: 24px 24px 0 0 !important;
    box-shadow: 0 -8px 48px rgba(10, 15, 30, 0.2) !important;
    transform: translateY(100%) !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0.38s !important;
    display: flex !important;
    flex-direction: column !important;
    background: #ffffff !important;
    color: #0f172a !important;
    overflow: hidden !important;
  }

  .kk-filter-panel.kk-filter-open,
  .bb-shop-sidebar-open .kk-filter-panel {
    transform: translateY(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Drag-handle pill */
  .kk-filter-panel::before { background: #cbd5e1 !important; }

  .kk-filter-head       { border-bottom: 1.5px solid #f1f5f9 !important; }
  .kk-filter-title      { color: #0f172a !important; font-weight: 700 !important; }
  .kk-filter-close      { background: #f1f5f9 !important; color: #475569 !important; }
  .kk-group-name        { color: #0f172a !important; font-weight: 700 !important; }
  .kk-sub-label         { color: #64748b !important; font-weight: 700 !important; }

  .kk-check {
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    color: #334155 !important;
  }
  .kk-check:has(input:checked) {
    background: #0f172a !important;
    border-color: #0f172a !important;
    color: #ffffff !important;
  }

  .kk-input,
  .kk-select {
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    color: #0f172a !important;
  }

  .kk-mobile-actions  { background: #ffffff !important; border-top: 1.5px solid #f1f5f9 !important; }
  .kk-mobile-cancel   { color: #475569 !important; }
  .kk-mobile-apply    { background: #0f172a !important; color: #ffffff !important; box-shadow: 0 4px 16px rgba(15, 23, 42, 0.2) !important; }
}

/* ══════════════════════════════════════════════════════════
   🌙 MOBILE FILTER DRAWER — DARK MODE (dark slate sheet)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .dark-mode .kk-filter-panel {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    box-shadow: 0 -8px 48px rgba(0, 0, 0, 0.55) !important;
  }

  .dark-mode .kk-filter-panel.kk-filter-open,
  .dark-mode .bb-shop-sidebar-open .kk-filter-panel {
    transform: translateY(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Drag-handle pill */
  .dark-mode .kk-filter-panel::before { background: #475569 !important; }

  /* Header */
  .dark-mode .kk-filter-head    { border-bottom: 1.5px solid #334155 !important; }
  .dark-mode .kk-filter-title   { color: #f8fafc !important; font-weight: 700 !important; }
  .dark-mode .kk-filter-clear   { color: #60a5fa !important; }
  .dark-mode .kk-filter-close   { background: #334155 !important; color: #94a3b8 !important; }
  .dark-mode .kk-filter-close:active { background: #475569 !important; }

  /* Group headings & separators */
  .dark-mode .kk-group           { border-top-color: #334155 !important; }
  .dark-mode .kk-group-name      { color: #f1f5f9 !important; font-weight: 700 !important; }
  .dark-mode .kk-sub-label       { color: #64748b !important; font-weight: 700 !important; }

  /* Scrollable body bg */
  .dark-mode .kk-filter-scroll-body { background: #1e293b; }

  /* Pill chips (filter options) */
  .dark-mode .kk-check {
    background: #0f172a !important;
    border: 1.5px solid #334155 !important;
    color: #cbd5e1 !important;
  }
  .dark-mode .kk-check:active { transform: scale(0.96); }

  /* Selected pill */
  .dark-mode .kk-check:has(input:checked) {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3) !important;
  }

  /* Price & sort inputs */
  .dark-mode .kk-input,
  .dark-mode .kk-select {
    background: #0f172a !important;
    border: 1.5px solid #334155 !important;
    color: #f1f5f9 !important;
  }
  .dark-mode .kk-input:focus,
  .dark-mode .kk-select:focus {
    border-color: #60a5fa !important;
    background: #0f172a !important;
  }

  .dark-mode .kk-group .custom-select {
    background: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
  }
  .dark-mode .kk-group .custom-select::after {
    color: #94a3b8 !important;
  }
  .dark-mode .kk-group .select-options {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55) !important;
  }
  .dark-mode .kk-group .select-options li {
    color: #cbd5e1 !important;
  }
  .dark-mode .kk-group .select-options li:hover {
    background: #334155 !important;
    color: #60a5fa !important;
  }

  /* Price range dash */
  .dark-mode .kk-dash { color: #475569 !important; }

  /* Or divider */
  .dark-mode .kk-or { color: #475569 !important; }
  .dark-mode .kk-or::before,
  .dark-mode .kk-or::after { border-bottom-color: #334155 !important; }

  /* Active chip tags at top */
  .dark-mode .kk-chip {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #93c5fd !important;
    border: 1px solid #2563eb !important;
  }

  /* Search within group */
  .dark-mode .kk-search-input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
  }
  .dark-mode .kk-search-input::placeholder { color: #475569 !important; }
  .dark-mode .kk-search-input:focus { border-color: #60a5fa !important; }

  /* Availability "In stock only" toggle row */
  .dark-mode .kk-group:last-of-type .kk-check {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
  }

  /* Bottom action bar */
  .dark-mode .kk-mobile-actions {
    background: #1e293b !important;
    border-top: 1.5px solid #334155 !important;
  }
  .dark-mode .kk-mobile-cancel  { color: #94a3b8 !important; }
  .dark-mode .kk-mobile-apply {
    background: #0f172a  !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3) !important;
  }
  .dark-mode .kk-mobile-apply:active {
    background: #0f172a  !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2) !important;
  }
}



/* ======================================================================
   Desktop: the panel is a drawer here too
   ======================================================================

   The panel used to stand permanently in a 276px column on desktop, which
   spent a quarter of every listing page on filters a shopper mostly is not
   using. It is now the same slide-in drawer the phone already had, opened
   from a "Filters" button that sits above the grid, so the products get the
   full width of the page.

   The drawer, the backdrop, the close button and the footer actions are all
   the ones the mobile sheet uses - only the geometry differs, so there is one
   set of markup and one set of behaviour (product-filters.js needs no width
   check of its own).
   ====================================================================== */

@media (min-width: 992px) {

  /* ---- The button above the grid ---- */
  .kk-filter-trigger {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    position: static !important;
    transform: none !important;
    margin: 0 0 4px !important;
    padding: 10px 20px !important;
    border: 1px solid #d5d9e0 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #0f172a !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: .2px !important;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none !important;
    transition: border-color .18s ease, background .18s ease;
  }

  .kk-filter-trigger:hover {
    border-color: #184890 !important;
    background: #f0f5fa !important;
    color: #184890 !important;
  }

  /* A shopper with filters on should be able to see that from the button. */
  .kk-filter-trigger.kk-has-filters {
    border-color: #184890 !important;
    background: #184890 !important;
    color: #fff !important;
  }

  .dark-mode .kk-filter-trigger {
    background: #0b0f19 !important;
    border: 1px solid #334155 !important;
    color: #e2e8f0 !important;
  }

  /* ---- One column: the grid takes the whole width ---- */
  .kk-shop-layout {
    display: block;
    grid-template-columns: none;
    gap: 0;
  }

  .kk-shop-sidebar {
    width: 100%;
    margin-bottom: 8px;
  }

  /* ---- Backdrop ---- */
  .kk-filter-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, .45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100050;
  }
  .kk-filter-backdrop[hidden] { display: none; }

  /* ---- The popup itself ----
     A centred dialog rather than a drawer off the left edge: every filter
     group laid out side by side in columns, so a shopper sees all of them at
     once instead of scrolling one long list. */
  .kk-filter-panel,
  .dark-mode .kk-filter-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    bottom: auto;
    right: auto;
    width: min(1120px, 94vw);
    max-width: 94vw;
    height: auto;
    max-height: 86vh;
    z-index: 100055;
    padding: 0;
    border: 1px solid #e8eaed;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(10, 15, 30, .28);
    transform: translate(-50%, -48%) scale(.97);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease, visibility .22s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
  }

  .dark-mode .kk-filter-panel { background: #0b0f19; border-color: #1e293b; }

  .kk-filter-panel.kk-filter-open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* ---- Labels: the long forms, with the icon before the title ---- */
  .kk-filter-panel .kk-title-short { display: none; }
  .kk-filter-panel .kk-title-long { display: inline; }
  .kk-filter-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 21px;
    color: #10213f;
  }
  .kk-heading-icon { display: inline-block; font-size: 18px; color: #184890; }
  .dark-mode .kk-filter-title { color: #f1f5f9; }
  .dark-mode .kk-heading-icon { color: #60a5fa; }

  /* Reset Filter in the footer does what Clear All did up here. */
  .kk-filter-head .kk-filter-clear { display: none; }

  /* ---- Groups in columns ---- */
  /* The popup's height is its content, up to 86vh; the form has to carry
     that cap itself or the body never gets a height to scroll inside. */
  .kk-filter-form { height: auto; max-height: 86vh; }

  /* Columns rather than a grid: a long group (Suitable For) and a short one
     (Thickness) stack under each other without leaving a hole the height of
     the long one. */
  .kk-filter-scroll-body {
    min-height: 0;
    display: block;
    columns: 4 220px;
    column-gap: 40px;
    padding: 24px 32px 28px;
  }

  .kk-filter-scroll-body > .kk-chips { column-span: all; margin-bottom: 20px; }

  .kk-filter-panel .kk-group,
  .kk-filter-panel .kk-group:first-of-type {
    border-top: none;
    padding: 0 0 26px;
    min-width: 0;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
  }

  /* The price bands are radios; the theme hides radios site-wide. */
  .kk-filter-panel .kk-check input[type="radio"] {
    display: inline-block !important;
    appearance: auto;
    -webkit-appearance: radio;
    opacity: 1;
    position: static;
  }

  .kk-filter-panel .kk-select { padding: 9px 12px; border-radius: 8px; cursor: pointer; }
  .dark-mode .kk-filter-panel .kk-select,
  .dark-mode .kk-filter-panel .kk-input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
  }

  /* Every group is open in the popup - there is room to show them all, and a
     heading that hides its options is one more click for nothing. */
  .kk-filter-panel .kk-group-head { cursor: default; pointer-events: none; }
  .kk-filter-panel .kk-caret { display: none; }
  .kk-filter-panel .kk-group-body { display: block; padding-top: 12px; }

  .kk-filter-panel .kk-group-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none !important;
    color: #10213f;
  }
  .dark-mode .kk-filter-panel .kk-group-name { color: #f1f5f9 !important; }

  .kk-filter-panel .kk-options { max-height: 230px; }

  .kk-filter-panel .kk-check { padding: 5px 0; align-items: center; }
  .kk-filter-panel .kk-check input {
    width: 17px;
    height: 17px;
    margin-top: 0;
    accent-color: #f7931e;
  }
  .kk-filter-panel .kk-option-label { color: #5b6b85; }
  .kk-filter-panel .kk-check:has(input:checked) .kk-option-label { color: #10213f; font-weight: 500; }
  .kk-filter-panel .kk-option-count { color: #8a97ab; }
  .dark-mode .kk-filter-panel .kk-option-label { color: #94a3b8 !important; }
  .dark-mode .kk-filter-panel .kk-check:has(input:checked) .kk-option-label { color: #f1f5f9 !important; }

  /* ---- Header, scroll body, footer: a column that fills the drawer ---- */
  .kk-filter-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
  }

  .kk-filter-head {
    align-items: center;
    position: relative;
    padding: 20px 60px 16px 24px;
    margin-bottom: 0;
    border-bottom: 1px solid #eceef1;
    flex-shrink: 0;
  }

  .dark-mode .kk-filter-head { border-bottom-color: #1e293b; }

  .kk-filter-scroll-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
    padding: 12px 24px 24px;
  }

  .kk-filter-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 20px;
    top: 18px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease;
  }
  .kk-filter-close:hover { background: #e2e8f0; }

  .dark-mode .kk-filter-close { background: #1e293b; color: #cbd5e1; }

  /* The drawer needs its own way out on desktop as much as on a phone. */
  .kk-mobile-actions {
    display: flex !important;
    gap: 12px;
    flex-shrink: 0;
    padding: 14px 24px;
    border-top: 1px solid #eceef1;
    background: #fff;
  }

  .dark-mode .kk-mobile-actions { background: #0b0f19; border-top-color: #1e293b; }

  .kk-mobile-actions { justify-content: flex-start; align-items: center; padding: 18px 32px; }
  .kk-mobile-cancel { display: none; }

  .kk-filter-reset {
    display: inline-block;
    padding: 11px 12px;
    border: none;
    background: none;
    color: #8a97ab;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }
  .kk-filter-reset:hover { color: #184890; }
  .dark-mode .kk-filter-reset:hover { color: #93c5fd; }

  .kk-mobile-cancel,
  .kk-mobile-apply {
    flex: 0 0 auto;
    padding: 11px 24px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }

  .kk-mobile-cancel { background: #fff; border-color: #d5d9e0; color: #475569; }
  .kk-mobile-cancel:hover { border-color: #94a3b8; }

  .kk-mobile-apply { background: #184890; color: #fff; }
  .kk-mobile-apply:hover { background: #10356c; }
}
