/* Store Filters Styles - Matching Design */

/* Main Filters Container */
.store-filters-container {
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1000;
}

/* Filters Bar - Horizontal Layout - CENTERED */
.store-filters-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 16px;
    max-width: 100%;
    overflow: visible;
    padding: 4px 0;
    justify-content: center;
    position: relative;
}

/* Filter Dropdown Container */
.filter-dropdown {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    z-index: 1001;
}

/* When dropdown is open, give it higher z-index */
.filter-dropdown.open {
    z-index: 9999;
}

/* Filter Button Styling - Matching Design */
.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-family: inherit;
    height: 36px;
    position: relative;
    z-index: 1;
}

.filter-btn:hover {
    border-color: #999;
    background: #FAFAFA;
}

.filter-btn.active {
    border-color: #FF4856;
    background: #FFF5F5;
    color: #FF4856;
}

/* Filter Icon - SVG styling */
.filter-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.filter-icon svg {
    width: 16px;
    height: 16px;
}

/* Filter Label */
.filter-label {
    font-weight: 400;
    font-size: 13px;
    color: #333;
}

/* Filter Arrow - Small chevron */
.filter-arrow {
    font-size: 8px;
    color: #666;
    transition: transform 0.2s ease;
    margin-left: 2px;
}

.filter-dropdown.open .filter-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu - FIXED: Using absolute positioning with high z-index */
.filter-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    min-width: 160px;
    background: #fff;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    display: none;
    list-style: none;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
}

.filter-dropdown.open .filter-dropdown-menu {
    display: block;
}

/* Filter Option */
.filter-option {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 13px;
    color: #333;
    background: #fff;
    display: block;
    text-align: left;
}

.filter-option:hover {
    background: #F5F5F5;
}

.filter-option.selected {
    background: #FFF5F5;
    color: #FF4856;
    font-weight: 500;
}

.filter-option:first-child {
    border-radius: 8px 8px 0 0;
}

.filter-option:last-child {
    border-radius: 0 0 8px 8px;
}

/* Toggle Filter Styles - Matching Design */
.filter-toggle {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    transition: all 0.2s ease;
    position: relative;
    height: 36px;
}

.toggle-label:hover {
    border-color: #999;
    background: #FAFAFA;
}

.toggle-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toggle-icon svg {
    width: 16px;
    height: 16px;
}

.toggle-text {
    font-weight: 400;
    font-size: 13px;
}

/* Toggle Slider - Smaller, matching design */
.toggle-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    background: #D0D0D0;
    border-radius: 18px;
    transition: all 0.3s ease;
    margin-left: 6px;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: #4CAF50;
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(14px);
}

.toggle-label:has(input:checked) {
    border-color: #4CAF50;
    background: #E8F5E9;
}

/* Results Count - Centered below filters */
.store-results-count {
    padding: 14px 0 0 0;
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-top: 0;
}

#store-count-display {
    font-weight: 600;
    color: #333;
}

/* Mobile Responsive Styles */
@media (max-width: 1200px) {
    .store-filters-bar {
        justify-content: flex-start;
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 768px) {
    .store-filters-container {
        padding: 12px 0;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        /* Hide scrollbar across browsers */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }

    .store-filters-container::-webkit-scrollbar {
        display: none; /* Chrome/Safari/Opera */
    }

    .store-filters-bar {
        gap: 10px;
        justify-content: flex-start;
        padding-left: 16px;
        padding-right: 16px;
        width: max-content;
        overflow: visible;
    }

    .filter-btn,
    .toggle-label {
        padding: 6px 12px;
        font-size: 12px;
        height: 32px;
    }

    .filter-icon,
    .toggle-icon {
        width: 14px;
        height: 14px;
    }

    .filter-icon svg,
    .toggle-icon svg {
        width: 14px;
        height: 14px;
    }

    .toggle-slider {
        width: 28px;
        height: 16px;
    }

    .toggle-slider::before {
        width: 12px;
        height: 12px;
    }

    .toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
        transform: translateX(12px);
    }

    .filter-dropdown-menu {
        min-width: 140px;
        position: fixed;
    }

    .filter-option {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Extra Small Screens */
@media (max-width: 480px) {
    .store-filters-bar {
        gap: 8px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .filter-btn,
    .toggle-label {
        padding: 5px 10px;
        font-size: 11px;
        border-radius: 16px;
        height: 30px;
    }

    .filter-label,
    .toggle-text {
        white-space: nowrap;
    }

    .toggle-slider {
        width: 24px;
        height: 14px;
    }

    .toggle-slider::before {
        width: 10px;
        height: 10px;
    }

    .toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
        transform: translateX(10px);
    }
}

/* Animation for dropdown */
@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-dropdown.open .filter-dropdown-menu {
    animation: dropdownFadeIn 0.15s ease;
}

/* Active filter indicator */
.filter-btn.has-filter {
    border-color: #FF4856;
    background: #FFF8F8;
}

.filter-btn.has-filter .filter-label {
    color: #FF4856;
    font-weight: 500;
}
