/**
 * Southline Product Filter — All Devices
 *
 * < 992px  = full-screen slide-in drawer (mobile / tablet)
 * >= 992px = enhanced sidebar panels rendered inline in #secondary
 *
 * All selectors prefixed .mfd-* to prevent conflicts.
 */

/* --- CSS custom props -------------------------------------------------------- */
:root {
  --mfd-navy:        #11253e; /* Reference deep dark navy */
  --mfd-navy-hover:  #0d1d32;
  --mfd-accent:      #11253e;
  --mfd-accent-inv:  #ffffff;
  --mfd-radius:      12px;
  --mfd-pill-radius: 8px;
  --mfd-shadow:      0 10px 30px rgba(0, 0, 0, 0.16);
  --mfd-ink:         #1a202c;
  --mfd-sub:         #64748b;
  --mfd-border:      #e2e8f0;
  --mfd-border-light:#edf2f7;
  --mfd-bg:          #ffffff;
  --mfd-bg-soft:     #f8fafc;
  --mfd-bg-subtle:   #f1f5f9;
}

/* =============================================================================
   MOBILE / TABLET DRAWER  (< 992px)
   ============================================================================= */

.mfd-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 199998;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.mfd-backdrop.is-visible { display: block; }

.mfd-panel {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 199999;
  width: 100%;
  max-width: min(390px, 100vw);
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--mfd-bg);
  box-shadow: var(--mfd-shadow);
  transform: translateX(-110%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  border-radius: 0 var(--mfd-radius) var(--mfd-radius) 0;
  box-sizing: border-box;
  font-family: inherit;
}
.mfd-panel.is-open { transform: translateX(0); }

@media (max-width: 420px) {
  .mfd-panel { max-width: 100vw; border-radius: 0; }
}

/* Header */
.mfd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--mfd-border);
  flex-shrink: 0;
  background: var(--mfd-bg);
  box-sizing: border-box;
}
.mfd-header-left { display: flex; align-items: center; gap: 8px; }
.mfd-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.015em;
  margin: 0;
}
.mfd-active-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.mfd-active-badge[data-count="0"] { display: none; }

.mfd-close {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  border-radius: 6px !important;
  border: none !important;
  background: transparent !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  padding: 0 !important;
  box-shadow: none !important;
  line-height: 1 !important;
  transition: background 0.15s, color 0.15s;
}
.mfd-close:hover { background: #f1f5f9 !important; color: #334155 !important; }
.mfd-close svg { stroke: currentColor; }

/* Body */
.mfd-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  min-width: 0;
  box-sizing: border-box;
  background: var(--mfd-bg);
}
.mfd-body::-webkit-scrollbar { width: 5px; }
.mfd-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* Footer / Action Area */
.mfd-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--mfd-border);
  background: var(--mfd-bg);
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.mfd-btn-clear {
  flex: 0 0 auto;
  padding: 11px 18px !important;
  border-radius: var(--mfd-pill-radius) !important;
  border: 1px solid var(--mfd-border) !important;
  background: #ffffff !important;
  color: #334155 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  line-height: 1.3 !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.mfd-btn-clear:hover {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
}
.mfd-btn-clear:focus {
  outline: 2px solid #cbd5e1 !important;
  outline-offset: 1px !important;
}
.mfd-btn-clear:disabled,
.mfd-btn-clear[disabled],
.mfd-btn-clear.is-disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #94a3b8 !important;
}

