/* ======================================
   فروشگاه سورس - استایل اصلی
   بدون وابستگی به CDN خارجی
   ====================================== */

/* فونت وزیرمتن - داخلی */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ======== متغیرها ======== */
:root {
    --primary: #1a1f2e;
    --primary-light: #2c3550;
    --accent: #6c63ff;
    --accent-hover: #5a52e0;
    --success: #00c896;
    --warning: #ffb300;
    --danger: #ff4757;
    --info: #17a2b8;
    --bg: #f0f2f8;
    --surface: #ffffff;
    --surface2: #f8f9fc;
    --border: #e2e8f0;
    --text: #1a202c;
    --text-muted: #718096;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 48px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 50px;
}

/* ======== ریست و پایه ======== */
*, *::before, *::after { box-sizing: border-box; }

body {
    background: var(--bg);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    color: var(--text);
    line-height: 1.8;
    margin: 0;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ======== نوار پیمایش ======== */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 0.7rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.navbar-brand {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.navbar-brand span.brand-icon {
    background: var(--accent);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    padding: 0.45rem 0.9rem;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}
.nav-links a:hover { background: rgba(255,255,255,0.15); color: #fff; }
.nav-links a.active { background: var(--accent); color: #fff; }

/* بج سبد خرید */
.cart-link { position: relative; }
.cart-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background: var(--warning);
    color: #1a1a1a;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* دراپ‌داون */
.dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 0.5rem;
    z-index: 1001;
    border: 1px solid var(--border);
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
    color: var(--text) !important;
    padding: 0.6rem 1rem !important;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dropdown-menu a:hover { background: var(--surface2) !important; }
.dropdown-menu a.text-danger { color: var(--danger) !important; }
.dropdown-divider { border-top: 1px solid var(--border); margin: 0.5rem 0; }

/* hamburger */
.navbar-toggler {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    color: white;
    font-size: 1.2rem;
}

/* ======== Layout ======== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

main.main-content {
    padding: 1.5rem 0 3rem;
}

/* ======== پیام‌های فلش ======== */
.flash-container { padding: 0.5rem 0; }
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    border: none;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.alert-success { background: #d4f5ea; color: #065f46; }
.alert-danger   { background: #fee2e2; color: #991b1b; }
.alert-warning  { background: #fef3c7; color: #92400e; }
.alert-info     { background: #dbeafe; color: #1e40af; }
.alert-close {
    margin-right: auto;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
}
.alert-close:hover { opacity: 1; }

/* ======== Hero ======== */
.hero-section {
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 50%, #ec4899 100%);
    color: white;
    padding: 4rem 2rem;
    border-radius: 24px;
    margin: 1rem 0 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-section h1 {
    font-size: 2.8rem;
    font-weight: 900;
    margin: 0 0 1rem;
    position: relative;
}
.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0 0 2rem;
    position: relative;
}
.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--accent);
    padding: 0.85rem 2.5rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.3s;
    position: relative;
}
.hero-btn:hover {
    background: var(--warning);
    color: #1a1a1a;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

/* ======== کارت محصول ======== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.product-thumb {
    position: relative;
    height: 210px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.product-card:hover .product-thumb img { transform: scale(1.06); }
.product-thumb-icon {
    font-size: 4rem;
    opacity: 0.4;
    color: white;
}
.product-thumb-label {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.product-body {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 0.5rem;
}
.product-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    flex: 1;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}
.product-price {
    color: var(--success);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}
.product-price small { font-size: 0.8rem; font-weight: 400; color: var(--text-muted); }

.product-actions {
    display: flex;
    gap: 0.5rem;
}
.product-actions .btn { flex: 1; text-align: center; }

/* ======== دکمه‌ها ======== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius-sm);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: linear-gradient(135deg, var(--accent), #8b5cf6); color: white; }
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-hover), #7c3aed); box-shadow: 0 6px 20px rgba(108,99,255,0.4); color: white; }

.btn-success { background: linear-gradient(135deg, var(--success), #10b981); color: white; }
.btn-success:hover { box-shadow: 0 6px 20px rgba(0,200,150,0.4); color: white; }

.btn-warning { background: var(--warning); color: #1a1a1a; }
.btn-warning:hover { background: #ffa000; color: #1a1a1a; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #e0002c; color: white; }

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: rgba(108,99,255,0.05); }

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}
.btn-outline-primary:hover { background: var(--accent); color: white; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1.05rem; }
.btn-pill { border-radius: var(--radius-pill); }
.btn-block { width: 100%; }
.btn-icon { padding: 0.5rem; min-width: 38px; }

/* ======== فرم‌ها ======== */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text); }
.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
textarea.form-control { resize: vertical; min-height: 90px; }

/* ======== کارت / پنل ======== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: none;
}
.card-sm { padding: 1.25rem; }

.section-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary);
    margin: 0 0 1.5rem;
}
.section-title span { color: var(--accent); }

/* ======== جدول ======== */
.table-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table thead { background: var(--primary); color: white; }
.data-table th, .data-table td {
    padding: 0.85rem 1rem;
    text-align: center;
    vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--surface2); }
.data-table tbody tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.data-table img { border-radius: 8px; }

/* ======== بج وضعیت ======== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-danger  { background: #fee2e2; color: #991b1b; }

/* ======== صفحه احراز هویت ======== */
.auth-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}
.auth-card {
    background: var(--surface);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
}
.auth-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin: 0 auto 1.5rem;
}
.auth-title { text-align: center; font-size: 1.4rem; font-weight: 700; margin-bottom: 1.75rem; }

/* ======== سبد خرید ======== */
.qty-input {
    width: 80px;
    text-align: center;
    padding: 0.4rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 0.9rem;
}
.qty-input:focus { border-color: var(--accent); outline: none; }

.cart-summary {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 80px;
}
.cart-summary h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }
.cart-total {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--success);
}

