/* ============================================
   CLEAN MINIMAL DESIGN - ALL FEATURES KEPT
   Only visual appearance changed
   ============================================ */

:root {
    --clean-border: #e5e5e5;
    --clean-text: #333;
    --clean-gray: #666;
    --clean-black: #000;
    --clean-bg: #fff;
    --clean-hover: #f5f5f5;
}

/* ============================================
   MAIN CONTAINER
   ============================================ */

.awf-filters-widget {
    background: var(--clean-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.awf-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--clean-border);
}

.awf-filters-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--clean-black);
    margin: 0;
    text-transform: uppercase;
}

.awf-clear-filters {
    background: transparent;
    border: 1px solid var(--clean-border);
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    color: var(--clean-text);
    transition: all 0.2s ease;
}

.awf-clear-filters:hover {
    background: var(--clean-black);
    color: #fff;
    border-color: var(--clean-black);
}

/* ============================================
   FILTER GROUPS - CLEAN SECTIONS
   ============================================ */

.awf-filter-group {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--clean-border);
}

.awf-filter-group:last-child {
    border-bottom: none;
}

.awf-filter-heading {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--clean-black);
    margin: 0 0 15px 0;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.awf-toggle-icon {
    width: 10px;
    height: 10px;
    border: solid var(--clean-text);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.awf-filter-heading.active .awf-toggle-icon {
    transform: rotate(-135deg);
}

/* Also support collapsed state via parent */
.awf-filter-group.awf-collapsed .awf-toggle-icon {
    transform: rotate(45deg);
}

.awf-filter-group:not(.awf-collapsed) .awf-toggle-icon {
    transform: rotate(-135deg);
}

.awf-filter-options {
    margin-top: 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

/* Expanded state - JS will set max-height dynamically */
.awf-filter-group:not(.awf-collapsed) .awf-filter-options {
    /* max-height will be set by JS based on content */
}

/* ============================================
   CATEGORIES & BASIC FILTERS - SIMPLE LIST
   ============================================ */

.awf-filter-option {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.awf-filter-option:hover {
    background: var(--clean-hover);
    margin: 0 -5px;
    padding-left: 5px;
    padding-right: 5px;
}

.awf-filter-checkbox {
    width: 16px;
    height: 16px;
    margin: 0 10px 0 0;
    cursor: pointer;
    accent-color: var(--clean-black);
}

.awf-filter-label {
    flex: 1;
    font-size: 14px;
    color: var(--clean-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.awf-filter-count {
    font-size: 13px;
    color: var(--clean-gray);
    margin-left: 8px;
}

/* ============================================
   PRICE FILTER - SIMPLE CLEAN SLIDER
   ============================================ */

.awf-glassmorphic-slider {
    background: transparent;
    padding: 15px 12px; /* Added horizontal padding to prevent thumb clipping */
}

.awf-price-values {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.awf-price-box {
    flex: 1;
    text-align: center;
    padding: 12px;
    border: 1px solid var(--clean-border);
    background: var(--clean-bg);
}

.awf-price-label {
    font-size: 11px;
    color: var(--clean-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.awf-price-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--clean-black);
}

.awf-range-slider {
    position: relative;
    height: 50px;
    overflow: visible; /* Ensure thumbs aren't clipped */
}

.awf-slider-track {
    position: absolute;
    top: 50%;
    left: 10px; /* Half of 20px thumb width */
    right: 10px; /* Half of 20px thumb width */
    height: 8px;
    background: var(--clean-border);
    transform: translateY(-50%);
    border-radius: 4px;
    z-index: 1;
}

.awf-slider-range {
    position: absolute;
    top: 0;
    left: 0; /* Will be set by JS */
    width: 100%; /* Will be set by JS */
    height: 100%;
    background: var(--clean-black);
    border-radius: 4px;
    transition: none; /* Remove lag - line moves with thumb instantly */
    z-index: 2;
    pointer-events: none;
}

.awf-range-input {
    position: absolute;
    width: 100%;
    height: 50px; /* Match container height */
    top: 0;
    left: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 3; /* Above track and range fill */
}

.awf-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px; /* Increased from 16px */
    height: 20px;
    border-radius: 50%;
    background: var(--clean-black);
    cursor: pointer;
    pointer-events: all;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    margin-top: -4px; /* Center with 8px track: (20px - 8px) / 2 = 6px */
}

.awf-range-input::-moz-range-thumb {
    width: 20px; /* Increased from 16px */
    height: 20px;
    border-radius: 50%;
    background: var(--clean-black);
    cursor: pointer;
    pointer-events: all;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Firefox track reset - hide default track */
.awf-range-input::-moz-range-track {
    background: transparent;
    border: none;
}

.awf-range-input::-moz-range-progress {
    background: transparent;
}

/* ============================================
   COLOR FILTER - CIRCULAR SWATCHES
   ============================================ */

.awf-color-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.awf-color-option {
    display: flex;
    align-items: center;
    padding: 5px 0;
    cursor: pointer;
}

.awf-color-option .awf-filter-checkbox {
    display: none;
}

.awf-color-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid var(--clean-border);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.awf-color-option:hover .awf-color-swatch {
    border-color: var(--clean-text);
    transform: scale(1);
}

.awf-color-option .awf-filter-checkbox:checked ~ .awf-filter-label .awf-color-swatch {
    border-color: var(--clean-black);
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.awf-color-name {
    font-size: 14px;
    color: var(--clean-text);
}


/* ============================================
   BRAND FILTER - CLEAN GRID WITH LOGOS
   ============================================ */

.awf-brand-search-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.awf-brand-search {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--clean-border);
    border-radius: 0;
    font-size: 13px;
    color: var(--clean-text);
    background: var(--clean-bg);
    outline: none;
    transition: border-color 0.2s ease;
}

.awf-brand-search:focus {
    border-color: var(--clean-black);
}

.awf-brand-search::placeholder {
    color: var(--clean-gray);
    font-size: 13px;
}

.awf-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--clean-gray);
    pointer-events: none;
}

.awf-brand-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px; /* ✅ Increased gap to prevent cut-off */
    margin-top: 15px;
}

.awf-brand-item {
    cursor: pointer;
    display: block;
    margin: 0;
    transition: all 0.2s ease;
}

.awf-brand-checkbox {
    display: none;
}

.awf-brand-logo-wrapper {
    border: 2px solid var(--clean-border); /* ✅ Always 2px to prevent layout shift */
    padding: 20px 15px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--clean-bg);
    transition: all 0.2s ease;
    position: relative;
}

.awf-brand-item:hover .awf-brand-logo-wrapper {
    border-color: var(--clean-text);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* ✅ Fixed selected state - no border width change */
.awf-brand-checkbox:checked + .awf-brand-logo-wrapper {
    border-color: var(--clean-black);
    background: #fafafa;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1); /* ✅ Reduced shadow */
}

.awf-brand-item.awf-selected .awf-brand-logo-wrapper {
    border-color: var(--clean-black);
    background: #fafafa;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1); /* ✅ Reduced shadow */
}

.awf-brand-logo {
    max-width: 100%;
    max-height: 45px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(0);
    transition: filter 0.2s ease;
}

.awf-brand-item:hover .awf-brand-logo {
    filter: grayscale(0);
}

.awf-brand-text-logo {
    font-size: 13px;
    font-weight: 600;
    color: var(--clean-text);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.awf-brand-count {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--clean-black);
    color: #fff;
    padding: 3px 7px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.awf-brand-no-results {
    text-align: center;
    padding: 30px 20px;
    color: var(--clean-gray);
    font-size: 13px;
    background: var(--clean-hover);
    border: 1px solid var(--clean-border);
    margin-top: 10px;
}

.awf-brand-item.awf-hidden {
    display: none;
}

/* ============================================
   TAGS FILTER - CLEAN PILLS
   ============================================ */

.awf-tags-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.awf-tag-option {
    margin: 0;
}

.awf-tag-option .awf-filter-checkbox {
    display: none;
}

.awf-tag-label {
    display: inline-block;
    padding: 6px 12px;
    background: var(--clean-bg);
    border: 1px solid var(--clean-border);
    border-radius: 3px;
    font-size: 13px;
    color: var(--clean-text);
    transition: all 0.2s ease;
    cursor: pointer;
}

.awf-tag-option:hover .awf-tag-label {
    border-color: var(--clean-text);
}

.awf-tag-option .awf-filter-checkbox:checked + .awf-filter-label,
.awf-tag-option .awf-filter-checkbox:checked ~ .awf-tag-label {
    background: var(--clean-black);
    color: #fff;
    border-color: var(--clean-black);
}

/* ============================================
   RATING FILTER - CLEAN STARS
   ============================================ */

.awf-rating-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.awf-rating-option {
    display: flex;
    align-items: center;
    padding: 5px 0;
}

.awf-rating-option .awf-filter-checkbox {
    width: 16px;
    height: 16px;
    margin-right: 10px;
}

.awf-rating-stars {
    display: inline-flex;
    gap: 2px;
    margin-right: 8px;
}

.awf-star {
    font-size: 14px;
}

.awf-star-filled {
    color: #ffa500;
}

.awf-star-empty {
    color: #ddd;
}

.awf-rating-text {
    font-size: 14px;
    color: var(--clean-text);
}

/* ============================================
   SORT SELECT - CLEAN DROPDOWN
   ============================================ */

.awf-sort-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--clean-border);
    background: var(--clean-bg);
    font-size: 14px;
    color: var(--clean-text);
    cursor: pointer;
    outline: none;
}

.awf-sort-select:focus {
    border-color: var(--clean-text);
}

/* ============================================
   APPLY BUTTON - CLEAN BLACK BUTTON
   ============================================ */

.awf-filter-actions {
    margin-top: 20px;
}

.awf-apply-filters {
    width: 100%;
    padding: 12px;
    background: var(--clean-black);
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.awf-apply-filters:hover {
    background: #333;
}

/* ============================================
   ACTIVE FILTERS DISPLAY
   ============================================ */

.awf-active-filters {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid var(--clean-border);
}

.awf-active-filters-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--clean-black);
    margin: 0 0 10px 0;
}

.awf-active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ============================================
   LOADER - SIMPLE SPINNER
   ============================================ */

.awf-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.awf-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--clean-border);
    border-top-color: var(--clean-black);
    border-radius: 50%;
    animation: awf-spin 0.8s linear infinite;
}

