/* ============================================
   Universal Filter System Styles
   Compatible with all pages (index, cat, sub, type, quick-order)
   ============================================ */

/* CSS Variables - Fallback if not defined in page */
:root {
  --filter-bg: rgba(255, 255, 255, 0.02);
  --filter-border: var(--accent, rgba(91, 67, 234, 0.2));
  --filter-text: #ffffff;
  --filter-text-secondary: rgba(255, 255, 255, 0.7);
  --filter-accent: #5b43ea;
  --filter-success: #26c281;
  --filter-warning: #ffb020;
  --filter-danger: #f59e0b;
  --filter-info: #3b82f6;
  
  --filter-space-xs: 4px;
  --filter-space-sm: 8px;
  --filter-space-md: 12px;
  --filter-space-lg: 16px;
  --filter-space-xl: 20px;
  --filter-space-2xl: 24px;
  --filter-space-3xl: 32px;
  
  --filter-radius-sm: var(--radius-sm, 16px);
  --filter-radius: var(--radius, 22px);
  --filter-radius-lg: var(--radius-lg, 22px);
  
  --filter-transition: 0.2s ease;
  
  /* Icon color filters - centralized for easy maintenance */
  /* Brand color #5b43ea = rgb(91, 67, 234) */
  --icon-filter-brand: brightness(0) saturate(100%) invert(40%) sepia(90%) saturate(2000%) hue-rotate(235deg) brightness(100%) contrast(100%);
  --icon-filter-white: brightness(0) invert(1);
}

/* Use page-specific variables if available, fallback to filter-* */
/* Unified Page Header - Replaces filter-top-bar and section-header */
.unified-page-header {
  margin-bottom: var(--space-xl, var(--filter-space-xl));
  padding-bottom: var(--space-lg, var(--filter-space-lg));
  width: 100%;
  clear: both;
}

.header-title-section {
  margin-bottom: var(--space-lg, var(--filter-space-lg));
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md, var(--filter-space-md));
  flex-wrap: wrap;
}

.header-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--quick-text, var(--filter-text));
  margin: 0;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}

/* ============================================
   Hero Search Bar (Quick Order style)
   Shared between Quick Order, Cat, Sub, Type pages
   ============================================ */
.unified-page-header .hero-search-wrapper {
  position: relative;
}

.hero-search-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
}

.hero-search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}

.unified-page-header .hero-search-input {
  width: 100%;
  padding: 0 2.75rem 0 2.5rem;
  background: transparent;
  border: 0.5px solid var(--quick-border, var(--accent, rgba(91, 67, 234, 0.2)));
  border-radius: var(--radius-xs, 10px);
  color: var(--quick-text, var(--ink, #fff));
  font-size: 0.9375rem;
  font-weight: 400;
  transition: border-color 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
  height: 48px;
  min-width: 0;
}

.unified-page-header .hero-search-input:focus {
  outline: none;
  border-color: rgba(91, 67, 234, 0.4);
  background: rgba(255, 255, 255, 0.02);
}

.unified-page-header .hero-search-input::placeholder {
  color: var(--quick-text-secondary, var(--ink-2, rgba(255, 255, 255, 0.55)));
  opacity: 0.8;
}

.unified-page-header .hero-search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--brand, #5b43ea);
  pointer-events: none;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.hero-search-input-wrapper:focus-within .hero-search-icon {
  opacity: 1;
}

.unified-page-header .hero-search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--quick-text-secondary, var(--ink-2, rgba(255, 255, 255, 0.55)));
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease;
}

.unified-page-header .hero-search-clear svg {
  width: 16px;
  height: 16px;
}

.unified-page-header .hero-search-clear:hover {
  color: var(--quick-text, var(--ink, #fff));
  background: rgba(255, 255, 255, 0.06);
}

/* Hero Filter Button — matches site header button style (.user-btn) */
.unified-page-header .hero-filter-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm, 16px);
  color: var(--ink-2, rgba(255, 255, 255, 0.8));
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition-normal, 0.25s ease);
  white-space: nowrap;
  height: 48px;
  flex-shrink: 0;
  position: relative;
}

.unified-page-header .hero-filter-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.24);
  color: var(--ink, #fff);
}

.unified-page-header .hero-filter-btn:active {
  transform: scale(0.98);
}

.unified-page-header .hero-filter-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.7);
  stroke: rgba(255, 255, 255, 0.7);
}

.hero-filter-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--brand, #5b43ea);
  color: #fff;
  font-size: 0.5625rem;
  font-weight: 600;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.hero-filter-text {
  display: inline;
}

/* Hero Sort Button */
/* Keep below filter/sorting modals (they use z-index 99999+) so sort button doesn't overlay modals */
:is(.unified-page-header, .promoted-services-section .home-services-toolbar) .hero-sort-dropdown-wrapper {
  position: relative;
  display: inline-block;
  z-index: 1000;
  flex-shrink: 0;
}

:is(.unified-page-header, .promoted-services-section .home-services-toolbar) .hero-sort-dropdown-wrapper.active {
  z-index: 10004;
}

/* Hero Sort Button — matches site header button style (.user-btn) */
:is(.unified-page-header, .promoted-services-section .home-services-toolbar) .hero-sort-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm, 16px);
  color: var(--ink-2, rgba(255, 255, 255, 0.8));
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition-normal, 0.25s ease);
  white-space: nowrap;
  height: 48px;
  flex-shrink: 0;
}

:is(.unified-page-header, .promoted-services-section .home-services-toolbar) .hero-sort-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.24);
  color: var(--ink, #fff);
}

:is(.unified-page-header, .promoted-services-section .home-services-toolbar) .hero-sort-btn:active {
  transform: scale(0.98);
}

:is(.unified-page-header, .promoted-services-section .home-services-toolbar) .hero-sort-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.7);
  stroke: rgba(255, 255, 255, 0.7);
}

.hero-sort-text {
  display: none;
}

@media (min-width: 640px) {
  .hero-sort-text {
    display: inline;
  }
}

/* Tablet */
@media (max-width: 768px) {
  .hero-search-container {
    gap: 0.5rem;
  }

  .unified-page-header .hero-search-input {
    font-size: 0.875rem;
    padding: 0 2.25rem 0 2.25rem;
    height: 44px;
    border-radius: var(--radius-xs, 10px);
  }

  .unified-page-header .hero-search-icon {
    left: 0.75rem;
    width: 16px;
    height: 16px;
  }

  /* Icon-only: no space for label, icon centered (matches header .user-btn) */
  .unified-page-header .hero-filter-btn,
  :is(.unified-page-header, .promoted-services-section .home-services-toolbar) .hero-sort-btn {
    min-width: 44px;
    width: 44px;
    max-width: 44px;
    padding: 0;
    height: 44px;
    border-radius: var(--radius-sm, 16px);
    gap: 0;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .hero-filter-text,
  .hero-sort-text {
    display: none !important;
    width: 0;
    min-width: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .hero-search-container {
    gap: 0.375rem;
  }

  .unified-page-header .hero-search-input {
    height: 42px;
    font-size: 0.8125rem;
    padding-left: 2rem;
    padding-right: 2rem;
    border-radius: var(--radius-xs, 10px);
  }

  .unified-page-header .hero-search-icon {
    left: 0.625rem;
    width: 15px;
    height: 15px;
  }

  .unified-page-header .hero-filter-btn,
  :is(.unified-page-header, .promoted-services-section .home-services-toolbar) .hero-sort-btn {
    min-width: 42px;
    width: 42px;
    max-width: 42px;
    height: 42px;
    padding: 0;
    border-radius: var(--radius-sm, 16px);
    gap: 0;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .unified-page-header .hero-filter-btn svg,
  :is(.unified-page-header, .promoted-services-section .home-services-toolbar) .hero-sort-btn svg {
    width: 17px;
    height: 17px;
  }
}

/* RTL support */
[dir="rtl"] .unified-page-header .hero-search-icon {
  left: auto;
  right: 0.875rem;
}

[dir="rtl"] .unified-page-header .hero-search-input {
  padding: 0 2.5rem 0 2.75rem;
}

[dir="rtl"] .unified-page-header .hero-search-clear {
  right: auto;
  left: 0.5rem;
}

[dir="rtl"] .hero-filter-badge {
  right: auto;
  left: 6px;
}

@media (max-width: 768px) {
  [dir="rtl"] .unified-page-header .hero-search-icon {
    left: auto;
    right: 0.75rem;
  }
  [dir="rtl"] .unified-page-header .hero-search-input {
    padding: 0 2.25rem 0 2.25rem;
  }
}

@media (max-width: 480px) {
  [dir="rtl"] .unified-page-header .hero-search-icon {
    left: auto;
    right: 0.625rem;
  }
  [dir="rtl"] .unified-page-header .hero-search-input {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ============================================
   Legacy header-controls (kept for backward compatibility)
   ============================================ */
.header-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-lg, var(--filter-space-lg));
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Desktop: filter/sort buttons on the left, search on the right */
@media (min-width: 769px) {
  .header-controls {
    grid-template-columns: auto 1fr;
  }
  .header-controls > .filter-actions {
    grid-column: 1;
    justify-content: flex-start;
  }
  .header-controls > .search-wrapper {
    grid-column: 2;
    justify-self: end;
    max-width: 100%;
  }
}

/* Hide mobile search toggle on desktop */
.mobile-search-toggle {
  display: none;
}

/* Desktop: Always show search wrapper */
@media (min-width: 769px) {
  .header-controls > .search-wrapper {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }
  
  .mobile-search-toggle {
    display: none !important;
  }
}

/* Legacy support - keep filter-top-bar for backward compatibility */
.filter-top-bar {
  margin-bottom: var(--space-2xl, var(--filter-space-2xl));
  padding-bottom: var(--space-lg, var(--filter-space-lg));
  border-bottom: 1px solid var(--quick-border, var(--filter-border));
  width: 100%;
  clear: both;
}

.filter-top-bar-content {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-lg, var(--filter-space-lg));
  width: 100%;
  position: relative;
  z-index: 1;
}

.search-wrapper {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 500px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile Search Toggle Button - Matches filter-btn style */
.mobile-search-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

.mobile-search-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--active-border);
  color: #ffffff;
  transform: none;
}

.mobile-search-toggle:active {
  transform: scale(0.98);
  background: color-mix(in srgb, var(--brand, var(--quick-accent, var(--filter-accent))) 10%, transparent);
}

.mobile-search-toggle .search-icon {
  width: 18px;
  height: 18px;
  opacity: 1;
  color: var(--brand, var(--quick-accent, var(--filter-accent)));
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-search-input {
  width: 100%;
  padding: 0 var(--space-md, var(--filter-space-md));
  padding-left: 44px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--quick-text, var(--filter-text));
  font-size: 0.875rem;
  font-weight: 400;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  line-height: 44px;
}

.filter-search-input:focus {
  outline: none;
  border-color: var(--active-border);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 2px rgba(91, 67, 234, 0.1);
}

.filter-search-input::placeholder {
  color: var(--quick-text-secondary, var(--filter-text-secondary));
}

.search-wrapper .search-icon {
  position: absolute;
  left: var(--space-md, var(--filter-space-md));
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--brand);
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-search-input:focus ~ .search-icon {
  opacity: 0.8;
}

.search-clear-btn {
  position: absolute;
  right: var(--space-md, var(--filter-space-md));
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--brand);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.6;
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--brand);
  opacity: 0.9;
}

.search-clear-btn svg {
  width: 16px;
  height: 16px;
}

/* Mobile Search Close Button */
.mobile-search-close {
  display: none;
  position: absolute;
  right: var(--space-md, var(--filter-space-md));
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--accent);
  color: var(--brand, var(--quick-accent, var(--filter-accent)));
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.7;
  z-index: 10;
}

.mobile-search-close:hover {
  background: rgba(91, 67, 234, 0.15);
  color: var(--brand, var(--quick-accent, var(--filter-accent)));
  opacity: 1;
  transform: translateY(-50%);
}

.mobile-search-close:active {
  transform: translateY(-50%);
  background: rgba(91, 67, 234, 0.2);
}

.mobile-search-close svg {
  width: 16px;
  height: 16px;
  color: var(--brand, var(--quick-accent, var(--filter-accent)));
}

/* Clear button - Show only when input has value */
@media (max-width: 768px) {
  .search-clear-btn {
    display: none;
  }
  
  .search-wrapper:has(.filter-search-input:not(:placeholder-shown)) .search-clear-btn {
    display: flex;
  }
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md, var(--filter-space-md));
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  justify-content: flex-start;
}


