/* --- ساختار کلی صفحه فروشگاه --- */
.shop-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin-top: 40px;
    margin-bottom: 80px;
    align-items: start;
}

/* --- سایدبار فیلترها --- */
.filter-sidebar {
    background: #fff;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 100px;
}

.filter-box {
    margin-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 20px;
}

.filter-box:last-child {
    border-bottom: none;
}

.filter-box h3 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 15px;
}

/* رادیو باتن‌های اختصاصی */
.custom-radio {
    display: flex;
    align-items: center;
    position: relative;
    padding-right: 30px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: 0.3s;
}

.custom-radio:hover { color: #e67e22; }

.custom-radio input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-mark {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.custom-radio:hover input ~ .radio-mark { border-color: #e67e22; }

.custom-radio input:checked ~ .radio-mark {
    border-color: #e67e22;
    background-color: #fff;
}

.radio-mark:after {
    content: "";
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e67e22;
}

.custom-radio input:checked ~ .radio-mark:after { display: block; }

/* فیلتر قیمت */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-inputs input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    transition: 0.3s;
}

.price-inputs input:focus { border-color: #e67e22; }

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-apply { margin-top: 0; }
.btn-reset {
    background: #f1f2f6;
    color: #576574;
    margin-top: 0;
}
.btn-reset:hover {
    background: #dfe4ea;
    color: #2f3542;
    box-shadow: none;
}

/* --- تاپ‌بار و مرتب‌سازی --- */
.shop-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04);
    margin-bottom: 30px;
}

.products-count {
    font-size: 14px;
    color: #7f8c8d;
}

/* سلکت باکس اختصاصی */
.custom-select-wrapper {
    position: relative;
    width: 200px;
}

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 10px 15px 10px 40px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.custom-select:hover, .custom-select:focus {
    border-color: #e67e22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.custom-select-wrapper::after {
    content: "\25BC";
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    font-size: 10px;
    color: #7f8c8d;
    pointer-events: none;
}

/* --- گرید محصولات (اختصاصی این صفحه) --- */
.products-page-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

/* --- صفحه‌بندی --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
}

.page-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
    color: #555;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: 0.3s;
}

.page-link.prev-next { width: auto; padding: 0 15px; }

.page-link:hover, .page-link.active {
    background: #e67e22;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.3);
}

.page-dots { color: #999; letter-spacing: 2px; }

/* --- ریسپانسیو --- */
@media (max-width: 992px) {
    .shop-container { grid-template-columns: 220px 1fr; }
    .products-page-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .shop-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .filter-sidebar {
        position: static;
        box-shadow: none;
        border: 1px solid #eee;
    }

    .shop-topbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .custom-select-wrapper { width: 100%; }

    .products-page-grid { grid-template-columns: 1fr; }
}
/* استایل‌های مخفی برای دسکتاپ */
.btn-mobile-filter,
.sidebar-mobile-header,
.filter-overlay {
    display: none;
}

/* استایل‌های مخصوص موبایل */
@media (max-width: 768px) {
    /* دکمه باز کردن فیلتر */
    .btn-mobile-filter {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 12px;
        background: #2c3e50;
        color: #fff;
        border: none;
        border-radius: 10px;
        font-family: inherit;
        font-size: 15px;
        cursor: pointer;
    }

    /* لایه تاریک پس‌زمینه */
    .filter-overlay.active {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        backdrop-filter: blur(2px);
    }

    /* تبدیل سایدبار به منوی کشویی */
    .filter-sidebar {
        position: fixed;
        top: 0;
        right: -100%; /* پنهان در خارج از صفحه */
        width: 280px;
        height: 100vh;
        background: #fff;
        z-index: 999;
        overflow-y: auto;
        transition: right 0.4s ease;
        border-radius: 0;
        margin: 0;
    }

    .filter-sidebar.active {
        right: 0; /* نمایش منو */
    }

    /* هدر سایدبار در موبایل */
    .sidebar-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid #f0f0f0;
    }

    .sidebar-mobile-header h2 {
        font-size: 18px;
        color: #2c3e50;
    }

    .btn-close-filter {
        background: none;
        border: none;
        font-size: 28px;
        color: #e74c3c;
        cursor: pointer;
    }
}
