/* ===== ریست و متغیرها ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ink:      #1a1a2e;
    --ink-soft: #4a4a6a;
    --ink-pale: #8888aa;
    --paper:    #f8f7f4;
    --white:    #ffffff;
    --accent:   #6c63ff;
    --accent-2: #ff6584;
    --accent-lt:#ede8ff;
    --border:   #e8e6f0;
    --shadow:   0 2px 20px rgba(108,99,255,.08);
    --shadow-lg:0 8px 40px rgba(108,99,255,.14);
    --radius:   14px;
    --radius-sm:8px;
    --transition: .2s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.7;
    font-size: 15px;
    direction: rtl;
}

/* ===== لایه‌بندی ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.main { min-height: calc(100vh - 140px); }

/* ===== هدر ===== */
.header {
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 700;
    font-size: 20px;
}

.logo-icon {
    color: var(--accent);
    font-size: 22px;
}

.nav { display: flex; gap: 4px; }

.nav-link {
    text-decoration: none;
    color: var(--ink-soft);
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 14px;
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover { background: var(--accent-lt); color: var(--accent); }

.cart-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--ink);
    color: var(--white);
    text-decoration: none;
    padding: 9px 18px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.cart-btn:hover { background: var(--accent); transform: translateY(-1px); }

.cart-badge {
    background: var(--accent-2);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* ===== هیرو ===== */
.hero {
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(108,99,255,.07) 0%, transparent 70%);
    pointer-events: none;
}

.hero-eyebrow {
    display: inline-block;
    background: var(--accent-lt);
    color: var(--accent);
    padding: 4px 16px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: .03em;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
    margin-bottom: 16px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
}

.hero-sub {
    color: var(--ink-soft);
    font-size: 16px;
    max-width: 450px;
    margin: 0 auto 36px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(108,99,255,.35);
}

.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(108,99,255,.4); }

/* ===== بخش‌ها ===== */
.section { padding: 56px 0; }
.section-head { margin-bottom: 36px; }

.section-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--ink);
}

.section-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
}

.see-all {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.see-all:hover { opacity: .7; }

/* ===== گرید محصولات ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* ===== کارت محصول ===== */
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.product-img-wrap {
    position: relative;
    overflow: hidden;
    background: var(--paper);
    aspect-ratio: 1;
}

.product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.product-card:hover .product-img-wrap img { transform: scale(1.05); }

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-2);
    color: white;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 40px;
    font-weight: 600;
}

.product-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-category {
    font-size: 11px;
    color: var(--ink-pale);
    font-weight: 600;
    letter-spacing: .06em;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.4;
    text-decoration: none;
    display: block;
}

.product-name:hover { color: var(--accent); }

.product-desc {
    font-size: 13px;
    color: var(--ink-soft);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.product-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.add-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.add-btn:hover { background: #5a52d4; transform: scale(1.04); }
.add-btn:active { transform: scale(.98); }

/* ===== صفحه محصولات ===== */
.page-hero {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 40px 0;
}

.page-hero h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 4px; }
.page-hero p { color: var(--ink-soft); }

.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.filter-btn {
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--ink-soft);
    padding: 7px 16px;
    border-radius: 40px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ===== صفحه تک محصول ===== */
.product-detail { padding: 48px 0; }

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.product-detail-img {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 1;
    background: var(--paper);
}

.product-detail-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-info { display: flex; flex-direction: column; gap: 20px; }

.product-detail-cat {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}

.product-detail-name {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
}

.product-detail-desc { color: var(--ink-soft); line-height: 1.8; }

.product-detail-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink);
}

.qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.qty-input {
    width: 70px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    text-align: center;
    color: var(--ink);
    background: var(--white);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 40px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover { background: #5a52d4; transform: translateY(-1px); }

/* ===== سبد خرید ===== */
.cart-page { padding: 48px 0; }

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: start;
}

.cart-table {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child { border-bottom: none; }

.cart-item-img {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--paper);
}

.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 15px; }
.cart-item-price { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

.qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-ctrl-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--paper);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-family: inherit;
}

.qty-ctrl-btn:hover { background: var(--accent); border-color: var(--accent); color: white; }

.qty-num { min-width: 24px; text-align: center; font-weight: 600; }

.remove-btn {
    background: none;
    border: none;
    color: var(--ink-pale);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
    font-family: inherit;
}

.remove-btn:hover { color: var(--accent-2); }

.cart-summary {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-summary h2 { font-size: 1.1rem; font-weight: 700; }

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--ink-soft);
}

.summary-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--ink);
}

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

/* ===== فرم ===== */
.checkout-form {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 28px;
}

.checkout-form h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    background: var(--paper);
    transition: var(--transition);
    direction: rtl;
}

.form-group textarea { height: 90px; resize: vertical; }

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(108,99,255,.12);
}

/* ===== پیام موفقیت ===== */
.success-box {
    text-align: center;
    padding: 80px 20px;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 24px;
    display: block;
}

.success-box h1 { font-size: 1.8rem; margin-bottom: 12px; }
.success-box p { color: var(--ink-soft); margin-bottom: 28px; }

/* ===== سبد خالی ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state .empty-icon { font-size: 56px; margin-bottom: 20px; display: block; }
.empty-state h2 { font-size: 1.4rem; margin-bottom: 10px; }
.empty-state p { color: var(--ink-soft); margin-bottom: 24px; }

/* ===== فوتر ===== */
.footer {
    background: var(--ink);
    color: rgba(255,255,255,.5);
    padding: 28px 0;
    margin-top: 60px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 700;
}

.footer-copy { font-size: 13px; }

/* ===== اعلان‌ها ===== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--ink);
    color: white;
    padding: 12px 24px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transition: transform .3s ease;
    z-index: 999;
    white-space: nowrap;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== ریسپانسیو ===== */
@media (max-width: 768px) {
    .hero { padding: 50px 0 40px; }
    .product-detail-grid, .cart-layout { grid-template-columns: 1fr; }
    .nav { display: none; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
}

/* ===== نشان وضعیت (badge) ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 40px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-pending    { background: #fef3c7; color: #92400e; }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-shipped    { background: #ede9fe; color: #5b21b6; }
.badge-delivered  { background: #dcfce7; color: #166534; }
.badge-cancelled  { background: #fee2e2; color: #991b1b; }

/* ===== دکمه کوچک ===== */
.btn-sm {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--accent-lt);
    border: 1px solid transparent;
    border-radius: 40px;
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-sm:hover { background: var(--accent); color: white; }
.btn-danger:hover { background: #fff0f0; color: #dc2626; }

/* ===== فلش ===== */
.flash {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    font-weight: 500;
}
.flash-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.flash-error   { background: #fff0f0; border: 1px solid #fca5a5; color: #dc2626; }

/* ===== نشان آدرس پیش‌فرض ===== */
.address-default-badge {
    background: var(--accent);
    color: white;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 40px;
    font-weight: 600;
}
