/**
 * Healthcare24 Filter Sidebar - Design 3
 * Complete rewrite matching superdesign reference exactly
 * Reference: e_commerce_category__3.html
 */

/* ============================================
   1. CSS Variables - Color Palette
   ============================================ */
:root {
    --hc24-teal-500: #5BB5C5;
    --hc24-teal-600: #4AA4B4;
    --hc24-teal-700: #3991A1;
    --hc24-orange-500: #F5A623;
    --hc24-orange-600: #E09515;
    --hc24-dark-800: #1F2937;
    --hc24-dark-900: #111827;
    --hc24-gray-50: #F9FAFB;
    --hc24-gray-100: #F3F4F6;
    --hc24-gray-200: #E5E7EB;
    --hc24-gray-300: #D1D5DB;
    --hc24-gray-400: #9CA3AF;
    --hc24-gray-500: #6B7280;
    --hc24-gray-600: #4B5563;
}

/* ============================================
   2. Base Container Styles
   ============================================ */

/* Sidebar wrapper - contained within Bootstrap column */
.filter-sidebar-col,
#filterSidebar,
aside.col-lg-3.filter-sidebar-col {
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important; /* Contain content within sidebar bounds */
    position: sticky;
    top: 1rem;
    padding-left: 0 !important;
    padding-right: 12px !important; /* Gap between sidebar and main content */
}

.catalog-filter,
.catalog-filter.design3-filter {
    width: 100%; /* Use full column width instead of fixed width */
    max-width: none; /* Remove max-width - use Bootstrap column width */
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); /* Softer shadow to reduce visual collision */
    overflow: visible !important; /* Allow content to be visible */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    height: auto !important;
    max-height: none !important;
}

/* ============================================
   3. HEADER - Hide duplicates, single teal header
   ============================================ */
/* CRITICAL: Hide the wrapper header that appears BEFORE the catalog-filter */
/* The server has a wrapper with .filter-sidebar-header (no .design3) that duplicates the header */
.filter-sidebar-col > .filter-sidebar-header:not(.design3),
.filter-sidebar-col > .filter-sidebar-header:first-child:not(.design3),
#filterSidebar > .filter-sidebar-header:not(.design3),
aside.col-lg-3 > .filter-sidebar-header:not(.design3) {
    display: none !important;
}

/* Hide any vendor-generated filter headers or titles */
.catalog-filter > h1,
.catalog-filter > h2,
.catalog-filter > h3,
.catalog-filter > .filter-header:not(.design3),
.catalog-filter > header:not(.filter-sidebar-header):not(.hc24f-header),
.catalog-filter-search > h3,
.catalog-filter .catalog-filter-search .filter-title,
.catalog-filter-tree > h3,
.catalog-filter-tree > header,
.catalog-filter-price > h3,
.catalog-filter-supplier > h3 {
    display: none !important;
}

/* Main Header with Gradient */
.filter-sidebar-header.design3 {
    background: linear-gradient(to right, #4AA4B4, #5BB5C5) !important;
    padding: 1rem 1.25rem !important;
    margin: 0 !important;
}

.filter-sidebar-header.design3 .filter-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-sidebar-header.design3 .filter-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-sidebar-header.design3 .filter-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #fff;
    stroke: #fff;
}

.filter-sidebar-header.design3 .filter-title {
    color: #fff !important;
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em;
    margin: 0 !important;
    text-transform: none !important;
    border: none !important;
    border-bottom: none !important;
    text-decoration: none !important;
}

/* Filter Count Badge - Orange */
.filter-count-badge {
    background: #F5A623 !important;
    color: #fff !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    padding: 0.25rem 0.625rem !important;
    border-radius: 9999px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

/* ============================================
   4. Glassmorphism Active Tags
   ============================================ */
.filter-active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff !important;
    font-size: 0.75rem !important;
    padding: 0.25rem 0.625rem !important;
    border-radius: 9999px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    animation: tagSlideIn 0.2s ease;
}