.mfd-btn-results {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 16px !important;
  border-radius: var(--mfd-pill-radius) !important;
  border: none !important;
  background: var(--mfd-navy) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.3 !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  box-sizing: border-box !important;
  transition: background 0.15s, opacity 0.15s;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.mfd-btn-results:hover { background: var(--mfd-navy-hover) !important; color: #ffffff !important; }
.mfd-btn-results:focus {
  outline: 2px solid var(--mfd-navy) !important;
  outline-offset: 1px !important;
}
.mfd-btn-results.is-loading { opacity: 0.65 !important; cursor: wait !important; }

@media (max-width: 360px) {
  .mfd-footer {
    padding: 12px 14px;
    gap: 8px;
  }
  .mfd-btn-clear {
    padding: 10px 12px;
    font-size: 12px;
  }
  .mfd-btn-results {
    padding: 10px 12px;
    font-size: 12px;
  }
}

body.mfd-open { overflow: hidden; touch-action: none; }

@media (min-width: 992px) {
  .mfd-panel, .mfd-backdrop { display: none !important; }
}

/* =============================================================================
   SHARED SECTION STYLES (drawer + desktop sidebar)
   ============================================================================= */

.mfd-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--mfd-border);
  min-width: 0;
  box-sizing: border-box;
}
.mfd-section:last-child { border-bottom: none; }

.mfd-section-head-wrap {
  margin-bottom: 12px;
  transition: margin-bottom 0.2s ease;
}
.mfd-section.is-collapsed .mfd-section-head-wrap {
  margin-bottom: 0;
}

/* Accessible full-width clickable header button */
button.mfd-section-toggle,
.mfd-section-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  background: transparent !important;
  border: 0 !important;
  padding: 4px 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  text-align: left !important;
  text-decoration: none !important;
  box-shadow: none !important;
  border-radius: 4px !important;
  color: inherit !important;
  font-family: inherit !important;
  outline: none !important;
  user-select: none !important;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}
button.mfd-section-toggle:hover,
.mfd-section-toggle:hover {
  opacity: 0.85;
}
button.mfd-section-toggle:focus-visible,
.mfd-section-toggle:focus-visible {
  outline: 2px solid var(--mfd-navy) !important;
  outline-offset: 2px !important;
}

.mfd-section-title-wrap {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.mfd-section-label {
  font-size: 15px;
  font-weight: 700;
  color: #64748b;
  text-transform: none;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  line-height: 1.2;
}

.mfd-section-meta-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 10px;
}

.mfd-section-meta {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  text-align: right;
  line-height: 1.2;
}
.mfd-section-meta.has-selection {
  color: var(--mfd-navy);
  font-weight: 600;
}

/* Chevron arrow indicator */
.mfd-section-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #64748b;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s ease;
}
.mfd-section-chevron svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  display: block;
}
button.mfd-section-toggle:hover .mfd-section-chevron {
  color: var(--mfd-navy);
}

/* When section is collapsed: chevron points right/up depending on orientation, here rotated -90deg */
.mfd-section.is-collapsed .mfd-section-chevron {
  transform: rotate(-90deg);
}

/* Collapsible Section Body */
.mfd-section-body {
  overflow: hidden;
  transition: opacity 0.22s ease;
}
.mfd-section.is-collapsed .mfd-section-body {
  display: none !important;
}

/* Plain-text See All button */
button.mfd-see-all,
.mfd-see-all {
  display: inline-block !important;
  margin-top: 10px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: var(--mfd-navy) !important;
  text-decoration: none !important;
  cursor: pointer !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 4px 0 !important;
  text-align: left !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  line-height: 1.4 !important;
  transition: opacity 0.15s !important;
}
button.mfd-see-all:hover,
.mfd-see-all:hover {
  background: transparent !important;
  color: var(--mfd-navy) !important;
  opacity: 0.75 !important;
}
button.mfd-see-all:focus,
.mfd-see-all:focus {
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--mfd-navy) !important;
  text-decoration: underline !important;
}