/* ======== ویژگی‌های صفحه اصلی ======== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin: 2.5rem 0;
}
.feature-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.75rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: box-shadow 0.3s;
}
.feature-card:hover { box-shadow: var(--shadow); }
.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1rem;
}
.feature-icon.blue { background: #eff6ff; color: #2563eb; }
.feature-icon.green { background: #f0fdf4; color: #16a34a; }
.feature-icon.yellow { background: #fffbeb; color: #d97706; }
.feature-card h5 { font-weight: 700; font-size: 1rem; margin: 0 0 0.4rem; }
.feature-card p { color: var(--text-muted); font-size: 0.88rem; margin: 0; }

/* ======== سفارش تأیید شده ======== */
.order-success-banner {
    background: linear-gradient(135deg, var(--success), #10b981);
    color: white;
    padding: 3rem 2rem;
    border-radius: 24px;
    text-align: center;
    margin-bottom: 2rem;
}
.order-success-banner .check-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}
.order-success-banner h2 { font-size: 1.8rem; font-weight: 900; margin: 0 0 0.5rem; }

/* ======== صفحه حساب ======== */
.profile-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--accent);
}
.profile-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
}
.profile-row:last-of-type { border-bottom: none; }
.profile-row-icon { color: var(--accent); font-size: 1rem; margin-top: 3px; }
.profile-row-label { color: var(--text-muted); font-size: 0.85rem; }
.profile-row-value { font-weight: 600; }

/* ======== سبد خالی / حالت خالی ======== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.empty-state .empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.4;
}
.empty-state h4 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ======== Checkout ======== */
.checkout-notice {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-size: 0.88rem;
    color: #92400e;
    margin-top: 1rem;
    line-height: 1.6;
}

/* ======== فوتر ======== */
footer {
    background: var(--primary);
    color: rgba(255,255,255,0.75);
    padding: 2.5rem 0 1.5rem;
    margin-top: 4rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}
footer h5 { color: white; font-weight: 700; margin: 0 0 1rem; font-size: 1rem; }
footer a { color: var(--warning); transition: color 0.2s; }
footer a:hover { color: white; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.5rem; font-size: 0.9rem; }
.footer-social { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.footer-social a {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    transition: background 0.2s;
}
.footer-social a:hover { background: var(--accent); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.25rem;
    text-align: center;
    font-size: 0.85rem;
}

/* ======== ابزار‌های کمکی ======== */
.row { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.col { flex: 1; min-width: 0; }
.col-2 { flex: 0 0 calc(50% - 0.75rem); }
.col-3 { flex: 0 0 calc(33.333% - 1rem); }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.w-100 { width: 100%; }

/* ======== ریسپانسیو ======== */
@media (max-width: 768px) {
    .hero-section h1 { font-size: 1.8rem; }
    .hero-section p { font-size: 1rem; }
    .nav-links { display: none; }
    .navbar-toggler { display: block; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        right: 0;
        left: 0;
        background: var(--primary);
        padding: 1rem;
        gap: 0.25rem;
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
    .col-2, .col-3 { flex: 0 0 100%; }
    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 0.6rem 0.5rem; }
    .auth-card { padding: 1.5rem; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: 1fr; }
    .hero-section { padding: 2.5rem 1.25rem; }
    .hero-section h1 { font-size: 1.5rem; }
    .container { padding: 0 1rem; }
    .card { padding: 1.25rem; }
}