.filter-tag .filter-tag-remove,
.filter-tag button {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.filter-tag .filter-tag-remove:hover,
.filter-tag button:hover {
    color: #F5A623 !important;
}

.filter-tag .filter-tag-remove svg,
.filter-tag button svg {
    width: 0.75rem;
    height: 0.75rem;
    fill: currentColor;
}

@keyframes tagSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   5. Filter Body Container
   ============================================ */
.filter-body {
    padding: 1.25rem;
}

.filter-body > form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ============================================
   6. Filter Sections (General)
   ============================================ */
.filter-section {
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Section Header Button */
.filter-section-header {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.5rem 0 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    text-align: left !important;
}

.filter-section-header span {
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    color: var(--hc24-dark-800) !important;
    transition: color 0.2s ease;
}

.filter-section-header:hover span {
    color: var(--hc24-teal-600) !important;
}

/* Chevron Arrow */
.filter-section-arrow {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--hc24-gray-400);
    stroke: var(--hc24-gray-400);
    transition: transform 0.3s ease;
    transform: rotate(180deg);
}

.filter-section.collapsed .filter-section-arrow {
    transform: rotate(0deg);
}

/* Section Content - override healthcare24.css 24px horizontal padding */
.filter-section-content {
    padding: 0.5rem 0.75rem 1rem !important; /* Reduced from 0 24px 20px */
}

.filter-section.collapsed .filter-section-content {
    display: none;
}

/* Dividers */
.filter-divider {
    height: 1px;
    background: var(--hc24-gray-100);
    margin: 1rem 0;
}

/* ============================================
   7. CATEGORY TREE - Match reference exactly
   ============================================ */
.category-section .filter-section-content {
    padding-top: 0.5rem;
}

.category-tree,
.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Category Item */
.category-item {
    margin: 0;
}

/* Parent Category Row */
.category-parent {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}

.category-parent:hover {
    background-color: var(--hc24-gray-50);
}

/* Expand Button */
.category-expand-btn {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-expand-icon {
    width: 1rem;
    height: 1rem;
    color: var(--hc24-gray-400);
    stroke: var(--hc24-gray-400);
    transition: transform 0.2s ease, color 0.2s ease, stroke 0.2s ease;
}

.category-expand-btn.expanded .category-expand-icon {
    transform: rotate(90deg);
    color: var(--hc24-teal-500);
    stroke: var(--hc24-teal-500);
}

/* Category Link */
.category-link {
    display: flex;
    align-items: center;
    flex: 1;
    text-decoration: none !important;
    gap: 0.5rem;
}

.category-link .category-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hc24-gray-600);
    transition: color 0.2s ease;
}

.category-parent:hover .category-link .category-name {
    color: var(--hc24-teal-600);
}