/* View Toggle - Grid/List View Switcher */
/* Hidden on desktop, shown only on mobile */
.view-toggle {
  display: none;
  align-items: center;
  flex-shrink: 0;
  justify-content: center;
}

/* Show view-toggle only on mobile devices */
@media (max-width: 768px) {
  .view-toggle {
    display: flex;
  }
}

/* Very small screens: keep view-toggle visible and usable */
@media (max-width: 480px) {
  /* Force single column when in list view on very small screens */
  .services-grid.list-view,
  #servicesGrid.list-view,
  .product-cards-grid.list-view,
  .quick-order-container .services-grid.list-view,
  .quick-order-container #servicesGrid.list-view {
    grid-template-columns: 1fr !important;
  }

  /* Filter and Sort: compact icon-only on very small screens (no stretch, no empty space for label) */
  .header-controls > .filter-actions {
    width: auto !important;
    display: flex !important;
    flex-direction: row !important;
    gap: var(--space-sm, var(--filter-space-sm)) !important;
    justify-content: flex-start !important;
    grid-column: 1 / -1 !important;
  }

  .filter-btn,
  .filter-btn.sort-btn {
    flex: 0 0 auto !important;
    min-width: 42px !important;
    width: 42px !important;
    max-width: 42px !important;
    padding: 0 !important;
    gap: 0 !important;
    justify-content: center !important;
  }

  .filter-btn:not(.sort-btn) {
    flex: 0 0 auto !important;
  }
}

/* View Toggle in filter top bar — same single-button style as Quick Order (qo-view-switch) */
.header-controls .view-toggle .qo-view-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  margin-left: 0.5rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs, 10px);
  color: var(--brand, var(--filter-accent, #5b43ea));
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  padding: 0;
  opacity: 0.85;
}

.header-controls .view-toggle .qo-view-switch:hover {
  color: var(--brand, var(--filter-accent, #5b43ea));
  background: rgba(255, 255, 255, 0.04);
  opacity: 1;
}

.header-controls .view-toggle .qo-view-switch:active {
  transform: scale(0.94);
}

.header-controls .view-toggle .qo-view-icon {
  width: 14px;
  height: 14px;
  transition: opacity 0.2s ease;
}

.header-controls .view-toggle .qo-view-switch .qo-view-icon {
  stroke: currentColor;
}

@media (max-width: 768px) {
  .header-controls .view-toggle .qo-view-switch {
    width: 24px;
    height: 24px;
    margin-left: 0.375rem;
  }

  .header-controls .view-toggle .qo-view-icon {
    width: 12px;
    height: 12px;
  }
}

[dir="rtl"] .header-controls .view-toggle .qo-view-switch {
  margin-left: 0;
  margin-right: 0.5rem;
}

@media (max-width: 768px) {
  [dir="rtl"] .header-controls .view-toggle .qo-view-switch {
    margin-left: 0;
    margin-right: 0.375rem;
  }
}

.filter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm, var(--filter-space-sm));
  padding: var(--space-md, var(--filter-space-md)) var(--space-lg, var(--filter-space-lg));
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition, var(--filter-transition)), background-color var(--transition, var(--filter-transition));
  position: relative;
  box-sizing: border-box;
  white-space: nowrap;
  height: 44px;
  min-height: 44px;
  line-height: 1;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.filter-btn:active {
  transform: scale(0.98);
}

.filter-btn:focus-visible {
  outline: 2px solid var(--brand, var(--quick-accent, var(--filter-accent)));
  outline-offset: 2px;
}

/* Active/expanded state (used by sort dropdown + filter panel) */
.filter-btn[aria-expanded="true"],
.filter-btn.active {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: none;
}

.filter-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.filter-btn:disabled:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--accent);
}

.filter-btn:hover svg {
  color: rgba(255, 255, 255, 0.88);
  stroke: rgba(255, 255, 255, 0.88);
}

.filter-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.72);
  stroke: rgba(255, 255, 255, 0.72);
}

/* Filter Icon - Universal style */
.filter-icon {
  width: 18px;
  height: 18px;
  color: var(--brand, var(--quick-accent, var(--filter-accent)));
  stroke: var(--brand, var(--quick-accent, var(--filter-accent)));
  transition: color var(--transition, var(--filter-transition));
  flex-shrink: 0;
}

/* Dropdown Arrow - Universal style */
.dropdown-arrow {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--brand, var(--quick-accent, var(--filter-accent)));
  stroke: var(--brand, var(--quick-accent, var(--filter-accent)));
  transition: transform var(--transition, var(--filter-transition));
}

/* Sort button - inherits filter-btn styles, unified appearance */
.filter-btn.sort-btn svg.filter-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--brand, var(--quick-accent, var(--filter-accent)));
  stroke: var(--brand, var(--quick-accent, var(--filter-accent)));
  transition: color var(--transition, var(--filter-transition));
}

.filter-btn.sort-btn svg.dropdown-arrow {
  display: none;
}

.filter-btn.sort-btn:hover svg.filter-icon {
  color: var(--brand, var(--quick-accent, var(--filter-accent)));
  stroke: var(--brand, var(--quick-accent, var(--filter-accent)));
}

.filter-btn.sort-btn #sortBtnText {
  flex: 0 1 auto;
  white-space: nowrap;
}

/* ============================================
   Modern Sorting Dropdown - Desktop
   ============================================ */

/* Base z-index low so sort button stays below filter/sorting modals (z-index 99999+) */
.sort-dropdown-wrapper {
  position: relative;
  display: inline-block;
  z-index: 1000;
  isolation: isolate;
}

@media (min-width: 769px) {
  .sort-dropdown-wrapper.active {
    z-index: 10004;
  }
}

/* Sort dropdown — matches theme: filter panel + hero buttons (--accent, --ink, --brand) */
.sort-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  max-width: 280px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--accent, rgba(91, 67, 234, 0.2));
  border-radius: var(--radius-sm, 16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  z-index: 10004;
  padding: 6px;
  overflow: hidden;
}

.sort-dropdown-wrapper.active .sort-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s 0s;
}

.sort-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm, 16px);
  color: var(--ink-2, var(--quick-text-secondary, rgba(255, 255, 255, 0.75)));
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  text-align: left;
  position: relative;
}

.sort-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink, #fff);
}

.sort-dropdown-item[aria-checked="true"],
.sort-dropdown-item.active {
  background: var(--active-bg, rgba(91, 67, 234, 0.12));
  color: var(--brand, #5b43ea);
  font-weight: 500;
}

.sort-dropdown-item[aria-checked="true"] .sort-option-icon,
.sort-dropdown-item.active .sort-option-icon {
  opacity: 1;
}

.sort-dropdown-item:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.05);
}

.sort-dropdown-item:focus-visible {
  outline: 2px solid var(--brand, #5b43ea);
  outline-offset: 2px;
}

.sort-option-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  flex-shrink: 0;
  color: var(--brand, #5b43ea);
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.sort-dropdown-item:hover .sort-option-icon {
  opacity: 0.9;
}

.sort-option-icon svg {
  width: 14px;
  height: 14px;
}

.sort-option-label {
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.4;
}

.sort-check-icon {
  width: 16px;
  height: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
  color: var(--brand, #5b43ea);
}

.sort-dropdown-item[aria-checked="true"] .sort-check-icon,
.sort-dropdown-item.active .sort-check-icon {
  opacity: 1;
}

/* Mobile: Use bottom sheet instead of dropdown */
@media (max-width: 768px) {
  .sort-dropdown-wrapper {
    position: relative;
    z-index: 1000;
  }

  .sort-dropdown-wrapper.active {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999998;
    isolation: isolate;
  }

  /* Prevent a 1-frame flash of the trigger button at the top when the wrapper becomes fixed */
  .sort-dropdown-wrapper.active > .filter-btn.sort-btn,
  .sort-dropdown-wrapper.active > .hero-sort-btn {
    display: none;
  }
  
  /* Overlay backdrop — matches filter panel backdrop */
  .sort-dropdown-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    opacity: 0;
    pointer-events: auto;
    touch-action: none;
    isolation: isolate;
  }
  
  .sort-dropdown-wrapper.active .sort-dropdown-overlay {
    display: block;
    animation: fadeIn 0.2s ease-out forwards;
  }
  
  @keyframes fadeIn {
    to {
      opacity: 1;
    }
  }
  
  .sort-dropdown-menu:not(.sort-dropdown-menu--in-popover) {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-lg, 16px) var(--radius-lg, 16px) 0 0;
    border: none;
    border-top: 1px solid var(--accent, rgba(91, 67, 234, 0.2));
    transform: translateY(100%);
    padding: 16px 16px 24px;
    padding-top: 20px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000000;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    isolation: isolate;
  }
  
  .sort-dropdown-wrapper.active .sort-dropdown-menu {
    transform: translateY(0);
  }
  
  .sort-dropdown-menu::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--ink-2, rgba(255, 255, 255, 0.5));
    border-radius: 2px;
    opacity: 0.7;
    z-index: 1;
  }
  
  .sort-dropdown-item {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
  }
  
  .sort-option-icon {
    width: 22px;
    height: 22px;
  }
  
  .sort-option-icon svg {
    width: 13px;
    height: 13px;
  }
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--quick-accent, var(--filter-accent));
  color: white;
  border-radius: var(--radius-xs, 10px);
  font-size: 0.75rem;
  font-weight: 600;
  margin-inline-start: -4px;
  margin-inline-end: 4px;
}

.sort-select {
  padding: 0 var(--space-lg, var(--filter-space-lg));
  padding-right: 36px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--brand, var(--quick-accent, var(--filter-accent)));
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition, var(--filter-transition)), background-color var(--transition, var(--filter-transition));
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b43ea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  box-sizing: border-box;
  white-space: nowrap;
  min-width: 140px;
  height: 44px;
  min-height: 44px;
  line-height: 44px;
  vertical-align: middle;
}

.sort-select:focus {
  outline: none;
  border-color: var(--active-border);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 2px rgba(91, 67, 234, 0.1);
}

.sort-select:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--active-border);
}

/* ============================================
   Custom Filter Bottom Sheet (chip tap)
   MUST stay in sync with filter-panel mobile styles (see @media max-width: 768px .filter-panel)
   - Same background, backdrop, border, padding, transition: none
   - Do NOT add open/close animations
   ============================================ */
.custom-filter-bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  visibility: hidden;
}

.custom-filter-bottom-sheet.show {
  pointer-events: auto;
  visibility: visible;
}

.custom-filter-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: none;
}

.custom-filter-bottom-sheet.show .custom-filter-sheet-backdrop {
  opacity: 1;
  visibility: visible;
}

.custom-filter-sheet-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100vw;
  max-width: 100vw;
  max-height: 85vh;
  height: auto;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-lg, var(--filter-radius-lg)) var(--radius-lg, var(--filter-radius-lg)) 0 0;
  border-left: none;
  border-top: 1px solid var(--quick-border, var(--filter-border));
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: none;
  padding-top: var(--space-2xl, var(--filter-space-2xl));
}

.custom-filter-bottom-sheet.show .custom-filter-sheet-panel {
  transform: translateY(0);
}

.custom-filter-sheet-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: var(--quick-text-secondary, var(--filter-text-secondary));
  border-radius: 2px;
  opacity: 0.6;
}

.custom-filter-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm, var(--filter-space-sm));
  padding: var(--space-lg, var(--filter-space-lg)) var(--space-xl, var(--filter-space-xl)) var(--space-md, var(--filter-space-md)) var(--space-xl, var(--filter-space-xl));
  border-bottom: 1px solid rgba(91, 67, 234, 0.2);
  flex-shrink: 0;
}

.custom-filter-sheet-header-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.custom-filter-sheet-option-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.custom-filter-sheet-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--quick-text, var(--filter-text));
}

.custom-filter-sheet-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(91, 67, 234, 0.2);
  color: var(--quick-text, var(--filter-text));
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius, var(--filter-radius-sm));
  padding: 0;
  transition: var(--transition, var(--filter-transition));
}

.custom-filter-sheet-close:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(91, 67, 234, 0.4);
}

.custom-filter-sheet-body {
  overflow-y: auto;
  padding: var(--space-lg, var(--filter-space-lg)) var(--space-xl, var(--filter-space-xl));
  padding-bottom: var(--space-3xl, var(--filter-space-3xl));
}

.custom-filter-sheet-body::-webkit-scrollbar {
  width: 8px;
}

.custom-filter-sheet-body::-webkit-scrollbar-track {
  background: rgba(91, 67, 234, 0.04);
}