/* Selectable box grid (Gender, Age Group) & category pills */
.mfd-cat-grid,
.mfd-box-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.mfd-cat-pill,
.mfd-box-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: var(--mfd-pill-radius);
  border: 1px solid var(--mfd-border);
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
  line-height: 1.3;
  min-width: 0;
  user-select: none;
}
.mfd-cat-pill:hover,
.mfd-box-pill:hover { border-color: #cbd5e1; background: #f8fafc; color: #0f172a; }
.mfd-cat-pill.is-selected,
.mfd-box-pill.is-selected {
  background: var(--mfd-navy);
  color: #ffffff;
  border-color: var(--mfd-navy);
  font-weight: 600;
}
.mfd-cat-pill.is-hidden,
.mfd-box-pill.is-hidden { display: none; }

/* =============================================================================
   CATEGORY HIERARCHICAL TREE
   ============================================================================= */
.mfd-cat-tree-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mfd-cat-item {
  margin: 1px 0;
  min-width: 0;
  position: relative;
}

.mfd-cat-item.is-hidden {
  display: none !important;
}

.mfd-cat-row-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.mfd-cat-row-wrap .mfd-check-row {
  flex: 1 1 auto;
  min-width: 0;
}

/* Subtle visual distinction for parent categories with children */
.mfd-cat-has-children > .mfd-cat-row-wrap > .mfd-check-row .mfd-check-name {
  font-weight: 600;
  color: #1e293b;
}

.mfd-cat-has-children > .mfd-cat-row-wrap > .mfd-check-row:hover {
  background: #f8fafc;
}

/* Independent Expand/Collapse Chevron Button */
button.mfd-cat-toggle,
.mfd-cat-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 4px !important;
  background: transparent !important;
  background-color: transparent !important;
  color: #64748b !important;
  cursor: pointer !important;
  flex: 0 0 26px !important;
  line-height: 1 !important;
  transition: color 0.15s ease, background-color 0.15s ease !important;
  box-shadow: none !important;
  user-select: none !important;
}

button.mfd-cat-toggle::before,
button.mfd-cat-toggle::after,
.mfd-cat-toggle::before,
.mfd-cat-toggle::after {
  display: none !important;
  content: none !important;
}

button.mfd-cat-toggle:hover,
.mfd-cat-toggle:hover {
  background: #f1f5f9 !important;
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: transparent !important;
}

button.mfd-cat-toggle:focus-visible,
.mfd-cat-toggle:focus-visible {
  outline: 2px solid var(--mfd-navy) !important;
  outline-offset: 1px !important;
}

