/**
 * 📱 Mobile Bottom Sheet Filters - Styles
 * 
 * Features:
 * - Smooth animations
 * - Touch-friendly sizing
 * - Backdrop overlay
 * - Swipe indicator
 * - Responsive design
 * 
 * @version 1.0.0
 */

/* =====================================
   Mobile Filter Trigger Button
   ===================================== */
.mobile-filter-toggle {
    display: none; /* Hidden on desktop */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 998;
    padding: 14px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.mobile-filter-toggle:active {
    transform: scale(0.95);
}

.mobile-filter-toggle i {
    margin-left: 8px;
}

/* Show on mobile */
@media (max-width: 768px) {
    .mobile-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
}

/* =====================================
   Overlay
   ===================================== */
.mobile-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-filter-overlay.show {
    display: block;
    opacity: 1;
}

/* =====================================
   Bottom Sheet
   ===================================== */
.mobile-filter-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    background: #fff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.mobile-filter-sheet.open {
    display: flex;
    flex-direction: column;
    transform: translateY(0);
}

/* =====================================
   Sheet Handle (Swipe Indicator)
   ===================================== */
.sheet-handle {
    width: 40px;
    height: 5px;
    background: #d1d5db;
    border-radius: 10px;
    margin: 12px auto 8px;
    flex-shrink: 0;
}

/* =====================================
   Sheet Header
   ===================================== */
.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.sheet-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    font-family: 'Cairo', sans-serif;
}

.btn-close-sheet {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    color: #6b7280;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close-sheet:active {
    background: #e5e7eb;
    transform: scale(0.9);
}

/* =====================================
   Sheet Content (Scrollable)
   ===================================== */
.sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar */
.sheet-content::-webkit-scrollbar {
    width: 6px;
}

.sheet-content::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.sheet-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

/* =====================================
   Quick Filter Chips
   ===================================== */
.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.quick-filter-chip {
    padding: 10px 16px;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Cairo', sans-serif;
}

.quick-filter-chip:active {
    transform: scale(0.95);
}

.quick-filter-chip.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #2563eb;
    color: #fff;
}

/* =====================================
   Filter Sections
   ===================================== */
.filter-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-section-mobile {
    background: #f9fafb;
    border-radius: 12px;
    overflow: hidden;
}

.section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: none;
    border: none;
    text-align: right;
    cursor: pointer;
    transition: all 0.2s;
}

.section-toggle:active {
    background: #f3f4f6;
}

.section-toggle span {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    font-family: 'Cairo', sans-serif;
}

.section-toggle i:first-child {
    color: #3b82f6;
}

.section-toggle .fa-chevron-down {
    transition: transform 0.3s ease;
}

.section-toggle.active .fa-chevron-down {
    transform: rotate(180deg);
}

/* Section Content */
.section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.section-content.show {
    max-height: 500px;
    padding: 16px;
}

/* Filter Options */
.filter-option-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.filter-option-mobile:last-child {
    border-bottom: none;
}

.filter-option-mobile input {
    margin-left: 12px;
    width: 20px;
    height: 20px;
    accent-color: #3b82f6;
}

.option-label {
    flex: 1;
    font-size: 0.9375rem;
    color: #374151;
    font-family: 'Cairo', sans-serif;
}

.option-count {
    font-size: 0.875rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

/* =====================================
   Price Range (Mobile)
   ===================================== */
.price-range-mobile {
    padding: 16px;
}

.price-inputs-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.price-inputs-mobile input {
    flex: 1;
    padding: 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    font-family: 'Cairo', sans-serif;
}

.price-inputs-mobile span {
    color: #6b7280;
    font-weight: 600;
}

.quick-prices-mobile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.quick-prices-mobile button {
    padding: 10px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Cairo', sans-serif;
}

.quick-prices-mobile button:active {
    background: #f3f4f6;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* =====================================
   Sheet Footer (Actions)
   ===================================== */
.sheet-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    background: #fff;
}

.btn-clear-mobile {
    flex: 1;
    padding: 14px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Cairo', sans-serif;
}

.btn-clear-mobile:active {
    background: #f9fafb;
    border-color: #ef4444;
    color: #ef4444;
}

.btn-apply-mobile {
    flex: 2;
    padding: 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Cairo', sans-serif;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-apply-mobile:active {
    transform: scale(0.98);
}

.results-count {
    margin-right: 6px;
    opacity: 0.9;
}

/* =====================================
   Animations
   ===================================== */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* =====================================
   Responsive Adjustments
   ===================================== */
@media (max-width: 480px) {
    .mobile-filter-sheet {
        max-height: 90vh;
    }
    
    .sheet-header h3 {
        font-size: 1.125rem;
    }
    
    .quick-filter-chip {
        font-size: 0.8125rem;
        padding: 8px 14px;
    }
}

/* Hide on desktop */
@media (min-width: 769px) {
    .mobile-filter-sheet,
    .mobile-filter-overlay,
    .mobile-filter-toggle {
        display: none !important;
    }
}
