/* ========== متغیرهای رنگی ========== */
:root {
    --primary: #1a1a1a;       /* سیاه */
    --secondary: #d4af37;      /* طلایی */
    --light: #f5f5f5;          /* سفید روشن */
    --white: #ffffff;          /* سفید */
    --text: #333;              /* متن سیاه */
    --border: #e0e0e0;         /* حاشیه خاکستری */
    --success: #4caf50;
    --danger: #f44336;
    --warning: #ff9800;
    --info: #2196f3;

    /* توکن‌های تم تیره/پرمیوم (صفحه اصلی و چیدمان‌های تیره) */
    --ink-950: #0a0a0c;
    --ink-900: #101012;
    --ink-800: #17171a;
    --ink-700: #1f1f23;
    --ink-line: rgba(255, 255, 255, 0.08);
    --ink-line-strong: rgba(255, 255, 255, 0.14);
    --paper: #f5f2ea;
    --paper-dim: #a9a9b2;
    --gold: #d4af37;
    --gold-soft: #f1d78a;
    --gold-dim: rgba(212, 175, 55, 0.16);
    --ease-premium: cubic-bezier(0.16, 0.8, 0.24, 1);
    --radius-lg: 22px;
    --radius-md: 14px;
}

/* ========== ریست و تنظیمات پایه ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    direction: rtl;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background-color: var(--light);
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
}

/* ========== تایپوگرافی ========== */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    color: var(--primary);
    font-weight: 700;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #b8922f;
    text-decoration: underline;
}

/* ========== کانتینر و گریڈ ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.col {
    display: flex;
    flex-direction: column;
}

/* ========== ناوبر ========== */
nav.navbar {
    background: rgba(10, 10, 12, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 1rem 0;
    border-bottom: 1px solid var(--ink-line);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.4s var(--ease-premium), border-color 0.4s var(--ease-premium), box-shadow 0.4s var(--ease-premium);
}

nav.navbar.scrolled {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* در صفحه اصلی، هدر ابتدا کاملاً شفاف روی Hero می‌نشیند و با اسکرول شیشه‌ای می‌شود */
body.home-page nav.navbar {
    position: fixed;
    left: 0;
    right: 0;
    background: transparent;
    border-bottom-color: transparent;
    box-shadow: none;
}

body.home-page nav.navbar.scrolled {
    background: rgba(10, 10, 12, 0.85);
    border-bottom-color: var(--ink-line);
}

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

.nav-logo {
    color: var(--white);
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: 0.2px;
    flex-shrink: 0;
}

.nav-logo .logo-mark {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-logo .logo-pro {
    color: var(--gold);
}

.nav-collapse {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.nav-menu {
    display: flex;
    gap: 2.2rem;
    list-style: none;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-menu a {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
    text-decoration: none;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s var(--ease-premium);
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-menu a:hover {
    color: var(--white);
    text-decoration: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-shrink: 0;
}

.nav-link-action {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.92rem;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-link-action:hover {
    color: var(--gold);
    text-decoration: none;
}

.nav-admin-tag {
    color: var(--gold);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--gold-dim);
    border-radius: 999px;
    background: var(--gold-dim);
}

.nav-cart-link {
    position: relative;
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
}

.nav-cart-count {
    position: absolute;
    top: -8px;
    left: -10px;
    background: var(--gold);
    color: #17140a;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.3rem;
    background: var(--gold);
    color: #17140a;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 0 0 rgba(212, 175, 55, 0);
    transition: transform 0.3s var(--ease-premium), box-shadow 0.3s var(--ease-premium), background 0.3s ease;
}

.btn-cta:hover {
    background: var(--gold-soft);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(212, 175, 55, 0.35);
    text-decoration: none;
    color: #17140a;
}

.nav-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    width: 26px;
    height: 20px;
    background: transparent;
    border: none;
    padding: 0;
}

.nav-btn span {
    width: 100%;
    height: 2px;
    background: var(--gold);
    transition: all 0.3s var(--ease-premium);
    display: block;
}

.nav-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-btn.active span:nth-child(2) {
    opacity: 0;
}

.nav-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ========== دکمه‌ها ========== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    margin-bottom: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, #b8922f 100%);
    color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3);
}

.btn-secondary {
    background: var(--primary);
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

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

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

.btn-dark:hover {
    background: #333;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* ========== فرم‌ها ========== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.form-control.error {
    border-color: var(--danger);
}

.form-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--secondary);
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}

/* ========== اسلاید شو ========== */
.slider {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 3rem;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: linear-gradient(135deg, var(--primary) 0%, #2d2d2d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-align: center;
}

.slide.active {
    opacity: 1;
}

.slide-content {
    z-index: 10;
}

.slide h2 {
    color: var(--secondary);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.slide p {
    font-size: 1.2rem;
    color: var(--light);
    margin-bottom: 2rem;
}

.slider-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 20;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    background: var(--secondary);
    transform: scale(1.3);
}

/* ========== کارت‌ها ========== */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.15);
    border-color: var(--secondary);
}

.card-header {
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    color: var(--secondary);
    font-size: 1.3rem;
    margin: 0;
}

.card-body {
    padding: 1rem 0;
}

.card-footer {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 1rem;
}

/* ========== جدول‌ها ========== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table th {
    background: linear-gradient(135deg, var(--primary) 0%, #2d2d2d 100%);
    color: var(--secondary);
    padding: 1rem;
    text-align: right;
    font-weight: 600;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.table tr:hover {
    background: var(--light);
}

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

/* ========== داشبورد ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-right: 5px solid var(--secondary);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-weight: 600;
}

/* ========== فوتر ========== */
footer {
    background: var(--ink-950);
    color: var(--white);
    padding: 4.5rem 0 1.5rem;
    margin-top: 4rem;
    border-top: 1px solid var(--ink-line);
}

.footer-top {
    display: grid;
    grid-template-columns: 1.1fr 2fr;
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-brand .footer-logo .logo-pro {
    color: var(--gold);
}

.footer-brand p {
    color: var(--paper-dim);
    line-height: 1.9;
    max-width: 340px;
}

.footer-social {
    display: flex;
    gap: 0.7rem;
    margin-top: 1.5rem;
    list-style: none;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--ink-line-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--paper-dim);
    transition: all 0.3s var(--ease-premium);
}

.social-icon svg {
    width: 18px;
    height: 18px;
}

.social-icon:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: #17140a;
    transform: translateY(-3px);
    text-decoration: none;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-section {
    margin-bottom: 0;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: 1.3rem;
    font-size: 1rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.7rem;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 2px;
    background: var(--gold);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.85rem;
}

.footer-section a {
    color: var(--paper-dim);
    font-size: 0.92rem;
    transition: color 0.3s ease, padding-right 0.3s ease;
}

.footer-section a:hover {
    color: var(--gold);
    text-decoration: none;
    padding-right: 4px;
}

.footer-bottom {
    border-top: 1px solid var(--ink-line);
    padding-top: 1.8rem;
    text-align: center;
    color: var(--paper-dim);
    font-size: 0.88rem;
}

/* ========== پیام‌ها و الرت‌ها ========== */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border-right: 4px solid;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: var(--success);
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
    border-color: var(--danger);
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border-color: var(--warning);
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-color: var(--info);
}