.mfd-cat-toggle svg {
  width: 12px !important;
  height: 12px !important;
  display: block !important;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Rotate chevron 90deg when parent item is expanded (points down) */
.mfd-cat-item.is-expanded > .mfd-cat-row-wrap > .mfd-cat-toggle svg {
  transform: rotate(90deg);
}

/* Subcategory Container (Indented Hierarchy) */
.mfd-cat-sublist {
  display: none;
  list-style: none;
  margin: 2px 0 4px 14px;
  padding: 0 0 0 10px;
  border-left: 2px solid #e2e8f0;
}

.mfd-cat-item.is-expanded > .mfd-cat-sublist {
  display: block;
  animation: mfdSublistSlide 0.18s ease-out;
}

@keyframes mfdSublistSlide {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subcategory Row Typography and Spacing */
.mfd-cat-sublist .mfd-check-row {
  font-size: 12px;
  padding: 4.5px 6px;
}

.mfd-cat-sublist .mfd-check-name {
  color: #475569;
  font-weight: 400;
}

.mfd-cat-sublist .mfd-check-row:hover .mfd-check-name {
  color: #0f172a;
}

.mfd-cat-sublist .mfd-check-row.is-selected .mfd-check-name {
  color: var(--mfd-navy);
  font-weight: 600;
}

/* Scroll wrapper — applied around size/colour/brand/tag grids.
   Collapsed: natural height (only visible items, rest hidden via is-hidden).
   Expanded:  bounded 240 px with internal scroll so the panel never grows. */
.mfd-scroll-wrap {
  min-width: 0;
}
.mfd-scroll-wrap.is-expanded {
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.mfd-scroll-wrap.is-expanded::-webkit-scrollbar { width: 4px; }
.mfd-scroll-wrap.is-expanded::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* Size grid - reference design pill cards */
.mfd-size-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  min-width: 0;
}

.mfd-size-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border-radius: var(--mfd-pill-radius);
  border: 1px solid var(--mfd-border);
  background: #fff;
  color: #1e293b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  min-height: 48px;
  line-height: 1.2;
  min-width: 0;
  box-sizing: border-box;
  user-select: none;
}
.mfd-size-btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.mfd-size-btn.is-selected {
  background: var(--mfd-navy);
  color: #ffffff;
  border-color: var(--mfd-navy);
}
.mfd-size-btn.is-selected .mfd-size-count {
  color: rgba(255, 255, 255, 0.75);
}
.mfd-size-btn.is-unavailable { opacity: 0.35; cursor: default; pointer-events: none; }
.mfd-size-count {
  font-size: 10px;
  font-weight: 400;
  margin-top: 3px;
  color: #94a3b8;
}
.mfd-size-btn.is-hidden { display: none; }

/* Colour search & grid - reference pill rows with dot */
.mfd-colour-search-wrap {
  margin-bottom: 10px;
  min-width: 0;
}
.mfd-colour-search {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--mfd-pill-radius);
  border: 1px solid var(--mfd-border);
  font-size: 12.5px;
  color: #1e293b;
  background: #fff;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}
.mfd-colour-search:focus {
  border-color: var(--mfd-navy);
}
.mfd-colour-search::placeholder {
  color: #94a3b8;
}

.mfd-colour-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

@media (max-width: 350px) {
  .mfd-colour-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.mfd-colour-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--mfd-pill-radius);
  text-decoration: none;
  color: #334155;
  font-size: 12px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
  border: 1px solid var(--mfd-border);
  background: #ffffff;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  user-select: none;
}
.mfd-colour-row:hover { border-color: #cbd5e1; background: #f8fafc; color: #0f172a; }
.mfd-colour-row.is-selected {
  border-color: var(--mfd-navy);
  background: #ffffff;
  font-weight: 600;
  color: var(--mfd-navy);
  box-shadow: inset 0 0 0 1px var(--mfd-navy);
}
.mfd-colour-row.is-hidden { display: none !important; }

.mfd-colour-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
}
.mfd-colour-dot--unknown {
  background: #e2e8f0 !important;
  background-image: repeating-linear-gradient(
    45deg, rgba(0,0,0,0.08) 0, rgba(0,0,0,0.08) 2px,
    transparent 2px, transparent 4px) !important;
}
.mfd-colour-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.mfd-colour-count {
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Price passthrough and layout */
.mfd-price-passthrough {
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.mfd-price-passthrough .widget_price_filter { margin: 0 !important; }
.mfd-price-passthrough .widget-title { display: none !important; }
.mfd-price-passthrough .widget-content { max-height: none !important; overflow: visible !important; }
.mfd-price-passthrough .price_slider_wrapper {
  padding-top: 6px;
  box-sizing: border-box;
}
.mfd-price-passthrough .price_slider {
  margin-bottom: 14px;
  margin-left: 6px;
  margin-right: 6px;
  background: #e2e8f0 !important;
  height: 4px !important;
  border: none !important;
  border-radius: 2px !important;
}
.mfd-price-passthrough .ui-slider-range {
  background: var(--mfd-navy) !important;
  border-radius: 2px !important;
}
.mfd-price-passthrough .ui-slider-handle {
  background: #ffffff !important;
  border: 2px solid var(--mfd-navy) !important;
  border-radius: 50% !important;
  width: 14px !important;
  height: 14px !important;
  top: -5px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
  cursor: pointer !important;
}
.mfd-price-passthrough .price_slider_amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.mfd-price-passthrough .price_slider_amount input[type="text"] {
  display: none !important;
}
.mfd-price-passthrough .price_slider_amount .button {
  display: none !important;
}
.mfd-price-passthrough .price_slider_amount .price_label {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  float: none !important;
  text-align: left !important;
}
.mfd-price-passthrough .price_slider_amount .clear { display: none !important; }

/* Custom Price inputs row */
.mfd-price-inputs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
  box-sizing: border-box;
}
.mfd-price-input-wrap {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  position: relative;
  min-width: 0;
}
.mfd-price-currency {
  position: absolute;
  left: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: #94a3b8;
  pointer-events: none;
}
.mfd-price-input {
  width: 100%;
  padding: 7px 8px 7px 22px;
  border-radius: var(--mfd-pill-radius);
  border: 1px solid var(--mfd-border);
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
  background: #fff;
  box-sizing: border-box;
  outline: none;
}
.mfd-price-input:focus {
  border-color: var(--mfd-navy);
}
.mfd-price-separator {
  color: #94a3b8;
  font-weight: 500;
  flex-shrink: 0;
}

/* Brand / Manufacturer checkboxes */
.mfd-check-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mfd-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  user-select: none;
}
.mfd-check-row:hover { background: #f8fafc; color: #0f172a; }
.mfd-check-row.is-selected { background: #f1f5f9; font-weight: 600; color: var(--mfd-navy); }
.mfd-check-row.is-hidden { display: none; }
.mfd-check-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.mfd-check-row.is-selected .mfd-check-box {
  background: var(--mfd-navy);
  border-color: var(--mfd-navy);
}
.mfd-check-box svg { display: none; width: 10px; height: 10px; stroke: #fff; stroke-width: 2.5; fill: none; }
.mfd-check-row.is-selected .mfd-check-box svg { display: block; }
.mfd-check-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mfd-check-count { font-size: 11px; font-weight: 400; color: #94a3b8; flex-shrink: 0; white-space: nowrap; }
.mfd-check-top-label {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  text-align: right;
  margin-bottom: 4px;
}

/* Tag cloud */
.mfd-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}


.mfd-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--mfd-border);
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  user-select: none;
}
.mfd-tag:hover { border-color: #cbd5e1; background: #f8fafc; color: #0f172a; }
.mfd-tag.is-selected {
  background: var(--mfd-navy);
  color: #ffffff;
  border-color: var(--mfd-navy);
}
.mfd-tag.is-hidden { display: none; }

/* Toggle rows */
.mfd-toggle-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mfd-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  min-width: 0;
}
.mfd-toggle-info { flex: 1 1 auto; min-width: 0; }
.mfd-toggle-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  display: block;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mfd-toggle-desc { font-size: 11.5px; color: #64748b; display: block; margin-top: 1px; line-height: 1.4; }
.mfd-toggle-switch {
  flex-shrink: 0;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.2s;
}
.mfd-toggle-switch::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: left 0.2s;
}
.mfd-toggle-row.is-selected .mfd-toggle-switch { background: var(--mfd-navy); }
.mfd-toggle-row.is-selected .mfd-toggle-switch::after { left: 18px; }

/* =============================================================================
   DESKTOP SIDEBAR MODE  (>= 992px)
   ============================================================================= */

@media (min-width: 992px) {
  .mfd-desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid var(--mfd-border);
    border-radius: var(--mfd-radius);
    padding: 6px 0;
    margin-bottom: 24px;
  }
  .mfd-desktop-sidebar .mfd-section {
    padding: 14px 18px;
    border-bottom: 1px solid var(--mfd-border-light);
    overflow: hidden;
    min-width: 0;
  }
  .mfd-desktop-sidebar .mfd-section:last-child { border-bottom: none; }
  .mfd-desktop-sidebar .mfd-cat-pill,
  .mfd-desktop-sidebar .mfd-box-pill { font-size: 11.5px; padding: 5px 10px; }
  .mfd-desktop-sidebar .mfd-size-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .mfd-desktop-sidebar .mfd-size-btn { font-size: 11.5px; min-height: 44px; padding: 6px 2px; }
  .mfd-desktop-sidebar .mfd-colour-row { font-size: 11.5px; padding: 6px 8px; gap: 6px; }
  .mfd-desktop-sidebar .mfd-check-row { font-size: 12.5px; padding: 5px 6px; }
  .mfd-desktop-sidebar .mfd-cat-toggle { width: 24px; height: 24px; flex: 0 0 24px; }
  .mfd-desktop-sidebar .mfd-cat-sublist { margin: 2px 0 3px 12px; padding-left: 8px; }
  .mfd-desktop-sidebar .mfd-cat-sublist .mfd-check-row { font-size: 11.5px; padding: 4px 6px; }
  .mfd-desktop-sidebar .mfd-tag { font-size: 11.5px; padding: 4px 10px; }
  .mfd-desktop-sidebar .mfd-colour-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .mfd-desktop-clear {
    display: block;
    width: calc(100% - 36px);
    margin: 12px 18px 8px 18px;
    padding: 9px 14px;
    border-radius: var(--mfd-pill-radius);
    border: 1px solid var(--mfd-border);
    background: #fff;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.3;
    transition: border-color 0.15s, background 0.15s, color 0.15s, opacity 0.15s;
  }
  .mfd-desktop-clear:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
  }
  .mfd-desktop-clear:disabled,
  .mfd-desktop-clear[disabled],
  .mfd-desktop-clear.is-disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
  }
}

