﻿/* ===== صفحه عنوان ===== */
.page-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.page-header h1 {
    font-size: 1.8rem;
}

.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: #00695c;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #ff7300;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* ===== بخش فیلتر ===== */
.filter-section {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.filter-section .form-select,
.filter-section .form-control {
    border-radius: 10px;
    border-color: #e0e0e0;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    transition: all 0.3s ease;
}

.filter-section .form-select:focus,
.filter-section .form-control:focus {
    border-color: #ff7300;
    box-shadow: 0 0 0 0.2rem rgba(255, 115, 0, 0.15);
}

#attributeFiltersContainer .col-md-12:first-child{
    border-top : none;
    margin-top : 0px;
    padding-top : 0px;
}
#attributeFiltersContainer .col-md-12{
    border-top : 1px solid #E0E0E0;
    margin-top : 5px;
    padding-top : 5px;
}
/* ===== فیلترهای فعال ===== */
#activeFilters {
    border-bottom: 1px solid #ddd;
    padding: 10px;
    border-radius: .375rem;
    background: linear-gradient(#e8f8f9, #fff);
}
#activeFilters .badge {
    font-weight: 400;
    font-size: 0.8rem;
    border-radius: 20px;
    background: #f1f3f5 !important;
    color: #333 !important;
    border: 1px solid #e0e0e0 !important;
    padding: 0.4rem 1rem !important;
}

/* ===== بخش محصولات ===== */
.products-section {
    min-height: 400px;
    position: relative;
    background: linear-gradient(#e8f8f9,#f8f9fa);
    border-radius: .375rem;
}

/* ===== صفحه‌بندی ===== */
.pagination {
    gap: 0.3rem;
}

.pagination .page-item .page-link {
    border-radius: 8px;
    border: none;
    padding: 0.5rem 1rem;
    color: #333;
    background: #f8f9fa;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination .page-item .page-link:hover {
    background: #ff7300;
    color: #fff;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: #ff7300;
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 115, 0, 0.3);
}

.pagination .page-item.disabled .page-link {
    color: #ccc;
    background: #f1f3f5;
    cursor: not-allowed;
    transform: none;
}

/* ===== انیمیشن ورود کارت‌ها ===== */
.product-item {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== استایل‌های بارگذاری ===== */
#loadingSpinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}

#productGrid {
    transition: opacity 0.3s ease;
    position: relative;
}

/* ===== فیلتر پنل ===== */
.filter-panel {
    background: #fff;
    border-radius: 12px;
    padding: 10px;
}

/* ===== گروه فیلتر ===== */
.filter-group {
    padding:5px 15px;
    margin: 5px;
    border-radius: .375rem;
    box-shadow: 0 5px 10px #E0E0E0;
}


/* ===== هدر فیلتر ===== */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 5px 0;
    font-weight: 600;
    color: #2d3748;
    transition: all 0.2s;
}

.filter-header:hover {
    color: #ff7300;
}

.filter-header i {
    transition: transform 0.3s;
    font-size: 0.8rem;
}

.filter-header i.fa-chevron-up {
    transform: rotate(180deg);
}

/* ===== بدنه فیلتر ===== */
.filter-body {
    padding-top: 10px;
    display: none;
}

.filter-body.active {
    display: block;
}

/* ===== گزینه‌های فیلتر ===== */
.filter-options {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.filter-options::-webkit-scrollbar {
    width: 4px;
}

.filter-options::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.filter-options .form-check {
    margin-bottom: 4px;
}

.filter-options .form-check-label {
    color: #4a5568;
    cursor: pointer;
}

.filter-options .form-check-input:checked + .form-check-label {
    color: #ff7300;
}

.availableProduct {
    cursor: pointer;
}
/* ===== RangeSlider قیمت ===== */
.price-range-wrapper {
    padding: 10px 10px 20px 10px;
}

.price-labels {
    display: flex;
    justify-content: space-between;
    flex-direction:row-reverse;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #666;
}

/* ===== استایل‌های دکمه ===== */
#btnToggleFilters {
    transition: all 0.3s;
}

#btnToggleFilters:hover {
    background: #ff7300;
    color: #fff;
    border-color: #ff7300;
}

#btnApplyFilters {
    background: linear-gradient(135deg, #ff7300, #e66400);
    border: none;
    transition: all 0.3s;
}

#btnApplyFilters:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 115, 0, 0.3);
}

#btnClearFilters {
    transition: all 0.3s;
}

#btnClearFilters:hover {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

