/* Filter Sidebar System - Professional Slide-in Filters */

.filter-sidebar::-webkit-scrollbar {
    width: 4px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.filter-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.collection-container {
    display: flex;
    position: relative;
    min-height: calc(100vh - 200px);
}

.filter-sidebar {
    position: fixed;
    top: 0;
    left: -360px;
    width: 360px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    z-index: 1001;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.filter-sidebar.open {
    left: 0;
}

.filter-sidebar-content {
    padding: 0 24px 24px;
    flex: 1;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}

.filter-title {
    font-size: 16px;
    font-weight: 700;
    color: #0B2341;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.filter-close {
    background: none;
    border: 1px solid #e5e7eb;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filter-close:hover {
    background: #f3f4f6;
    color: #0B2341;
    border-color: #d1d5db;
}

.filter-section {
    padding: 20px 0;
    border-bottom: 1px solid #f3f4f6;
}

.filter-section:last-of-type {
    border-bottom: none;
}

.filter-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #0B2341;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-section-title .filter-active-badge {
    display: none;
    align-items: center;
    justify-content: center;
    background: #0B2341;
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.filter-section-title .filter-active-badge.visible {
    display: inline-flex;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-options.color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px 12px;
    transition: all 0.15s ease;
    border-radius: 8px;
    margin: 0 -12px;
}

.filter-option:hover {
    background: #f8f9fa;
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    position: relative;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.filter-option input[type="checkbox"]:checked {
    background: #0B2341;
    border-color: #0B2341;
}

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

.filter-option-label {
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    flex: 1;
    user-select: none;
    line-height: 1.4;
}

.filter-option-count {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
}

/* Color Swatches */
.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.filter-options.color-grid .filter-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    margin: 0;
}

.filter-options.color-grid .filter-option:hover .color-swatch {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.filter-options.color-grid .filter-option-label {
    font-size: 11px;
    line-height: 1.2;
    color: #6b7280;
}

.color-swatch.white { 
    background: #ffffff; 
    border: 2px solid #d1d5db;
}
.color-swatch.natural { background: #d4a574; }
.color-swatch.brown { background: #8b6f47; }
.color-swatch.grey { background: #9ca3af; }
.color-swatch.darks { background: #374151; }

.color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 10px 4px;
    text-align: center;
    font-size: 11px;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.color-option input[type="checkbox"] {
    display: none;
}

.color-option:hover .color-swatch {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.color-option.active .color-swatch {
    transform: scale(1.15);
    border: 3px solid #0B2341;
    box-shadow: 0 2px 8px rgba(11, 35, 65, 0.3);
}

.color-option.active span {
    color: #0B2341;
    font-weight: 600;
}

.color-filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

/* Price Range Slider */
.price-range-container {
    padding: 4px 0;
}

.price-range-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.price-value {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #0B2341;
    min-width: 70px;
    text-align: center;
}

.price-separator {
    color: #9ca3af;
    font-size: 13px;
    font-weight: 500;
}

.price-slider-track {
    position: relative;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin: 8px 0 20px;
}

.price-slider-range {
    position: absolute;
    height: 100%;
    background: #0B2341;
    border-radius: 3px;
}

.price-slider-track input[type="range"] {
    position: absolute;
    width: 100%;
    height: 6px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    top: 0;
    margin: 0;
}

.price-slider-track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #0B2341;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.price-slider-track input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transform: scale(1.1);
}

.price-slider-track input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #0B2341;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.price-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.price-preset {
    padding: 5px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.price-preset:hover {
    border-color: #0B2341;
    color: #0B2341;
}

.price-preset.active {
    background: #0B2341;
    border-color: #0B2341;
    color: white;
}

/* Filter Toggle Button - Original (hidden) */
.filter-toggle-btn {
    display: none !important;
}

/* Inline Filter Toggle Button */
.filter-toggle-btn-inline {
    background: none !important;
    color: #374151 !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-right: 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    visibility: visible !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.filter-toggle-btn-inline:hover {
    color: #0B2341 !important;
    background: none !important;
}

.filter-toggle-btn-inline:focus,
.filter-toggle-btn-inline:active,
.filter-toggle-btn-inline:focus-visible,
#filterToggle:focus,
#filterToggle:active,
#filterToggle:focus-visible {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    background: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.filter-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    background-image: url('/images/icon/funnel-tool.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Main Content */
.collection-main {
    flex: 1;
    transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100%;
}

.collection-main.sidebar-open {
    margin-left: 360px;
}

/* Filter Overlay */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

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

/* Filter Controls (bottom bar) */
.filter-controls {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.filter-clear {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-clear:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.filter-apply {
    flex: 2;
    padding: 12px 16px;
    border: none;
    background: #0B2341;
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-apply:hover {
    background: #0a1f35;
}

/* Active filter count in button */
.filter-active-count {
    display: none;
    align-items: center;
    justify-content: center;
    background: #0B2341;
    color: white;
    font-size: 11px;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-left: 8px;
}

.filter-active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0B2341;
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-left: 6px;
}

/* Section Toggle (collapsible) */
.filter-section-toggle {
    width: 100%;
    padding: 12px 0;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: #0B2341;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 8px;
}

.filter-section-toggle:hover {
    color: #1a1a1a;
}

.filter-section-toggle:focus {
    outline: none;
}

.toggle-arrow {
    font-size: 10px;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.filter-options-wrapper {
    display: none;
    padding-top: 4px;
}

.filter-options-wrapper.open {
    display: block;
}

.filter-option-hidden {
    display: none !important;
}

.filter-show-more {
    background: none;
    border: none;
    color: #0B2341;
    font-size: 13px;
    cursor: pointer;
    padding: 8px 0;
    font-weight: 500;
}

.filter-show-more:hover {
    text-decoration: underline;
}

/* Dropdown Styles */
.filter-dropdown-container {
    margin-left: 8px;
}

.filter-dropdown-button-container {
    margin-top: 12px;
    position: relative;
}

.filter-dropdown-button {
    width: 100%;
    padding: 8px 0;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.filter-dropdown-button:hover,
.filter-dropdown-button:focus {
    background: transparent;
    outline: none;
}

.dropdown-text {
    font-weight: 500;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
    font-size: 12px;
    color: #6b7280;
}

.filter-dropdown-button.open .dropdown-arrow {
    transform: rotate(180deg);
}

.filter-dropdown-menu {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 1002;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    margin-top: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-dropdown-menu::-webkit-scrollbar {
    display: none;
}

.filter-dropdown-menu.open {
    display: block;
}

.filter-dropdown-item {
    padding: 8px 0;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: none;
}

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

.filter-dropdown-item:hover {
    background: transparent;
    color: #374151;
}

.filter-dropdown-item.active {
    background: transparent;
    color: #0B2341;
    font-weight: 600;
}

.filter-dropdown-item.active:hover {
    background: transparent;
    color: #0a1f35;
}

.filter-dropdown {
    width: 100%;
    padding: 8px 12px;
    background: white;
    border: none;
    border-radius: 4px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

.filter-dropdown:focus {
    outline: 2px solid #0B2341;
    outline-offset: 1px;
}

/* Collection Section Headers */
.collection-section-badge {
    display: inline-block;
    background: #0B2341;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.collection-section-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    padding: 16px 0 8px;
    border-bottom: 2px solid #0B2341;
    margin-bottom: 8px;
    margin-top: 16px;
}

.collection-section-header:first-child {
    margin-top: 0;
}

.collection-section-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #0B2341;
}

.collection-section-link {
    text-decoration: none;
    color: inherit;
}

.collection-section-link:hover h2 {
    color: #2563eb;
    text-decoration: underline;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results h3 {
    margin: 0 0 8px;
    color: #374151;
}

.no-results p {
    margin: 0;
    color: #9ca3af;
}

/* Loading states */
.filter-section.loading {
    opacity: 0.6;
    pointer-events: none;
}

.filter-section.loading::after {
    content: 'Loading...';
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
}

/* Active Filter Tags in header bar */
.active-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f0f4f8;
    border: 1px solid #d1d9e6;
    border-radius: 20px;
    font-size: 12px;
    color: #0B2341;
    font-weight: 500;
}

.active-filter-tag .remove-tag {
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    margin-left: 2px;
    line-height: 1;
}

.active-filter-tag .remove-tag:hover {
    color: #dc2626;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .collection-main.sidebar-open {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .filter-sidebar {
        width: 100%;
        left: -100%;
    }

    .filter-sidebar.open {
        left: 0;
    }

    .collection-main.sidebar-open {
        margin-left: 0;
    }

    .filter-sidebar-content {
        padding: 0 20px 20px;
        padding-bottom: 100px;
    }
}

@media (max-width: 480px) {
    .filter-sidebar-content {
        padding: 0 16px 16px;
        padding-bottom: 100px;
    }

    .filter-section {
        padding: 16px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .filter-sidebar,
    .collection-main,
    .filter-toggle-btn,
    .filter-overlay {
        transition: none;
    }
}

.filter-option input[type="checkbox"]:focus {
    outline: 2px solid #0B2341;
    outline-offset: 2px;
}

.filter-toggle-btn:focus {
    outline: 2px solid #0B2341;
    outline-offset: 2px;
}
