/* ============================================
   📱 MOBILE FILTER SECTION
   Premium, Clean, Meesho-style
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: #f5f5f5;
    color: #1a1a1a;
}

/* Dark Mode */
body.dark-mode {
    background: #1a1a1a !important;
    color: #ffffff !important;
}

/* ============================================
   📱 MOBILE STICKY FILTER BAR
   ============================================ */

.mobile-filter-bar {
    position: sticky;
    top: 70px;
    left: 0;
    right: 0;
    height: 56px; /* Larger - was 48px */
    background: #ffffff;
    border-top: 1px solid #e5e5e5; /* ADD top border */
    border-bottom: 1px solid #e5e5e5;
    display: none;
    z-index: 998;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04); /* Subtle shadow */
}

body.dark-mode .mobile-filter-bar {
    background: #2a2a2a !important;
    border-top-color: #3a3a3a !important; /* ADD */
    border-bottom-color: #3a3a3a !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Match navbar height changes on small screens */
@media (max-width: 375px) {
    .mobile-filter-bar {
        top: 65px; /* Match navbar height at this breakpoint */
    }
}

@media (max-width: 320px) {
    .mobile-filter-bar {
        top: 60px; /* Match navbar height at this breakpoint */
    }
}

body.dark-mode .mobile-filter-bar {
    background: #2a2a2a !important;
    border-bottom-color: #3a3a3a !important;
}

/* Show only on mobile */
@media (max-width: 768px) {
    .mobile-filter-bar {
        display: flex;
    }
    
    /* Remove body padding - filter bar is now sticky, not fixed */
}
/* Desktop: hide bar + modals, remove bottom padding */
@media (min-width: 769px) {
    .mobile-filter-bar {
        display: none !important;
    }

    .bottom-modal {
        display: none !important;
    }

    body {
        padding-bottom: 0 !important;
    }
}
/* Filter Buttons */
/* Filter Buttons */
.filter-btn {
    flex: 1;
    height: 56px; /* Match new bar height */
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 14px; /* Slightly larger */
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    border-right: 1px solid #e5e5e5;
    transition: all 0.2s ease;
    font-family: inherit;
}
body.dark-mode .filter-btn {
    color: #e0e0e0 !important;
    border-right-color: #3a3a3a !important;
}

.filter-btn:last-child {
    border-right: none;
}

.filter-btn:active {
    background: #f5f5f5;
}

body.dark-mode .filter-btn:active {
    background: #333 !important;
}

/* Sort Icon (Stacked Arrows) */
/* Sort Icon (Two Separate Arrows) */
.sort-icon {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 0.7;
    font-size: 15px;
    color: #000;
}

body.dark-mode .sort-icon {
    color: #f0f0f0 !important;
}

/* Arrow Down */
.arrow-down {
    font-size: 10px;
    margin-left: 2px;
}

/* Filters Icon */
.filters-icon {
    font-size: 16px;
    font-weight: 400;
}

/* Active State */
.filter-btn.active {
    color: #667eea;
}

body.dark-mode .filter-btn.active {
    color: #667eea !important;
}

/* ============================================
   🌑 MODAL OVERLAY
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1090;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    z-index: 1099; /* Above bottom bar */
}
.bottom-modal {
    position: fixed;
    bottom: 0px;
    left: 0;
    right: 0;
    max-height: calc(80vh - 75px);
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    transform: translateY(calc(100% + 75px));
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);
}

body.dark-mode .bottom-modal {
    background: #2a2a2a !important;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4) !important;
}

.bottom-modal.active {
    transform: translateY(0);
}
.close-modal {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border: none !important;
    outline: none !important;
    border-radius: 50%;
    font-size: 20px;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-modal:active {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(0.95);
}
.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff !important;
    letter-spacing: 0.5px;
}

body.dark-mode .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

body.dark-mode .close-modal {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}
.clear-btn {
    background: transparent !important;
    border: 2px solid #667eea !important;
    color: #667eea !important;
}

.done-btn, .apply-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    border: none !important;
}

body.dark-mode .clear-btn {
    border-color: #667eea !important;
    color: #667eea !important;
}

body.dark-mode .done-btn,
body.dark-mode .apply-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}


