/* ===== تنظیمات کلی ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: #f1f5f9;
    color: #334155;
    line-height: 1.8;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}


/* ===== نوار بالا (Topbar) ===== */
.topbar {
    background: var(--dark);
    color: #94a3b8;
    font-size: 0.8rem;
    padding: 6px 0;
}

.topbar a {
    color: #94a3b8;
}

.topbar a:hover {
    color: white;
}


/* ===== نوبار اصلی ===== */
.main-navbar {
    background: white !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    padding: 12px 0;
    position: relative;
    z-index: 1000;
}

.main-navbar .navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary) !important;
}

.main-navbar .navbar-brand i {
    font-size: 1.6rem;
}

.main-navbar .nav-link {
    color: var(--dark) !important;
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: var(--transition);
}

.main-navbar .nav-link:hover {
    background: #f1f5f9;
    color: var(--primary) !important;
}


/* ===== جستجو ===== */
.search-box {
    position: relative;
}

.search-box input {
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    padding: 8px 20px 8px 45px;
    width: 280px;
    font-family: 'Vazirmatn', sans-serif;
    transition: var(--transition);
    font-size: 0.9rem;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.search-box button {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 1.1rem;
    cursor: pointer;
}


/* ===== سبد خرید ===== */
.cart-btn {
    position: relative;
    background: #f1f5f9;
    border: none;
    padding: 8px 16px;
    border-radius: 50px;
    color: var(--dark);
    font-weight: 500;
    font-family: 'Vazirmatn', sans-serif;
    transition: var(--transition);
    text-decoration: none;
}

.cart-btn:hover {
    background: var(--primary);
    color: white;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}


/* ═══════════════════════════════════════════ */
/* ===== مگامنوی دسته‌بندی (استایل دیجی‌کالا) ===== */
/* ═══════════════════════════════════════════ */

.category-bar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    z-index: 999;
}

.mega-wrapper {
    position: relative;
}

.mega-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark);
    user-select: none;
}

.mega-toggle:hover {
    color: var(--primary);
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
}

.hamburger-icon span {
    display: block;
    height: 2.5px;
    background: currentColor;
    border-radius: 2px;
    transition: 0.3s;
}

.hamburger-icon span:nth-child(2) {
    width: 70%;
}

.mega-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 820px;
    background: white;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    display: none;
    z-index: 1001;
}

.mega-dropdown.open {
    display: flex;
}

.mega-sidebar {
    width: 230px;
    min-width: 230px;
    background: #f8fafc;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    max-height: 420px;
    overflow-y: auto;
    border-left: 1px solid #f1f5f9;
}

.mega-sidebar::-webkit-scrollbar {
    width: 3px;
}

.mega-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.mega-sidebar-item {
    position: relative;
    list-style: none;
}

.mega-sidebar-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: #475569;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.15s;
    border-right: 3px solid transparent;
}

.mega-sidebar-item a i:first-child {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: #94a3b8;
    transition: 0.15s;
}

.mega-sidebar-item .mega-arrow {
    margin-right: auto;
    font-size: 0.65rem;
    color: #cbd5e1;
    transition: 0.15s;
}

.mega-sidebar-item:hover a,
.mega-sidebar-item.active a {
    background: white;
    color: var(--primary);
    border-right-color: var(--primary);
}

.mega-sidebar-item:hover a i:first-child,
.mega-sidebar-item.active a i:first-child {
    color: var(--primary);
}

.mega-sidebar-item:hover .mega-arrow,
.mega-sidebar-item.active .mega-arrow {
    color: var(--primary);
}

.mega-panels {
    flex: 1;
    position: relative;
    min-height: 300px;
}

.mega-panel {
    display: none;
    padding: 20px 25px;
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    animation: fadePanel 0.2s ease;
}

.mega-panel.active {
    display: block;
}

@keyframes fadePanel {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mega-panel::-webkit-scrollbar {
    width: 3px;
}

.mega-panel::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.mega-panel-header {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.mega-panel-header a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: 0.2s;
}

.mega-panel-header a:hover {
    gap: 12px;
}

.mega-panel-header a .bi-arrow-left {
    margin-right: auto;
    font-size: 0.8rem;
}

.mega-panel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.mega-panel-link {
    display: block;
    padding: 10px 14px;
    color: #475569;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.15s;
    position: relative;
    padding-right: 22px;
}

.mega-panel-link::before {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: 0.15s;
}

.mega-panel-link:hover {
    background: #eff6ff;
    color: var(--primary);
    padding-right: 26px;
}

.mega-panel-link:hover::before {
    background: var(--primary);
}

.mega-panel-empty {
    text-align: center;
    padding: 50px 20px;
    color: #94a3b8;
}

.mega-panel-empty i {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
    color: #e2e8f0;
}

.mega-panel-empty p {
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.mega-panel-btn {
    display: inline-block;
    padding: 8px 20px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: 0.2s;
}

.mega-panel-btn:hover {
    background: var(--primary-dark);
    color: white;
}

/* لینک‌های سریع */
.quick-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 10px;
}

.quick-nav a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    color: #475569;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    transition: 0.2s;
    white-space: nowrap;
}