.custom-filter-sheet-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.custom-filter-sheet-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, var(--filter-space-sm));
}

.custom-filter-sheet-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm, var(--filter-space-sm));
  padding: var(--space-sm, var(--filter-space-sm));
  cursor: pointer;
  border-radius: var(--radius, var(--filter-radius));
  transition: var(--transition, var(--filter-transition));
  position: relative;
}

.custom-filter-sheet-option:hover {
  background: rgba(255, 255, 255, 0.04);
}

.custom-filter-sheet-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.custom-filter-sheet-option .checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(91, 67, 234, 0.2);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
  transition: var(--transition, var(--filter-transition));
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-filter-sheet-option input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--quick-accent, var(--filter-accent));
  border-color: var(--quick-accent, var(--filter-accent));
}

.custom-filter-sheet-option .checkbox-custom::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s ease;
  box-sizing: border-box;
}

.custom-filter-sheet-option input[type="checkbox"]:checked + .checkbox-custom::after {
  transform: rotate(45deg) scale(1);
}

.custom-filter-sheet-option .checkbox-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--quick-text, var(--filter-text));
  flex: 1;
}

.custom-filter-sheet-footer {
  padding: var(--space-md, var(--filter-space-md)) var(--space-xl, var(--filter-space-xl));
  border-top: 1px solid rgba(91, 67, 234, 0.2);
  flex-shrink: 0;
}

.custom-filter-sheet-apply {
  width: 100%;
  padding: 0.625rem 1rem;
  background: var(--quick-accent, var(--filter-accent));
  border: none;
  border-radius: var(--radius, var(--filter-radius));
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition, var(--filter-transition));
}

.custom-filter-sheet-apply:hover {
  background: #4a36d1;
}

.custom-filter-sheet-apply:active {
  transform: scale(0.98);
}

/* Filter Quick Chips Row (above cards, scrollable on mobile) */
.filter-quick-chips-row {
  margin-bottom: var(--space-md, var(--filter-space-md));
  width: 100%;
  overflow: hidden;
}

.filter-quick-chips-scroll {
  display: flex;
  gap: var(--space-sm, var(--filter-space-sm));
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.filter-quick-chips-scroll::-webkit-scrollbar {
  height: 4px;
}

.filter-quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(91, 67, 234, 0.18);
  border-radius: var(--radius);
  color: var(--quick-text, var(--filter-text));
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-quick-chip:hover {
  background: rgba(91, 67, 234, 0.08);
  border-color: rgba(91, 67, 234, 0.35);
}

.filter-quick-chip:active {
  transform: scale(0.98);
}

.filter-quick-chip-chevron {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.filter-quick-chip:hover .filter-quick-chip-chevron {
  opacity: 0.9;
}

.filter-quick-chip.active {
  background: rgba(91, 67, 234, 0.12);
  border-color: rgba(91, 67, 234, 0.4);
  color: var(--quick-text, var(--filter-text));
}

.filter-quick-chip.active .filter-quick-chip-chevron {
  opacity: 1;
}

.filter-quick-chip-icon-wrap {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.filter-section-icon-custom {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
}

.filter-option-icon-wrap {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 768px) {
  .filter-quick-chips-row {
    margin-bottom: var(--space-sm);
  }
  .filter-quick-chip {
    padding: 6px 12px;
    font-size: 0.8125rem;
    gap: 5px;
  }
  .filter-quick-chip-chevron {
    width: 12px;
    height: 12px;
  }
}

/* Active Filters Bar */
/* Active Filters Bar - Ultra Minimal Design */
.active-filters-bar {
  display: flex;
  align-items: center;
  gap: var(--space-xs, var(--filter-space-xs));
  margin-bottom: var(--space-lg, var(--filter-space-lg));
  flex-wrap: wrap;
  min-height: 28px;
}

/* Active Filters Chips Container */
.active-filters-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
  align-items: center;
}

/* Active Filter Chip - Ultra Minimal Design */
.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(91, 67, 234, 0.08);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--quick-text, var(--filter-text));
  font-size: 0.8125rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.3;
  white-space: nowrap;
  height: 28px;
}

.active-filter-chip:hover {
  background: rgba(91, 67, 234, 0.14);
  transform: translateY(-1px);
}

.active-filter-chip:active {
  transform: translateY(0);
  background: rgba(91, 67, 234, 0.18);
}

.filter-chip-remove {
  width: 13px;
  height: 13px;
  opacity: 0.5;
  transition: opacity 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 1px;
}

.active-filter-chip:hover .filter-chip-remove {
  opacity: 0.85;
  transform: rotate(90deg);
}

/* Clear All Button - Ultra Minimal Design */
.clear-all-filters-btn {
  padding: 5px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  font-size: 0.8125rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  white-space: nowrap;
  opacity: 0.65;
  height: 28px;
  display: inline-flex;
  align-items: center;
}

.clear-all-filters-btn:hover {
  color: var(--quick-text, var(--filter-text));
  background: rgba(255, 255, 255, 0.04);
  opacity: 1;
  transform: translateY(-1px);
}

.clear-all-filters-btn:active {
  transform: translateY(0);
  opacity: 0.9;
}

/* ============================================
   Filter Layout Row - Desktop Sidebar + Main Content
   ============================================ */
.filter-layout-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.filter-sidebar {
  display: none; /* Hidden on mobile by default */
}

.filter-main-content {
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* Mobile/Tablet: filter-sidebar as slide-in overlay when open */
@media (max-width: 1023px) {
  .filter-layout-row.filter-sidebar-open .filter-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.284);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid rgba(91, 67, 234, 0.2);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
  }
  
  /* Panel inside sidebar: fill parent, no fixed positioning */
  .filter-sidebar .filter-panel {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    transform: none !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
}

/* Desktop: Sidebar + Main layout - sidebar visible when filter-sidebar-open */
@media (min-width: 1024px) {
  .filter-layout-row {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-2xl, 24px);
  }
  
  .filter-layout-row.filter-sidebar-open .filter-sidebar {
    display: flex;
  }
  
  .filter-sidebar {
    flex-shrink: 0;
    width: 280px;
    min-width: 280px;
    position: sticky;
    top: var(--header-height, 80px);
    height: calc(100vh - var(--header-height, 80px) - var(--space-xl, 20px));
    max-height: calc(100vh - var(--header-height, 80px) - var(--space-xl, 20px));
    overflow: visible;
    display: flex;
    flex-direction: column;
  }
  
  .filter-sidebar .filter-panel {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    flex: 1;
    min-height: 0; /* Allow flex child to shrink and scroll */
    transform: none;
    border-radius: var(--radius-lg, 16px);
    border: 1px solid rgba(91, 67, 234, 0.2);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  .filter-sidebar .filter-panel,
  .filter-sidebar .filter-panel.show {
    transform: none;
  }
  
  /* Sidebar footer: keep buttons visible and distinct (Reset=start, Apply=end) */
  .filter-sidebar .filter-panel-footer {
    flex-shrink: 0;
    padding: var(--space-md, 12px);
    justify-content: space-between;
    gap: var(--space-md, 12px);
  }
  
  .filter-sidebar .filter-reset-btn {
    flex: 0 0 auto;
    min-width: 64px;
    order: 1;
  }
  
  .filter-sidebar .filter-apply-btn {
    flex: 1 1 auto;
    min-width: 80px;
    order: 2;
  }
  
  .filter-main-content {
    flex: 1;
    min-width: 0;
  }
  
  /* Desktop: hide filter + view toggle; sort stays in main content (separate from filter) */
  .filter-layout-row .unified-page-header .hero-filter-btn {
    display: none !important;
  }
  
  .filter-layout-row .qo-category-nav .qo-view-switch {
    display: none !important;
  }
  
  .filter-layout-row .unified-page-header .hero-search-container {
    display: flex;
    align-items: center;
  }
  
  .filter-layout-row .unified-page-header .hero-search-wrapper {
    margin-bottom: 0;
  }
  
  .filter-layout-row .unified-page-header {
    margin-bottom: var(--space-md, 12px);
    padding-bottom: 0;
  }
  
  /* Sort in main content: push to end of row (separate from filter sidebar) */
  .filter-layout-row .unified-page-header .hero-sort-dropdown-wrapper {
    flex-shrink: 0;
    margin-inline-start: auto;
  }
}

/* RTL: Sidebar on right side */
[dir="rtl"] .filter-layout-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .filter-sidebar .filter-panel {
  border-left: none;
  border-right: 1px solid rgba(91, 67, 234, 0.2);
}

/* RTL mobile overlay: slide from left */
@media (max-width: 1023px) {
  [dir="rtl"] .filter-layout-row.filter-sidebar-open .filter-sidebar {
    right: auto;
    left: 0;
    border-left: 1px solid rgba(91, 67, 234, 0.2);
    border-right: none;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }
}

/* Filter Panel - Slide-in Design (Mobile / fallback when not in layout) */
.filter-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: none;
  z-index: 10000;
}

.filter-panel-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* Hide backdrop on desktop - sidebar doesn't use overlay */
@media (min-width: 1024px) {
  .filter-panel-backdrop {
    display: none !important;
  }
}

/* Faster backdrop animation on mobile - similar to service-modal */
  @media (max-width: 768px) {
    .filter-panel-backdrop {
      transition: none;
    }
  }

.filter-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.02);
  border: none;
  border-left: 1px solid rgba(91, 67, 234, 0.2);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: none;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.filter-panel.show {
  transform: translateX(0);
}

/* When panel is inside filter-sidebar (desktop), override fixed positioning */
.filter-sidebar .filter-panel {
  position: relative;
  top: auto;
  right: auto;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 400px;
  transform: none;
  box-shadow: none;
  z-index: 1;
}

/* Mobile Bottom Sheet Handle */
.filter-panel-handle {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: transparent;
  cursor: grab;
  z-index: 10;
  touch-action: none;
  user-select: none;
}

.filter-panel-handle:active {
  cursor: grabbing;
}

.filter-panel-handle-bar {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: var(--quick-text-secondary, var(--filter-text-secondary));
  border-radius: 2px;
  opacity: 0.6;
  transition: opacity 0.08s ease;
}

.filter-panel-handle:hover .filter-panel-handle-bar {
  opacity: 1;
}

.filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xl, var(--filter-space-xl));
  border-bottom: 1px solid rgba(91, 67, 234, 0.2);
  flex-shrink: 0;
  position: relative;
}



.filter-panel-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--quick-text, var(--filter-text));
  display: flex;
  align-items: center;
  gap: var(--space-sm, var(--filter-space-sm));
}

.filter-panel-header .header-icon {
  width: 20px;
  height: 20px;
  color: var(--quick-accent, var(--filter-accent));
  flex-shrink: 0;
}

.close-panel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(91, 67, 234, 0.2);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 300;
  cursor: pointer;
  border-radius: var(--radius, var(--filter-radius));
  transition: var(--transition, var(--filter-transition));
  line-height: 1;
}

@media (min-width: 1024px) {
  .close-panel-btn {
    display: none;
  }
}

.close-panel-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--active-border);
  color: #ffffff;
}

.filter-panel-content {
  flex: 1;
  min-height: 0; /* Allow scroll in flex container */
  overflow-y: auto;
  padding: var(--space-xl, var(--filter-space-xl));
  padding-bottom: var(--space-2xl, var(--filter-space-2xl));
}

/* Custom Scrollbar */
.filter-panel-content::-webkit-scrollbar {
  width: 8px;
}

.filter-panel-content::-webkit-scrollbar-track {
  background: rgba(91, 67, 234, 0.04);
}

.filter-panel-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.filter-panel-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Filter Section */
.filter-section {
  margin-bottom: var(--space-2xl, var(--filter-space-2xl));
  position: relative;
}

.filter-section-content {
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  max-height: 2000px;
  opacity: 1;
}

.filter-section.collapsed .filter-section-content {
  max-height: 0;
  margin-bottom: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm, var(--filter-space-sm));
  margin-bottom: var(--space-md, var(--filter-space-md));
  cursor: pointer;
  user-select: none;
  padding: var(--space-xs, var(--filter-space-xs)) 0;
  transition: opacity 0.2s ease;
  border-radius: var(--radius-sm, var(--filter-radius-sm));
  position: relative;
}

.filter-section-header:hover {
  opacity: 0.8;
}

.filter-section-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--quick-text, var(--filter-text));
}

.filter-section-icon {
  width: 18px;
  height: 18px;
  color: var(--quick-accent, var(--filter-accent));
  flex-shrink: 0;
  display: inline-block;
}

