/* ============================================================================
   MODERN E-COMMERCE FILTER - Premium Design
   ============================================================================ */

/* ===== FILTER CONTAINER ===== */
.store-filter-container {
    width: min(94%, 1400px);
    margin: 0 auto 32px;
    padding: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== FILTER BAR (Desktop) ===== */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 28px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(22, 20, 93, 0.08), 0 1px 4px rgba(22, 20, 93, 0.04);
    border: 1px solid rgba(22, 20, 93, 0.06);
    position: relative;
    overflow: visible;
}

.filter-group-left {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    flex: 1;
}

.filter-group-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ===== SEARCH INPUT ===== */
.filter-search-wrapper {
    position: relative;
    min-width: 260px;
    flex: 1;
    max-width: 360px;
}

.filter-search-input {
    width: 100%;
    padding: 14px 20px 14px 52px;
    border: 2px solid transparent;
    border-radius: 50px;
    font-family: var(--body_font);
    font-size: 0.95rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #f8f9fc 0%, #f0f2f8 100%);
    color: var(--dark-blue);
    font-weight: 500;
}

.filter-search-input::placeholder {
    color: #8a8a9a;
    font-weight: 400;
}

.filter-search-input:hover {
    background: linear-gradient(135deg, #f5f6fa 0%, #eceef5 100%);
    box-shadow: 0 2px 12px rgba(22, 20, 93, 0.08);
}

.filter-search-input:focus {
    background: #ffffff;
    border-color: var(--dark-blue);
    outline: none;
    box-shadow: 0 0 0 4px rgba(22, 20, 93, 0.1), 0 4px 16px rgba(22, 20, 93, 0.12);
}

.filter-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #8a8a9a;
    pointer-events: none;
    font-size: 1.1rem;
    transition: all 0.25s ease;
}

.filter-search-wrapper:focus-within .filter-search-icon {
    color: var(--dark-blue);
    transform: translateY(-50%) scale(1.1);
}

/* ===== FILTER PILLS (Dropdowns) ===== */
.filter-dropdown {
    position: relative;
}

.filter-select {
    padding: 12px 44px 12px 20px;
    appearance: none;
    background: linear-gradient(135deg, #f8f9fc 0%, #f0f2f8 100%);
    border: 2px solid transparent;
    border-radius: 50px;
    font-family: var(--body_font);
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--dark-blue);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    white-space: nowrap;
    min-width: 120px;
    text-align: left;
}

.filter-select:hover {
    background: linear-gradient(135deg, #f5f6fa 0%, #eceef5 100%);
    box-shadow: 0 2px 12px rgba(22, 20, 93, 0.08);
    transform: translateY(-1px);
}

.filter-select:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--dark-blue);
    box-shadow: 0 0 0 4px rgba(22, 20, 93, 0.1), 0 4px 16px rgba(22, 20, 93, 0.12);
}

.filter-dropdown::after {
    content: '';
    position: absolute;
    right: 18px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--dark-blue);
    border-bottom: 2px solid var(--dark-blue);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
    transition: transform 0.25s ease;
    opacity: 0.6;
}

.filter-dropdown:hover::after {
    opacity: 1;
}

.filter-select:focus ~ .filter-dropdown::after,
.filter-dropdown:focus-within::after {
    transform: translateY(-35%) rotate(-135deg);
}

/* ===== RESET BUTTON ===== */
.filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #777;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.25s ease;
    padding: 10px 16px;
    border-radius: 50px;
    font-family: var(--medium_font);
    white-space: nowrap;
    font-weight: 500;
}

.filter-reset::before {
    content: '✕';
    font-size: 0.75rem;
    opacity: 0.7;
}

.filter-reset:hover {
    color: var(--dark-blue);
    background: rgba(22, 20, 93, 0.06);
}

.filter-reset:active {
    transform: scale(0.96);
}

