/* Filter Color Variables */
:root {
    --filter-teal: #2db5a5;
    --filter-teal-hover: #26a69a;
    --filter-teal-light: rgba(45, 181, 165, 0.1);
    --filter-teal-shadow: rgba(45, 181, 165, 0.3);
    --filter-blue: #0ea5e9;
    --filter-dark: #212529;
    --filter-gray: #6c757d;
    --filter-light-gray: #f8f9fa;
    --filter-border: #e3e6ea;
}

/* Modern Filter Styles - Like the image */
.modern-filter-section {
    background: white !important;
    padding: 15px 0px !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Filter Header */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.filter-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-item {
    color: var(--filter-gray);
    font-weight: 400;
}

.breadcrumb-item.active {
    color: var(--filter-dark);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--filter-gray);
    font-size: 12px;
}

.active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(108, 117, 125, 0.1);
    color: var(--filter-gray);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.filter-tag i {
    font-size: 10px;
}

.remove-filter {
    background: none;
    border: none;
    color: var(--filter-gray);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    transition: color 0.2s ease;
}

.remove-filter:hover {
    color: #dc3545;
}

.filter-buttons-row {
    max-width: 100%;
    gap: 8px;
}

.filter-buttons-row::-webkit-scrollbar {
    display: none;
}

.filter-buttons-row {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Filter Toggle Button (Main Filter Button) */
.filter-toggle-btn {
    border-radius: 9999px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid var(--filter-border);
    white-space: nowrap;
    box-shadow: none;
}

.filter-toggle-btn i {
    font-size: 12px;
}

/* Filter Dropdown Buttons */
.filter-btn {
    background: var(--filter-light-gray) !important;
    border: 1px solid var(--filter-border);
    border-radius: 9999px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 400;
    color: var(--filter-gray) !important;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
    justify-content: space-between;
    white-space: nowrap;
    box-shadow: none;
}

.filter-btn span {
    white-space: nowrap;
}

.filter-btn:hover {
    background: #e9ecef !important;
    border-color: var(--filter-gray);
    color: var(--filter-dark);
    box-shadow: none !important;
}

.filter-btn.active,
.filter-btn.has-filter {
    background: #8a2bff;
    color: white;
    white-space: nowrap;
    box-shadow: none;
}

.filter-indicator {
    background: white;
    color: #8a2bff;
    font-size: 12px;
    font-weight: bold;
    border-radius: 9999px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    line-height: 1;
    white-space: nowrap;
    box-shadow: none;
}

.filter-btn.has-filter .filter-indicator {
    background: white;
    color: #8a2bff;
}

.filter-btn i {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.filter-btn.active i {
    transform: rotate(180deg);
}

/* Clear Button */
.clear-all-btn {
    background: transparent;
    border: 1px solid var(--filter-gray);
    border-radius: 9999px;
    color: var(--filter-gray);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: none;
}

.clear-all-btn:hover {
    background: var(--filter-gray);
    color: white;
    box-shadow: none;
}

/* Custom Dropdown Menus */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

.custom-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-width: 200px;
    margin-top: 4px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

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

/* Keep dropdown open when hovering over it */
.custom-dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content {
    padding: 16px;
    display: block;
    visibility: visible;
}

.dropdown-option {
    display: flex;
    align-items: center;
    padding: 12px 0;
    cursor: pointer;
    transition: background 0.2s ease;
    visibility: visible;
    opacity: 1;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background: transparent;
}

.option-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    margin: 0;
    margin-right: 12px;
    cursor: pointer;
    position: relative;
    background: white;
    transition: all 0.2s ease;
}

.option-input:checked {
    background: #8a2bff;
    border-color: #8a2bff;
}

.option-input:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.option-label {
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    margin: 0;
    flex: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.option-label:hover {
    background: #f8f9fa;
    color: var(--filter-dark);
}

/* Selected State Styling */
.option-input:checked + .option-label {
    color: #374151;
    font-weight: 500;
}

/* Dropdown Labels and Inputs */
.dropdown-label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
    padding: 0;
}

.dropdown-input {
    width: 80px;
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    margin: 0 4px;
}

.apply-btn {
    background: var(--wish-teal, #2db5a5);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    width: calc(100% - 32px);
    margin: 8px 16px 0;
    transition: all 0.2s ease;
}

.apply-btn:hover {
    background: #26a69a;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(45, 181, 165, 0.3);
}

/* Price Filter Specific */
.price-filter-content {
    padding: 0;
}

.price-filter-tabs {
    margin-bottom: 16px;
}

.price-tab-buttons {
    display: flex;
    background: #f3f4f6;
    border-radius: 6px;
    padding: 2px;
}

.price-tab-btn {
    flex: 1;
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.price-tab-btn.active {
    background: white;
    color: #8a2bff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.price-ranges {
    padding: 0;
    margin: 0;
}

.price-custom {
    padding: 0;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.price-separator {
    font-size: 12px;
    color: #6b7280;
}

.apply-btn {
    background: #8a2bff;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.price-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 16px;
    margin-bottom: 8px;
}

.price-inputs span {
    color: #6b7280;
    font-weight: 500;
}

/* Dropdown Actions */
.dropdown-actions {
    padding: 16px 0 0 0;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

.clear-btn {
    background: transparent;
    border: none;
    color: #8a2bff;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.clear-btn:hover {
    color: #1c7ed6;
    text-decoration: underline;
}

/* Category Dropdown Specific */
.category-dropdown-menu {
    max-height: 300px;
}

.subcategory-option {
    padding-left: 20px;
}

.subcategory-option .option-label {
    font-size: 13px;
    color: #6b7280;
}

.childcategory-option {
    padding-left: 40px;
}

.childcategory-option .option-label {
    font-size: 12px;
    color: #9ca3af;
}

.category-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

.category-item:hover {
    background: #f9fafb;
}

.category-item.active {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 500;
}

.category-item.subcategory {
    padding-left: 32px;
    font-size: 13px;
}

.category-item.child-category {
    padding-left: 48px;
    font-size: 12px;
    color: #6b7280;
}

/* Price Filter Content */
.price-filter-content {
    min-width: 220px;
}

.price-filter-content .form-label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.price-inputs input {
    width: 80px;
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

.price-inputs span {
    color: #6b7280;
    font-weight: 500;
}

/* Stars for Rating */
.stars {
    color: #fbbf24;
    font-size: 14px;
    margin-right: 4px;
}

/* Price Inputs */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-inputs input {
    width: 80px;
    text-align: center;
}

.price-inputs span {
    color: #6c757d;
    font-weight: 500;
}

.price-inputs .btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Attributes */
.attributes-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    max-height: 80px;
    overflow-y: auto;
    padding-right: 5px;
}

.attributes-horizontal::-webkit-scrollbar {
    width: 4px;
}

.attributes-horizontal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.attributes-horizontal::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.attributes-horizontal::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.attribute-group {
    min-width: 150px;
    flex: 1;
}

.attribute-group .form-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 4px;
}

.attribute-group .form-select {
    font-size: 13px;
    padding: 4px 8px;
    height: auto;
}

/* Clear Filters Button */
#clear-filters {
    border: 2px solid #dc3545;
    color: #dc3545;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border-radius: 8px;
}

#clear-filters:hover {
    background-color: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Mobile Filters */
#mobileFilters {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dashboard-sidebar-btn {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.dashboard-sidebar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Filter Overlay */
.filter-overlay {
    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: all 0.3s ease;
}

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

/* Desktop Sidebar Filter */
.desktop-filter-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    z-index: 1050;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
}

.desktop-filter-sidebar.show {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.sidebar-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.close-sidebar-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-sidebar-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.sidebar-content {
    padding: 20px;
}

/* Mobile Bottom Sheet Filter */
.mobile-filter-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    max-height: 80vh;
    background: white;
    z-index: 1050;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transition: bottom 0.3s ease;
    overflow: hidden;
}

.mobile-filter-sheet.show {
    bottom: 0 !important;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 12px auto 8px;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.sheet-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.close-sheet-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-sheet-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.sheet-content {
    max-height: calc(80vh - 80px);
    padding: 20px;
    overflow-y: auto;
}

.widget.woocommerce.widget_product_categories.widget-toggle,
.catalog-sidebar {
    padding: 0 !important;
    box-shadow: none !important;
}

.category-link {
    padding: 0 !important;
    background-color: transparent !important;
}

#woocommerce_product_categories-4 > ul > li > span {
    padding: 0 !important;
    background-color: transparent !important;
}

/* Hide mobile sheet on desktop */
@media (min-width: 769px) {
    .mobile-filter-sheet {
        display: none;
    }
}

/* Hide desktop sidebar on mobile */
@media (max-width: 768px) {
    .desktop-filter-sidebar {
        display: none;
    }
}

/* Sidebar and Sheet Content Styling */
.sidebar-content .widget,
.sheet-content .widget {
    margin-bottom: 25px;
    padding: 0;
    background: transparent;
    border: none;
}

.sidebar-content .widget-title,
.sheet-content .widget-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.sidebar-content .form-check,
.sheet-content .form-check {
    margin-bottom: 12px !important;
    padding: 8px 12px !important;
    background: white !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 10px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.sidebar-content .form-check:hover,
.sheet-content .form-check:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.sidebar-content .form-check-label,
.sheet-content .form-check-label {
    font-size: 14px !important;
    color: #374151 !important;
    cursor: pointer !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
    flex: 1 !important;
    line-height: 1.4 !important;
    font-weight: 500 !important;
}

.sidebar-content .form-check-input,
.sheet-content .form-check-input {
    margin-right: 0 !important;
    margin-left: 0 !important;
    width: 16px !important;
    height: 16px !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
}

.sidebar-content .form-check-input:checked,
.sheet-content .form-check-input:checked {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

.sidebar-content .form-check-input:focus,
.sheet-content .form-check-input:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
    outline: none !important;
}

/* Price Range Styling in Sidebar/Sheet */
.sidebar-content .price-range-block,
.sheet-content .price-range-block {
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.sidebar-content .price-range-field,
.sheet-content .price-range-field {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.sidebar-content .filter-btn,
.sheet-content .filter-btn {
    background: var(--wish-teal, #2db5a5);
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: none;
}

.sidebar-content .filter-btn:hover,
.sheet-content .filter-btn:hover {
    background: #26a69a;
    box-shadow: none;
}

/* Smooth animations */
.desktop-filter-sidebar,
.mobile-filter-sheet {
    will-change: transform;
}

/* Prevent body scroll when filter is open */
body.filter-open {
    overflow: hidden;
}

/* Enhanced mobile sheet handle */
.sheet-handle {
    cursor: grab;
    transition: background 0.2s ease;
}

.sheet-handle:hover {
    background: #9ca3af;
}

/* Loading state for filter content */
.filter-loading .sidebar-content,
.filter-loading .sheet-content {
    opacity: 0.6;
    pointer-events: none;
}

/* Scrollbar styling for sidebar content */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Hide scrollbar on mobile filter sheet */
.sheet-content::-webkit-scrollbar {
    display: none;
}

.sheet-content {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.filter-section h6 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .filter-buttons-row {
        gap: 6px;
    }

    .filter-btn {
        font-size: 13px;
        padding: 6px 10px;
        min-width: 70px;
    }
}

@media (max-width: 992px) {
    .modern-filter-section {
        padding: 12px 0px;
    }

    .filter-buttons-row {
        gap: 4px;
    }

    .filter-btn {
        font-size: 12px;
        padding: 6px 8px;
        min-width: 60px;
    }

    .filter-toggle-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .modern-filter-section {
        padding: 10px 0px;
    }

    .filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .filter-breadcrumb {
        font-size: 13px;
    }

    .active-filters {
        width: 100%;
        justify-content: flex-start;
    }

    .filter-tag {
        font-size: 11px;
        padding: 3px 6px;
    }

    .filter-btn,
    .filter-toggle-btn {
        width: 100%;
        justify-content: space-between;
    }

    .clear-all-btn {
        text-align: center;
        padding: 10px;
    }

    .custom-dropdown-menu {
        margin-top: 8px;
        box-shadow: none;
        border: 1px solid #e5e7eb;
        position: static;
        transform: none;
    }

    .custom-dropdown-menu.show {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 576px) {
    .price-inputs {
        flex-direction: column;
        gap: 8px;
    }

    .price-inputs input {
        width: 100%;
    }

    .category-item {
        padding: 12px 16px;
        font-size: 15px;
    }

    .category-item.subcategory {
        padding-left: 24px;
    }

    .category-item.child-category {
        padding-left: 32px;
    }
}

/* Animation for filter changes */
.top-filter-section .form-select,
.top-filter-section .form-control {
    transition: all 0.2s ease;
}

/* Loading state */
.filter-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.filter-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Enhanced mobile sidebar */
@media (max-width: 1199px) {
    #mobileFilters .widget {
        margin-bottom: 20px;
        padding: 15px;
        background: #f8f9fa;
        border-radius: 8px;
        border: 1px solid #e9ecef;
    }

    #mobileFilters .widget-title {
        font-size: 16px;
        font-weight: 600;
        color: #495057;
        margin-bottom: 15px;
        padding-bottom: 8px;
        border-bottom: 2px solid #0d6efd;
    }

    #mobileFilters .form-check {
        margin-bottom: 8px;
    }

    #mobileFilters .form-check-label {
        font-size: 14px;
        color: #6c757d;
    }

    #mobileFilters .price-range-block {
        padding: 10px;
    }
}

/* Category select enhancement */
.category-filter option {
    padding: 8px 12px;
    font-size: 14px;
}

.category-filter option:hover {
    background-color: #e9ecef;
}

/* Button enhancements */
.filter-btn {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    border: none;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
}

/* additional styles */

.filter-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.filter-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.breadcrumb-item {
    color: #6c757d;
    font-size: 14px;
}

.breadcrumb-item.active {
    color: #8a2bff;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #dee2e6;
}

.filter-badge {
    background: #f8f9fa;
    color: #495057;
    padding: 4px 8px;
    border-radius: 50px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #dee2e6;
    margin-right: 4px;
    margin-bottom: 4px;
}

.badge-content {
    font-weight: 500;
    white-space: nowrap;
}

.badge-remove {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.2s ease;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.badge-remove:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

.filter-badge:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Price specific formatting */
.price-filter-badge .badge-content:before {
    content: "Rp";
    margin-right: 2px;
    font-weight: 600;
}

.price-range-filter-badge .badge-content:before {
    content: "";
}

.filter-summary {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 50px;
    border: 1px solid #e9ecef;
}

.filter-summary small {
    font-weight: 500;
    color: #495057;
}

.filter-count-badge {
    background: #dc3545;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 50px;
    margin-left: 8px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
}

/* Enhanced filter badge styles */
.price-filter-badge {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.price-range-filter-badge {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.attribute-filter-badge {
    background: #cce5ff;
    border-color: #b3d4fc;
    color: #004085;
}

/* Responsive badges */
@media (max-width: 768px) {
    .filter-badge {
        font-size: 11px;
        padding: 3px 6px;
        margin-right: 2px;
        margin-bottom: 2px;
    }

    .badge-content {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Enhanced button styles */
.filter-toggle-btn {
    transition: all 0.3s ease;
}

.filter-btn {
    transition: all 0.3s ease;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .filter-summary {
        justify-content: center;
        text-align: center;
    }
}

.filter-buttons-row {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding: 5px 0 10px 0 !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    min-width: 0 !important;
    width: 100% !important;
}

/* Hide scrollbar for filter buttons */
.filter-buttons-row::-webkit-scrollbar {
    height: 4px !important;
    background: transparent !important;
}

.filter-buttons-row::-webkit-scrollbar-track {
    background: #f1f3f4 !important;
    border-radius: 2px !important;
}

.filter-buttons-row::-webkit-scrollbar-thumb {
    background: #c1c1c1 !important;
    border-radius: 2px !important;
}

.filter-buttons-row::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8 !important;
}

.custom-dropdown {
    position: relative !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
}

.filter-btn {
    border: 1px solid #dee2e6 !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: none;
    margin-top: 0 !important;
}

.filter-btn span {
    font-weight: 500 !important;
}

.filter-btn:hover {
    border-color: #adb5bd;
    box-shadow: none;
}

.filter-btn.has-filter {
    background: #8a2bff;
    color: white;
    box-shadow: none;
}

.filter-indicator {
    background: #8a2bff;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 9999px;
    min-width: 18px;
    text-align: center;
    box-shadow: none;
}

.custom-dropdown-menu {
    position: fixed !important;
    background: white !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    z-index: 99999 !important;
    min-width: 320px !important;
    max-width: 90vw !important;
    max-height: none !important;
    overflow: visible !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    /* transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important; */
    white-space: nowrap !important;
}

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

.dropdown-content {
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    /* overflow-x: auto !important;
    overflow-y: visible !important; */
    visibility: visible !important;
    white-space: nowrap !important;
    align-items: flex-start !important;
    min-height: auto !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Custom scrollbar for dropdown content */
.dropdown-content::-webkit-scrollbar {
    height: 6px !important;
    background: transparent !important;
}

.dropdown-content::-webkit-scrollbar-track {
    background: #f1f3f4 !important;
    border-radius: 3px !important;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: #c1c1c1 !important;
    border-radius: 3px !important;
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8 !important;
}

.dropdown-label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.dropdown-option {
    margin-bottom: 0 !important;
    margin-right: 8px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 0px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    min-width: auto !important;
}

.dropdown-option:hover {
    transform: translateY(-1px) !important;
}

.option-input {
    margin: 0;
}

.option-label {
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    flex: 1;
    display: flex;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    gap: 2px;
}

.option-main {
    font-weight: 500;
    color: #212529;
    white-space: nowrap !important;
}

.option-desc {
    font-size: 11px;
    color: #6c757d;
    font-style: italic;
}

.dropdown-option:hover .option-main {
    color: #8a2bff;
}

.dropdown-actions {
    border-top: 1px solid #e9ecef !important;
    padding-top: 12px !important;
    margin-top: 12px !important;
    margin-left: 16px !important;
    display: flex !important;
    gap: 8px !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.btn-clear {
    background: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    cursor: pointer;
}

.btn-clear:hover {
    background: #5a6268;
}

/* Filter Overlay */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.filter-overlay.show {
    display: block;
}

/* Desktop Sidebar */
.desktop-filter-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    z-index: 1001;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.desktop-filter-sidebar.show {
    right: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h5 {
    margin: 0;
    font-weight: 600;
}

.close-sidebar-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6c757d;
    border-radius: 50px;
    padding: 8px;
    transition: all 0.2s ease;
}

.close-sidebar-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.sidebar-content {
    padding: 20px;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

/* Mobile Bottom Sheet */
.mobile-filter-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    max-height: 80vh;
    background: white;
    z-index: 1001;
    transition: bottom 0.3s ease;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
}

.mobile-filter-sheet.show {
    bottom: 0;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: #dee2e6;
    border-radius: 2px;
    margin: 12px auto 8px;
}

.sheet-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sheet-header h5 {
    margin: 0;
    font-weight: 600;
}

.close-sheet-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6c757d;
    border-radius: 50px;
    padding: 8px;
    transition: all 0.2s ease;
}

.close-sheet-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.sheet-content {
    padding: 20px;
    max-height: calc(80vh - 120px);
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .modern-filter-section {
        padding-block: 15px;
    }

    .filter-buttons-row {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .custom-dropdown-menu {
        min-width: 200px;
    }

    .desktop-filter-sidebar {
        display: none;
    }
}

@media (min-width: 769px) {
    .mobile-filter-sheet {
        display: none;
    }
}

.top-filter-section {
    border: 1px solid #e9ecef;
}

.filter-group {
    height: 100%;
}

.filter-title {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.price-inputs input {
    width: 80px;
}

.attribute-group {
    min-width: 150px;
}

.attributes-horizontal {
    max-height: 60px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .top-filter-section {
        padding: 15px !important;
    }

    .attributes-horizontal {
        flex-direction: column;
        max-height: none;
    }

    .attribute-group {
        min-width: 100%;
    }

    .price-inputs {
        flex-direction: column;
        gap: 8px !important;
    }

    .price-inputs input {
        width: 100%;
    }
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    background: white;
    padding: 30px;
    border-radius: 50px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8a2bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* Loading state for buttons */
.filter-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.filter-btn.loading::after {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    display: inline-block;
}

@media (max-width: 768px) {
    .filters {
        display: flex;
        flex-wrap: nowrap; /* Supaya item tidak turun ke bawah */
        gap: 8px; /* Jarak antar filter */
        overflow-x: auto; /* Aktifkan scroll horizontal */
        overflow-y: hidden; /* Matikan scroll vertical */
        -webkit-overflow-scrolling: touch; /* Smooth scroll di iOS */
        padding: 8px 0;
    }

    .filters::-webkit-scrollbar {
        display: none; /* Sembunyikan scrollbar di mobile */
    }

    .filters .filter-btn {
        flex: 0 0 auto; /* Supaya tombol tetap ukuran normal, tidak mengecil */
    }
}