.filter-section-chevron {
  width: 16px;
  height: 16px;
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(0deg);
}

.filter-section-chevron svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Chevron rotation - default state (expanded) */
.filter-section:not(.collapsed) .filter-section-chevron {
  transform: rotate(0deg);
}

.filter-section.collapsed .filter-section-chevron {
  transform: rotate(-90deg);
}


.filter-section.active .filter-section-header {
  color: var(--quick-accent, var(--filter-accent));
}

.filter-section.active .filter-section-header::after {
  content: '';
  position: absolute;
  right: calc(var(--space-sm, var(--filter-space-sm)) + 20px);
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--quick-accent, var(--filter-accent));
  border-radius: 50%;
  flex-shrink: 0;
  z-index: 1;
}

.filter-section.active .filter-section-icon {
  color: var(--quick-accent, var(--filter-accent));
}

.filter-section-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
}

/* Hide SVG icons that are not inside filter sections or other containers */
body > svg:not(.filter-section-icon):not([class*="icon"]):not([id]) {
  display: none !important;
}

/* Ensure SVG icons inside filter sections are properly sized */
.filter-section svg.filter-section-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
}

.filter-section-divider {
  height: 1px;
  background: var(--accent);
  margin: var(--space-xl, var(--filter-space-xl)) 0;
  opacity: 0.5;
}

/* Price Range */
.price-range-container {
  margin-bottom: var(--space-md, var(--filter-space-md));
}

.price-inputs {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md, var(--filter-space-md));
  margin-top: var(--space-md, var(--filter-space-md));
}

.price-input-wrapper {
  flex: 1;
}

.price-input-wrapper label {
  display: block;
  font-size: 0.75rem;
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  margin-bottom: var(--space-xs, var(--filter-space-xs));
}

.price-input-prefix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.price-input-prefix {
  position: absolute;
  left: 10px;
  font-size: 0.875rem;
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  pointer-events: none;
  user-select: none;
}

.price-input-prefix--toman {
  left: auto;
  right: 10px;
  font-size: 0.75rem;
}

.price-input-prefix-wrap--toman .price-input {
  padding-left: var(--space-md, var(--filter-space-md));
  padding-right: 3.25rem;
}

.price-input {
  width: 100%;
  padding: var(--space-sm, var(--filter-space-sm)) var(--space-md, var(--filter-space-md));
  padding-left: 22px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(91, 67, 234, 0.2);
  border-radius: var(--radius-sm, var(--filter-radius-sm));
  color: var(--quick-text, var(--filter-text));
  font-size: 0.875rem;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.price-input:focus {
  outline: none;
  border-color: var(--active-border);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 2px rgba(91, 67, 234, 0.1);
}

.price-presets {
  display: flex;
  gap: var(--space-xs, var(--filter-space-xs));
  flex-wrap: wrap;
  margin-top: var(--space-sm, var(--filter-space-sm));
}

.price-preset-btn {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(91, 67, 234, 0.2);
  border-radius: var(--radius-sm, var(--filter-radius-sm));
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  font-size: 0.75rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.price-preset-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--active-border);
  color: var(--quick-text, var(--filter-text));
}

.price-preset-btn.active {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--active-border);
  color: var(--brand);
}

/* Checkbox Filter */
.filter-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, var(--filter-space-sm));
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm, var(--filter-space-sm));
  padding: var(--space-sm, var(--filter-space-sm));
  cursor: pointer;
  border-radius: var(--radius, var(--filter-radius));
  transition: var(--transition, var(--filter-transition));
  position: relative;
}

.filter-checkbox:hover {
  background: rgba(255, 255, 255, 0.04);
}

.filter-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(91, 67, 234, 0.2);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  flex-shrink: 0;
  transition: var(--transition, var(--filter-transition));
  display: flex;
  align-items: center;
  justify-content: center;
}

.filter-checkbox input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--quick-accent, var(--filter-accent));
  border-color: var(--quick-accent, var(--filter-accent));
}

.checkbox-custom::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s ease;
  box-sizing: border-box;
}

.filter-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
  transform: rotate(45deg) scale(1);
}

.checkbox-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--quick-text, var(--filter-text));
  flex: 1;
}

.checkbox-description {
  font-size: 0.75rem;
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  margin-left: auto;
}

/* Quality Stars */
.quality-stars {
  display: inline-flex;
  gap: 2px;
  margin-left: var(--space-xs, var(--filter-space-xs));
  align-items: center;
}

.quality-star {
  width: 14px;
  height: 14px;
  color: var(--quick-warning, var(--filter-warning));
  opacity: 0.3;
}

.filter-checkbox input[type="checkbox"]:checked ~ .quality-stars .quality-star {
  opacity: 1;
}

/* ============================================
   Filter Panel Icon Styling
   Match homepage "Why Follownic?" icon style (CSS mask + brand color)
   ============================================ */

/* Mask-based icon (uses --icon-url, --icon-size, --icon-color, --icon-opacity) */
.filter-icon-mask {
  width: var(--icon-size, 18px);
  height: var(--icon-size, 18px);
  display: inline-block;
  flex: 0 0 var(--icon-size, 18px);
  background-color: var(--icon-color, var(--brand));
  opacity: var(--icon-opacity, 0.95);
  -webkit-mask: var(--icon-url) no-repeat center / contain;
  mask: var(--icon-url) no-repeat center / contain;
  transition: opacity 0.15s ease;
}

/* Hidden probe image to detect 404 and hide the container (avoids empty purple badges) */
.filter-icon-mask .icon-mask-probe {
  display: none;
}

.filter-checkbox:hover .filter-icon-mask {
  opacity: 1;
}

/* ============================================
   Icon Container Styling (Region, Access Type, Quality)
   Minimal badge style matching service card features
   ============================================ */

/* Shared icon container base styles */
.filter-checkbox .region-icon,
.filter-checkbox .access-type-icon,
.filter-checkbox .quality-stars {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  gap: 2px;
  padding: 4px 8px;
  border-radius: var(--radius-xs, 10px);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(91, 67, 234, 0.2);
  /* Same brand color, very transparent (as requested) */
  transition: all 0.15s ease;
}

/* Hover state - matches .feature:hover */
.filter-checkbox:hover .region-icon,
.filter-checkbox:hover .access-type-icon,
.filter-checkbox:hover .quality-stars {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--active-border);
}

/* Checked state - brand accent highlight */
.filter-checkbox input[type="checkbox"]:checked ~ .region-icon,
.filter-checkbox input[type="checkbox"]:checked ~ .access-type-icon,
.filter-checkbox input[type="checkbox"]:checked ~ .quality-stars {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--active-border);
  box-shadow: 0 0 0 1px rgba(91, 67, 234, 0.2);
}

/* Icon sizes within containers */
.filter-checkbox .region-icon .filter-icon-mask,
.filter-checkbox .access-type-icon .filter-icon-mask,
.filter-checkbox .quality-stars .filter-icon-mask {
  --icon-size: 14px;
}

/* Toggle Switch */
.filter-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-md, var(--filter-space-md));
  cursor: pointer;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(91, 67, 234, 0.2);
  border-radius: var(--radius-sm);
  transition: var(--transition, var(--filter-transition));
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  left: 2px;
  top: 2px;
  transition: left 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filter-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.filter-toggle input[type="checkbox"]:checked + .toggle-switch {
  background: var(--quick-accent, var(--filter-accent));
}

.filter-toggle input[type="checkbox"]:checked + .toggle-switch::after {
  left: 26px;
}

.toggle-label {
  font-size: 0.875rem;
  color: var(--quick-text, var(--filter-text));
  flex: 1;
}

/* Filter Panel Footer */
.filter-panel-footer {
  padding: var(--space-md, var(--filter-space-md)) var(--space-xl, var(--filter-space-xl));
  border-top: 1px solid rgba(91, 67, 234, 0.2);
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: var(--space-md, var(--filter-space-md));
  flex-shrink: 0;
  margin-top: auto;
}

.filter-reset-btn {
  padding: 0.625rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(91, 67, 234, 0.2);
  border-radius: var(--radius, var(--filter-radius));
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition, var(--filter-transition));
  flex: 0 0 auto;
  min-width: 64px;
  white-space: nowrap;
}

.filter-reset-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--quick-warning, var(--filter-warning));
  color: #ffffff;
}

/* Apply button - clean redesign */
.filter-apply-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--quick-accent, var(--filter-accent));
  border: none;
  border-radius: var(--radius, var(--filter-radius));
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition, var(--filter-transition));
  flex: 1 1 auto;
  min-width: 0;
}

.apply-btn-label {
  white-space: nowrap;
}

.apply-btn-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 11px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.apply-btn-count.hidden {
  display: none;
}

.filter-apply-btn:hover {
  background: #4a36d1;
}

.filter-apply-btn:hover .apply-btn-count:not(.hidden) {
  background: rgba(255, 255, 255, 0.35);
}

.filter-apply-btn:active {
  transform: scale(0.98);
}

/* Navigation Panel Styles */
/* Navigation Panel Styles - Improved UI/UX */
.navigation-section {
  margin-bottom: var(--space-lg, var(--filter-space-lg));
  border-radius: var(--radius, var(--filter-radius));
  overflow: hidden;
}

/* Navigation Header (Accordion Toggle) */
.navigation-header-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md, var(--filter-space-md)) var(--space-lg, var(--filter-space-lg));
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(91, 67, 234, 0.2);
  border-radius: var(--radius, var(--filter-radius));
  cursor: pointer;
  transition: var(--transition, var(--filter-transition));
  font-family: inherit;
  text-align: left;
}

.navigation-header-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--active-border);
}

.navigation-header-toggle.expanded {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--active-border);
}

.navigation-header-content {
  display: flex;
  align-items: center;
  gap: var(--space-sm, var(--filter-space-sm));
  flex: 1;
}

.navigation-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--quick-accent, var(--filter-accent));
  opacity: 0.8;
}

.navigation-header-toggle h4 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--quick-text, var(--filter-text));
}

.navigation-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  transition: transform 0.3s ease;
}

.navigation-header-toggle.expanded .navigation-chevron {
  transform: rotate(180deg);
}

/* Navigation Content (Collapsible) */
.navigation-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 var(--space-lg, var(--filter-space-lg));
}

.navigation-content.expanded {
  max-height: 1000px;
  padding: var(--space-md, var(--filter-space-md)) var(--space-lg, var(--filter-space-lg));
}

/* Navigation Level */
.navigation-level {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs, var(--filter-space-xs));
}

/* Navigation Items */
.navigation-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm, var(--filter-space-sm));
  padding: var(--space-sm, var(--filter-space-sm)) var(--space-md, var(--filter-space-md));
  border-radius: var(--radius, var(--filter-radius));
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(91, 67, 234, 0.2);
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  text-decoration: none;
  transition: var(--transition, var(--filter-transition));
  position: relative;
  font-size: 0.875rem;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.navigation-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--active-border);
  color: var(--quick-text, var(--filter-text));
  transform: translateX(4px);
}

.navigation-item.active {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--active-border);
  color: var(--quick-accent, var(--filter-accent));
  font-weight: 500;
  box-shadow: 0 0 0 1px rgba(91, 67, 234, 0.2);
}

/* Indentation for Visual Hierarchy */
.navigation-item-indented {
  margin-left: var(--space-lg, var(--filter-space-lg));
  border-left: 2px solid var(--accent, rgba(91, 67, 234, 0.2));
  padding-left: var(--space-md, var(--filter-space-md));
}

.navigation-item-indented-2 {
  margin-left: calc(var(--space-lg, var(--filter-space-lg)) * 2);
  border-left: 2px solid var(--accent, rgba(91, 67, 234, 0.2));
  padding-left: var(--space-md, var(--filter-space-md));
}

.navigation-item-text {
  flex: 1;
}

/* Navigation Badge (Count) */
.navigation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(91, 67, 234, 0.2);
  color: var(--quick-accent, var(--filter-accent));
  border-radius: var(--radius-xs, 10px);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.navigation-item.active .navigation-badge {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--active-border);
}

/* Level-specific colors */
.navigation-level-1 .navigation-icon {
  color: #5b43ea;
}

.navigation-level-2 .navigation-icon {
  color: #7c5cf5;
}

.navigation-level-3 .navigation-icon {
  color: #9d75ff;
}

