/**
 * ============================================
 * PREMIUM SHOP FILTERS - INTERNATIONAL LEVEL
 * Modern ecommerce filter design inspired by
 * Amazon, Sephora, and other top platforms
 * ============================================
 */

/* ==========================================
   PAGE HEADER
   ========================================== */
.page-header {
    background: linear-gradient(135deg, #f5f5f0 0%, #ffffff 100%);
    padding: 60px 0 40px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.page-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #222;
    letter-spacing: -0.5px;
}

.breadcrumb {
    justify-content: center;
    background: transparent;
    margin: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #2c5f2d;
    text-decoration: underline;
}

/* ==========================================
   MOBILE FILTER TOGGLE
   ========================================== */
.mobile-filter-toggle {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(44, 95, 45, 0.2);
    border: none;
    background: linear-gradient(135deg, var(--primary-color), #5cb860);
    color: white;
    transition: all 0.3s ease;
}

.mobile-filter-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 95, 45, 0.3);
}

/* ==========================================
   FILTER OVERLAY
   ========================================== */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   PREMIUM FILTER SIDEBAR
   ========================================== */
.premium-filter-sidebar {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-filter-sidebar:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   FILTER HEADER
   ========================================== */
.filter-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(to bottom, #ffffff, #fafafa);
    position: relative;
}

.filter-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-main-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-main-title i {
    color: var(--primary-color);
    font-size: 18px;
}

.btn-reset-all {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: white;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-reset-all:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateX(-2px);
}

.btn-close-filter {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.btn-close-filter:hover {
    background: #ff4757;
    border-color: #ff4757;
    color: white;
    transform: translateY(-50%) rotate(90deg);
}

/* ==========================================
   ACTIVE FILTERS SIDEBAR
   ========================================== */
.active-filters-sidebar {
    padding: 0 24px 16px;
    display: none;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    flex-wrap: wrap;
}

.active-filters-sidebar.has-filters {
    display: flex;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-color), #5cb860);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin: 4px;
    transition: all 0.3s ease;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.filter-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 95, 45, 0.3);
}

.filter-tag .remove-filter {
    cursor: pointer;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.3s ease;
}

.filter-tag .remove-filter:hover {
    background: white;
    color: var(--primary-color);
    transform: scale(1.1);
}

.clear-all-filters {
    display: inline-block;
    margin: 8px 4px 4px;
    color: #ff4757;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-all-filters:hover {
    color: #ff3838;
    text-decoration: underline;
}

/* ==========================================
   FILTER SCROLL CONTAINER
   ========================================== */
.filter-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.filter-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.filter-scroll-container::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.filter-scroll-container::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.filter-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ==========================================
   FILTER SECTIONS
   ========================================== */
.filter-section {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s ease;
}

.filter-section:hover {
    background: #fafafa;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section-header {
    padding: 16px 24px;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.filter-section-header:hover {
    background: rgba(44, 95, 45, 0.03);
}

.filter-section-header:active {
    background: rgba(44, 95, 45, 0.05);
}

.filter-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #2a2a2a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-section-title i {
    color: var(--primary-color);
    font-size: 14px;
}

.filter-toggle-icon {
    color: #999;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.filter-section-header[aria-expanded="false"] .filter-toggle-icon {
    transform: rotate(0deg);
}

.filter-section-header[aria-expanded="true"] .filter-toggle-icon {
    transform: rotate(180deg);
}

.filter-section-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.filter-section-content.collapse {
    max-height: 0;
}

.filter-section-content.collapse.show {
    max-height: 1000px;
}

/* ==========================================
   FILTER SEARCH BOX
   ========================================== */
.filter-search-box {
    padding: 12px 24px 8px;
    position: relative;
}