/* Tablet: narrower drawer */
@media (min-width: 600px) and (max-width: 991px) {
  .mfd-panel { max-width: min(380px, 85vw); }
}

/* =============================================================================
   PRODUCT RESULTS FILTER LOADING OVERLAY
   ============================================================================= */
.sls-shop-products-wrap {
  position: relative;
  min-width: 0;
  transition: min-height 0.2s ease;
}

/* Products container in loading state: dim products slightly while keeping them visible */
.sls-shop-products-wrap.is-loading > .products,
.sls-shop-products-wrap.is-loading > .woocommerce-info {
  opacity: 0.45;
  filter: grayscale(15%);
  pointer-events: none;
  transition: opacity 0.22s ease, filter 0.22s ease;
}

/* Subtle translucent overlay covering the product results area */
.sls-filter-loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.sls-shop-products-wrap.is-loading .sls-filter-loader-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Centered floating card with refined spinner & typography */
.sls-filter-loader-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: #ffffff;
  border: 1px solid var(--mfd-border, #e2e8f0);
  border-radius: 9999px;
  box-shadow: 0 4px 20px -2px rgba(17, 37, 62, 0.12), 0 2px 6px -1px rgba(0, 0, 0, 0.05);
  user-select: none;
  animation: slsLoaderPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 999999;
}