/* Mobile: Tab-based Progressive Navigation */
@media (max-width: 1024px) {
  .navigation-section {
    margin-bottom: var(--space-md, var(--filter-space-md));
  }
  
  .navigation-header-toggle {
    padding: var(--space-sm, var(--filter-space-sm)) var(--space-md, var(--filter-space-md));
    font-size: 0.875rem;
  }
  
  .navigation-content {
    padding: 0 var(--space-md, var(--filter-space-md));
  }
  
  .navigation-content.expanded {
    padding: var(--space-sm, var(--filter-space-sm)) var(--space-md, var(--filter-space-md));
  }
  
  .navigation-item {
    padding: var(--space-xs, var(--filter-space-xs)) var(--space-sm, var(--filter-space-sm));
    font-size: 0.8125rem;
  }
  
  .navigation-item-indented {
    margin-left: var(--space-md, var(--filter-space-md));
  }
  
  .navigation-item-indented-2 {
    margin-left: calc(var(--space-md, var(--filter-space-md)) * 2);
  }
  
  /* Only show one expanded section at a time on mobile */
  .navigation-content:not(.expanded) {
    max-height: 0;
    padding: 0;
  }
}

/* Navigation Categories specific styles */
#navigationCategories,
#navigationSubcategoriesList,
#navigationTypesList {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs, var(--filter-space-xs));
}

.navigation-categories,
.navigation-subcategories,
.navigation-types {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs, var(--filter-space-xs));
}

/* Sorting Modal Styles */
/* DEPRECATED: Sorting Modal Styles - No longer used, replaced by dropdown
   Kept for backward compatibility only */
.sorting-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: none;
  opacity: 0;
  transition: none;
  pointer-events: none;
}

.sorting-modal.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.sorting-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: none;
  z-index: 999998;
  pointer-events: auto;
}

.sorting-modal-content {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: auto;
  transform: translateY(100%);
  transition: none;
  background: rgba(10, 8, 24, 0.65);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg, var(--filter-radius-lg)) var(--radius-lg, var(--filter-radius-lg)) 0 0;
  margin: 0;
  width: 100%;
  max-width: none;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  padding-top: var(--space-2xl, var(--filter-space-2xl));
  z-index: 999999;
  pointer-events: auto;
}

.sorting-modal.show .sorting-modal-content {
  transform: translateY(0);
}

/* Mobile Bottom Sheet Handle */
.sorting-modal-handle {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: transparent;
  cursor: grab;
  z-index: 10;
  touch-action: none;
  user-select: none;
}

.sorting-modal-handle:active {
  cursor: grabbing;
}

.sorting-modal-handle-bar {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: var(--quick-text-secondary, var(--filter-text-secondary));
  border-radius: 2px;
  opacity: 0.6;
  transition: opacity 0.08s ease;
}

.sorting-modal-handle:hover .sorting-modal-handle-bar {
  opacity: 1;
}

/* Desktop: Center modal, not full width */
@media (min-width: 768px) {
  .sorting-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%) scale(1);
    width: auto;
    min-width: 400px;
    max-width: 500px;
    max-height: 80vh;
    border-radius: var(--radius-lg, var(--filter-radius-lg));
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    padding-top: 0;
    transition: none;
  }
  
  .sorting-modal.show .sorting-modal-content {
    transform: translate(-50%, -50%) scale(1);
  }
  
  .sorting-modal-handle {
    display: none;
  }
}

/* Mobile: Bottom sheet with handle */
@media (max-width: 768px) {
  .sorting-modal-handle {
    display: block;
  }
  
  .sorting-modal-header {
    padding: var(--space-lg, var(--filter-space-lg)) var(--space-xl, var(--filter-space-xl)) var(--space-md, var(--filter-space-md)) var(--space-xl, var(--filter-space-xl));
  }
  
  .sorting-modal-body {
    padding: var(--space-lg, var(--filter-space-lg)) var(--space-xl, var(--filter-space-xl));
  }
}

.sorting-modal-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: var(--space-lg, var(--filter-space-lg)) var(--space-xl, var(--filter-space-xl));
  border-bottom: 1px solid var(--quick-border, var(--filter-border));
}

.sorting-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--quick-text, var(--filter-text));
  margin: 0;
}

.sorting-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  transition: var(--transition, var(--filter-transition));
}

.sorting-modal-close:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.sorting-modal-close svg {
  width: 18px;
  height: 18px;
  color: var(--quick-accent, var(--filter-accent));
}

.sorting-modal-body {
  padding: var(--space-lg, var(--filter-space-lg)) var(--space-xl, var(--filter-space-xl));
  overflow-y: auto;
  flex: 1;
}

.sorting-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, var(--filter-space-sm));
}

.sorting-option {
  display: flex;
  align-items: center;
  gap: var(--space-md, var(--filter-space-md));
  padding: var(--space-md, var(--filter-space-md));
  cursor: pointer;
  transition: var(--transition, var(--filter-transition));
  border-radius: var(--radius-sm, var(--filter-radius-sm));
  border: 1px solid transparent;
}

.sorting-option:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--accent, rgba(91, 67, 234, 0.2));
}

.sorting-option:has(.sorting-radio:checked) {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--active-border, var(--brand, #5b43ea));
  border-radius: var(--radius, var(--filter-radius));
}

.sorting-option:has(.sorting-radio:checked) .sorting-option-text {
  font-weight: 500;
  color: var(--quick-accent, var(--filter-accent));
}

.sorting-option:has(.sorting-radio:checked) .sorting-option-icon {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--accent, rgba(91, 67, 234, 0.2));
}

.sorting-radio {
  width: 18px;
  height: 18px;
  cursor: pointer;
  border-radius: 50%;
  border: 2px solid var(--quick-border, var(--filter-border));
  background: transparent;
  transition: var(--transition, var(--filter-transition));
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex-shrink: 0;
}

.sorting-radio:checked {
  background: var(--quick-accent, var(--filter-accent));
  border-color: var(--quick-accent, var(--filter-accent));
}

.sorting-radio:checked::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
}

.sorting-radio:hover {
  border-color: var(--quick-accent, var(--filter-accent));
}

.sorting-option-content {
  display: flex;
  align-items: center;
  gap: var(--space-md, var(--filter-space-md));
  cursor: pointer;
  flex: 1;
}

.sorting-option-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--accent, rgba(91, 67, 234, 0.2));
  color: var(--quick-accent, var(--filter-accent));
  flex-shrink: 0;
}

.sorting-option-icon svg {
  width: 16px;
  height: 16px;
}

.sorting-option-text {
  font-size: 0.875rem;
  color: var(--quick-text, var(--filter-text));
  font-weight: 400;
}

.sorting-modal-footer {
  display: flex;
  gap: var(--space-md, var(--filter-space-md));
  padding: var(--space-lg, var(--filter-space-lg)) var(--space-xl, var(--filter-space-xl));
  border-top: 1px solid var(--quick-border, var(--filter-border));
}

.sorting-btn-secondary {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--quick-border, var(--filter-border));
  border-radius: var(--radius-sm, var(--filter-radius-sm));
  padding: var(--space-sm, var(--filter-space-sm)) var(--space-md, var(--filter-space-md));
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition, var(--filter-transition));
}

.sorting-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--quick-accent, var(--filter-accent));
  color: #ffffff;
}

.sorting-btn-primary {
  flex: 1;
  background: var(--quick-accent, var(--filter-accent));
  border: none;
  border-radius: var(--radius-sm, var(--filter-radius-sm));
  padding: var(--space-sm, var(--filter-space-sm)) var(--space-md, var(--filter-space-md));
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition, var(--filter-transition));
}

.sorting-btn-primary:hover {
  background: #4a36d1;
}

/* Tablet Responsive */
@media (max-width: 1024px) and (min-width: 769px) {
  .filter-top-bar-content,
  .header-controls {
    grid-template-columns: 1fr auto;
    gap: var(--space-md, var(--filter-space-md));
  }
  
  .search-wrapper {
    max-width: 100%;
  }
  
  .filter-actions {
    gap: var(--space-sm, var(--filter-space-sm));
  }
  
  .filter-btn {
    padding: var(--space-sm, var(--filter-space-sm)) var(--space-md, var(--filter-space-md));
    font-size: 0.8125rem;
  }
  
  /* Hide mobile search toggle on tablet and desktop */
  .mobile-search-toggle {
    display: none;
  }
  
  /* Show search wrapper on tablet and desktop */
  .header-controls > .search-wrapper {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  /* Mobile Bottom Sheet Styles - Similar to service-modal-form */
  .filter-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100vw;
    max-width: 100vw;
    max-height: 85vh;
    height: auto;
    border-radius: var(--radius-lg, var(--filter-radius-lg)) var(--radius-lg, var(--filter-radius-lg)) 0 0;
    border-left: none;
    border-top: 1px solid var(--quick-border, var(--filter-border));
    transform: translateY(100%);
    transition: none;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
  }
  
  .filter-panel.show {
    transform: translateY(0);
  }
  
  .filter-panel-handle {
    display: block;
  }
  
  .filter-panel-header {
    padding: var(--space-lg, var(--filter-space-lg)) var(--space-xl, var(--filter-space-xl)) var(--space-md, var(--filter-space-md)) var(--space-xl, var(--filter-space-xl));
  }
  
  .filter-panel-content {
    padding: var(--space-lg, var(--filter-space-lg)) var(--space-xl, var(--filter-space-xl));
    padding-bottom: var(--space-3xl, var(--filter-space-3xl));
  }
  
  .filter-top-bar-content,
  .header-controls {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-sm, var(--filter-space-sm));
    align-items: center;
    width: 100%;
  }
  
  .header-title-section {
    margin-bottom: var(--space-md, var(--filter-space-md));
  }
  
  .header-title {
    font-size: 1.25rem;
  }
  
  /* Mobile Search - Simple: always visible, full width, minimal style */
  .mobile-search-toggle {
    display: none !important;
  }
  
  .mobile-search-close {
    display: none !important;
  }
  
  /* Search Wrapper - Always visible, full width on mobile */
  .header-controls > .search-wrapper {
    display: block !important;
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    max-width: 100%;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
  }
  
  /* Adjust grid for mobile - 2 columns for row 2 */
  .header-controls {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: var(--space-sm, var(--filter-space-sm));
  }
  
  /* Search wrapper spans full width */
  .header-controls > .search-wrapper {
    grid-column: 1 / -1;
  }
  
  /* Row 2: Filter actions on left (column 1) */
  .header-controls > .filter-actions {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    gap: var(--space-sm, var(--filter-space-sm));
    justify-content: flex-start;
    flex-shrink: 0;
  }
  
  /* Row 2: View toggle on right (column 2) */
  .header-controls > .view-toggle {
    grid-column: 2;
    grid-row: 2;
    flex-shrink: 0;
  }
  
  
  .filter-btn,
  .sort-select {
    flex: 0 0 auto;
    min-width: 0;
    white-space: nowrap;
  }
  
  /* Filter button: show only icon on mobile (keep in top bar for accessibility) */
  .filter-btn:not(.sort-btn) {
    min-width: 44px;
    width: 44px;
    max-width: 44px;
    padding: 0;
    gap: 0;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    text-indent: -9999px;
    white-space: nowrap;
  }
  
  /* Show only SVG icon in filter button on mobile */
  .filter-btn:not(.sort-btn) svg {
    position: relative;
    text-indent: 0;
    flex-shrink: 0;
    margin: 0;
  }
  
  /* Hide text content on mobile */
  .filter-btn:not(.sort-btn) > *:not(svg):not(.filter-badge) {
    display: none;
  }
  
  /* Keep badge visible if needed (positioned absolutely) */
  .filter-btn:not(.sort-btn) .filter-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    text-indent: 0;
    font-size: 0.6875rem;
    line-height: 1;
  }
}

/* Floating Filter Button (FAB) - Mobile Only */
.filter-fab {
  display: none;
  }
  
