@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

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

html, body {
    background: #f0fdf4;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    color: #333;
    direction: rtl;
    line-height: 1.8;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ═══ هدر ═══ */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px 10px;
    gap: 20px;
    flex-wrap: wrap;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    color: #1b5e20;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    gap: 3px;
    align-items: center;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.main-nav > a,
.main-nav .dropdown > a {
    padding: 10px 15px;
    color: #333;
    font-size: 15px;
    border-radius: 8px;
    display: inline-block;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s;
}

.main-nav > a:hover,
.main-nav .dropdown > a:hover {
    background: #e8f5e9;
    color: #1b5e20;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown > a::after {
    content: ' ▾';
    font-size: 12px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 8px 0;
    z-index: 1000;
    top: 100%;
    right: 0;
    margin-top: 5px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 10px 20px;
    color: #333;
    font-size: 14px;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background: #e8f5e9;
    color: #1b5e20;
    padding-right: 25px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-btn,
.user-btn-primary,
.user-btn-account {
    background: #eee;
    color: #333;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 13px;
    white-space: nowrap;
    text-decoration: none;
}

.user-btn-primary {
    background: #1b5e20;
    color: #fff;
}

.user-btn-account {
    background: #e8f5e9;
    color: #1b5e20;
}

.cart-btn {
    background: #1b5e20;
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: bold;
    white-space: nowrap;
    position: relative;
}

.cart-count {
    background: #bf360c;
    color: #fff;
    padding: 2px 8px;
    border-radius: 50%;
    margin-right: 5px;
    font-size: 12px;
}

.header-search {
    padding: 0 20px 15px;
}

.search-form {
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border-radius: 10px;
    padding: 4px;
    max-width: 600px;
    margin: 0 auto;
}

.search-form input {
    border: none;
    background: transparent;
    padding: 10px 15px;
    font-family: inherit;
    font-size: 15px;
    flex: 1;
    outline: none;
}

.search-form button {
    background: #1b5e20;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
}

.search-form button:hover {
    background: #0d3d11;
}

/* ═══ هیرو ═══ */
.hero {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    padding: 35px 0;
    text-align: center;
}

.hero h1 {
    font-size: 34px;
    color: #1b5e20;
    margin-bottom: 12px;
}

.hero p {
    font-size: 16px;
    color: #444;
    margin-bottom: 20px;
}

/* ═══ دکمه‌ها ═══ */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    font-size: 15px;
    border: none;
}

.btn-primary {
    background: #1b5e20;
    color: #fff;
}

.btn-primary:hover {
    background: #0d3d11;
}

.btn-add {
    background: #bf360c;
    color: #fff;
    width: 100%;
    text-align: center;
    margin-top: 10px;
    display: block;
}

.btn-add:hover {
    background: #bf360c;
}

/* ═══ محصولات ═══ */
.products-section {
    padding: 35px 0;
}

.section-title {
    text-align: center;
    font-size: 26px;
    color: #1b5e20;
    margin-bottom: 25px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #bf360c;
    margin: 10px auto 0;
    border-radius: 3px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.product-image {
    text-align: center;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 12px;
    aspect-ratio: 1 / 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.product-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.product-weight {
    background: #c8e6c9;
    color: #1b5e20;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
    margin-bottom: 8px;
    align-self: flex-start;
}

.product-price {
    font-size: 17px;
    font-weight: bold;
    color: #1b5e20;
    margin-top: auto;
    margin-bottom: 10px;
    padding-top: 10px;
}

.alert {
    background: #fff3e0;
    color: #bf360c;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

/* ═══ فوتر ═══ */
.site-footer {
    background: #1b3a1e;
    color: #c8e6c9;
    padding: 35px 0 15px;
    margin-top: 40px;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-col h3 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 17px;
}

.footer-col p,
.footer-col a {
    display: block;
    color: #c8e6c9;
    margin-bottom: 8px;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: #f9a825;
}

.footer-bottom {
    text-align: center;
    padding-top: 18px;
    font-size: 13px;
    color: #a5d6a7;
}

/* ═══ ریسپانسیو ═══ */
@media (max-width: 900px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr; }
    .hero h1 { font-size: 26px; }
}

@media (max-width: 600px) {
    .header-top { flex-wrap: wrap; justify-content: center; }
    .main-nav { order: 10; width: 100%; }
    .hero h1 { font-size: 22px; }
    .products-grid { grid-template-columns: 1fr; }
}

/* ═══ سبد خرید موبایل ═══ */
@media (max-width: 768px) {
    .cart-table thead { display: none; }
    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
    .cart-table tr { background: #f9fafb; border-radius: 12px; padding: 15px; margin-bottom: 15px; border: 1px solid #f0f0f0; }
    .cart-table td { padding: 8px 0 !important; border: none !important; display: flex; justify-content: space-between; align-items: center; }
    .cart-table td:first-child { justify-content: center; padding-bottom: 12px !important; border-bottom: 1px solid #f0f0f0 !important; margin-bottom: 8px; }
    .cart-table td:last-child { justify-content: center; padding-top: 12px !important; border-top: 1px solid #f0f0f0 !important; }
}