@keyframes awf-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   CRITICAL: RESPONSIVE MOBILE ISOLATION
   MANDATORY COMPLIANCE RULE
   ============================================ */

/* ✅ DESKTOP: Hide mobile trigger on desktop */
@media (min-width: 769px) {
    .awf-mobile-trigger-wrapper {
        display: none !important;
    }
    
    .awf-mobile-bottom-sheet {
        display: none !important;
    }
}

/* ✅ MOBILE: Hide desktop filters, show only mobile bottom sheet */
@media (max-width: 768px) {
    /* CRITICAL: Hide desktop filters on mobile to prevent duplicates */
    .awf-filters-widget:not(.awf-mobile-sheet-content .awf-filters-widget) {
        display: none !important;
    }
    
    /* Show filters ONLY when inside mobile bottom sheet */
    .awf-mobile-sheet-content .awf-filters-widget {
        display: block !important;
        padding: 0;
    }
    
    /* Ensure mobile trigger is visible */
    .awf-mobile-trigger-wrapper {
        display: block !important;
    }

    /* Adjust filter groups for mobile */
    .awf-mobile-sheet-content .awf-filter-group {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .awf-mobile-sheet-content .awf-brand-grid {
        gap: 8px;
    }

    .awf-mobile-sheet-content .awf-brand-logo-wrapper {
        padding: 15px 10px;
        min-height: 60px;
    }

    .awf-mobile-sheet-content .awf-brand-logo {
        max-height: 35px;
    }

    .awf-mobile-sheet-content .awf-color-swatch {
        width: 26px;
        height: 26px;
    }
    
    /* Hide desktop-specific elements in mobile view */
    .awf-mobile-sheet-content .awf-filter-actions {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .awf-mobile-sheet-content .awf-brand-grid {
        grid-template-columns: 1fr;
    }

    .awf-mobile-sheet-content .awf-filters-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* ============================================
   UTILITIES & FIXES
   ============================================ */

.awf-filters-widget * {
    box-sizing: border-box;
}

/* Clean scrollbars */
.awf-filter-options::-webkit-scrollbar {
    width: 4px;
}

.awf-filter-options::-webkit-scrollbar-track {
    background: transparent;
}

.awf-filter-options::-webkit-scrollbar-thumb {
    background: var(--clean-border);
    border-radius: 2px;
}

.awf-filter-options::-webkit-scrollbar-thumb:hover {
    background: var(--clean-text);
}