/* ===== ACTIVE FILTER STATES ===== */
.filter-select.active-filter {
    background: linear-gradient(135deg, #16145d 0%, #25239a 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(22, 20, 93, 0.3);
}

.filter-select.active-filter:hover {
    background: linear-gradient(135deg, #1a1870 0%, #2b2aa8 100%);
    box-shadow: 0 6px 20px rgba(22, 20, 93, 0.35);
    transform: translateY(-2px);
}

/* IMPORTANT: Keep dropdown options always readable (dark text on light background) */
.filter-select option {
    background: #ffffff;
    color: #333333;
    font-weight: 500;
    padding: 8px 12px;
}

.filter-select.active-filter option {
    background: #ffffff;
    color: var(--dark-blue, #16145d);
}

.filter-dropdown:has(.active-filter)::after {
    border-color: #ffffff;
    opacity: 1;
}

.filter-search-input.active-filter {
    background: #ffffff;
    border-color: var(--dark-blue);
    box-shadow: 0 0 0 3px rgba(22, 20, 93, 0.1);
}

/* ===== ACTIVE FILTERS CHIPS ROW ===== */
.active-filters-row {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 4px;
    animation: fadeSlideIn 0.3s ease;
}

.active-filters-row.visible {
    display: flex;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #16145d 0%, #25239a 100%);
    color: #ffffff;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(22, 20, 93, 0.25);
    animation: chipPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chipPop {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.filter-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.7rem;
}

.filter-chip-remove:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

/* ===== RESULTS COUNT ===== */
.filter-results-count {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    padding: 0 8px;
}

.filter-results-count strong {
    color: var(--dark-blue);
    font-weight: 700;
}

/* ===== NO RESULTS MESSAGE ===== */
.no-results-message {
    text-align: center;
    padding: 60px 24px;
    width: 100%;
    display: none;
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f8f9fc 0%, #ffffff 100%);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(22, 20, 93, 0.06);
}

.no-results-message p {
    font-size: 1.15rem;
    color: #555;
    font-family: var(--medium_font);
    margin-bottom: 16px;
}

.no-results-message .reset-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--dark-blue);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.no-results-message .reset-link:hover {
    text-decoration: underline;
}

/* ============================================================================
   MOBILE FILTER - Slide-up Drawer Style
   ============================================================================ */

/* Mobile Filter Toggle Button */
.filter-toggle-mobile {
    display: none;
    width: 100%;
    padding: 16px 24px;
    background: #ffffff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(22, 20, 93, 0.08);
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-toggle-mobile:active {
    transform: scale(0.98);
}

.filter-toggle-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.filter-toggle-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-toggle-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #16145d 0%, #25239a 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.filter-toggle-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-blue);
}

.filter-toggle-count {
    background: linear-gradient(135deg, #16145d 0%, #25239a 100%);
    color: #fff;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

.filter-toggle-arrow {
    font-size: 1.2rem;
    color: var(--dark-blue);
    transition: transform 0.3s ease;
}

/* Mobile Filter Drawer */
.filter-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
    overflow: hidden;
}

.filter-drawer-overlay.visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.filter-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    z-index: 9999;
    max-height: 80vh;
    overflow: hidden;
    overflow-x: hidden;
    transform: translateY(100%);
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.35s ease;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.filter-drawer.open {
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.filter-drawer-handle {
    width: 100%;
    padding: 12px;
    display: flex;
    justify-content: center;
    cursor: grab;
    flex-shrink: 0;
}

.filter-drawer-handle::before {
    content: '';
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 4px;
}

.filter-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px clamp(18px, 4vw, 24px) clamp(12px, 2vh, 20px);
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.filter-drawer-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-blue);
}

.filter-drawer-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    color: #666;
    transition: all 0.2s ease;
}

.filter-drawer-close:hover {
    background: #eee;
    color: var(--dark-blue);
}

.filter-drawer-content {
    padding: clamp(16px, 3vh, 24px);
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
}

.filter-drawer-section {
    margin-bottom: clamp(14px, 3vh, 24px);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.filter-drawer-section:last-child {
    margin-bottom: 0;
}

.filter-drawer-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: clamp(6px, 1.5vh, 10px);
    display: block;
}

.filter-drawer .filter-search-input,
.filter-drawer .filter-select {
    width: 100%;
    max-width: 100%;
    padding: clamp(12px, 2vh, 16px) 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    border: 2px solid #eee;
    background: #fafafa;
    box-sizing: border-box;
}

.filter-drawer .filter-search-input {
    padding-left: 48px;
}

.filter-drawer .filter-select {
    padding-right: 44px;
}

.filter-drawer .filter-dropdown::after {
    right: 20px;
}

.filter-drawer-footer {
    padding: clamp(14px, 2vh, 20px) clamp(18px, 4vw, 24px);
    padding-bottom: calc(clamp(14px, 2vh, 20px) + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    background: #fafafa;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.filter-drawer-reset {
    flex: 1;
    padding: clamp(12px, 2vh, 16px);
    background: transparent;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-drawer-reset:hover {
    border-color: var(--dark-blue);
    color: var(--dark-blue);
}

.filter-drawer-apply {
    flex: 2;
    padding: clamp(12px, 2vh, 16px);
    background: linear-gradient(135deg, #16145d 0%, #25239a 100%);
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(22, 20, 93, 0.3);
}

.filter-drawer-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(22, 20, 93, 0.4);
}

/* ============================================================================
   RESPONSIVE STYLES
   ============================================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .store-filter-container {
        width: min(96%, 1400px);
    }
    
    .filter-bar {
        padding: 16px 20px;
        gap: 12px;
    }
    
    .filter-search-wrapper {
        min-width: 200px;
    }
    
    .filter-select {
        min-width: 110px;
        padding: 10px 38px 10px 16px;
        font-size: 0.85rem;
    }
    
    .filter-dropdown::after {
        right: 14px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .store-filter-container {
        width: calc(100% - 32px);
        margin: 0 16px 24px;
        max-width: 100%;
        overflow: hidden;
    }
    
    /* Hide desktop filter bar */
    .filter-bar {
        display: none;
    }
    
    /* Show mobile toggle */
    .filter-toggle-mobile {
        display: block;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Active filters row adjustments */
    .active-filters-row {
        padding: 12px 0 0;
        max-width: 100%;
        overflow-x: auto;
    }
    
    .filter-chip {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .store-filter-container {
        width: calc(100% - 24px);
        margin: 0 12px 20px;
    }
    
    .filter-toggle-mobile {
        padding: 12px 16px;
        border-radius: 12px;
    }
    
    .filter-toggle-icon {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }
    
    .filter-toggle-text {
        font-size: 0.9rem;
    }
    
    .filter-drawer {
        max-height: 88vh;
    }
    
    .filter-drawer-content {
        padding: 14px 16px;
    }
    
    .filter-drawer-section {
        margin-bottom: 12px;
    }
    
    .filter-drawer-label {
        font-size: 0.7rem;
        margin-bottom: 6px;
    }
    
    .filter-drawer .filter-search-input,
    .filter-drawer .filter-select {
        padding: 11px 14px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .filter-drawer .filter-search-input {
        padding-left: 42px;
    }
    
    .filter-drawer .filter-select {
        padding-right: 38px;
    }
    
    .filter-drawer .filter-search-icon {
        left: 14px;
    }
    
    .filter-drawer .filter-dropdown::after {
        right: 14px;
    }
    
    .filter-drawer-footer {
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        flex-direction: row;
        gap: 8px;
    }
    
    .filter-drawer-reset {
        flex: 1;
        padding: 12px 10px;
        font-size: 0.9rem;
    }
    
    .filter-drawer-apply {
        flex: 1.5;
        padding: 12px 10px;
        font-size: 0.9rem;
    }
}

/* Extra small / short screens */
@media (max-height: 600px) {
    .filter-drawer {
        max-height: 90vh;
    }
    
    .filter-drawer-handle {
        padding: 8px;
    }
    
    .filter-drawer-header {
        padding: 2px 18px 10px;
    }
    
    .filter-drawer-title {
        font-size: 1rem;
    }
    
    .filter-drawer-content {
        padding: 12px 16px;
    }
    
    .filter-drawer-section {
        margin-bottom: 10px;
    }
    
    .filter-drawer-label {
        font-size: 0.65rem;
        margin-bottom: 4px;
    }
    
    .filter-drawer .filter-search-input,
    .filter-drawer .filter-select {
        padding: 10px 12px;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    
    .filter-drawer .filter-search-input {
        padding-left: 38px;
    }
    
    .filter-drawer-footer {
        padding: 10px 16px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }
    
    .filter-drawer-reset,
    .filter-drawer-apply {
        padding: 10px 8px;
        font-size: 0.85rem;
        border-radius: 10px;
    }
}

/* ===== ANIMATIONS ===== */
@media (prefers-reduced-motion: no-preference) {
    .filter-select,
    .filter-search-input,
    .filter-reset,
    .filter-chip {
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
}
