/* ===== متغیرها و ریست ===== */
:root {
    --bg-dark: #0a1628;
    --bg-medium: #0f1e35;
    --bg-light: #1a2b47;
    --border: #1e3a5f;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-dark: #1e40af;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #cbd5e1;
    --white: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 10px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ===== نوار تبلیغ بالا ===== */
.top-ad-bar {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    padding: 8px 0;
    overflow: hidden;
}
.top-ad-item {
    color: var(--white);
    display: inline-block;
    padding: 0 20px;
    font-size: 13px;
    animation: slide 20s linear infinite;
}
.top-ad-item:hover { color: #fff; text-decoration: underline; }
@keyframes slide {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

/* ===== هدر ===== */
.main-header {
    background: var(--bg-medium);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    gap: 20px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: bold;
    color: var(--white);
}
.logo i {
    color: var(--primary);
    font-size: 28px;
    background: rgba(59, 130, 246, 0.1);
    padding: 10px;
    border-radius: 10px;
}

.main-nav ul { display: flex; gap: 5px; }
.main-nav a {
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.main-nav a:hover, .main-nav a.active {
    background: var(--bg-light);
    color: var(--primary-hover);
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
    background: var(--bg-light);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: var(--transition);
}
.icon-btn:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.badge {
    background: var(--danger);
    color: var(--white);
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: bold;
}

.user-dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 200px;
    padding: 8px;
    margin-top: 8px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
}
.user-dropdown:hover .dropdown-menu,
.user-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-dim);
}
.dropdown-menu a:hover { background: var(--bg-light); color: var(--primary-hover); }

.mobile-toggle { display: none; }

/* ===== منوی موبایل (پیش‌فرض مخفی در دسکتاپ) ===== */
.mobile-menu {
    display: none;
}

/* ===== دکمه‌ها ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: var(--white); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-hover), var(--primary)); transform: translateY(-2px); box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--primary); border-color: var(--primary); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: var(--white); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
/* ===== استایل کامل و فیکس‌شده بخش هیرو ===== */
.hero {
    position: relative;
    overflow: hidden;
    background: var(--bg-dark);
    padding: 100px 0;
    text-align: center;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(8px);
    transform: scale(1.1);
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 22, 40, 0.75);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

/* برگرداندن فونت درشت، ضخیم و خفن قبلی */
.hero h1 {
    font-size: 48px;
    color: var(--white);
    margin-bottom: 20px;
    font-weight: 800; /* ضخامت بالا مثل روز اول */
}

.hero h1 span { 
    color: var(--primary); 
}

.hero p {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 30px;
}
/* ===== بخش‌ها ===== */
.section { padding: 60px 0; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.section-title {
    font-size: 28px;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-title i { color: var(--primary); }
.section-title::after {
    content: '';
    display: inline-block;
    width: 50px;
    height: 3px;
    background: var(--primary);
    margin-right: 15px;
    border-radius: 2px;
}

/* ===== دسته‌بندی‌ها ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}
.category-card {
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px 15px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}
.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.15);
}
.category-card i {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 12px;
    background: rgba(59, 130, 246, 0.1);
    width: 70px; height: 70px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.category-card h3 { color: var(--white); font-size: 15px; margin-bottom: 4px; }
.category-card span { color: var(--text-muted); font-size: 12px; }

/* ===== کارت محصول ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.product-card {
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}
.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.product-image {
    height: 180px;
    background: linear-gradient(135deg, var(--bg-light), var(--bg-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-image i { font-size: 70px; color: var(--primary); opacity: 0.6; }
.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
}
.product-badge.featured { background: var(--warning); }
.product-body { padding: 18px; }
.product-category {
    color: var(--primary);
    font-size: 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.product-title {
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    min-height: 48px;
    line-height: 1.5;
}
.product-desc {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-muted);
}
.product-meta span i { margin-left: 4px; }
.product-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.price-current { color: var(--primary); font-size: 18px; font-weight: bold; }
.price-old { color: var(--text-muted); font-size: 13px; text-decoration: line-through; margin-right: 8px; }

/* ===== فرم‌ها ===== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    color: var(--text-dim);
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); background: var(--bg-medium); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

/* ===== جداول ===== */
.table-wrap { background: var(--bg-medium); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 14px; text-align: right; border-bottom: 1px solid var(--border); font-size: 14px; }
table th { background: var(--bg-light); color: var(--white); font-weight: 600; }
table tr:hover { background: rgba(59, 130, 246, 0.05); }
table tr:last-child td { border-bottom: none; }

/* ===== وضعیت‌ها ===== */
.status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.status-pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status-paid { background: rgba(59, 130, 246, 0.15); color: var(--primary); }
.status-processing { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.status-completed { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-cancelled { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* ===== کارت‌های آمار ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: var(--transition);
}
.stat-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.stat-icon {
    width: 55px; height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--white);
    flex-shrink: 0;
}
.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #1e40af); }
.stat-icon.green { background: linear-gradient(135deg, #10b981, #047857); }
.stat-icon.orange { background: linear-gradient(135deg, #f59e0b, #b45309); }
.stat-icon.red { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.stat-info h3 { color: var(--white); font-size: 24px; margin-bottom: 2px; }
.stat-info p { color: var(--text-muted); font-size: 13px; }

/* ===== احراز هویت ===== */
.auth-wrap {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-box {
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow);
}
.auth-box h2 {
    color: var(--white);
    text-align: center;
    margin-bottom: 8px;
    font-size: 26px;
}
.auth-box .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 14px;
}
.auth-box .auth-icon {
    text-align: center;
    font-size: 50px;
    color: var(--primary);
    margin-bottom: 20px;
}
.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 14px;
}
.auth-footer a { color: var(--primary); font-weight: 500; }

/* ===== سبد خرید ===== */
.cart-wrap {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 25px;
}
.cart-items { background: var(--bg-medium); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    gap: 15px;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
    width: 80px; height: 80px;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.cart-item-img i { font-size: 32px; color: var(--primary); }
.cart-item-info h4 { color: var(--white); font-size: 15px; margin-bottom: 5px; }
.cart-item-info p { color: var(--text-muted); font-size: 13px; }
.qty-control { display: flex; align-items: center; gap: 8px; background: var(--bg-dark); border-radius: 8px; padding: 4px; }
.qty-btn { width: 30px; height: 30px; background: var(--bg-light); border: none; color: var(--white); border-radius: 6px; cursor: pointer; }
.qty-btn:hover { background: var(--primary); }
.qty-num { min-width: 30px; text-align: center; color: var(--white); font-weight: 600; }
.cart-item-price { color: var(--primary); font-weight: bold; font-size: 16px; min-width: 120px; text-align: left; }
.cart-remove { color: var(--danger); background: none; border: none; cursor: pointer; font-size: 16px; padding: 8px; }

.cart-summary {
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 100px;
}
.cart-summary h3 { color: var(--white); margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.summary-row { display: flex; justify-content: space-between; padding: 10px 0; color: var(--text-dim); }
.summary-row.total { color: var(--primary); font-size: 18px; font-weight: bold; border-top: 1px solid var(--border); margin-top: 10px; padding-top: 15px; }

/* ===== پنل ادمین ===== */
.admin-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.admin-sidebar {
    background: var(--bg-medium);
    border-left: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.admin-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: 18px;
    font-weight: bold;
}
.admin-logo i { color: var(--primary); font-size: 24px; }
.admin-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-dim);
    font-size: 14px;
    border-right: 3px solid transparent;
    transition: var(--transition);
}
.admin-menu a:hover, .admin-menu a.active {
    background: var(--bg-light);
    color: var(--primary-hover);
    border-right-color: var(--primary);
}
.admin-menu a i { width: 20px; text-align: center; }

.admin-main { padding: 25px; }
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.admin-header h1 { color: var(--white); font-size: 24px; }

/* ===== پیج‌بکس ===== */
.page-box {
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 25px;
}
.page-box h2 {
    color: var(--white);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== پیگیری سفارش ===== */
.track-box {
    max-width: 600px;
    margin: 60px auto;
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
}
.track-box h2 { color: var(--white); margin-bottom: 10px; }
.track-box p { color: var(--text-muted); margin-bottom: 25px; }
.track-box .form-group { text-align: right; }

.order-timeline {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-dark);
    border-radius: 10px;
    text-align: right;
}
.timeline-step {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-right: 2px solid var(--border);
    padding-right: 25px;
    margin-right: 15px;
    position: relative;
}
.timeline-step::before {
    content: '';
    position: absolute;
    right: -9px;
    top: 20px;
    width: 16px; height: 16px;
    background: var(--border);
    border-radius: 50%;
    border: 3px solid var(--bg-dark);
}
.timeline-step.active::before { background: var(--primary); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2); }
.timeline-step.done::before { background: var(--success); }
.timeline-step h4 { color: var(--white); font-size: 15px; margin-bottom: 4px; }
.timeline-step p { color: var(--text-muted); font-size: 13px; margin: 0; }

/* ===== آلرت ===== */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid;
}
.alert-success { background: rgba(16, 185, 129, 0.1); color: var(--success); border-color: rgba(16, 185, 129, 0.3); }
.alert-error { background: rgba(239, 68, 68, 0.1); color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }
.alert-info { background: rgba(59, 130, 246, 0.1); color: var(--primary); border-color: rgba(59, 130, 246, 0.3); }

/* ===== فوتر ===== */
.main-footer {
    position: relative;
    background-image: url('<?= SITE_URL ?>/assets/img/footer-bg.jpg'); /* اصلاح مسیر با متغیر سایت */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    width: 100%;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}
.footer-col h3, .footer-col h4 {
    color: var(--white);
    margin-bottom: 18px;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-col h3 i { color: var(--primary); }
.footer-col p { color: var(--text-muted); font-size: 14px; line-height: 1.8; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a { color: var(--text-dim); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.footer-col ul a:hover { color: var(--primary); padding-right: 5px; }
.social-links { display: flex; gap: 10px; margin-top: 15px; }
.social-links a {
    width: 38px; height: 38px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: var(--transition);
}
.social-links a:hover { background: var(--primary); color: var(--white); border-color: var(--primary); transform: translateY(-3px); }
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== خالی ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 60px; color: var(--border); margin-bottom: 20px; }
.empty-state h3 { color: var(--white); margin-bottom: 10px; }

/* ===== ریسپانسیو ===== */
@media (max-width: 992px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: fixed; right: -260px; z-index: 200; transition: var(--transition); }
    .admin-sidebar.open { right: 0; }
    .cart-wrap { grid-template-columns: 1fr; }
    .hero h1 { font-size: 34px; }
}
@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-toggle { display: block; }
    .mobile-menu { display: none; background: var(--bg-medium); border-top: 1px solid var(--border); padding: 15px; }
    .mobile-menu.open { display: block; }
    .mobile-menu a { display: flex; align-items: center; gap: 10px; padding: 12px; color: var(--text-dim); border-radius: 8px; }
    .mobile-menu a:hover { background: var(--bg-light); color: var(--primary); }
    .user-name { display: none; }
    .cart-item { grid-template-columns: 60px 1fr; gap: 10px; }
    .cart-item-img { width: 60px; height: 60px; }
    .cart-item-price, .qty-control { grid-column: 2; }
    .hero { padding: 50px 0; }
    .hero h1 { font-size: 28px; }
    .section { padding: 40px 0; }
    .section-title { font-size: 22px; }
}