@media (max-width: 768px) {
  /* Floating Filter Button (FAB) - Mobile Only */
  .filter-fab {
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand, var(--quick-accent, var(--filter-accent)));
    border: 1px solid var(--active-border);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(91, 67, 234, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    overflow: visible;
  }
  
  /* Hide filter FAB when service modal is open */
  body:has(.service-modal.show) .filter-fab {
    display: none !important;
  }
  
  .filter-fab:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(91, 67, 234, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    background: #4a36d1;
  }
  
  .filter-fab:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 2px 8px rgba(91, 67, 234, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
    }
  
  .filter-fab svg {
    width: 24px;
    height: 24px;
    color: #ffffff;
    stroke: #ffffff;
    flex-shrink: 0;
  }
  
  .filter-fab .filter-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ff4444;
    color: white;
    border-radius: var(--radius-xs, 10px);
    font-size: 0.6875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--bg, var(--quick-bg, rgba(10, 8, 24, 0.96)));
  }
  
  .filter-fab[aria-expanded="true"],
  .filter-fab.active {
    background: #4a36d1;
    border-color: var(--active-border);
    box-shadow: 0 4px 16px rgba(91, 67, 234, 0.6), 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  /* Sort button: hide text, icon-only on mobile (no extra space for label) */
  .filter-btn.sort-btn #sortBtnText {
    display: none;
  }
  
  .filter-btn.sort-btn {
    min-width: 44px;
    width: 44px;
    max-width: 44px;
    padding: 0;
    gap: 0;
    justify-content: center;
    align-items: center;
  }
  
  .active-filters-bar {
    margin-bottom: var(--space-lg, var(--filter-space-lg));
    gap: 6px;
    min-height: 26px;
  }
  
  .active-filters-chips {
    width: 100%;
    gap: 5px;
  }
  
  .active-filter-chip {
    font-size: 0.75rem;
    padding: 4px 9px;
    height: 26px;
    gap: 4px;
  }
  
  .filter-chip-remove {
    width: 12px;
    height: 12px;
  }
  
  .clear-all-filters-btn {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 4px 10px;
    height: 26px;
  }
  
  /* Price inputs should be 50-50 side by side on mobile */
  .price-inputs {
    display: flex !important;
    flex-direction: row !important;
    gap: var(--space-md, var(--filter-space-md)) !important;
    justify-content: space-between !important;
  }
  
  .price-input-wrapper {
    flex: 1 !important;
    min-width: 0 !important;
    max-width: calc(50% - var(--space-md, var(--filter-space-md)) / 2) !important;
  }
  
  /* Filter panel footer buttons should be 50-50 side by side on mobile */
  .filter-panel-footer {
    display: flex !important;
    flex-direction: row !important;
    gap: var(--space-md, var(--filter-space-md)) !important;
  }
  
  .filter-reset-btn {
    flex: 1 !important;
    min-width: 0 !important;
    max-width: calc(50% - var(--space-md, var(--filter-space-md)) / 2) !important;
  }
  
  .filter-apply-btn {
    flex: 1 !important;
    min-width: 0 !important;
    max-width: calc(50% - var(--space-md, var(--filter-space-md)) / 2) !important;
  }
}

/* ============================================
   Modern Navigation Panel - Harmonized with Filter Sections
   ============================================ */

.filter-panel .modern-navigation-section,
#modernNavigationSection {
  display: block !important;
  margin-bottom: var(--space-2xl, var(--filter-space-2xl));
  min-height: 44px;
}

.navigation-placeholder {
  margin: 0;
  padding: var(--space-md, 12px) var(--space-lg, 16px);
  color: var(--filter-text-secondary, rgba(255, 255, 255, 0.7));
  font-size: 0.875rem;
}

/* Breadcrumb Navigation */
.modern-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs, var(--filter-space-xs));
  margin-bottom: var(--space-md, var(--filter-space-md));
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}

.breadcrumb-item {
  background: none;
  border: none;
  padding: var(--space-xs, var(--filter-space-xs)) var(--space-sm, var(--filter-space-sm));
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  font-size: 0.8125rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.15s ease;
  border-radius: var(--radius-sm, var(--filter-radius-sm));
  font-family: inherit;
  opacity: 0.7;
}

.breadcrumb-item:hover {
  color: var(--quick-text, var(--filter-text));
  opacity: 1;
  background: rgba(91, 67, 234, 0.08);
}

.breadcrumb-item.active {
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  font-weight: 500;
  opacity: 0.85;
  background: none;
  cursor: default;
}

.breadcrumb-item.active:hover {
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  opacity: 0.85;
  background: none;
}

.breadcrumb-separator {
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  opacity: 0.4;
  font-size: 0.875rem;
  line-height: 1;
  margin: 0 var(--space-xs, var(--filter-space-xs));
}

/* Modern Dropdown */
.modern-dropdown-wrapper {
  position: relative;
  margin-bottom: var(--space-sm, var(--filter-space-sm));
  z-index: 10003;
  isolation: isolate;
}

/* Z-index for cascade dropdowns - each level higher than previous */
.modern-dropdown-wrapper[data-dropdown-level="category"] {
  z-index: 10003;
}

.modern-dropdown-wrapper[data-dropdown-level="subcategory"] {
  z-index: 10004;
}

.modern-dropdown-wrapper[data-dropdown-level="type"] {
  z-index: 10005;
}

/* When a dropdown is active, ensure its wrapper and menu are above others */
.modern-dropdown-wrapper.active {
  z-index: 10006;
}

.modern-dropdown-wrapper[data-dropdown-level="subcategory"].active {
  z-index: 10007;
}

.modern-dropdown-wrapper[data-dropdown-level="type"].active {
  z-index: 10008;
}

/* Fallback for browsers that support :has() */
.modern-dropdown-wrapper:has(.modern-dropdown-trigger.active) {
  z-index: 10006;
}

.modern-dropdown-wrapper[data-dropdown-level="subcategory"]:has(.modern-dropdown-trigger.active) {
  z-index: 10007;
}

.modern-dropdown-wrapper[data-dropdown-level="type"]:has(.modern-dropdown-trigger.active) {
  z-index: 10008;
}

.dropdown-label-above {
  display: none;
}

.modern-dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md, var(--filter-space-md));
  padding: var(--space-md, var(--filter-space-md)) var(--space-lg, var(--filter-space-lg));
  background: rgba(91, 67, 234, 0.04);
  border: 1px solid rgba(91, 67, 234, 0.1);
  border-radius: var(--radius-sm);
  color: var(--quick-text, var(--filter-text));
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  text-align: left;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.modern-dropdown-trigger::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--quick-accent, var(--filter-accent));
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-brand-icon {
  width: 18px;
  height: 18px;
  color: var(--quick-accent, var(--filter-accent));
  flex-shrink: 0;
  opacity: 0.7;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-dropdown-trigger:hover {
  background: rgba(91, 67, 234, 0.04);
  border-color: rgba(91, 67, 234, 0.12);
}

.modern-dropdown-trigger.active {
  background: rgba(91, 67, 234, 0.08);
  border-color: rgba(91, 67, 234, 0.25);
}

.modern-dropdown-trigger.active::before {
  transform: scaleY(1);
}

.modern-dropdown-trigger.active .dropdown-brand-icon {
  opacity: 1;
}

.dropdown-value {
  flex: 1;
  color: var(--quick-text, var(--filter-text));
  text-align: left;
  display: flex;
  align-items: center;
  gap: var(--space-sm, var(--filter-space-sm));
  min-width: 0;
}

.dropdown-chevron {
  width: 16px;
  height: 16px;
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  opacity: 0.5;
}

.modern-dropdown-trigger:hover .dropdown-chevron {
  opacity: 0.7;
}

.modern-dropdown-trigger.active .dropdown-chevron {
  transform: rotate(180deg);
  opacity: 1;
  color: var(--quick-accent, var(--filter-accent));
}

/* Dropdown Menu */
.modern-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg, var(--quick-bg, rgba(10, 8, 24, 0.96)));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(91, 67, 234, 0.15);
  border-radius: var(--radius, var(--filter-radius));
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: inherit;
  margin-top: var(--space-xs, var(--filter-space-xs));
}

.modern-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-search-wrapper {
  padding: var(--space-sm, var(--filter-space-sm));
  border-bottom: 1px solid rgba(91, 67, 234, 0.12);
}

.dropdown-search-input {
  width: 100%;
  padding: var(--space-xs, var(--filter-space-xs)) var(--space-sm, var(--filter-space-sm));
  background: rgba(91, 67, 234, 0.04);
  border: 1px solid rgba(91, 67, 234, 0.12);
  border-radius: var(--radius-sm);
  color: var(--quick-text, var(--filter-text));
  font-size: 0.75rem;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.dropdown-search-input:focus {
  outline: none;
  border-color: rgba(91, 67, 234, 0.25);
  background: rgba(91, 67, 234, 0.05);
  box-shadow: 0 0 0 2px rgba(91, 67, 234, 0.1);
}

.dropdown-items {
  padding: var(--space-sm, var(--filter-space-sm));
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-dropdown-item {
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  padding: 10px var(--space-md, 12px);
  background: none;
  border: none;
  border-radius: var(--radius-sm, var(--filter-radius-sm));
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  font-family: inherit;
  margin: 0;
  gap: 10px;
  line-height: 1.35;
  box-sizing: border-box;
}

/* Keep icon + label + badge on a single row in modern navigation dropdowns */
.modern-dropdown-menu .filter-dropdown-item {
  display: flex;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
}

/* Icon wrapper alignment - override existing styles */
.filter-dropdown-item .filter-dropdown-item-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  opacity: 0.7;
  transition: opacity var(--filter-transition, 0.2s ease);
  vertical-align: middle;
}

/* Label text alignment */
.filter-dropdown-item > span:not(.filter-dropdown-item-icon-wrapper):not(.dropdown-badge) {
  display: inline-flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  vertical-align: middle;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Badge alignment */
.filter-dropdown-item > .dropdown-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
  vertical-align: middle;
}

/* Desktop filter sidebar is narrow: nowrap + ellipsis above; ensure wrappers don't force wrap */
@media (min-width: 1024px) {
  .filter-sidebar .modern-dropdown-wrapper {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .filter-sidebar .modern-dropdown-menu {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .filter-sidebar .modern-dropdown-menu .filter-dropdown-item {
    gap: 8px;
    padding-left: 10px;
    padding-right: 10px;
  }
}

.filter-dropdown-item:hover {
  background: rgba(91, 67, 234, 0.04);
}

.filter-dropdown-item.active {
  background: rgba(91, 67, 234, 0.1);
  color: var(--quick-accent, var(--filter-accent));
  font-weight: 500;
}

.dropdown-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: rgba(91, 67, 234, 0.2);
  color: var(--quick-accent, var(--filter-accent));
  border-radius: var(--radius-xs, 10px);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  margin-left: var(--space-sm, var(--filter-space-sm));
}

.filter-dropdown-item.active .dropdown-badge {
  background: rgba(91, 67, 234, 0.3);
  color: var(--quick-accent, var(--filter-accent));
}

/* Dropdown Item Icons */
.filter-dropdown-item-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--space-sm, var(--filter-space-sm));
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: opacity var(--filter-transition, 0.2s ease);
  vertical-align: middle;
}