/* Modal Content (Scrollable) */
/* Modal Content (Scrollable) */
.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px; /* More top/bottom padding */
}
.modal-content::-webkit-scrollbar {
    width: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 4px;
}

body.dark-mode .modal-content::-webkit-scrollbar-thumb {
    background: #4a4a4a !important;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    gap: 12px;
    flex-shrink: 0;
}

body.dark-mode .modal-footer {
    border-top-color: #3a3a3a !important;
}

/* ============================================
   📻 RADIO BUTTONS (Mobile)
   ============================================ */

.radio-option-mobile {
    display: flex;
    align-items: center;
    padding: 14px 0;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
}

body.dark-mode .radio-option-mobile {
    border-bottom-color: #333 !important;
}

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

.radio-option-mobile input[type="radio"] {
    display: none;
}

.radio-custom-mobile {
    width: 20px;
    height: 20px;
    border: 2px solid #d0d0d0;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

body.dark-mode .radio-custom-mobile {
    border-color: #666 !important;
}

.radio-option-mobile input[type="radio"]:checked + .radio-custom-mobile {
    border-color: #667eea;
}

.radio-option-mobile input[type="radio"]:checked + .radio-custom-mobile::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #667eea;
    border-radius: 50%;
}

.radio-label-mobile {
    font-size: 14px;
    font-weight: 500;
    color: #4a4a4a;
    flex: 1;
}

body.dark-mode .radio-label-mobile {
    color: #d0d0d0 !important;
}

.radio-option-mobile input[type="radio"]:checked ~ .radio-label-mobile {
    color: #667eea;
    font-weight: 600;
}

/* ============================================
   ☑️ CHECKBOXES (Mobile Category)
   ============================================ */

.checkbox-option-mobile {
    display: flex;
    align-items: center;
    padding: 14px 0;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
}

body.dark-mode .checkbox-option-mobile {
    border-bottom-color: #333 !important;
}

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

.checkbox-option-mobile input[type="checkbox"] {
    display: none;
}

.checkbox-custom-mobile {
    width: 20px;
    height: 20px;
    border: 2px solid #d0d0d0;
    border-radius: 3px;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

body.dark-mode .checkbox-custom-mobile {
    border-color: #666 !important;
}

.checkbox-option-mobile input[type="checkbox"]:checked + .checkbox-custom-mobile {
    border-color: #667eea;
    background: #667eea;
}

.checkbox-option-mobile input[type="checkbox"]:checked + .checkbox-custom-mobile::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label-mobile {
    font-size: 14px;
    font-weight: 500;
    color: #4a4a4a;
    flex: 1;
}

body.dark-mode .checkbox-label-mobile {
    color: #d0d0d0 !important;
}

.checkbox-option-mobile input[type="checkbox"]:checked ~ .checkbox-label-mobile {
    color: #667eea;
    font-weight: 600;
}

/* ============================================
   🔍 CATEGORY SEARCH (Mobile)
   ============================================ */

.category-search-wrapper-mobile {
    position: relative;
    margin-bottom: 16px;
}

.search-icon-mobile {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
}

.category-search-mobile {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fafafa;
    color: #1a1a1a;
}

body.dark-mode .category-search-mobile {
    background: #333 !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}

.category-search-mobile:focus {
    outline: none;
    border-color: #667eea;
}

.category-search-mobile::placeholder {
    color: #999;
}

/* Category List */
.category-list-mobile {
    max-height: 400px;
    overflow-y: auto;
}

/* ============================================
   💰 PREMIUM PRICE INPUT
   ============================================ */

.premium-price-input {
    padding: 8px 0;
}

.premium-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
}

body.dark-mode .premium-label {
    color: #ffffff !important;
}

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

.price-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: #fafafa;
    border: 1.5px solid #e5e5e5;
    border-radius: 10px;
    padding: 14px 16px;
    transition: all 0.2s ease;
}

body.dark-mode .price-input-wrapper {
    background: #333 !important;
    border-color: #444 !important;
}

.price-input-wrapper:focus-within {
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

body.dark-mode .price-input-wrapper:focus-within {
    background: #3a3a3a !important;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
}

.currency-symbol {
    font-size: 16px;
    font-weight: 600;
    color: #666;
    margin-right: 6px;
}

body.dark-mode .currency-symbol {
    color: #999 !important;
}

.price-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    outline: none;
    width: 100%;
}

