/* --- تنظیمات پایه و فونت --- */
@font-face {
    font-family: 'BNazanin';
    src: url('fonts/B-NAZANIN.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --primary-coffee: #a97142;
    --primary-hover: #c28856;
    --text-main: #f0f0f0;
    --text-muted: #b0b0b0;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 15px rgba(169, 113, 66, 0.2);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    font-family: 'BNazanin', Tahoma, sans-serif; /* اولویت با فونت شما */
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; font-family: inherit; }

/* --- هدر --- */
header {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-coffee);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    transition: var(--transition);
    font-weight: bold;
    font-size: 1.1rem;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-coffee);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cart-btn {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-btn:hover {
    background: var(--primary-coffee);
    border-color: var(--primary-coffee);
}

.cart-count {
    background: #ff4757;
    color: white;
    font-size: 0.8rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- بخش اصلی (Hero) --- */
.hero {
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at center, #2a2a2a 0%, #121212 70%);
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
    /* اصلاح مشکل چیدمان وسط */
    width: 100%;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--primary-coffee);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.cta-btn {
    background: var(--primary-coffee);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    transition: var(--transition);
    box-shadow: var(--shadow-glow);
}

.cta-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-5px);
}

/* --- منوی محصولات --- */
.menu-section {
    padding: 5rem 5%;
    flex-grow: 1;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary-coffee);
}

.filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary-coffee);
    color: white;
    border-color: var(--primary-coffee);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-soft);
    border-color: var(--primary-coffee);
}

.product-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.product-desc {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-coffee);
}

.add-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.2rem;
}

.add-btn:hover {
    background: var(--primary-coffee);
    transform: rotate(90deg);
}

/* --- فرم‌ها و مودال‌ها --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: white;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--primary-coffee);
}

.submit-btn {
    width: 100%;
    background: var(--primary-coffee);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    transition: var(--transition);
}

.submit-btn:hover {
    background: var(--primary-hover);
}

/* --- سبد خرید سایدبار --- */
.cart-sidebar {
    width: 400px;
    max-width: 90%;
    background: var(--bg-card);
    height: 100%;
    padding: 2rem;
    transform: translateX(100%);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255,255,255,0.1);
    position: absolute;
    left: 0; /* RTL: سایدبار از راست باز میشه */
    top: 0;
}

.modal-overlay.open .cart-sidebar {
    transform: translateX(0);
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,0.03);
    padding: 1rem;
    border-radius: 12px;
}

.cart-item img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.cart-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 25px;
    height: 25px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- فوتر --- */
footer {
    background: #0a0a0a;
    padding: 3rem 5%;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-col h3 {
    color: var(--primary-coffee);
    margin-bottom: 1.5rem;
}

.footer-col p, .footer-col li {
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.map-placeholder {
    width: 100%;
    height: 200px;
    background: #222;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 1px dashed #444;
}

/* --- پنل ادمین و داشبورد --- */
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.dashboard-table th, .dashboard-table td {
    text-align: right;
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dashboard-table th {
    color: var(--primary-coffee);
}

.status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}
.status-pending { background: #f39c12; color: #fff; }
.status-completed { background: #27ae60; color: #fff; }

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--bg-card);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    border-right: 4px solid var(--primary-coffee);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 3000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .nav-links { display: none; }
    .cart-sidebar { width: 100%; }
}