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

body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.8;
    color: #1a1a2e;
    background: #f8fafc;
}

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

.btn-primary {
    display: inline-block;
    background: #f59e0b;
    color: #1a1a2e;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    text-decoration: none;
}

.btn-primary:hover {
    background: #d97706;
    transform: scale(1.02);
}

/* ---------- هدر ---------- */
header {
    background: #1a1a2e;
    color: #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.8rem;
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

nav a:hover {
    color: #f59e0b;
}

.cart-btn {
    background: #f59e0b;
    color: #1a1a2e;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-btn:hover {
    background: #d97706;
}

#cartCount {
    background: #1a1a2e;
    color: #fff;
    border-radius: 50%;
    padding: 0 0.5rem;
    font-size: 0.8rem;
}

/* ---------- بنر اصلی ---------- */
.hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 5rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- محصولات ---------- */
.products {
    padding: 4rem 0;
}

.products h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 2.5rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.product-card .emoji {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.product-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.product-card .price {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f59e0b;
    margin: 0.5rem 0;
}

.product-card .desc {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
    flex: 1;
}

.product-card .add-btn {
    background: #1a1a2e;
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.product-card .add-btn:hover {
    background: #f59e0b;
    color: #1a1a2e;
}

/* ---------- سبد خرید (کناری) ---------- */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    left: -400px;  /* چپ به راست شد */
    width: 380px;
    max-width: 90vw;
    height: 100%;
    background: #fff;
    z-index: 300;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: left 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.cart-sidebar.open {
    left: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.cart-close {
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    transition: color 0.3s;
}

.cart-close:hover {
    color: #1a1a2e;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding-left: 0.25rem;
}

.empty-cart {
    color: #94a3b8;
    text-align: center;
    margin-top: 2rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.cart-item-price {
    font-size: 0.85rem;
    color: #64748b;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.cart-item-controls button {
    background: #f1f5f9;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.cart-item-controls button:hover {
    background: #e2e8f0;
}

.cart-item-controls .qty {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.cart-item-remove {
    color: #ef4444;
    background: none !important;
    font-size: 1.2rem !important;
    width: auto !important;
    padding: 0 0.25rem;
}

.cart-item-remove:hover {
    color: #dc2626 !important;
    background: none !important;
}

.cart-footer {
    border-top: 2px solid #f1f5f9;
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.checkout-btn {
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
    padding: 0.9rem;
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    nav {
        gap: 1rem;
    }

    nav a {
        font-size: 0.9rem;
    }

    .cart-sidebar {
        width: 100%;
        max-width: 100vw;
        left: -100%;
    }
}

@media (max-width: 480px) {
    .nav-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    nav {
        justify-content: center;
        flex-wrap: wrap;
    }

    .cart-btn {
        justify-content: center;
    }
}