/* ===== واکنش‌گرایی ===== */
@media (max-width: 768px) {
    .filter-panel {
        padding: 15px;
    }
    
    .filter-group {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    
    .filter-options {
        max-height: 150px;
    }
}

@media (max-width: 576px) {
    .filter-panel {
        padding: 10px;
        border-radius: 8px;
    }
    
    .filter-header {
        font-size: 0.9rem;
    }
}

/* ===== واکنش‌گرایی ===== */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.4rem;
    }
    
    .filter-section .form-select,
    .filter-section .form-control {
        font-size: 0.85rem;
        padding: 0.5rem 0.8rem;
    }
    
    .pagination .page-item .page-link {
        padding: 0.3rem 0.7rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 1rem 0;
    }
    
    .page-header h1 {
        font-size: 1.2rem;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
    }
    
    .filter-section .row > div {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 767px) {
    #sortControlSlot,
    #stockControlSlot {
        display: none;
    }

    #filterPanel.filter-panel {
        position: fixed;
        inset: 0;
        z-index: 1300;
        display: flex !important;
        flex-direction: column;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        margin: 0 !important;
        padding: 0;
        overflow: hidden;
        border: 0;
        border-radius: 0;
        background: #f7f9fc;
        transform: translateY(100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform .36s cubic-bezier(.2,.75,.25,1), visibility 0s linear .36s;
        will-change: transform;
    }

    #filterPanel.filter-panel.is-open {
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
        transition: transform .36s cubic-bezier(.2,.75,.25,1), visibility 0s;
    }

    .filters-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1290;
        background: rgba(16, 31, 47, .52);
        opacity: 0;
        visibility: hidden;
        transition: opacity .28s ease, visibility 0s linear .28s;
    }

    .filters-backdrop.is-open {
        opacity: 1;
        visibility: visible;
        transition: opacity .28s ease, visibility 0s;
    }

    body.filters-open {
        overflow: hidden;
        overscroll-behavior: none;
    }

    .filter-mobile-header {
        position: relative;
        z-index: 1;
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        min-height: 92px;
        padding: calc(27px + env(safe-area-inset-top)) 20px 15px;
        border-bottom: 1px solid #e8edf2;
        background: #fff;
    }

    .filter-mobile-header::before {
        position: absolute;
        top: 10px;
        right: 50%;
        width: 38px;
        height: 4px;
        border-radius: 4px;
        background: #d7dee7;
        content: "";
        transform: translateX(50%);
    }

    .filter-mobile-heading > span {
        display: block;
        margin-bottom: 4px;
        color: #738196;
        font-size: .72rem;
    }

    .filter-mobile-heading > span i { margin-left: 5px; color: #e67e22; }
    .filter-mobile-heading h2 { margin: 0; color: #24344a; font-size: 1.08rem; font-weight: 800; }

    .filter-mobile-close {
        display: inline-flex;
        flex: 0 0 42px;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border: 1px solid #e4eaf0;
        border-radius: 14px;
        background: #f7f9fc;
        color: #42536a;
        font-size: 1rem;
    }

    .filter-mobile-controls {
        display: grid;
        flex: 0 0 auto;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px;
        padding: 14px 16px 4px;
        background: #fff;
    }

    #sortControl .form-label { color: #738196 !important; }
    #sortControl .form-select { min-height: 44px; background-color: #f8fafc; }

    #stockControl {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 7px 10px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #f8fafc;
    }

    #stockControl .form-check { margin: 0; }
    #stockControl .form-check-label { color: #40516a; font-size: .78rem; }

    .filter-panel-content {
        flex: 1 1 auto;
        min-height: 0;
        padding: 14px 14px 20px;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .filter-panel-content > .row { margin: 0; }
    .filter-panel-content > .row > .col-md-12 { padding: 0; }
    .filter-panel-content .filter-group { margin: 0 0 11px; padding: 13px 15px; border: 1px solid #e8edf2; border-radius: 15px; background: #fff; }
    .filter-panel-content .filter-header { min-height: 28px; }
    .filter-panel-content .filter-options { max-height: 190px; }

    .filter-mobile-footer {
        flex: 0 0 auto;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid #e8edf2;
        background: rgba(255,255,255,.97);
        box-shadow: 0 -8px 24px rgba(31, 51, 73, .06);
    }

    .filter-mobile-done {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        min-height: 48px;
        border: 0;
        border-radius: 13px;
        background: linear-gradient(135deg, #f28a26, #e46117);
        color: #fff;
        font: inherit;
        font-size: .88rem;
        font-weight: 700;
        box-shadow: 0 7px 18px rgba(228, 97, 23, .2);
    }
}

@media (min-width: 768px) {
    .filter-mobile-header,
    .filter-mobile-controls,
    .filter-mobile-footer,
    .filters-backdrop {
        display: none !important;
    }
}
