/* ============================================
   🎨 استایل صفحه محصولات پرفروش - تم سورمه‌ای و نقره‌ای
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* ============================================
   📸 بخش هدر با تصویر
   ============================================ */

.bestseller-hero {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.5) 0%, rgba(26, 26, 46, 0.2) 100%);
}

/* ============================================
   ⭐ نوار سورمه‌ای با متن (حذف شد)
   ============================================ */

/* نوار حذف شد */

/* ============================================
   📊 تعداد محصولات
   ============================================ */

.bestseller-count {
    text-align: center;
    padding: 18px 20px;
    font-size: 14px;
    color: #2d2d44;
    background: rgba(26, 26, 46, 0.05);
    border-bottom: 1px solid rgba(26, 26, 46, 0.1);
}

.bestseller-count span {
    font-weight: 900;
    font-size: 18px;
    color: #1a1a2e;
}

/* ============================================
   🎴 شبکه محصولات
   ============================================ */

.bestseller-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
    max-width: 1300px;
    margin: 30px auto;
    padding: 0 20px 40px;
}

/* ============================================
   💳 کارت محصول (سورمه‌ای/نقره‌ای)
   ============================================ */

.bestseller-card {
    background: #1a1a2e;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(26, 26, 46, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(192, 192, 192, 0.15);
}

.bestseller-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(26, 26, 46, 0.3);
    border-color: rgba(192, 192, 192, 0.3);
}

/* ===== تصویر کارت ===== */

.bestseller-card .card-image {
    position: relative;
    padding-top: 100%;
    background: #2d2d44;
    overflow: hidden;
}

.bestseller-card .card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.bestseller-card:hover .card-image img {
    transform: scale(1.08);
}

/* ===== برچسب پرفروش (نقره‌ای) ===== */

.bestseller-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #1a1a2e;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.3);
    z-index: 2;
    animation: bounceBadge 2s ease-in-out infinite;
    letter-spacing: 0.5px;
}

@keyframes bounceBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===== برچسب رتبه (نقره‌ای) ===== */

.bestseller-rank {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(10px);
    color: #c0c0c0;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(192, 192, 192, 0.2);
    z-index: 2;
}

/* ===== اطلاعات کارت ===== */

.bestseller-card .card-info {
    padding: 16px 18px 20px;
}

.bestseller-card .card-name {
    font-size: 15px;
    font-weight: 700;
    color: #e8e8e8;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.bestseller-card .card-name a {
    color: #e8e8e8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.bestseller-card .card-name a:hover {
    color: #c0c0c0;
}

.bestseller-card .card-category {
    font-size: 12px;
    color: rgba(192, 192, 192, 0.5);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bestseller-card .card-category i {
    font-size: 10px;
}

/* ===== قیمت‌ها ===== */

.bestseller-card .card-prices {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bestseller-card .price-current {
    font-size: 19px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.bestseller-card .price-current small {
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    margin-right: 2px;
}

/* ===== تعداد فروش ===== */

.bestseller-card .sales-count {
    font-size: 12px;
    color: rgba(192, 192, 192, 0.4);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.bestseller-card .sales-count i {
    color: #c0c0c0;
    font-size: 11px;
}

/* ===== دکمه مشاهده (نقره‌ای) ===== */

.bestseller-card .view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    padding: 8px 20px;
    border-radius: 10px;
    background: rgba(192, 192, 192, 0.1);
    border: 1px solid rgba(192, 192, 192, 0.2);
    color: #c0c0c0;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Vazirmatn', sans-serif;
    width: 100%;
}

.bestseller-card .view-btn:hover {
    background: rgba(192, 192, 192, 0.2);
    border-color: #c0c0c0;
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(192, 192, 192, 0.15);
    color: #ffffff;
}

.bestseller-card .view-btn i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.bestseller-card .view-btn:hover i {
    transform: translateX(-4px);
}

/* ============================================
   🔄 دکمه بازگشت
   ============================================ */

.back-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(192, 192, 192, 0.2);
    color: #e8e8e8;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    font-family: 'Vazirmatn', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(26, 26, 46, 0.3);
}

.back-btn:hover {
    background: #2d2d44;
    color: #c0c0c0;
    border-color: #c0c0c0;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(26, 26, 46, 0.4);
}

.back-btn i {
    font-size: 14px;
}

/* ============================================
   ⏳ لودینگ
   ============================================ */

.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(26, 26, 46, 0.4);
}

.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(26, 26, 46, 0.1);
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   📭 حالت خالی
   ============================================ */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: rgba(26, 26, 46, 0.4);
}

.empty-state i {
    font-size: 60px;
    color: rgba(26, 26, 46, 0.15);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: rgba(26, 26, 46, 0.3);
}

.empty-state .retry-btn {
    margin-top: 16px;
    padding: 8px 24px;
    border-radius: 10px;
    border: 1px solid rgba(26, 26, 46, 0.2);
    background: rgba(26, 26, 46, 0.05);
    color: #1a1a2e;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 13px;
    transition: all 0.3s ease;
}

.empty-state .retry-btn:hover {
    background: rgba(26, 26, 46, 0.1);
    border-color: #1a1a2e;
}

/* ============================================
   🎨 انیمیشن fadeInUp
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   📱 ریسپانسیو
   ============================================ */

@media (max-width: 992px) {
    .bestseller-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
        padding: 0 16px 30px;
    }

    .bestseller-hero {
        height: 220px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .bestseller-hero {
        height: 180px;
    }

    .bestseller-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
        padding: 0 12px 20px;
        margin: 20px auto;
    }

    .bestseller-card .card-info {
        padding: 12px 14px 16px;
    }

    .bestseller-card .card-name {
        font-size: 13px;
        color: #e8e8e8;
    }

    .bestseller-card .price-current {
        font-size: 16px;
        color: #ffffff;
    }

    .bestseller-badge {
        font-size: 10px;
        padding: 3px 10px;
        top: 8px;
        left: 8px;
    }

    .bestseller-rank {
        font-size: 11px;
        padding: 3px 10px;
        bottom: 8px;
        left: 8px;
        color: #c0c0c0;
    }

    .back-btn {
        top: 12px;
        right: 12px;
        padding: 8px 14px;
        font-size: 12px;
    }

    .bestseller-card .view-btn {
        font-size: 12px;
        padding: 6px 16px;
    }

    .bestseller-count {
        font-size: 12px;
        padding: 12px 16px;
    }

    .bestseller-count span {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .bestseller-hero {
        height: 150px;
    }

    .bestseller-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 8px 16px;
        margin: 14px auto;
    }

    .bestseller-card .card-name {
        font-size: 12px;
        color: #e8e8e8;
    }

    .bestseller-card .price-current {
        font-size: 14px;
        color: #ffffff;
    }

    .bestseller-card .card-category {
        font-size: 10px;
    }

    .bestseller-card .card-info {
        padding: 10px 10px 14px;
    }

    .bestseller-card .view-btn {
        font-size: 11px;
        padding: 5px 12px;
        margin-top: 10px;
    }

    .bestseller-badge {
        font-size: 9px;
        padding: 2px 8px;
        top: 6px;
        left: 6px;
    }

    .bestseller-rank {
        font-size: 10px;
        padding: 2px 8px;
        bottom: 6px;
        left: 6px;
        color: #c0c0c0;
    }

    .back-btn {
        top: 8px;
        right: 8px;
        padding: 6px 12px;
        font-size: 11px;
        border-radius: 8px;
    }

    .bestseller-count {
        font-size: 11px;
        padding: 10px 12px;
    }

    .bestseller-count span {
        font-size: 14px;
    }
}