.quick-nav a:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.quick-nav a.hot {
    color: #ef4444;
}

.quick-nav a.hot:hover {
    background: #fef2f2;
    color: #dc2626;
}


/* ===== بنر اصلی ===== */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius);
    padding: 60px 40px;
    color: white;
    text-align: center;
    margin-bottom: 40px;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 15px;
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 25px;
}

.hero-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 35px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.hero-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: #667eea;
}


/* ===== عنوان بخش‌ها ===== */
.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 25px;
    position: relative;
    padding-right: 15px;
}

.section-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 5px;
    width: 4px;
    height: 70%;
    background: var(--primary);
    border-radius: 4px;
}


/* ===== کارت دسته‌بندی ===== */
.category-card {
    background: white;
    border-radius: var(--radius);
    padding: 25px 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.category-card img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 3px solid #f1f5f9;
}

.category-card h5 {
    color: var(--dark);
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0;
}


/* ===== کارت محصول ===== */
.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: none;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.product-card .card-img-container {
    position: relative;
    overflow: hidden;
    height: 220px;
}

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

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

.product-card .discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--danger);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 2;
}

.product-card .stock-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    z-index: 2;
}

.product-card .card-body {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card .product-category {
    color: var(--secondary);
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.product-card .product-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 12px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-name:hover {
    color: var(--primary);
}

.product-card .price-section {
    margin-top: auto;
}

.price-old {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 0.85rem;
}

.price-new {
    color: var(--danger);
    font-weight: 800;
    font-size: 1.15rem;
}

.price-normal {
    color: var(--dark);
    font-weight: 800;
    font-size: 1.1rem;
}

.product-card .card-footer {
    background: white;
    border-top: 1px solid #f1f5f9;
    padding: 12px 18px;
}


/* ===== دکمه‌ها ===== */
.btn-primary-custom {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

.btn-primary-custom:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
}

.btn-success-custom {
    background: var(--success);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

.btn-success-custom:hover {
    background: #16a34a;
    color: white;
    transform: translateY(-2px);
}

.btn-outline-custom {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 8px 22px;
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}

.btn-outline-custom:hover {
    background: var(--primary);
    color: white;
}

.btn-add-cart {
    background: var(--success);
    color: white;
    border: none;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-add-cart:hover {
    background: #16a34a;
    transform: translateY(-2px);
    color: white;
}


/* ===== ساید‌بار فیلتر ===== */
.filter-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
}

.filter-card .filter-header {
    background: var(--dark);
    color: white;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 0.95rem;
}

.filter-card .filter-item {
    padding: 10px 18px;
    color: var(--dark);
    border-bottom: 1px solid #f1f5f9;
    transition: var(--transition);
    display: block;
    font-weight: 500;
    text-decoration: none;
}

.filter-card .filter-item:hover {
    background: #f8fafc;
    color: var(--primary);
    padding-right: 25px;
}

.filter-card .filter-item.active {
    background: #eff6ff;
    color: var(--primary);
    border-right: 3px solid var(--primary);
    font-weight: 700;
}


/* ===== صفحه جزئیات محصول ===== */
.product-detail-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
}

.product-detail-card .product-image img {
    width: 100%;
    border-radius: var(--radius);
}

.product-detail-card .product-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 10px;
}

.price-box {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.price-box .old-price {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 1.1rem;
}

.price-box .final-price {
    color: var(--danger);
    font-size: 1.8rem;
    font-weight: 900;
}

.price-box .discount-percent {
    background: var(--danger);
    color: white;
    padding: 4px 14px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
}

.stock-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.stock-info.in-stock {
    background: #f0fdf4;
    color: var(--success);
}

.stock-info.out-of-stock {
    background: #fef2f2;
    color: var(--danger);
}

.quantity-input {
    width: 80px;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
}


/* ===== سبد خرید ===== */
.cart-table {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.cart-table th {
    background: var(--dark);
    color: white;
    font-weight: 600;
    padding: 14px 18px;
    border: none;
}

.cart-table td {
    padding: 16px 18px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.cart-product-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}


/* ===== فرم‌ها ===== */
.form-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 35px;
}

.form-card .form-control {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    font-family: 'Vazirmatn', sans-serif;
    transition: var(--transition);
}

.form-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-card .form-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
}


/* ===== پیام‌ها ===== */
.alert {
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    padding: 14px 20px;
}


/* ===== Breadcrumb ===== */
.breadcrumb-custom {
    background: white;
    border-radius: var(--radius);
    padding: 12px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.breadcrumb-custom .breadcrumb {
    margin: 0;
}


/* ===== فوتر ===== */
.main-footer {
    background: var(--dark);
    color: #94a3b8;
    padding: 50px 0 0;
    margin-top: 60px;
}

.main-footer h5 {
    color: white;
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.main-footer a {
    color: #94a3b8;
    display: block;
    padding: 4px 0;
    transition: var(--transition);
    text-decoration: none;
}

.main-footer a:hover {
    color: white;
    padding-right: 8px;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    font-size: 0.85rem;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #334155;
    color: white;
    margin: 0 5px;
    font-size: 1.1rem;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
}


/* ===== انیمیشن ===== */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ===== صفحه‌بندی ===== */
.page-link-custom {
    border: none !important;
    color: var(--dark) !important;
    font-weight: 600;
    padding: 10px 16px !important;
    margin: 0 3px;
    border-radius: 10px !important;
    font-family: 'Vazirmatn', sans-serif;
    transition: var(--transition);
    background: white !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.page-link-custom:hover {
    background: var(--primary) !important;
    color: white !important;
    transform: translateY(-2px);
}

.page-item.active .page-link-custom {
    background: var(--primary) !important;
    color: white !important;
}

.page-item.disabled .page-link-custom {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
}


/* ===== امتیاز در کارت محصول ===== */
.product-card-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 5px 0;
}

.mini-stars {
    display: flex;
    gap: 1px;
}

.mini-stars i {
    font-size: 0.75rem;
}

.mini-stars .bi-star-fill {
    color: #fbbf24;
}

.mini-stars .bi-star-half {
    color: #fbbf24;
}

.mini-stars .bi-star {
    color: #e2e8f0;
}

.product-card-rating .rating-text {
    font-weight: 800;
    font-size: 0.85rem;
    color: #1e293b;
}

.product-card-rating .rating-count {
    font-size: 0.75rem;
    color: #94a3b8;
}


/* ===== بخش نظرات ===== */
.reviews-section {
    margin-top: 40px;
}

.rating-summary-improved {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    text-align: center;
}

.rating-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.rating-circle .rating-number {
    font-size: 2.2rem;
    font-weight: 900;
    color: #1e293b;
    line-height: 1;
}

.rating-circle .rating-from {
    font-size: 0.75rem;
    color: #94a3b8;
}

.rating-circle.excellent {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 3px solid #86efac;
}

.rating-circle.good {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 3px solid #93c5fd;
}

.rating-circle.average {
    background: linear-gradient(135deg, #fefce8, #fef9c3);
    border: 3px solid #fde047;
}

.rating-circle.poor {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 3px solid #fca5a5;
}

.rating-stars {
    color: #fbbf24;
    font-size: 1.2rem;
}

.rating-stars .bi-star-fill { color: #fbbf24; }
.rating-stars .bi-star { color: #e2e8f0; }

.rating-bar-improved {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.rating-bar-improved .star-label {
    width: 45px;
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    color: #475569;
}

.rating-bar-improved .bar-bg {
    flex: 1;
    height: 10px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
}

.rating-bar-improved .bar-fill {
    height: 100%;
    border-radius: 10px;
}

.rating-bar-improved .bar-fill.star-5 { background: #22c55e; }
.rating-bar-improved .bar-fill.star-4 { background: #84cc16; }
.rating-bar-improved .bar-fill.star-3 { background: #fbbf24; }
.rating-bar-improved .bar-fill.star-2 { background: #f97316; }
.rating-bar-improved .bar-fill.star-1 { background: #ef4444; }

.rating-bar-improved .bar-count {
    width: 30px;
    text-align: left;
    color: #94a3b8;
    font-size: 0.8rem;
}

.review-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.review-tab {
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid #e2e8f0;
    color: #64748b;
    background: white;
    transition: var(--transition);
}

.review-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.review-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.review-card-improved {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 16px;
    border-right: 4px solid transparent;
    transition: var(--transition);
}

.review-card-improved:hover {
    box-shadow: var(--shadow-hover);
}

.review-card-improved.rating-high { border-right-color: #22c55e; }
.review-card-improved.rating-mid { border-right-color: #fbbf24; }
.review-card-improved.rating-low { border-right-color: #ef4444; }

.review-card-improved.user-review {
    border: 2px solid var(--primary);
    border-right: 4px solid var(--primary);
    background: #fafbff;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reviewer-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
}

.reviewer-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.buyer-badge {
    background: #f0fdf4;
    color: #16a34a;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.review-rating {
    display: flex;
    gap: 2px;
}

.review-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--dark);
}

.review-text {
    color: #475569;
    line-height: 2;
    margin-bottom: 12px;
}

.review-date {
    color: #94a3b8;
    font-size: 0.8rem;
}

.pros-cons-improved {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 12px 0;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
}

.pros-section, .cons-section {
    flex: 1;
    min-width: 180px;
}

.pros-section .pro-item,
.cons-section .con-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 4px 0;
    font-size: 0.88rem;
}

.pros-section .pro-item i {
    color: #22c55e;
    margin-top: 4px;
}

.cons-section .con-item i {
    color: #ef4444;
    margin-top: 4px;
}

.helpful-btn-improved {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    color: #64748b;
    transition: var(--transition);
}

.helpful-btn-improved:hover,
.helpful-btn-improved.active {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
}

.review-form-improved {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    border-top: 4px solid var(--primary);
}

.star-rating-improved {
    display: flex;
    gap: 8px;
    direction: ltr;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.star-rating-improved input {
    display: none;
}

.star-rating-improved label {
    cursor: pointer;
    font-size: 2.2rem;
    color: #e2e8f0;
    transition: all 0.2s;
}

.star-rating-improved input:checked + label,
.star-rating-improved input:checked + label ~ label {
    color: #fbbf24;
}

.star-rating-improved label:hover,
.star-rating-improved label:hover ~ label {
    color: #fbbf24 !important;
}

.rating-label {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 5px;
}

.rating-label.r1 { background: #fef2f2; color: #ef4444; }
.rating-label.r2 { background: #fff7ed; color: #f97316; }
.rating-label.r3 { background: #fefce8; color: #eab308; }
.rating-label.r4 { background: #f0fdf4; color: #22c55e; }
.rating-label.r5 { background: #f0fdf4; color: #16a34a; }


/* ===== ریسپانسیو ===== */
@media (max-width: 992px) {
    .mega-dropdown {
        width: 100%;
        left: 0;
        border-radius: 0 0 12px 12px;
    }

    .mega-dropdown.open {
        flex-direction: column;
    }

    .mega-sidebar {
        width: 100%;
        min-width: auto;
        max-height: 180px;
        border-left: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .mega-panels {
        min-height: 200px;
    }

    .mega-panel-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 35px 20px;
    }

    .hero-section h1 {
        font-size: 1.6rem;
    }
}

@media (max-width: 576px) {
    .mega-panel-grid {
        grid-template-columns: 1fr;
    }

    .product-card-rating .rating-count {
        display: none;
    }
}

/* ═══════════════════════════════════════════ */
/* ===== جستجوی زنده ===== */
/* ═══════════════════════════════════════════ */

.search-box {
    position: relative;
    z-index: 1050;
}

.search-box input {
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    padding: 10px 20px 10px 45px;
    width: 320px;
    font-family: 'Vazirmatn', sans-serif;
    transition: all 0.3s;
    font-size: 0.9rem;
    background: #f8fafc;
}

.search-box input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
    width: 380px;
}

.search-box button {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 1.1rem;
    cursor: pointer;
}

/* دراپ‌داون نتایج */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 450px;
    max-width: 90vw;
    background: white;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    max-height: 500px;
    overflow-y: auto;
    display: none;
    z-index: 1050;
    animation: dropDown 0.2s ease;
}

.search-dropdown.show {
    display: block;
}

@keyframes dropDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* اسکرول‌بار */
.search-dropdown::-webkit-scrollbar {
    width: 4px;
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* هدر نتایج */
.search-header {
    padding: 12px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-header .badge {
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.75rem;
}

/* بخش دسته‌بندی‌ها */
.search-section {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.search-section:last-child {
    border-bottom: none;
}

.search-section-title {
    padding: 8px 18px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* آیتم دسته‌بندی */
.search-category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.15s;
    font-size: 0.88rem;
}

.search-category-item:hover {
    background: #eff6ff;
    color: var(--primary);
}

.search-category-item .cat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1rem;
}

.search-category-item .cat-info {
    flex: 1;
}

.search-category-item .cat-name {
    font-weight: 600;
}

.search-category-item .cat-count {
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
}

/* آیتم محصول */
.search-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.15s;
    border-bottom: 1px solid #f8fafc;
}

.search-product-item:last-child {
    border-bottom: none;
}

.search-product-item:hover {
    background: #f8fafc;
}

.search-product-image {
    width: 55px;
    height: 55px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.search-product-info {
    flex: 1;
    min-width: 0;
}

.search-product-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
}

.search-product-item:hover .search-product-name {
    color: var(--primary);
}

.search-product-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #94a3b8;
}

.search-product-rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.search-product-rating i {
    color: #fbbf24;
    font-size: 0.7rem;
}

.search-product-price {
    text-align: left;
    flex-shrink: 0;
}

.search-product-price .final {
    font-weight: 800;
    color: var(--dark);
    font-size: 0.9rem;
}

.search-product-price .original {
    text-decoration: line-through;
    color: #cbd5e1;
    font-size: 0.72rem;
    display: block;
}

.search-product-price .discount-tag {
    display: inline-block;
    background: #fef2f2;
    color: #ef4444;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 4px;
}

/* دکمه مشاهده همه */
.search-view-all {
    display: block;
    text-align: center;
    padding: 14px;
    background: #eff6ff;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    transition: 0.2s;
    border-top: 1px solid #dbeafe;
    position: sticky;
    bottom: 0;
}

.search-view-all:hover {
    background: var(--primary);
    color: white;
}

/* حالت‌های خاص */
.search-loading {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.search-loading .spinner-border {
    width: 30px;
    height: 30px;
    border-width: 3px;
    color: var(--primary);
}

.search-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.search-empty i {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
    color: #e2e8f0;
}

.search-empty p {
    margin: 0;
    font-size: 0.9rem;
}

.search-empty small {
    font-size: 0.8rem;
    color: #cbd5e1;
}

/* هایلایت متن جستجو شده */
.search-highlight {
    background: #fef3c7;
    color: #92400e;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 700;
}

/* ریسپانسیو */
@media (max-width: 992px) {
    .search-box input {
        width: 280px;
    }

    .search-box input:focus {
        width: 320px;
    }

    .search-dropdown {
        width: 100%;
        min-width: 300px;
    }
}


/* ═══════════════════════════════════════════ */
/* ===== نمادهای اعتماد فوتر ===== */
/* ═══════════════════════════════════════════ */

.trust-section {
    background: white;
    padding: 30px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    margin-top: 40px;
}

.trust-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 25px;
    position: relative;
}

.trust-title::before,
.trust-title::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 60px;
    height: 1px;
    background: #e2e8f0;
}

.trust-title::before {
    right: calc(50% + 100px);
}

.trust-title::after {
    left: calc(50% + 100px);
}

.trust-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 130px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
}

.trust-badge:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.1);
    transform: translateY(-5px);
}

.trust-badge img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(30%);
    transition: filter 0.3s;
}

.trust-badge:hover img {
    filter: grayscale(0%);
}

/* حالت خالی (وقتی هنوز نمادی اضافه نشده) */
.trust-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 130px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 15px;
    color: #94a3b8;
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.6;
}

.trust-placeholder i {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .trust-title::before,
    .trust-title::after {
        display: none;
    }

    .trust-badge,
    .trust-placeholder {
        width: 100px;
        height: 100px;
        padding: 10px;
    }

    .trust-badges {
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .trust-badge,
    .trust-placeholder {
        width: 85px;
        height: 85px;
    }
}


/* ═══════════════════════════════════════════ */
/* ===== صفحه محصول حرفه‌ای ===== */
/* ═══════════════════════════════════════════ */

.product-page {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

/* ===== گالری تصاویر ===== */
.product-gallery {
    position: relative;
}

.main-image-wrapper {
    position: relative;
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
}

.main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.main-image-wrapper:hover .main-image {
    transform: scale(1.05);
}

/* بج‌های تصویر */
.product-badges {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.badge-discount {
    background: #ef4444;
    color: white;
    padding: 5px 12px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.badge-new {
    background: #22c55e;
    color: white;
    padding: 5px 12px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.75rem;
}

/* دکمه‌های تصویر (لایک، اشتراک) */
.image-actions {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.image-action-btn {
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.image-action-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* Thumbnail ها */
.thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.thumbnails::-webkit-scrollbar {
    height: 4px;
}

.thumbnails::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.thumbnail {
    flex: 0 0 auto;
    width: 75px;
    height: 75px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 5px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.thumbnail:hover {
    border-color: var(--primary);
}

.thumbnail.active {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* ===== اطلاعات محصول ===== */
.product-info {
    padding: 0 15px;
}

.product-brand {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.product-title-new {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.6;
    margin-bottom: 10px;
}

.product-title-en {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 15px;
    direction: ltr;
    text-align: left;
}

/* امتیاز و آمار */
.product-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #64748b;
}

.stat-item .stars {
    color: #fbbf24;
}

.stat-item .value {
    font-weight: 700;
    color: #1e293b;
}

.stat-divider {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
}

/* ویژگی‌های کلیدی */
.key-features-box {
    background: #fafbff;
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
}

.key-features-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.key-features-title i {
    color: var(--primary);
}

.key-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.key-features-list li {
    padding: 6px 0;
    color: #475569;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.key-features-list li::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    margin-top: 8px;
    flex-shrink: 0;
}

/* ===== باکس خرید (سمت چپ) ===== */
.purchase-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

.seller-info {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 15px;
}

.seller-info .label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 4px;
}

.seller-info .name {
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.seller-info .name i {
    color: var(--primary);
}

/* گارانتی و ارسال */
.purchase-features {
    padding: 12px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 15px;
}

.purchase-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: #475569;
    font-size: 0.85rem;
}

.purchase-feature i {
    width: 32px;
    height: 32px;
    background: #f0fdf4;
    color: #22c55e;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* قیمت */
.price-section-new {
    text-align: left;
    margin-bottom: 15px;
}

.price-original {
    color: #cbd5e1;
    text-decoration: line-through;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.price-discount-percent {
    display: inline-block;
    background: #ef4444;
    color: white;
    padding: 3px 12px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-left: 8px;
}

.price-final {
    font-size: 1.8rem;
    font-weight: 900;
    color: #1e293b;
}

.price-final .currency {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    margin-right: 5px;
}

.price-saving {
    color: #22c55e;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 5px;
}

/* دکمه خرید */
.buy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    margin-bottom: 10px;
}

.buy-btn:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.buy-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* انتخاب تعداد */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.quantity-selector label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
}

.quantity-selector input {
    width: 60px;
    text-align: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px;
    font-weight: 700;
    font-family: 'Vazirmatn', sans-serif;
}

/* موجودی */
.stock-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.stock-status.available {
    background: #f0fdf4;
    color: #16a34a;
}

.stock-status.low {
    background: #fef3c7;
    color: #d97706;
}

.stock-status.out {
    background: #fef2f2;
    color: #dc2626;
}

/* ═══════════════════════════════════════════ */
/* ===== تب‌های محصول ===== */
/* ═══════════════════════════════════════════ */

.product-tabs {
    background: white;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    overflow: hidden;
}

.tab-headers {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
}

.tab-headers::-webkit-scrollbar {
    height: 3px;
}

.tab-btn {
    padding: 16px 25px;
    background: none;
    border: none;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: white;
}

.tab-btn .count {
    background: #e2e8f0;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tab-btn.active .count {
    background: var(--primary);
    color: white;
}

.tab-content {
    padding: 30px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.tab-content h4 {
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    font-size: 1.15rem;
}

/* ===== جدول مشخصات ===== */
.attributes-group {
    margin-bottom: 25px;
}

.attributes-group-title {
    background: #f8fafc;
    color: #1e293b;
    padding: 12px 18px;
    border-radius: 10px 10px 0 0;
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0;
    border-bottom: 2px solid var(--primary);
}

.attributes-table {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.attributes-table tr {
    display: flex;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.attributes-table tr:last-child {
    border-bottom: none;
}

.attributes-table tr:hover {
    background: #fafbff;
}

.attributes-table td {
    padding: 12px 18px;
    font-size: 0.9rem;
}

.attr-name {
    flex: 0 0 40%;
    color: #64748b;
    font-weight: 500;
    background: #fafbff;
    border-left: 1px solid #f1f5f9;
}

.attr-value {
    flex: 1;
    color: #1e293b;
    font-weight: 600;
}

/* ===== توضیحات محصول ===== */
.product-description {
    color: #475569;
    line-height: 2.2;
    font-size: 0.95rem;
}

.product-description p {
    margin-bottom: 15px;
}

/* ===== محصولات مرتبط ===== */
.related-products {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* ===== ریسپانسیو ===== */
@media (max-width: 992px) {
    .product-info {
        padding: 20px 0;
    }

    .purchase-box {
        position: static;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .product-page {
        padding: 15px;
    }

    .product-title-new {
        font-size: 1.2rem;
    }

    .price-final {
        font-size: 1.4rem;
    }

    .tab-btn {
        padding: 12px 18px;
        font-size: 0.85rem;
    }

    .tab-content {
        padding: 20px;
    }

    .attributes-table tr {
        flex-direction: column;
    }

    .attr-name {
        flex: none;
        border-left: none;
        border-bottom: 1px solid #f1f5f9;
    }

    .thumbnail {
        width: 60px;
        height: 60px;
    }
}

/* ═══════════════════════════════════════════ */
/* ===== فیلترهای پیشرفته ===== */
/* ═══════════════════════════════════════════ */

/* Wrapper اصلی */
.filters-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.filters-wrapper::-webkit-scrollbar {
    width: 4px;
}

.filters-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* هدر فیلترها */
.filters-header {
    padding: 15px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.filters-header h5 {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filters-header .clear-all {
    color: #ef4444;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
}

.filters-header .clear-all:hover {
    color: #dc2626;
    text-decoration: underline;
}

/* هر بخش فیلتر (Accordion) */
.filter-section {
    border-bottom: 1px solid #f1f5f9;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-title {
    padding: 14px 18px;
    background: none;
    border: none;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
    transition: 0.15s;
}

.filter-title:hover {
    background: #f8fafc;
}

.filter-title i.chevron {
    transition: transform 0.3s;
    color: #94a3b8;
    font-size: 0.85rem;
}

.filter-title.collapsed i.chevron {
    transform: rotate(-90deg);
}

.filter-body {
    padding: 0 18px 15px;
    max-height: 300px;
    overflow-y: auto;
    animation: slideDown 0.2s ease;
}

.filter-body::-webkit-scrollbar {
    width: 3px;
}

.filter-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 300px; }
}

.filter-body.collapsed {
    display: none;
}

/* چک‌باکس‌های فیلتر */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    transition: 0.15s;
    position: relative;
}

.filter-checkbox:hover {
    padding-right: 4px;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.filter-checkbox label {
    flex: 1;
    font-size: 0.87rem;
    color: #475569;
    cursor: pointer;
    line-height: 1.5;
}

.filter-checkbox .count {
    font-size: 0.75rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 1px 8px;
    border-radius: 50px;
    font-weight: 600;
    flex-shrink: 0;
}

.filter-checkbox input:checked + label {
    color: var(--primary);
    font-weight: 700;
}

.filter-checkbox input:checked ~ .count {
    background: var(--primary);
    color: white;
}

/* Search داخل فیلتر */
.filter-search {
    position: relative;
    margin-bottom: 10px;
}

.filter-search input {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.85rem;
    background: #f8fafc;
}

.filter-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.filter-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
}

/* اسلایدر قیمت */
.price-range-slider {
    padding: 20px 5px 5px;
}

.price-inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.price-inputs input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.85rem;
    text-align: center;
    background: #f8fafc;
}

.price-inputs input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.price-range-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 5px;
}

.price-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, var(--primary) 0%, var(--primary) 50%, #e2e8f0 50%, #e2e8f0 100%);
    border-radius: 5px;
    outline: none;
    margin: 10px 0;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.price-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* توگل سوئیچ */
.filter-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: 0.15s;
}

.filter-toggle:hover {
    background: #f8fafc;
}

.filter-toggle span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-toggle span i {
    color: var(--primary);
    font-size: 1rem;
}

.toggle-switch {
    position: relative;
    width: 42px;
    height: 22px;
    background: #cbd5e1;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch.active::after {
    right: calc(100% - 20px);
}

/* دکمه اعمال فیلتر */
.filter-apply-btn {
    display: block;
    width: calc(100% - 36px);
    margin: 15px 18px;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
}

.filter-apply-btn:hover {
    background: var(--primary-dark);
}

/* ===== نوار فیلترهای فعال ===== */
.active-filters {
    background: white;
    border-radius: 12px;
    padding: 12px 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.active-filters .label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: 0.15s;
    text-decoration: none;
}

.active-filter-tag:hover {
    background: #dbeafe;
    color: var(--primary);
}

.active-filter-tag i {
    font-size: 0.7rem;
}

/* ===== نوار مرتب‌سازی و تعداد ===== */
.list-toolbar {
    background: white;
    border-radius: 12px;
    padding: 12px 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.list-toolbar .results-info {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.list-toolbar .results-info strong {
    color: #1e293b;
}

.sort-options {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.sort-options .label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
    margin-left: 5px;
}

.sort-btn {
    padding: 6px 14px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    color: #475569;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.sort-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.sort-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* دکمه فیلتر موبایل */
.mobile-filter-btn {
    display: none;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 992px) {
    .filters-wrapper {
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        max-width: 90vw;
        height: 100vh;
        max-height: 100vh;
        z-index: 2000;
        border-radius: 0;
        transition: right 0.3s;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    }

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

    .filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
        display: none;
    }

    .filter-overlay.show {
        display: block;
    }

    .mobile-filter-btn {
        display: inline-flex;
    }

    .list-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .sort-options {
        overflow-x: auto;
        padding-bottom: 5px;
    }
}


/* ═══════════════════════════════════════════ */
/* ===== صفحه ثابت (شرایط، حریم خصوصی...) ===== */
/* ═══════════════════════════════════════════ */

.static-page-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.static-page-header {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    padding: 30px;
    border-bottom: 1px solid #e2e8f0;
}

.static-page-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.static-page-header h1 i {
    color: var(--primary);
}

.page-meta {
    color: #64748b;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.static-page-content {
    padding: 35px 40px;
    line-height: 2.2;
    color: #334155;
    font-size: 0.95rem;
}

.static-page-content h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e293b;
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f5f9;
}

.static-page-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #334155;
    margin: 25px 0 12px 0;
}

.static-page-content p {
    margin-bottom: 15px;
    text-align: justify;
}

.static-page-content ul,
.static-page-content ol {
    padding-right: 25px;
    margin-bottom: 20px;
}

.static-page-content ul li,
.static-page-content ol li {
    margin-bottom: 10px;
    color: #475569;
}

.static-page-content a {
    color: var(--primary);
    text-decoration: underline;
}

.static-page-content strong {
    color: #1e293b;
    font-weight: 700;
}

.static-page-content blockquote {
    background: #f8fafc;
    border-right: 4px solid var(--primary);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 8px;
    color: #475569;
    font-style: italic;
}

/* ═══════════════════════════════════════════ */
/* ===== چک‌باکس تایید قوانین ===== */
/* ═══════════════════════════════════════════ */

.terms-check-box {
    background: #fefce8;
    border: 2px solid #fde047;
    border-radius: 12px;
    padding: 15px 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: 0.2s;
}

.terms-check-box.checked {
    background: #f0fdf4;
    border-color: #86efac;
}

.terms-check-box input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.terms-check-box label {
    flex: 1;
    cursor: pointer;
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.8;
    margin: 0;
}

.terms-check-box label a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
    transition: 0.15s;
}

.terms-check-box label a:hover {
    color: var(--primary-dark);
}

.terms-check-box label a i {
    font-size: 0.85rem;
}

/* دکمه پرداخت غیرفعال */
.buy-btn:disabled,
.btn-success-custom:disabled {
    background: #cbd5e1 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    transform: none !important;
    box-shadow: none !important;
}

/* مودال قوانین */
.terms-modal-body {
    max-height: 500px;
    overflow-y: auto;
    padding: 25px 30px;
    line-height: 2;
    color: #475569;
}

.terms-modal-body h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e293b;
    margin: 20px 0 10px;
}

.terms-modal-body h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
    margin: 15px 0 8px;
}

.terms-modal-body p {
    margin-bottom: 12px;
}

.terms-modal-body ul, .terms-modal-body ol {
    padding-right: 20px;
    margin-bottom: 15px;
}


/* ═══════════════════════════════════════ */
/* ===== ورود پیامکی (OTP) ===== */
/* ═══════════════════════════════════════ */

.otp-container {
    max-width: 450px;
    margin: 40px auto;
}

.otp-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 35px;
    text-align: center;
}

.otp-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.otp-icon i {
    font-size: 2.5rem;
    color: var(--primary);
}

.otp-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
}

.otp-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 25px;
}

.otp-phone-display {
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 20px;
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: #16a34a;
    letter-spacing: 2px;
    direction: ltr;
}

/* Input شماره موبایل */
.otp-phone-input {
    font-size: 1.5rem !important;
    font-weight: 700;
    letter-spacing: 3px;
    padding: 15px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    text-align: center;
    direction: ltr;
    font-family: monospace;
}

.otp-phone-input:focus {
    border-color: var(--primary) !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
    outline: none;
}

/* Input کد تایید */
.otp-input {
    font-size: 2rem !important;
    font-weight: 800;
    letter-spacing: 15px;
    padding: 15px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    text-align: center;
    direction: ltr;
    font-family: monospace;
    background: #f8fafc !important;
}

.otp-input:focus {
    border-color: var(--primary) !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
    outline: none;
}

/* دکمه اصلی */
.otp-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    width: 100%;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    transition: 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.otp-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.otp-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* شمارنده معکوس */
.otp-timer {
    background: #fef3c7;
    color: #92400e;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.otp-timer .timer-num {
    font-family: monospace;
    font-weight: 800;
    font-size: 1.1rem;
    color: #d97706;
}

/* لینک‌های زیر */
.otp-links {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
}

.otp-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
}

.otp-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.otp-link:disabled,
.otp-link.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    pointer-events: none;
}

/* دکمه ورود با نام کاربری */
.otp-alternate {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

.otp-alternate a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.otp-alternate a:hover {
    text-decoration: underline;
}