@keyframes slsLoaderPop {
  from {
    transform: translate(-50%, -50%) scale(0.92);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* Refined Circular Spinner (28px) */
.sls-filter-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid #e2e8f0;
  border-top-color: var(--mfd-navy, #11253e);
  box-sizing: border-box;
  animation: slsSpinnerRotate 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes slsSpinnerRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Tasteful Text Label */
.sls-filter-loader-text {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--mfd-navy, #11253e);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Accessibility: Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .sls-filter-spinner {
    animation-duration: 2s;
  }
  .sls-filter-loader-card {
    animation: none;
  }
  .sls-filter-loader-overlay,
  .sls-shop-products-wrap.is-loading > .products {
    transition: none;
  }
}

/* Mobile & Tablet adjustments */
@media (max-width: 768px) {
  .sls-filter-loader-card {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 8px 16px;
    gap: 10px;
  }
  .sls-filter-spinner {
    width: 24px;
    height: 24px;
    border-width: 2.2px;
  }
  .sls-filter-loader-text {
    font-size: 12px;
  }
}

/* Gender + Age Group: 2-column selectable button grid with count aligned right */
.mfd-box-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.mfd-box-grid .mfd-box-pill {
  width: 100%;
  min-width: 0;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  box-sizing: border-box;
}

.mfd-box-grid .mfd-box-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mfd-box-grid .mfd-box-count {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
}

.mfd-box-grid .mfd-box-pill.is-selected .mfd-box-count {
  color: rgba(255,255,255,0.8);
}