/* ========== صفحات خاص ========== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #2d2d2d 100%);
    color: var(--white);
    padding: 100px 0;
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    color: var(--secondary);
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.3rem;
    color: var(--light);
    margin-bottom: 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-item {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

/* ========== ری‌اسپانسیو ========== */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .nav-collapse {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        flex-direction: column;
        align-items: stretch;
        background: rgba(10, 10, 12, 0.97);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--ink-line);
        padding: 1.5rem 20px 2rem;
        gap: 0;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }

    .nav-collapse.active {
        display: flex;
    }

    .nav-menu {
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
        width: 100%;
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
        border-bottom: 1px solid var(--ink-line);
        text-align: center;
    }

    .nav-actions {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }

    .btn-cta {
        width: 100%;
        justify-content: center;
    }

    .nav-btn {
        display: flex;
    }

    .slider {
        height: 300px;
    }

    .slide h2 {
        font-size: 2rem;
    }

    .slide p {
        font-size: 1rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .row {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }

    /* جدول‌هایی که داخل ظرف اسکرول‌دار افقی هستند، عرض کمینه بگیرند
       تا به‌جای له‌شدن ستون‌ها، به‌صورت افقی اسکرول شوند */
    div[style*="overflow-x: auto"] > table.table {
        min-width: 640px;
    }

    div[style*="overflow-x: auto"] > table.table th,
    div[style*="overflow-x: auto"] > table.table td {
        white-space: nowrap;
    }

    .hero {
        padding: 50px 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .footer-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1rem; }

    .btn {
        width: 100%;
        text-align: center;
    }

    .hero {
        padding: 30px 0;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .form-control {
        padding: 0.6rem;
        font-size: 16px;
    }
}

/* ========== لودینگ ========== */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== مودال ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    animation: slideIn 0.3s ease;
}

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

.modal-header {
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.modal-close {
    float: left;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--danger);
}

/* ========== پاپ‌آپ اطلاعیه سایت ========== */

.announce-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 8, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease-premium), visibility 0.35s;
}

.announce-overlay.show {
    opacity: 1;
    visibility: visible;
}

.announce-box {
    position: relative;
    background: var(--ink-900);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-lg);
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.2rem 1.8rem 1.8rem;
    text-align: center;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
    transform: translateY(16px) scale(0.97);
    transition: transform 0.35s var(--ease-premium);
}

.announce-overlay.show .announce-box {
    transform: translateY(0) scale(1);
}

.announce-close {
    position: absolute;
    top: 0.9rem;
    left: 1rem;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--paper-dim);
    cursor: pointer;
    transition: color 0.2s ease;
}

.announce-close:hover {
    color: var(--gold);
}

.announce-title {
    color: var(--paper);
    font-size: 1.35rem;
    margin-bottom: 1.2rem;
    padding-left: 1.5rem;
}

.announce-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.2rem;
}

.announce-image img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
}

.announce-message {
    color: var(--paper-dim);
    line-height: 1.9;
    margin-bottom: 1.5rem;
}

.announce-btn {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    background: var(--gold);
    color: #17140a;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.25s var(--ease-premium), box-shadow 0.25s var(--ease-premium), background 0.25s ease;
}

.announce-btn:hover {
    background: var(--gold-soft);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(212, 175, 55, 0.35);
    text-decoration: none;
    color: #17140a;
}

@media (max-width: 480px) {
    .announce-box {
        padding: 1.8rem 1.3rem 1.4rem;
    }
}