body.dark-mode .price-input-wrapper input {
    color: #ffffff !important;
}

.price-input-wrapper input::placeholder {
    color: #999;
    font-weight: 500;
}

.range-separator {
    font-size: 18px;
    font-weight: 300;
    color: #999;
}

body.dark-mode .range-separator {
    color: #666 !important;
}

/* Remove number input arrows */
.price-input-wrapper input[type="number"]::-webkit-inner-spin-button,
.price-input-wrapper input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.price-input-wrapper input[type="number"] {
    -moz-appearance: textfield;
}
/* ============================================
   🔘 BUTTONS (Done, Clear, Apply)
   ============================================ */

.done-btn {
    flex: 1;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.done-btn:active {
    transform: scale(0.98);
    background: #5568d3;
}

.clear-btn {
    flex: 1;
    padding: 12px 24px;
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.clear-btn:active {
    transform: scale(0.98);
    background: #f5f5f5;
}

body.dark-mode .clear-btn:active {
    background: #333 !important;
}

.apply-btn {
    /* Same as done-btn */
}

/* Product Count */
.product-count-mobile {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

body.dark-mode .product-count-mobile {
    color: #999 !important;
}

/* Filter Section Title */
.filter-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

body.dark-mode .filter-section-title {
    color: #ffffff !important;
}


/* ============================================
   📱 RESPONSIVE
   ============================================ */

@media (min-width: 768px) {
    .mobile-filter-bar {
        display: none !important;
    }
    
    .bottom-modal {
        display: none !important;
    }
    
    body {
        padding-top: 0 !important;
    }
}
.price-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
}


/* change this for changing colors */
/* ============================================================
   MOBILE FILTER — Navy × Yellow palette patch
   ============================================================ */

/* === Filter bar === */
.mobile-filter-bar {
    background: #ffffff !important;
    border-top-color: #e8e8e8 !important;
    border-bottom-color: #e8e8e8 !important;
}

body.dark-mode .mobile-filter-bar {
    background: #1a1a1a !important;
    border-top-color: #2a2a2a !important;
    border-bottom-color: #2a2a2a !important;
}

/* === Filter buttons === */


body.dark-mode .filter-btn {
    color: #e0e0e0 !important;
    border-right-color: #2a2a2a !important;
}

.filter-btn:active {
    background: rgba(20,30,48,0.05) !important;
}

body.dark-mode .filter-btn:active {
    background: rgba(248,216,0,0.05) !important;
}

/* Active filter button */
.filter-btn.active {
    color: #141E30 !important;
}

body.dark-mode .filter-btn.active {
    color: #F8D800 !important;
}

/* === Modal header — navy gradient === */
.modal-header {
    background: linear-gradient(135deg, #141E30, #243B55) !important;
    border-radius: 20px 20px 0 0 !important;
}

body.dark-mode .modal-header {
    background: linear-gradient(135deg, #141E30, #243B55) !important;
}

/* Gold hairline at bottom of modal header */
.modal-header::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 2px !important;
    background: linear-gradient(90deg, transparent, #F8D800, #FFB300, transparent) !important;
    pointer-events: none !important;
}

.modal-header {
    position: relative !important;
}

.modal-header h3 {
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 2.5px !important;
    color: #ffffff !important;
    text-transform: uppercase !important;
}

/* Close button in modal header */
.close-modal {
    background: rgba(255,255,255,0.10) !important;
    border: 1px solid rgba(255,255,255,0.20) !important;
    color: rgba(255,255,255,0.8) !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    backdrop-filter: none !important;
}

.close-modal:active {
    background: rgba(248,216,0,0.18) !important;
    border-color: #F8D800 !important;
    transform: scale(0.95) !important;
}

/* === Modal footer buttons === */
.clear-btn {
    background: transparent !important;
    border: 1.5px solid #141E30 !important;
    color: #141E30 !important;
    border-radius: 10px !important;
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-weight: 700 !important;
}

.clear-btn:hover {
    background: rgba(20,30,48,0.05) !important;
}

.clear-btn:active {
    background: rgba(20,30,48,0.08) !important;
}

body.dark-mode .clear-btn {
    border-color: #F8D800 !important;
    color: #F8D800 !important;
}

body.dark-mode .clear-btn:active {
    background: rgba(248,216,0,0.08) !important;
}

.done-btn,
.apply-btn {
    background: linear-gradient(to right, #141E30 50%, #243B55 50%) !important;
    background-size: 200% 100% !important;
    background-position: right center !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-weight: 700 !important;
    transition: background-position 0.32s cubic-bezier(0.4,0,0.2,1),
                box-shadow 0.2s ease !important;
    box-shadow: 0 4px 14px rgba(20,30,48,0.20) !important;
}

.done-btn:hover,
.apply-btn:hover {
    background-position: left center !important;
    box-shadow: 0 6px 18px rgba(20,30,48,0.28) !important;
}

.done-btn:active,
.apply-btn:active {
    transform: scale(0.98) !important;
}

body.dark-mode .done-btn,
body.dark-mode .apply-btn {
    background: linear-gradient(to right, #F8D800 50%, #FFB300 50%) !important;
    background-size: 200% 100% !important;
    background-position: right center !important;
    color: #141E30 !important;
    box-shadow: 0 4px 14px rgba(248,216,0,0.20) !important;
}

body.dark-mode .done-btn:hover,
body.dark-mode .apply-btn:hover {
    box-shadow: 0 6px 18px rgba(248,216,0,0.28) !important;
}

/* === Radio buttons — navy === */
.radio-option-mobile input[type="radio"]:checked + .radio-custom-mobile {
    border-color: #141E30 !important;
}

.radio-option-mobile input[type="radio"]:checked + .radio-custom-mobile::after {
    background: #141E30 !important;
}

.radio-option-mobile input[type="radio"]:checked ~ .radio-label-mobile {
    color: #141E30 !important;
}

body.dark-mode .radio-option-mobile input[type="radio"]:checked + .radio-custom-mobile {
    border-color: #F8D800 !important;
}

body.dark-mode .radio-option-mobile input[type="radio"]:checked + .radio-custom-mobile::after {
    background: #F8D800 !important;
}

body.dark-mode .radio-option-mobile input[type="radio"]:checked ~ .radio-label-mobile {
    color: #F8D800 !important;
}

/* === Checkboxes — navy === */
.checkbox-option-mobile input[type="checkbox"]:checked + .checkbox-custom-mobile {
    border-color: #141E30 !important;
    background: #141E30 !important;
}

.checkbox-option-mobile input[type="checkbox"]:checked ~ .checkbox-label-mobile {
    color: #141E30 !important;
}

body.dark-mode .checkbox-option-mobile input[type="checkbox"]:checked + .checkbox-custom-mobile {
    border-color: #F8D800 !important;
    background: #F8D800 !important;
}

body.dark-mode .checkbox-option-mobile input[type="checkbox"]:checked + .checkbox-custom-mobile::after {
    color: #141E30 !important;
}

body.dark-mode .checkbox-option-mobile input[type="checkbox"]:checked ~ .checkbox-label-mobile {
    color: #F8D800 !important;
}

/* === Category search input === */
.category-search-mobile:focus {
    outline: none !important;
    border-color: #141E30 !important;
    box-shadow: 0 0 0 3px rgba(20,30,48,0.08) !important;
}

body.dark-mode .category-search-mobile:focus {
    border-color: #F8D800 !important;
    box-shadow: 0 0 0 3px rgba(248,216,0,0.08) !important;
}

/* === Price input focus === */
.price-input-wrapper:focus-within {
    border-color: #141E30 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(20,30,48,0.08) !important;
}

body.dark-mode .price-input-wrapper:focus-within {
    border-color: #F8D800 !important;
    background: #2a2a2a !important;
    box-shadow: 0 0 0 3px rgba(248,216,0,0.08) !important;
}

/* === Modal scrollbar === */
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(20,30,48,0.15) !important;
}

body.dark-mode .modal-content::-webkit-scrollbar-thumb {
    background: rgba(248,216,0,0.15) !important;
}

/* === Bottom modal dark mode bg === */
body.dark-mode .bottom-modal {
    background: #1a1a1a !important;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5) !important;
}

body.dark-mode .modal-footer {
    border-top-color: #2a2a2a !important;
}

body.dark-mode .radio-option-mobile {
    border-bottom-color: #2a2a2a !important;
}

body.dark-mode .checkbox-option-mobile {
    border-bottom-color: #2a2a2a !important;
}