/* Category Count Badge - for both custom and Aimeos-injected counts */
.category-count,
.cat-count {
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: var(--hc24-gray-400) !important;
    background: var(--hc24-gray-100) !important;
    padding: 0.125rem 0.5rem !important;
    border-radius: 9999px !important;
    margin-left: auto !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Leaf category counts - smaller, no background */
.category-leaf .cat-count {
    background: transparent !important;
    padding: 0 !important;
}

/* Children/Subcategories Container */
.category-children {
    margin-left: 1.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--hc24-gray-100);
    padding-top: 0.25rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.category-children.open {
    max-height: 500px;
    opacity: 1;
}

.category-children-inner {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Leaf Category (with checkbox) */
.category-leaf {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.category-leaf:hover {
    background-color: rgba(91, 181, 197, 0.1);
}

.category-leaf:hover .category-name {
    color: var(--hc24-teal-600);
}

.category-leaf .category-link {
    display: contents;
}

/* Category Checkbox */
.category-checkbox {
    position: relative;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    border: 2px solid var(--hc24-gray-300) !important;
    border-radius: 4px !important;
    background: #fff !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0;
}

.category-checkbox:hover {
    border-color: var(--hc24-teal-500) !important;
}

.category-checkbox.checked {
    background: linear-gradient(135deg, #5BB5C5, #4AA4B4) !important;
    border-color: #5BB5C5 !important;
}

.category-checkbox.checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Nested levels indentation */
.category-list.level-2 {
    padding-left: 0.5rem;
}

.category-list.level-3 {
    padding-left: 0.5rem;
}

/* ============================================
   8. PRICE RANGE - Match reference exactly
   ============================================ */
.price-section .filter-section-content {
    padding-top: 1rem;
    padding-bottom: 0.5rem;
}

/* Price Display Boxes */
.price-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.price-box {
    background: var(--hc24-gray-50) !important;
    border: 1px solid var(--hc24-gray-200) !important;
    border-radius: 0.5rem !important;
    padding: 0.5rem 0.75rem !important;
    width: 100px;
    text-align: left;
}

.price-box .price-label {
    font-size: 0.75rem;
    color: var(--hc24-gray-500);
    display: block;
    margin-bottom: 0.125rem;
}

.price-box .price-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--hc24-dark-800);
}

.price-separator {
    height: 1px;
    width: 1rem;
    background: var(--hc24-gray-300);
}

/* Slider Container */
.price-slider-container {
    position: relative;
    padding: 0 0.25rem;
}

/* Price Slider - Gradient Track */
.price-slider,
input[type="range"].price-slider {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    height: 6px !important;
    border-radius: 3px !important;
    background: linear-gradient(90deg, #5BB5C5 0%, #F5A623 100%) !important;
    outline: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Slider Thumb - WebKit */
.price-slider::-webkit-slider-thumb,
input[type="range"].price-slider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: white !important;
    border: 3px solid #5BB5C5 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.2s ease !important;
}

.price-slider::-webkit-slider-thumb:hover,
input[type="range"].price-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1) !important;
    border-color: #F5A623 !important;
}

/* Slider Thumb - Firefox */
.price-slider::-moz-range-thumb,
input[type="range"].price-slider::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    background: white !important;
    border: 3px solid #5BB5C5 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

.price-slider::-moz-range-track,
input[type="range"].price-slider::-moz-range-track {
    background: linear-gradient(90deg, #5BB5C5 0%, #F5A623 100%) !important;
    height: 6px !important;
    border-radius: 3px !important;
    border: none !important;
}

/* Quick Price Buttons */
.price-quick-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.price-quick-btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.375rem 0;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-weight: 500;
    /* Default: gray outline */
    background: transparent !important;
    border: 1px solid var(--hc24-gray-200) !important;
    color: var(--hc24-gray-600) !important;
}

.price-quick-btn:hover:not(.active) {
    border-color: var(--hc24-teal-500) !important;
    color: var(--hc24-teal-600) !important;
}

/* Active Quick Button - Gradient Fill */
.price-quick-btn.active {
    background: linear-gradient(to right, #5BB5C5, #4AA4B4) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* Price Reset Link */
.price-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--hc24-gray-500);
    text-decoration: none;
    transition: color 0.2s ease;
}

.price-reset:hover {
    color: var(--hc24-teal-600);
}

.price-reset svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* ============================================
   9. SUPPLIER/BRAND Filter
   ============================================ */
.supplier-section .filter-section-content {
    padding-top: 0.5rem;
}

/* Override circular checkboxes from healthcare24.css to be square */
.catalog-filter-supplier .filter-checkbox-custom,
.catalog-filter-attribute .filter-checkbox-custom,
.supplier-section .filter-checkbox-custom {
    border-radius: 4px !important; /* Square, not circular */
    width: 18px !important;
    height: 18px !important;
}

/* Square checkmark instead of circle for checked state */
.catalog-filter-supplier .filter-checkbox:checked + .filter-checkbox-custom,
.catalog-filter-attribute .filter-checkbox:checked + .filter-checkbox-custom {
    background: linear-gradient(135deg, #5BB5C5, #4AA4B4) !important;
    border-color: #5BB5C5 !important;
}

.catalog-filter-supplier .filter-checkbox:checked + .filter-checkbox-custom::after,
.catalog-filter-attribute .filter-checkbox:checked + .filter-checkbox-custom::after {
    content: '' !important;
    position: absolute !important;
    left: 5px !important;
    top: 2px !important;
    width: 5px !important;
    height: 9px !important;
    border: solid white !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
    background: transparent !important;
    border-radius: 0 !important;
}

/* Fix brand/supplier name text overflow - override healthcare24.css truncation */
.catalog-filter-supplier .filter-label-text,
.catalog-filter-supplier .attr-name,
.filter-label-text.attr-name,
.catalog-filter-supplier li label span,
.catalog-filter-attribute li label span,
.catalog-filter .filter-label-text {
    flex: 1 !important;
    min-width: 0 !important;
    /* Override healthcare24.css lines 6717-6725 truncation */
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
}

/* Fix filter label layout */
.catalog-filter-supplier .filter-label,
.catalog-filter-attribute .filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

/* Supplier Reset */
.supplier-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: var(--hc24-gray-500);
    text-decoration: none;
    transition: color 0.2s ease;
}

.supplier-reset:hover {
    color: var(--hc24-teal-600);
}

/* Search Input */
.supplier-search-wrapper {
    position: relative;
    margin-bottom: 0.75rem;
}

.supplier-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--hc24-gray-400);
    stroke: var(--hc24-gray-400);
    pointer-events: none;
}