.filter-search-input {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.filter-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

.filter-search-box i {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    pointer-events: none;
}

/* ==========================================
   FILTER OPTIONS
   ========================================== */
.filter-options {
    padding: 8px 24px 16px;
}

.filter-option {
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.filter-option.hidden {
    display: none;
}

/* Custom Checkbox Label */
.filter-checkbox-label,
.filter-radio-label {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    position: relative;
}

.filter-checkbox-label:hover,
.filter-radio-label:hover {
    background: rgba(44, 95, 45, 0.05);
}

/* Hide default checkbox/radio */
.filter-checkbox,
.filter-radio {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

/* Custom Checkmark */
.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d0d0d0;
    border-radius: 5px;
    margin-right: 12px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
    background: white;
}

.filter-checkbox:checked ~ .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-checkbox:checked ~ .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    color: white;
    font-size: 11px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Custom Radio Mark */
.radio-mark {
    width: 20px;
    height: 20px;
    border: 2px solid #d0d0d0;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
    background: white;
}

.filter-radio:checked ~ .radio-mark {
    border-color: var(--primary-color);
}

.filter-radio:checked ~ .radio-mark::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Filter Label Text */
.filter-label-text {
    flex: 1;
    font-size: 14px;
    color: #444;
    font-weight: 500;
}

/* Filter Count Badge */
.filter-count {
    font-size: 12px;
    color: #999;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f5f5f5;
    margin-left: auto;
    transition: all 0.3s ease;
}

.filter-checkbox:checked ~ .filter-count,
.filter-radio:checked ~ .filter-count {
    background: rgba(44, 95, 45, 0.1);
    color: var(--primary-color);
}

/* ==========================================
   PRICE RANGE FILTER
   ========================================== */
.price-range-container {
    padding: 12px 24px 16px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.price-input-group {
    flex: 1;
}

.price-input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-with-symbol {
    position: relative;
}

.currency-symbol {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-weight: 600;
    font-size: 14px;
}

.price-input {
    width: 100%;
    padding: 10px 12px 10px 28px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
}

.price-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

.price-separator {
    color: #999;
    font-size: 18px;
    font-weight: 300;
    margin-top: 24px;
}

/* Dual Range Slider */
.dual-range-slider {
    position: relative;
    height: 6px;
    margin: 24px 0;
}

.slider-track {
    position: absolute;
    width: 100%;
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
}

.slider-range {
    position: absolute;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), #5cb860);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.slider-thumb {
    position: absolute;
    width: 100%;
    height: 6px;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.slider-thumb::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 12px rgba(44, 95, 45, 0.3);
}

.slider-thumb::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.slider-thumb::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 12px rgba(44, 95, 45, 0.3);
}

.btn-apply-price {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary-color), #5cb860);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.btn-apply-price:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 95, 45, 0.3);
}

/* ==========================================
   SKIN TYPE FILTER
   ========================================== */
.skin-type-label .skin-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 8px;
}

/* ==========================================
   RATING FILTER
   ========================================== */
.rating-options .filter-option {
    margin-bottom: 4px;
}

.rating-stars {
    display: flex;
    gap: 2px;
    margin-right: 8px;
}

.rating-stars i {
    font-size: 14px;
    color: #ffc107;
}

.rating-stars i.far {
    color: #e0e0e0;
}

.rating-text {
    font-size: 14px;
    color: #444;
    font-weight: 500;
    flex: 1;
}

/* ==========================================
   SPECIAL OFFERS FILTER
   ========================================== */
.offer-label .offer-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 4px 0;
}

.offer-badge i {
    font-size: 14px;
}

.offer-badge.new {
    color: #845ef7;
}

.offer-badge.best {
    color: #ff6b6b;
}

.offer-badge.sale {
    color: #f59f00;
}

.offer-badge.featured {
    color: #ffd43b;
}

/* ==========================================
   AVAILABILITY FILTER
   ========================================== */
.availability-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.availability-badge.in-stock {
    color: #51cf66;
}

.availability-badge.out-of-stock {
    color: #ff6b6b;
}

.availability-badge i {
    font-size: 14px;
}

/* ==========================================
   FILTER FOOTER (Mobile)
   ========================================== */
.filter-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    background: white;
}

.btn-apply-filters {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-color), #5cb860);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-apply-filters:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 95, 45, 0.3);
}

/* ==========================================
   SHOP TOOLBAR
   ========================================== */
.shop-toolbar {
    padding: 20px 25px;
    border-radius: 12px;
    background: white;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.result-count {
    font-size: 15px;
    color: #666;
    font-weight: 500;
}

.shop-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.shop-actions .form-select {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.shop-actions .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 991px) {
    .premium-filter-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 360px;
        max-width: 90vw;
        height: 100vh;
        max-height: 100vh;
        z-index: 1000;
        border-radius: 0;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    }
    
    .premium-filter-sidebar.active {
        left: 0;
    }
    
    .btn-close-filter {
        display: flex;
    }
    
    .filter-header {
        flex-wrap: wrap;
    }
    
    .filter-header-content {
        width: 100%;
        padding-right: 50px;
    }
}

@media (max-width: 576px) {
    .premium-filter-sidebar {
        width: 100%;
        max-width: 100vw;
    }
    
    .shop-toolbar {
        padding: 15px;
    }
    
    .shop-toolbar .row {
        gap: 15px;
    }
    
    .result-count {
        font-size: 13px;
    }
    
    .shop-actions .form-select {
        width: 100%;
        font-size: 13px;
    }
    
    .price-inputs {
        flex-direction: column;
        gap: 8px;
    }
    
    .price-separator {
        display: none;
    }
}

/* ==========================================
   LOADING STATES
   ========================================== */
.filter-section.loading {
    opacity: 0.6;
    pointer-events: none;
}

.filter-section.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
