/* ========== صفحه محصولات – نسخه نهایی خفن ========== */
.products-page {
    padding: 60px 0;
    background: var(--bg-primary);
}

.products-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 900px) {
    .back-to-top {
        bottom: 125px !important;
        right: 20px !important;
    }
}

/* لایه‌بندی */
.products-layout {
    display: flex;
    gap: 30px;
    position: relative;
}

/* سایدبار فیلتر */
.filters-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 32px;
    border: 1px solid var(--border-light);
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 90px;
    transition: all 0.3s;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.filters-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.clear-filters-btn {
    background: transparent;
    border: none;
    color: var(--accent-gold);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-stats {
    background: var(--accent-glow);
    border-radius: 60px;
    padding: 8px 16px;
    text-align: center;
    font-size: 0.8rem;
    margin-bottom: 20px;
    color: var(--accent-gold);
}

.filters-group {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.filter-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

.filter-title i:first-child {
    margin-left: 8px;
    width: 24px;
}

.filter-title i:last-child {
    transition: transform 0.3s;
}

.filters-group.open .filter-title i:last-child {
    transform: rotate(180deg);
}

.filter-options {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 8px;
}

.filters-group.open .filter-options {
    max-height: 300px;
    padding: 8px 8px 16px;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.2s;
}

.filter-options label:hover {
    color: var(--accent-gold);
}

.price-slider {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

.price-slider input {
    width: 100%;
    accent-color: var(--accent-gold);
}

.price-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.apply-filters-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-gold), #e0b468);
    border: none;
    padding: 12px;
    border-radius: 60px;
    font-weight: 600;
    color: #0b0a0a;
    cursor: pointer;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}

.apply-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(199, 162, 82, 0.3);
}

/* لینک دور کارت محصول */
.product-card-link {
    text-decoration: none;
    display: block;
    color: inherit;
    transition: transform 0.3s;
}

.product-card-link:hover .product-card {
    transform: translateY(-8px);
    border-color: var(--accent-gold);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.add-to-cart-btn {
    position: relative;
    z-index: 2;
}

/* محتوای محصولات */
.products-content {
    flex: 1;
}

.products-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 8px;
}

.products-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.sort-options select {
    background: var(--glass-bg);
    border: 1px solid var(--border-light);
    border-radius: 40px;
    padding: 8px 16px;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
}

/* استایل های صفحه بندی */
.pagination-container {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    border-radius: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn.active {
    background: var(--accent-gold);
    color: #0b0a0a;
    border-color: var(--accent-gold);
}

.page-btn:hover:not(.active) {
    background: var(--accent-glow);
    border-color: var(--accent-gold);
}

/* گرید محصولات */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.product-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 28px;
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-gold);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.product-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, var(--accent-gold), #e0b468);
    color: #0b0a0a;
    padding: 4px 14px;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-image {
    height: 240px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.3));
}

.product-info {
    padding: 12px;
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: flex-start;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.product-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 3px !important;
    margin-bottom: 14px;
    font-size: 0.7rem;
}

.product-rating i {
    color: #fbbf24;
    rotate: 145deg;
}

.product-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-weight: 800;
    color: var(--accent-gold);
    font-size: 1rem;
    margin: 0 !important;
}

.add-to-cart-btn {
    background: var(--accent-glow);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--accent-gold);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.add-to-cart-btn:hover {
    background: var(--accent-gold);
    color: #0b0a0a;
    transform: scale(1.05);
}

.no-products {
    text-align: center;
    padding: 60px;
    background: var(--glass-bg);
    border-radius: 32px;
}

.reset-filter-btn {
    background: var(--accent-gold);
    border: none;
    padding: 8px 24px;
    border-radius: 40px;
    margin-top: 16px;
    cursor: pointer;
}

.loading-spinner {
    text-align: center;
    padding: 60px;
    font-size: 1.2rem;
    color: var(--accent-gold);
}

/* موبایل */
.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 100;
    background: var(--accent-gold);
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    color: #0b0a0a;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    gap: 8px;
    align-items: center;
}

@media (max-width: 900px) {
    .products-layout {
        flex-direction: column;
    }

    .filters-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 340px;
        height: 100vh;
        z-index: 2000;
        border-radius: 0;
        background: var(--nav-bg-mobile);
        backdrop-filter: blur(24px);
        overflow-y: auto;
        transition: right 0.3s;
        padding: 20px;
    }

    .filters-sidebar.mobile-open {
        right: 0;
    }

    .mobile-filter-toggle {
        display: flex;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    .product-image {
        height: 180px;
    }
}

@media (max-width: 550px) {
    .products-grid {
        grid-template-columns: 1fr 1fr;
    }

    .product-name {
        font-size: 0.9rem;
    }

    .product-price {
        font-size: 0.8rem;
    }
}