/* MOBILE FILTER MODAL SYSTEM - Simple & Clean */
/* Ganti drawer dengan modal pop-up yang lebih mudah digunakan */

/* ===== MOBILE FILTER BUTTON ===== */
.mobile-filter-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1040;
    background: var(--gold-color, #d4af37);
    color: #1a1a1a;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    transition: all 0.3s ease;
    font-size: 20px;
    cursor: pointer;
}

.mobile-filter-btn:hover {
    background: #f4e17a;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.mobile-filter-btn:active {
    transform: scale(0.95);
}

/* Dark mode untuk button */
body.dark-mode .mobile-filter-btn {
    background: var(--dark-accent, #d4af37);
    color: #1a1a1a;
}

/* Filter active indicator */
.mobile-filter-btn.has-active-filters {
    background: #dc2626;
}

.mobile-filter-btn.has-active-filters::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #ffffff;
}

/* ===== MOBILE FILTER MODAL ===== */
.mobile-filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

body.dark-mode .mobile-filter-modal {
    background: rgba(0, 0, 0, 0.7);
}

.mobile-filter-modal.show {
    display: flex;
}

/* Modal content */
.mobile-filter-content {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    border: 1px solid #e5e7eb;
}

body.dark-mode .mobile-filter-content {
    background: #1e293b;
    border: 2px solid #374151;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== MODAL HEADER ===== */
.mobile-filter-header {
    background: var(--gold-color, #d4af37);
    color: #1a1a1a;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f4e17a;
}

body.dark-mode .mobile-filter-header {
    background: #d4af37;
    color: #1a1a1a;
    border-bottom: 2px solid #f4e17a;
}

.mobile-filter-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
}

body.dark-mode .mobile-filter-title {
    color: #1a1a1a;
}

.mobile-filter-close {
    background: none;
    border: none;
    color: #1a1a1a;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .mobile-filter-close {
    color: #1a1a1a;
}

.mobile-filter-close:hover {
    background: rgba(26, 26, 26, 0.1);
}

/* ===== MODAL BODY ===== */
.mobile-filter-body {
    padding: 20px;
    background: #ffffff;
}

body.dark-mode .mobile-filter-body {
    background: #0f1629;
}

.filter-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

body.dark-mode .filter-section {
    border-bottom-color: #475569;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-section h6 {
    color: #1f2937;
    font-weight: 800;
    margin-bottom: 18px;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

body.dark-mode .filter-section h6 {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.filter-section h6 i {
    margin-right: 8px;
    color: var(--gold-color, #d4af37);
    font-size: 1rem;
}

/* ===== FORM ELEMENTS ===== */
.mobile-filter-content .form-check {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.mobile-filter-content .form-check:hover {
    background: #f8f9fa;
}

body.dark-mode .mobile-filter-content .form-check:hover {
    background: #374151;
}

.mobile-filter-content .form-check-input {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    margin-top: 0;
    border: 3px solid #6b7280;
    border-radius: 6px;
    background: #ffffff;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

body.dark-mode .mobile-filter-content .form-check-input {
    background: #1e293b;
    border-color: #94a3b8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mobile-filter-content .form-check-input:checked {
    background: var(--gold-color, #d4af37);
    border-color: var(--gold-color, #d4af37);
    position: relative;
}

body.dark-mode .mobile-filter-content .form-check-input:checked {
    background: #d4af37;
    border-color: #d4af37;
}

/* Custom checkmark */
.mobile-filter-content .form-check-input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000000;
    font-weight: 900;
    font-size: 16px;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.mobile-filter-content .form-check-label {
    color: #1f2937;
    font-weight: 600;
    cursor: pointer;
    font-size: 1.15rem;
    margin-bottom: 0;
    flex: 1;
    line-height: 1.4;
}

body.dark-mode .mobile-filter-content .form-check-label {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Price inputs */
.price-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
}

.mobile-filter-content .form-control {
    border: 2px solid #d1d5db;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 1.1rem;
    background: #ffffff;
    color: #1f2937;
    transition: all 0.2s ease;
    font-weight: 600;
}

body.dark-mode .mobile-filter-content .form-control {
    background: #1e293b;
    border-color: #94a3b8;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mobile-filter-content .form-control:focus {
    border-color: var(--gold-color, #d4af37);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    outline: none;
}

body.dark-mode .mobile-filter-content .form-control:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}

.price-separator {
    color: #6b7280;
    font-weight: 600;
    text-align: center;
}

body.dark-mode .price-separator {
    color: #9ca3af;
}

/* ===== MODAL FOOTER ===== */
.mobile-filter-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

body.dark-mode .mobile-filter-footer {
    border-top-color: #374151;
}

.mobile-filter-footer .btn {
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    text-align: center;
}

.btn-filter-reset {
    background: transparent;
    color: #6b7280;
    border-color: #d1d5db;
}

body.dark-mode .btn-filter-reset {
    color: #9ca3af;
    border-color: #4b5563;
}

.btn-filter-reset:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #9ca3af;
}

body.dark-mode .btn-filter-reset:hover {
    background: #374151;
    color: #f8fafc;
    border-color: #6b7280;
}

.btn-filter-apply {
    background: var(--gold-color, #d4af37);
    color: #1a1a1a;
    border-color: var(--gold-color, #d4af37);
}

.btn-filter-apply:hover {
    background: #f4e17a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* ===== RESPONSIVE BEHAVIOR ===== */
@media (max-width: 768px) {
    /* Show mobile elements */
    .mobile-filter-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Hide desktop filter */
    .filter-box {
        display: none !important;
    }
    
    /* Full width for product grid */
    .products-page .col-md-3 {
        display: none;
    }
    
    .products-page .col-md-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .mobile-filter-btn {
        width: 55px;
        height: 55px;
        font-size: 18px;
        bottom: 15px;
        right: 15px;
    }
    
    .mobile-filter-modal {
        padding: 15px;
    }
    
    .mobile-filter-content {
        max-height: 95vh;
    }
    
    .mobile-filter-header,
    .mobile-filter-body,
    .mobile-filter-footer {
        padding: 15px;
    }
}

/* ===== ACCESSIBILITY ===== */
.mobile-filter-modal:focus {
    outline: none;
}

.mobile-filter-btn:focus,
.mobile-filter-close:focus {
    outline: 2px solid var(--gold-color, #d4af37);
    outline-offset: 2px;
}

/* ===== LOADING STATE ===== */
.mobile-filter-loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--gold-color, #d4af37);
}

.mobile-filter-loading.show {
    display: block;
}

.mobile-filter-loading i {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== SEARCH SECTION ===== */
.search-section .form-control {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
}

body.dark-mode .search-section .form-control {
    background: #2d3748;
    border-color: #4a5568;
}

/* ===== CLEAR ALL FILTERS LINK ===== */
.clear-all-filters {
    color: #dc2626;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    margin-top: 5px;
}

.clear-all-filters:hover {
    color: #b91c1c;
    text-decoration: underline;
}

.clear-all-filters i {
    margin-right: 5px;
    font-size: 0.75rem;
}

/* ===== SCROLLBAR UNTUK MODAL ===== */
.mobile-filter-content::-webkit-scrollbar {
    width: 6px;
}

.mobile-filter-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

body.dark-mode .mobile-filter-content::-webkit-scrollbar-track {
    background: #334155;
}

.mobile-filter-content::-webkit-scrollbar-thumb {
    background: var(--gold-color, #d4af37);
    border-radius: 3px;
}

.mobile-filter-content::-webkit-scrollbar-thumb:hover {
    background: #f4e17a;
}