.filter-dropdown-item-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 3px;
  display: block;
  opacity: 0.7;
  filter: brightness(0) saturate(100%) invert(50%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-dropdown-item-icon-wrapper svg {
  width: 18px;
  height: 18px;
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  flex-shrink: 0;
  opacity: 0.7;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-dropdown-item-icon-wrapper i {
  font-size: 16px;
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  line-height: 1;
  display: inline-block;
  font-style: normal;
  opacity: 0.7;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Iconoir icon support */
.filter-dropdown-item-icon-wrapper i[class*="iconoir"] {
  font-size: 16px;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Icon via IconRenderer (category-icon-wrap structure) */
.filter-dropdown-item-icon-wrapper .category-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.filter-dropdown-item-icon-wrapper .category-icon-tinted {
  position: absolute;
  inset: 0;
  background: var(--category-color, var(--quick-text-secondary, rgba(255, 255, 255, 0.7)));
  -webkit-mask-image: var(--icon-url);
  mask-image: var(--icon-url);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  opacity: 0.7;
}

.filter-dropdown-item:hover .filter-dropdown-item-icon-wrapper .category-icon-tinted,
.filter-dropdown-item.active .filter-dropdown-item-icon-wrapper .category-icon-tinted {
  opacity: 1;
  background: var(--category-color, var(--quick-accent, var(--filter-accent)));
}

.filter-dropdown-item-icon-wrapper .category-icon-css-fallback {
  font-size: 16px;
  display: none;
}

.filter-dropdown-item-icon-wrapper .category-icon-css-fallback[style*="inline"] {
  display: inline-flex;
}

.filter-dropdown-item:hover .filter-dropdown-item-icon-wrapper,
.filter-dropdown-item:hover .filter-dropdown-item-icon-wrapper svg,
.filter-dropdown-item:hover .filter-dropdown-item-icon-wrapper i {
  opacity: 0.75;
}

.filter-dropdown-item:hover .filter-dropdown-item-icon-wrapper img.filter-dropdown-item-icon {
  opacity: 0.75;
}

/* Mask-based icons in dropdown - default state */
.filter-dropdown-item .filter-dropdown-item-icon-wrapper .filter-icon-mask.filter-dropdown-item-icon-mask {
  --icon-color: rgba(255, 255, 255, 0.7) !important;
  opacity: 0.7;
}

.filter-dropdown-item:hover .filter-dropdown-item-icon-wrapper .filter-icon-mask.filter-dropdown-item-icon-mask {
  opacity: 0.75;
}

.filter-dropdown-item.active .filter-dropdown-item-icon-wrapper {
  opacity: 1;
}

.filter-dropdown-item.active .filter-dropdown-item-icon-wrapper svg,
.filter-dropdown-item.active .filter-dropdown-item-icon-wrapper i {
  color: var(--quick-accent, var(--filter-accent));
  fill: var(--quick-accent, var(--filter-accent));
  stroke: var(--quick-accent, var(--filter-accent));
  opacity: 1;
}

.filter-dropdown-item.active .filter-dropdown-item-icon-wrapper svg * {
  fill: var(--quick-accent, var(--filter-accent));
  stroke: var(--quick-accent, var(--filter-accent));
}

/* Mask-based icons (same as filter panel) - change color directly via CSS variable */
.filter-dropdown-item.active .filter-dropdown-item-icon-wrapper .filter-icon-mask.filter-dropdown-item-icon-mask {
  --icon-color: var(--quick-accent, var(--filter-accent)) !important;
  opacity: 1;
}

/* Fallback for img tags (if any remain) */
.filter-dropdown-item.active .filter-dropdown-item-icon-wrapper img.filter-dropdown-item-icon {
  opacity: 1;
  /* Apply brand color using mask - mask-image will be set via JavaScript using the img src */
  background-color: var(--quick-accent, var(--filter-accent));
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  /* Remove default filter to allow mask to work */
  filter: none;
}

/* Dropdown Trigger Icons */
.dropdown-trigger-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.dropdown-trigger-icon-wrapper .category-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.dropdown-trigger-icon-wrapper .category-icon-tinted {
  position: absolute;
  inset: 0;
  background: var(--category-color, var(--quick-text-secondary, rgba(255, 255, 255, 0.7)));
  -webkit-mask-image: var(--icon-url);
  mask-image: var(--icon-url);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.dropdown-trigger-icon-wrapper .category-icon-css-fallback {
  font-size: 18px;
  display: none;
}

.dropdown-trigger-icon-wrapper .category-icon-css-fallback[style*="inline"] {
  display: inline-flex;
}

.dropdown-trigger-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 3px;
  display: block;
  opacity: 0.7;
  filter: brightness(0) saturate(100%) invert(50%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-trigger-icon-wrapper svg {
  width: 18px;
  height: 18px;
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  flex-shrink: 0;
  opacity: 0.7;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-trigger-icon-wrapper i {
  font-size: 16px;
  color: var(--quick-text-secondary, var(--filter-text-secondary));
  line-height: 1;
  display: inline-block;
  font-style: normal;
  opacity: 0.7;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Iconoir icon support for trigger */
.dropdown-trigger-icon-wrapper i[class*="iconoir"] {
  font-size: 16px;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modern-dropdown-trigger:hover .dropdown-trigger-icon-wrapper {
  opacity: 0.85;
}

.modern-dropdown-trigger:hover .dropdown-trigger-icon-wrapper svg,
.modern-dropdown-trigger:hover .dropdown-trigger-icon-wrapper i {
  opacity: 0.85;
}

.modern-dropdown-trigger:hover .dropdown-trigger-icon-wrapper img.dropdown-trigger-icon {
  opacity: 0.85;
}

/* Mask-based icons in trigger - default state */
.modern-dropdown-trigger .dropdown-trigger-icon-wrapper .filter-icon-mask {
  --icon-color: rgba(255, 255, 255, 0.7) !important;
  opacity: 0.7;
}

.modern-dropdown-trigger:hover .dropdown-trigger-icon-wrapper .filter-icon-mask {
  opacity: 0.85;
}

.modern-dropdown-trigger.active .dropdown-trigger-icon-wrapper {
  opacity: 1;
}

.modern-dropdown-trigger.active .dropdown-trigger-icon-wrapper svg,
.modern-dropdown-trigger.active .dropdown-trigger-icon-wrapper i {
  opacity: 1;
  color: var(--quick-accent, var(--filter-accent));
  fill: var(--quick-accent, var(--filter-accent));
  stroke: var(--quick-accent, var(--filter-accent));
}

.modern-dropdown-trigger.active .dropdown-trigger-icon-wrapper svg * {
  fill: var(--quick-accent, var(--filter-accent));
  stroke: var(--quick-accent, var(--filter-accent));
}

/* Mask-based icons in trigger - change color directly via CSS variable */
.modern-dropdown-trigger.active .dropdown-trigger-icon-wrapper .filter-icon-mask {
  --icon-color: var(--quick-accent, var(--filter-accent)) !important;
  opacity: 1;
}

.modern-dropdown-trigger.active .dropdown-trigger-icon-wrapper img.dropdown-trigger-icon {
  opacity: 1;
  /* Convert to brand color */
  filter: brightness(0) saturate(100%) invert(40%) sepia(90%) saturate(2000%) hue-rotate(235deg) brightness(100%) contrast(100%);
}

.dropdown-value {
  display: flex;
  align-items: center;
  flex: 1;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .modern-navigation-section {
    margin-bottom: var(--space-2xl, var(--filter-space-2xl));
  }
  
  .modern-breadcrumb {
    font-size: 0.75rem;
    margin-bottom: var(--space-sm, var(--filter-space-sm));
  }
  
  .breadcrumb-item {
    padding: 3px var(--space-xs, var(--filter-space-xs));
    font-size: 0.75rem;
  }
  
  /* Removed responsive styles for modern-dropdown-trigger, menu, and items to keep them readable on mobile/tablet */
  
  /* Filter Panel Footer - Mobile adjustments */
  .filter-panel-footer {
    padding: var(--space-lg, var(--filter-space-lg)) !important;
    gap: var(--space-md, var(--filter-space-md)) !important;
  }
  
  .apply-btn-count {
    min-width: 18px !important;
    height: 18px !important;
    font-size: 0.625rem !important;
    padding: 0 4px !important;
  }
}

/* ============================================
   Horizontal filter bar (cat / sub / type)
   ============================================ */
.filter-layout-row--horizontal,
.filter-layout-row:has(.has-horizontal-filters) {
  flex-direction: column;
}

@media (min-width: 1024px) {
  .filter-layout-row--horizontal,
  .filter-layout-row:has(.has-horizontal-filters) {
    flex-direction: column;
    gap: 0;
  }
}

.filter-layout-row--horizontal .filter-sidebar,
.filter-layout-row:has(.has-horizontal-filters) .filter-sidebar {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.filter-layout-row--horizontal .filter-main-content,
.filter-layout-row:has(.has-horizontal-filters) .filter-main-content {
  width: 100%;
  flex: 1 1 100%;
  min-width: 0;
}

.has-horizontal-filters .hero-filter-btn {
  display: none !important;
}

.has-horizontal-filters .hero-sort-dropdown-wrapper {
  display: none !important;
}

.filter-panel--horizontal {
  position: relative;
  width: 100%;
  margin: 0 0 12px;
  background: transparent;
  border: none;
  box-shadow: none;
  transform: none;
  height: auto;
  max-height: none;
  overflow: visible;
  z-index: 20;
  isolation: isolate;
}

.filter-main-content > .filter-panel--horizontal {
  margin-top: 0;
  margin-bottom: 1rem;
}

.section-cards.has-horizontal-filters > .filter-panel--horizontal {
  margin-top: 0;
  margin-bottom: 1rem;
}

.has-horizontal-filters .unified-page-header {
  margin-bottom: 1rem;
  padding-bottom: 0;
}

.has-horizontal-filters .content-layout {
  margin-top: 0.125rem;
}

.filter-panel--horizontal.show {
  transform: none;
}

/* Filter pills — minimal polish, softer than legacy hero-filter chips */
.horizontal-filter-bar {
  width: 100%;
  margin-bottom: 0;
  padding-top: 0;
  border-top: none;
}

.horizontal-filter-pills-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.2rem 0 0.25rem;
  padding-inline: 2px 1rem;
  scroll-padding-inline: 1rem;
}

.horizontal-filter-pills-scroll::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.42rem 0.82rem;
  min-height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(91, 67, 234, 0.22);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
  cursor: pointer;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.filter-pill:hover {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(91, 67, 234, 0.38);
}

.filter-pill:active {
  transform: scale(0.98);
}

.filter-pill.open,
.filter-pill.active {
  color: #fff;
  font-weight: 500;
  background: rgba(91, 67, 234, 0.1);
  border-color: rgba(91, 67, 234, 0.42);
}

.filter-pill.open {
  background: rgba(91, 67, 234, 0.12);
  border-color: rgba(91, 67, 234, 0.48);
  box-shadow: 0 0 0 1px rgba(91, 67, 234, 0.06);
}

.filter-pill.open .filter-pill-chevron {
  transform: rotate(180deg);
}

.filter-pill-chevron {
  width: 13px;
  height: 13px;
  opacity: 0.55;
  color: rgba(167, 139, 250, 0.85);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.filter-pill:hover .filter-pill-chevron {
  opacity: 0.72;
}

.filter-pill.open .filter-pill-chevron,
.filter-pill.active .filter-pill-chevron {
  opacity: 0.85;
}

@media (max-width: 1023px) {
  .filter-main-content > .qo-category-nav {
    margin-bottom: 0;
  }

  .filter-main-content > .filter-panel--horizontal,
  .section-cards.has-horizontal-filters > .filter-panel--horizontal {
    margin-top: 0;
    margin-bottom: 1rem;
  }

  .has-horizontal-filters.section-cards {
    padding-top: 0;
  }

  .has-horizontal-filters.section-cards::before {
    display: none;
  }

  .has-horizontal-filters .unified-page-header {
    margin-bottom: 0.625rem;
  }

  .has-horizontal-filters .content-layout {
    margin-top: 0.25rem;
  }

  .has-horizontal-filters .active-filters-bar {
    margin-bottom: var(--space-sm, 8px);
    min-height: 0;
  }
}

@media (min-width: 1024px) {
  .filter-main-content > .filter-panel--horizontal,
  .section-cards.has-horizontal-filters > .filter-panel--horizontal {
    margin-top: 0.25rem;
    margin-bottom: 1.25rem;
  }

  .has-horizontal-filters.section-cards {
    padding-top: 0.5rem;
  }
}

.filter-popover-backdrop {
  display: none;
}

@media (min-width: 1024px) {
  .filter-popover-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    z-index: 10000;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
  }

  .filter-popover-backdrop.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

.filter-popovers-host {
  position: static;
  overflow: visible;
}

.filter-panel-content--horizontal {
  padding: 0;
  border: none;
  background: transparent;
}

/* ============================================
   Mobile filter bottom sheet (single overlay above header)
   ============================================ */
.filter-mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 11000;
  pointer-events: none;
  visibility: hidden;
}

.filter-mobile-sheet.show {
  pointer-events: auto;
  visibility: visible;
}

.filter-mobile-sheet-scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.filter-mobile-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 640px);
  width: 100%;
  background: rgba(14, 14, 22, 0.98);
  border-top: 1px solid rgba(91, 67, 234, 0.3);
  border-radius: var(--radius-lg, 16px) var(--radius-lg, 16px) 0 0;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.55);
  transform: translateY(100%);
  transition: transform 0.24s ease;
  padding-top: var(--space-2xl, 20px);
}

.filter-mobile-sheet.show .filter-mobile-sheet-panel {
  transform: translateY(0);
}

.filter-mobile-sheet-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 5px;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  z-index: 2;
}

.filter-mobile-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md, 12px);
  padding: 0 var(--space-lg, 16px) var(--space-md, 12px);
  flex-shrink: 0;
}

.filter-mobile-sheet-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

.filter-mobile-sheet-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.625rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.filter-mobile-sheet-mount {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.filter-mobile-sheet-mount .filter-popover-panel {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  transform: none !important;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding-top: 0;
  background: transparent;
}

.filter-mobile-sheet-mount .filter-popover-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

html.filter-mobile-sheet-open,
body.filter-mobile-sheet-open {
  overflow: hidden;
}

@media (max-width: 1023px) {
  /* Empty host shells only — panel content lives in #filterMobileSheet when open */
  .filter-popovers-host .filter-popover {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }
}

.filter-popover-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-md, 12px) var(--space-lg, 16px);
  -webkit-overflow-scrolling: touch;
}

.filter-popover-footer {
  flex-shrink: 0;
  padding: var(--space-md, 12px) var(--space-lg, 16px);
  border-top: 1px solid rgba(91, 67, 234, 0.2);
}

.filter-popover-apply-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-md, 10px);
  background: linear-gradient(135deg, rgba(91, 67, 234, 0.95), rgba(120, 80, 255, 0.9));
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-popover-apply-btn:hover {
  filter: brightness(1.08);
}

/* Horizontal pills: flat sections in popover + mobile sheet (title only in sheet header / pill) */
.filter-popover .filter-section-header,
.filter-mobile-sheet-mount .filter-section-header {
  display: none !important;
}

.filter-popover .filter-section-content,
.filter-mobile-sheet-mount .filter-section-content {
  display: block !important;
  max-height: none !important;
  overflow: visible !important;
  opacity: 1 !important;
  padding: 0;
}

.filter-popover .filter-section.collapsed .filter-section-content,
.filter-mobile-sheet-mount .filter-section.collapsed .filter-section-content {
  max-height: none !important;
  opacity: 1 !important;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.filter-popover .filter-section-divider,
.filter-mobile-sheet-mount .filter-section-divider {
  display: none;
}

.filter-popover .filter-section,
.filter-mobile-sheet-mount .filter-section {
  border: none;
  margin: 0;
  padding: 0;
}

.filter-mobile-sheet-mount .filter-popover-intro,
.filter-mobile-sheet-mount .filter-sort-intro {
  display: none;
}

@media (min-width: 1024px) {
  .filter-popover-backdrop.show {
    background: transparent;
    pointer-events: none;
  }

  .filter-popover {
    position: static;
    inset: auto;
    display: block;
    height: 0;
    overflow: visible;
    visibility: visible;
    pointer-events: none;
    z-index: auto;
  }

  .filter-popover.show {
    pointer-events: none;
  }

  .filter-popover.show .filter-popover-panel {
    pointer-events: auto;
  }

  .filter-popover-scrim,
  .filter-popover-handle,
  .filter-popover-sheet-header {
    display: none !important;
  }

  .filter-popover-panel {
    position: absolute;
    left: auto;
    right: auto;
    bottom: auto;
    padding-top: 0;
    transform: none;
    transition: none;
    border-radius: var(--radius-lg, 16px);
    border: 1px solid rgba(91, 67, 234, 0.25);
    max-height: min(420px, 70vh);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    background: rgba(18, 18, 28, 0.98);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .filter-popover[data-popover-section="delivery"] .filter-popover-panel {
    max-height: min(560px, 78vh);
  }

  /* Browse: room for stacked category / subcategory / type dropdowns */
  .filter-popover[data-popover-section="browse"].show {
    z-index: 10050;
    overflow: visible;
  }

  .filter-popover[data-popover-section="browse"] .filter-popover-panel {
    max-height: min(720px, 88vh);
    overflow: visible;
    z-index: 10051;
  }

  .filter-popover[data-popover-section="browse"] .filter-popover-body {
    overflow-x: visible;
    overflow-y: auto;
  }

  .filter-popover[data-popover-section="browse"] .modern-navigation-section {
    overflow: visible;
  }

  .filter-panel--horizontal:has(#filterPopover-browse.show) {
    z-index: 10040;
    isolation: auto;
  }

  .filter-popover:not(.show) .filter-popover-panel {
    display: none;
  }
}

/* Browse filter — flat navigation lists (horizontal bar + mobile sheet) */
.modern-dropdown-wrapper--flat {
  position: static;
  z-index: auto;
  isolation: auto;
  margin-bottom: var(--space-md, 12px);
}

.modern-dropdown-wrapper--flat:last-child {
  margin-bottom: 0;
}

.filter-nav-flat-label {
  margin: 0 0 var(--space-sm, 8px);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.55);
}

.filter-nav-flat-section:first-child .filter-nav-flat-label {
  margin-top: 0;
}

.filter-nav-flat-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.filter-nav-flat-items .filter-dropdown-item {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 8px);
  background: rgba(91, 67, 234, 0.04);
  border: 1px solid transparent;
}

.filter-nav-flat-items .filter-dropdown-item:hover {
  background: rgba(91, 67, 234, 0.08);
  border-color: rgba(91, 67, 234, 0.15);
}

.filter-nav-flat-items .filter-dropdown-item.active {
  background: rgba(91, 67, 234, 0.14);
  border-color: rgba(91, 67, 234, 0.35);
  color: var(--quick-text, var(--filter-text));
}

/* Browse filter — mobile sheet: long category lists scroll inside the sheet body */
#filterMobileSheet[data-active-section="browse"] .filter-mobile-sheet-panel {
  max-height: min(94vh, 780px);
}