.supplier-search {
    width: 100% !important;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem !important;
    font-size: 0.875rem !important;
    border: 1px solid var(--hc24-gray-200) !important;
    border-radius: 0.5rem !important;
    background: #fff !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}

.supplier-search:focus {
    border-color: var(--hc24-teal-500) !important;
    box-shadow: 0 0 0 3px rgba(91, 181, 197, 0.1) !important;
}

/* Alphabet Quick Jump */
.supplier-alphabet {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.alphabet-btn {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    color: var(--hc24-gray-500) !important;
}

.alphabet-btn:hover:not(.disabled) {
    color: var(--hc24-teal-600) !important;
    background: rgba(91, 181, 197, 0.1) !important;
}

.alphabet-btn.active {
    background: var(--hc24-teal-500) !important;
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.alphabet-btn.disabled {
    color: var(--hc24-gray-300) !important;
    cursor: not-allowed !important;
}

/* Supplier/Brand List - Scrollable with max-height per superdesign */
.supplier-list,
.brand-list,
.catalog-filter-supplier ul,
.catalog-filter-supplier .filter-list,
.catalog-filter-attribute ul,
.catalog-filter-attribute .filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    list-style: none !important;
    margin: 0 !important;
    padding: 0.5rem !important;
    max-height: 160px !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: var(--hc24-teal-500) transparent;
}

/* Custom scrollbar for supplier/brand lists */
.supplier-list::-webkit-scrollbar,
.brand-list::-webkit-scrollbar,
.catalog-filter-supplier ul::-webkit-scrollbar,
.catalog-filter-attribute ul::-webkit-scrollbar {
    width: 4px;
}

.supplier-list::-webkit-scrollbar-track,
.brand-list::-webkit-scrollbar-track,
.catalog-filter-supplier ul::-webkit-scrollbar-track,
.catalog-filter-attribute ul::-webkit-scrollbar-track {
    background: transparent;
}

.supplier-list::-webkit-scrollbar-thumb,
.brand-list::-webkit-scrollbar-thumb,
.catalog-filter-supplier ul::-webkit-scrollbar-thumb,
.catalog-filter-attribute ul::-webkit-scrollbar-thumb {
    background: var(--hc24-teal-500);
    border-radius: 4px;
}

/* Supplier Item */
.supplier-item {
    list-style: none !important;
}

.supplier-item.prototype {
    display: none !important;
}

.supplier-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.supplier-label:hover {
    background: rgba(91, 181, 197, 0.1);
}

.supplier-label:hover .supplier-name {
    color: var(--hc24-teal-600);
}

/* Hide native checkbox */
.supplier-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom Supplier Checkbox */
.supplier-checkbox {
    position: relative;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    border: 2px solid var(--hc24-gray-300) !important;
    border-radius: 4px !important;
    background: #fff !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0;
}

.supplier-checkbox:hover,
.supplier-label:hover .supplier-checkbox {
    border-color: var(--hc24-teal-500) !important;
}

.supplier-checkbox.checked {
    background: linear-gradient(135deg, #5BB5C5, #4AA4B4) !important;
    border-color: #5BB5C5 !important;
}

.supplier-checkbox.checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.supplier-icon {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
    flex-shrink: 0;
}

.supplier-name {
    font-size: 0.875rem;
    color: var(--hc24-gray-600);
    flex: 1;
    transition: color 0.2s ease;
}

.supplier-count {
    font-size: 0.75rem;
    color: var(--hc24-gray-400);
    margin-left: auto;
}

/* Highlight effect for scroll-to */
.supplier-item.highlight {
    animation: highlightPulse 1s ease;
}

@keyframes highlightPulse {
    0%, 100% { background: transparent; }
    50% { background: rgba(91, 181, 197, 0.2); }
}

/* ============================================
   10. AVAILABILITY Pills
   ============================================ */
.availability-section .filter-section-content {
    padding-top: 0.75rem;
}

.availability-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.availability-pill {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent !important;
    border: 1px solid var(--hc24-gray-200) !important;
    color: var(--hc24-gray-600) !important;
}

.availability-pill:hover:not(.active) {
    border-color: var(--hc24-teal-500) !important;
    color: var(--hc24-teal-600) !important;
}

.availability-pill.active {
    background: linear-gradient(135deg, #5BB5C5, #4AA4B4) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(91, 181, 197, 0.4) !important;
}

/* ============================================
   11. RATING Section
   ============================================ */
.rating-section .filter-section-content {
    padding-top: 0.75rem;
}

.rating-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rating-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: 1px solid transparent;
}

.rating-option:hover {
    background: rgba(245, 166, 35, 0.1);
}

.rating-option.selected {
    background: rgba(245, 166, 35, 0.1);
    border-color: rgba(245, 166, 35, 0.3);
}

/* Hide native checkbox in rating */
.rating-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Rating Checkbox */
.rating-checkbox {
    position: relative;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    border: 2px solid var(--hc24-gray-300) !important;
    border-radius: 4px !important;
    background: #fff !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0;
}

.rating-checkbox.checked {
    background: linear-gradient(135deg, #5BB5C5, #4AA4B4) !important;
    border-color: #5BB5C5 !important;
}

.rating-checkbox.checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Star Container */
.rating-stars {
    display: flex;
    gap: 0.125rem;
}

.rating-stars .star {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.2s ease;
}

.rating-stars .star:hover {
    transform: scale(1.2);
}

.rating-stars .star.filled {
    color: var(--hc24-orange-500);
    fill: var(--hc24-orange-500);
}

.rating-stars .star.empty {
    color: var(--hc24-gray-300);
    fill: var(--hc24-gray-300);
}

.rating-label {
    font-size: 0.75rem;
    color: var(--hc24-gray-500);
}

.rating-count {
    font-size: 0.75rem;
    color: var(--hc24-gray-400);
    margin-left: auto;
}

/* ============================================
   12. FOOTER Buttons
   ============================================ */
.filter-footer-buttons {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0 0;
    margin-top: 1rem;
    border-top: 1px solid var(--hc24-gray-100);
}

/* Clear Button - Outline */
.btn-filter-clear {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--hc24-gray-600) !important;
    background: transparent !important;
    border: 2px solid var(--hc24-gray-300) !important;
    border-radius: 0.75rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.btn-filter-clear:hover {
    border-color: var(--hc24-gray-400) !important;
    color: var(--hc24-dark-800) !important;
}

/* Apply Button - Gradient with Shadow */
.btn-filter-apply {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff !important;
    background: linear-gradient(to right, #5BB5C5, #4AA4B4) !important;
    border: none !important;
    border-radius: 0.75rem !important;
    cursor: pointer !important;
    box-shadow: 0 10px 15px -3px rgba(91, 181, 197, 0.3), 0 4px 6px -2px rgba(91, 181, 197, 0.1) !important;
    transition: all 0.2s ease !important;
}

.btn-filter-apply:hover {
    background: linear-gradient(to right, #4AA4B4, #3991A1) !important;
    box-shadow: 0 20px 25px -5px rgba(91, 181, 197, 0.4), 0 10px 10px -5px rgba(91, 181, 197, 0.1) !important;
    transform: translateY(-2px);
}

/* ============================================
   13. Mobile Responsive
   ============================================ */
@media (max-width: 991px) {
    /* Reset wrapper styles on mobile */
    .filter-sidebar-col,
    #filterSidebar,
    aside.col-lg-3.filter-sidebar-col {
        position: static;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .catalog-filter,
    .catalog-filter.design3-filter {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        z-index: 1050;
        background: #fff;
        transition: left 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        border-radius: 0;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        /* Hide scrollbar on mobile but allow scrolling */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }

    .catalog-filter::-webkit-scrollbar,
    .catalog-filter.design3-filter::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .catalog-filter.open,
    .catalog-filter.design3-filter.open {
        left: 0;
    }

    /* Sticky Header */
    .filter-sidebar-header.design3 {
        position: sticky;
        top: 0;
        z-index: 10;
    }

    /* Sticky Footer */
    .filter-footer-buttons {
        position: sticky;
        bottom: 0;
        z-index: 10;
        background: linear-gradient(to top, #fff 80%, transparent);
        padding-bottom: 1rem;
    }

    /* Touch-friendly sizing */
    .filter-section-header {
        min-height: 48px;
    }

    .availability-pill {
        min-height: 44px;
        padding: 0.625rem 1.25rem;
    }

    .rating-option {
        min-height: 48px;
    }
}

/* ============================================
   14. Mobile Backdrop Overlay
   ============================================ */
.filter-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* ============================================
   15. Legacy Aimeos Overrides
   ============================================ */

/* Override any default Aimeos styles */
.catalog-filter .catalog-filter-search {
    margin-bottom: 0 !important;
    border: none !important;
    padding: 0 !important;
}

/* Hide search section header if it exists */
.catalog-filter-search > h3,
.catalog-filter-search > .header,
.catalog-filter-search .search-header {
    display: none !important;
}

/* Ensure search box styling */
.catalog-filter-search .input-group {
    display: flex;
    gap: 0;
}

.catalog-filter-search input.value {
    flex: 1;
    padding: 0.625rem 1rem !important;
    border: 1px solid var(--hc24-gray-200) !important;
    border-right: none !important;
    border-radius: 0.5rem 0 0 0.5rem !important;
    font-size: 0.875rem !important;
    outline: none !important;
}

.catalog-filter-search input.value:focus {
    border-color: var(--hc24-teal-500) !important;
}

.catalog-filter-search .btn-search {
    padding: 0.625rem 1rem !important;
    background: var(--hc24-teal-500) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0 0.5rem 0.5rem 0 !important;
    cursor: pointer !important;
}

.catalog-filter-search .btn-search:hover {
    background: var(--hc24-teal-600) !important;
}

/* ============================================
   16. DESIGN IMPROVEMENTS - Match Reference
   ============================================ */

/* Enhanced Header - Rounded corners, better padding */
.filter-sidebar-header.design3 {
    background: linear-gradient(to right, #4AA4B4, #5BB5C5) !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 0.75rem 0.75rem 0 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

.filter-sidebar-header.design3 .filter-header-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 0;
    width: 100%;
}

.filter-sidebar-header.design3 .filter-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 0.625rem;
}

.filter-sidebar-header.design3 .filter-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #fff;
    stroke: #fff;
    stroke-width: 2;
}

.filter-sidebar-header.design3 .filter-title {
    color: #fff !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    margin: 0 !important;
    text-transform: none !important;
    border: none !important;
    border-bottom: none !important;
    text-decoration: none !important;
}

/* Ensure h2 inside filter header has no underline or uppercase */
.filter-sidebar-header.design3 h2.filter-title {
    text-transform: none !important;
    border: none !important;
    border-bottom: none !important;
    text-decoration: none !important;
}

/* Enhanced Count Badge - Larger, rounder */
.filter-count-badge {
    background: #F5A623 !important;
    color: #fff !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    min-width: 28px;
    height: 28px;
    padding: 0 0.5rem !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.4) !important;
}

/* Enhanced Active Tags - Better glassmorphism */
.filter-active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff !important;
    font-size: 0.8125rem !important;
    font-weight: 500;
    padding: 0.5rem 0.875rem !important;
    border-radius: 9999px !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    transition: all 0.2s ease;
}

.filter-tag:hover {
    background: rgba(255, 255, 255, 0.35) !important;
}

.filter-tag .filter-tag-remove,
.filter-tag button {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    margin-left: 0.25rem;
    transition: all 0.2s ease;
}

.filter-tag .filter-tag-remove:hover,
.filter-tag button:hover {
    color: #F5A623 !important;
    transform: scale(1.1);
}

/* ============================================
   17. CATEGORY TREE - Match Reference Design EXACTLY
   Reference: e_commerce_category__3.html
   ============================================ */

/* Category Section Header */
.category-section .filter-section-header {
    padding: 0.5rem 0 !important;
    margin-bottom: 0;
}

.category-section .filter-section-header span {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--hc24-dark-800) !important;
}

/* Category Tree Container */
.category-tree {
    padding: 0.5rem 0 0 0;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Individual Category Item */
.category-item {
    margin: 0;
    padding: 0;
}

/* ========== PARENT CATEGORY ROW ========== */
/* Reference: button with chevron + link + count badge */
.category-parent {
    width: 100%;
    display: flex;
    align-items: flex-start; /* Align to top for multi-line text */
    gap: 0.5rem;
    padding: 0.5rem;
    margin: 0;
    border-radius: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease;
}

.category-parent:hover {
    background-color: var(--hc24-gray-50);
}

/* Chevron Icon - GRAY (not teal), rotates 90deg when expanded */
.category-chevron {
    width: 16px;
    height: 16px;
    min-width: 16px;
    color: var(--hc24-gray-400); /* Gray per superdesign reference */
    stroke: var(--hc24-gray-400); /* Gray per superdesign reference */
    stroke-width: 2;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

/* Expanded chevron becomes teal */
.category-parent.expanded .category-chevron {
    color: var(--hc24-teal-500);
    stroke: var(--hc24-teal-500);
}

.category-parent.expanded .category-chevron {
    transform: rotate(90deg);
}

/* Category Link inside parent - flex row for name + count */
.category-parent .category-link {
    display: flex;
    align-items: baseline; /* Align text baselines */
    flex: 1 1 auto;
    text-decoration: none !important;
    gap: 0.5rem;
    min-width: 100px; /* Ensure minimum width for text */
}

/* Parent Category Name - font-medium, gray-700 */
.category-parent .category-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151; /* gray-700 */
    flex: 1 1 auto;
    min-width: 80px; /* Minimum width to prevent excessive shrinking */
    transition: color 0.2s ease;
    line-height: 1.4;
}

/* Count badge inside link - positioned to the right */
.category-parent .category-link .cat-count {
    flex-shrink: 0;
    white-space: nowrap;
}

.category-parent:hover .category-name {
    color: var(--hc24-teal-600);
}

/* Parent Category Count Badge - Gray pill (NO parentheses) */
.category-parent .cat-count,
.category-parent .category-count-badge,
.category-item.has-children > .category-parent .cat-count,
.category-item.has-children > .category-parent .category-count-badge {
    font-size: 0.75rem !important;
    font-weight: 400 !important;
    color: var(--hc24-gray-400) !important;
    background: var(--hc24-gray-100) !important;
    padding: 0.125rem 0.5rem !important;
    border-radius: 9999px !important;
    border: none !important;
    margin-left: auto !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
}

/* Remove parentheses added by Aimeos default CSS */
.category-parent .cat-count::before,
.category-parent .cat-count::after,
.category-leaf .cat-count::before,
.category-leaf .cat-count::after {
    content: none !important;
    display: none !important;
}

/* ========== SUBCATEGORY CONTAINER ========== */
/* Reference: ml-6, border-l-2 border-gray-100, pl-3 */
.category-children {
    margin-left: 1rem; /* Reduced from 1.5rem to give more text width */
    padding-left: 0.5rem; /* Reduced from 0.75rem */
    border-left: 2px solid var(--hc24-gray-100);
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease-out, opacity 0.2s ease;
}

.category-children.open {
    max-height: 500px;
    opacity: 1;
}

.category-children-inner {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ========== LEAF/SUBCATEGORY ITEMS ========== */
/* Reference: checkbox + name + plain count */
.category-leaf {
    display: flex;
    align-items: flex-start; /* Align to top for multi-line text */
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    margin: 0;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.category-leaf:hover {
    background-color: rgba(91, 181, 197, 0.08); /* teal-50 equivalent */
}

.category-leaf:hover .category-name {
    color: var(--hc24-teal-600);
}

/* Leaf checkbox link */
.category-leaf .category-link {
    display: contents;
}

/* ========== CUSTOM CHECKBOX ========== */
/* Reference: 18x18, 2px border #d1d5db, 4px radius */
.category-checkbox {
    position: relative;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 4px !important;
    background: #fff !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0;
}

.category-checkbox:hover,
.category-leaf:hover .category-checkbox {
    border-color: var(--hc24-teal-500) !important;
}

/* Checked state - teal gradient */
.category-checkbox.checked {
    background: linear-gradient(135deg, #5BB5C5, #4AA3B3) !important;
    border-color: #5BB5C5 !important;
}

.category-checkbox.checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Subcategory Name - regular weight, gray-600 */
.category-leaf .category-name {
    font-size: 0.875rem;
    font-weight: 400;
    color: #4B5563; /* gray-600 */
    transition: color 0.2s ease;
    flex: 1 1 auto;
    min-width: 80px; /* Minimum width to prevent excessive shrinking */
    line-height: 1.4;
}

/* Subcategory Count - Plain number, NO background */
.category-leaf .cat-count,
.category-leaf .category-count,
.category-item.no-children .cat-count,
.category-item.no-children .category-count,
.category-item.nochild .cat-count,
.category-item.nochild .category-count {
    font-size: 0.75rem !important;
    font-weight: 400 !important;
    color: var(--hc24-gray-400) !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-left: auto !important;
}

/* ========== NESTED LEVELS ========== */
.category-list.level-2,
.category-list.level-3 {
    gap: 0.25rem;
}

/* Selected/Active States */
.category-leaf.selected .category-checkbox {
    background: linear-gradient(135deg, #5BB5C5, #4AA3B3) !important;
    border-color: #5BB5C5 !important;
}

.category-leaf.selected .category-checkbox::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.category-leaf.selected .category-name {
    color: #374151; /* slightly darker when selected */
    font-weight: 500;
}

/* ============================================
   18. SECTION SPACING - Better visual hierarchy
   ============================================ */

/* Filter Body Padding - reduced from 1.5rem to give more space for category names */
.filter-body {
    padding: 1rem 1.25rem !important;
}

/* Section Dividers - More subtle */
.filter-divider {
    height: 1px;
    background: var(--hc24-gray-100);
    margin: 1.25rem 0;
}

/* Section Headers - Consistent styling */
.filter-section-header {
    padding: 0.625rem 0 !important;
}

.filter-section-header span {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: var(--hc24-dark-800) !important;
}

/* Section Content - Better padding */
.filter-section-content {
    padding-top: 0.75rem;
    padding-bottom: 0.25rem;
}

/* ============================================
   19. PRICE SECTION - Match Reference
   ============================================ */

.price-section .filter-section-content {
    padding-top: 1rem;
}

/* Price Display Boxes - Larger, clearer */
.price-display {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.price-box {
    flex: 1;
    background: var(--hc24-gray-50) !important;
    border: 1px solid var(--hc24-gray-200) !important;
    border-radius: 0.625rem !important;
    padding: 0.75rem 1rem !important;
    text-align: left;
}

.price-box .price-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--hc24-gray-500);
    display: block;
    margin-bottom: 0.25rem;
    text-transform: none;
}

.price-box .price-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--hc24-dark-800);
}

.price-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
}

.price-separator::after {
    content: '';
    width: 12px;
    height: 2px;
    background: var(--hc24-gray-300);
}

/* Slider - Enhanced */
.price-slider-container {
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

/* Quick Price Buttons - Better sizing */
.price-quick-buttons {
    display: flex;
    gap: 0.625rem;
    margin-top: 1rem;
}

.price-quick-btn {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 0.5rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: #fff !important;
    border: 1.5px solid var(--hc24-gray-200) !important;
    color: var(--hc24-gray-600) !important;
}

.price-quick-btn:hover:not(.active) {
    border-color: var(--hc24-teal-500) !important;
    color: var(--hc24-teal-600) !important;
    background: rgba(91, 181, 197, 0.05) !important;
}

.price-quick-btn.active {
    background: linear-gradient(135deg, #5BB5C5, #4AA4B4) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(91, 181, 197, 0.35) !important;
}

/* ============================================
   20. FOOTER BUTTONS - Enhanced
   ============================================ */

.filter-footer-buttons {
    display: flex;
    gap: 0.875rem;
    padding: 1.25rem 0 0.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--hc24-gray-100);
}

.btn-filter-clear {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--hc24-gray-600) !important;
    background: #fff !important;
    border: 2px solid var(--hc24-gray-200) !important;
    border-radius: 0.75rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.btn-filter-clear:hover {
    border-color: var(--hc24-gray-400) !important;
    color: var(--hc24-dark-800) !important;
    background: var(--hc24-gray-50) !important;
}

.btn-filter-apply {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff !important;
    background: linear-gradient(to right, #5BB5C5, #4AA4B4) !important;
    border: none !important;
    border-radius: 0.75rem !important;
    cursor: pointer !important;
    box-shadow: 0 8px 20px -4px rgba(91, 181, 197, 0.4) !important;
    transition: all 0.2s ease !important;
    text-transform: none !important;
    letter-spacing: 0.03em;
}

.btn-filter-apply:hover {
    background: linear-gradient(to right, #4AA4B4, #3991A1) !important;
    box-shadow: 0 12px 28px -4px rgba(91, 181, 197, 0.5) !important;
    transform: translateY(-2px);
}