#filterMobileSheet[data-active-section="browse"] .filter-mobile-sheet-mount,
.filter-mobile-sheet-mount .filter-popover-panel[data-popover-section="browse"] {
  overflow: hidden;
}

.filter-mobile-sheet-mount .filter-popover-panel[data-popover-section="browse"] .filter-popover-body {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.filter-mobile-sheet-mount .filter-popover-panel[data-popover-section="browse"] .modern-navigation-section {
  min-height: 0;
}

/* Nested category dropdowns: in-flow on mobile so the sheet/panel scroll chain works */
@media (max-width: 1023px) {
  .filter-mobile-sheet-mount .modern-dropdown-menu.show,
  .filter-panel .modern-dropdown-menu.show {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    transform: none;
    max-height: min(45vh, 280px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .filter-mobile-sheet-mount .modern-dropdown-menu.show .dropdown-items,
  .filter-panel .modern-dropdown-menu.show .dropdown-items {
    max-height: none;
    overflow: visible;
  }
}

html[dir="rtl"] .filter-pill-chevron {
  transform: scaleX(-1);
}

html[dir="rtl"] .filter-pill.open .filter-pill-chevron {
  transform: scaleX(-1) rotate(180deg);
}

/* Popover intro + unified choice cards (delivery, quality, warranty, offers, sort) */
.filter-popover-intro,
.filter-delivery-intro,
.filter-sort-intro {
  margin: 0 0 var(--space-md, 12px);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62);
}

.filter-choice-list,
.filter-delivery-tiers {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, 8px);
}

.filter-choice-item,
.filter-delivery-tier {
  display: block;
  cursor: pointer;
  margin: 0;
}

.filter-choice-item input[type="checkbox"],
.filter-choice-item input[type="radio"],
.filter-delivery-tier input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.filter-choice-card,
.filter-delivery-tier-card {
  display: flex;
  align-items: center;
  gap: var(--space-md, 12px);
  padding: 12px 14px;
  border-radius: var(--radius-md, 12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.filter-choice-item:hover .filter-choice-card,
.filter-delivery-tier:hover .filter-delivery-tier-card {
  border-color: rgba(91, 67, 234, 0.45);
  background: rgba(91, 67, 234, 0.08);
}

.filter-choice-item input:checked + .filter-choice-card,
.filter-delivery-tier input:checked + .filter-delivery-tier-card {
  border-color: rgba(91, 67, 234, 0.75);
  background: rgba(91, 67, 234, 0.18);
  box-shadow: 0 0 0 1px rgba(91, 67, 234, 0.35);
}

.filter-choice-icon,
.filter-delivery-tier-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(167, 139, 250, 0.95);
}

.filter-choice-icon svg,
.filter-delivery-tier-icon svg {
  width: 22px;
  height: 22px;
}

.filter-choice-copy,
.filter-delivery-tier-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-choice-title,
.filter-delivery-tier-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
  line-height: 1.25;
}

.filter-choice-desc,
.filter-delivery-tier-desc {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.3;
}

.filter-choice-badge,
.filter-delivery-tier-range {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin-top: 2px;
}

.filter-choice-mark,
.filter-delivery-tier-mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.filter-choice-mark svg,
.filter-delivery-tier-mark svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.filter-choice-item input:checked + .filter-choice-card .filter-choice-mark,
.filter-delivery-tier input:checked + .filter-delivery-tier-card .filter-delivery-tier-mark {
  opacity: 1;
  border-color: rgba(91, 67, 234, 0.9);
  background: rgba(91, 67, 234, 0.95);
}

.filter-choice-item input:checked + .filter-choice-card .filter-choice-mark svg,
.filter-delivery-tier input:checked + .filter-delivery-tier-card .filter-delivery-tier-mark svg {
  opacity: 1;
  transform: scale(1);
  color: #fff;
}

/* Delivery tier icon accents */
.filter-choice-item--instant .filter-choice-icon,
.filter-delivery-tier--instant .filter-delivery-tier-icon {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}

.filter-choice-item--very-fast .filter-choice-icon,
.filter-delivery-tier--very-fast .filter-delivery-tier-icon {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
}

.filter-choice-item--fast .filter-choice-icon,
.filter-delivery-tier--fast .filter-delivery-tier-icon {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
}

.filter-choice-item--standard .filter-choice-icon,
.filter-delivery-tier--standard .filter-delivery-tier-icon {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
}

.filter-choice-item--quality .filter-choice-icon {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

.filter-choice-item--warranty .filter-choice-icon {
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
}

.filter-choice-item--offers .filter-choice-icon {
  color: #f472b6;
  background: rgba(244, 114, 182, 0.12);
}

.filter-choice-item--region .filter-choice-icon {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.filter-choice-item--access .filter-choice-icon {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
}

/* Price popover — card panel + preset rows */
.filter-price-panel {
  padding: 12px 14px;
  border-radius: var(--radius-md, 12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.filter-popover .price-range-container {
  margin-bottom: 0;
}

.filter-popover .price-inputs {
  margin-top: 0;
  margin-bottom: var(--space-sm, 8px);
}

.filter-popover .price-presets {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: var(--space-sm, 8px);
  margin-top: var(--space-sm, 8px);
}

.filter-popover .price-preset-btn {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md, 12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(255, 255, 255, 0.85);
}

.filter-popover .price-preset-btn:hover,
.filter-popover .price-preset-btn.active {
  border-color: rgba(91, 67, 234, 0.75);
  background: rgba(91, 67, 234, 0.18);
  color: #fff;
}

.filter-popover .price-input {
  border-radius: var(--radius-md, 10px);
  padding-top: 10px;
  padding-bottom: 10px;
}

.filter-popover .sort-dropdown-menu--in-popover,
.filter-mobile-sheet-mount .sort-dropdown-menu--in-popover {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  opacity: 1;
  visibility: visible;
  transform: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, 8px);
  min-width: 0;
  max-width: none;
  width: 100%;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  overflow: visible;
  z-index: auto;
}

.filter-popover .sort-dropdown-menu--in-popover::before,
.filter-mobile-sheet-mount .sort-dropdown-menu--in-popover::before {
  display: none;
}

.filter-popover .sort-dropdown-menu--in-popover .sort-dropdown-item,
.filter-mobile-sheet-mount .sort-dropdown-menu--in-popover .sort-dropdown-item {
  align-items: center;
  gap: var(--space-md, 12px);
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md, 12px);
  background: rgba(255, 255, 255, 0.03);
  width: 100%;
  text-align: start;
}

.filter-popover .sort-dropdown-menu--in-popover .sort-dropdown-item:hover,
.filter-mobile-sheet-mount .sort-dropdown-menu--in-popover .sort-dropdown-item:hover {
  border-color: rgba(91, 67, 234, 0.45);
  background: rgba(91, 67, 234, 0.08);
}

.filter-popover .sort-dropdown-menu--in-popover .sort-dropdown-item.active,
.filter-popover .sort-dropdown-menu--in-popover .sort-dropdown-item[aria-checked="true"],
.filter-mobile-sheet-mount .sort-dropdown-menu--in-popover .sort-dropdown-item.active,
.filter-mobile-sheet-mount .sort-dropdown-menu--in-popover .sort-dropdown-item[aria-checked="true"] {
  border-color: rgba(91, 67, 234, 0.75);
  background: rgba(91, 67, 234, 0.18);
}

.sort-option-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1;
  min-width: 0;
  text-align: start;
}

.sort-option-desc {
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.55);
}

.filter-popover .sort-dropdown-item.active .sort-option-desc,
.filter-popover .sort-dropdown-item[aria-checked="true"] .sort-option-desc,
.filter-mobile-sheet-mount .sort-dropdown-item.active .sort-option-desc,
.filter-mobile-sheet-mount .sort-dropdown-item[aria-checked="true"] .sort-option-desc {
  color: rgba(255, 255, 255, 0.58);
}

.filter-pill--sort.active {
  color: rgba(255, 255, 255, 0.9);
}



