/* ==========================================================================
   تم ۷ — «topup-icons» / شارژینو (sharjino.shop)
   حال‌وهوای فروشگاه شارژ موبایل/بازی/پلتفرم به سبک behpay.com: پس‌زمینه سفید،
   ناوبری دسته‌بندیِ آیکون‌دار زیر هدر، اکسنت آبی + CTA نارنجی.
   ========================================================================== */

:root {
    --c-bg: #f7f9fc;
    --c-surface: #ffffff;
    --c-text: #0f172a;
    --c-muted: #64748b;
    --c-border: #e5e9f0;
    --c-primary: #1f5fd1;      /* آبی */
    --c-primary-dark: #17459c;
    --c-accent: #f97316;       /* نارنجی CTA */
    --c-accent-dark: #ea6a0a;
    --c-navy: #0f2044;
    --c-danger: #dc2626;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(15, 32, 68, .08);
    --shadow-sm: 0 3px 12px rgba(15, 32, 68, .06);
    --container: 1200px;
    --font: "Vazirmatn", "IRANSansX", "IRANSans", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.95;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5 { margin: 0 0 .6em; line-height: 1.5; font-weight: 700; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--c-muted); }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 24px; border-radius: 999px; border: 1px solid transparent;
    background: #eef2f7; color: var(--c-text);
    font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: .15s;
}
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--c-accent); color: #fff; }
.btn-primary:hover { background: var(--c-accent-dark); filter: none; }
.btn-blue { background: var(--c-primary); color: #fff; }
.btn-success { background: var(--c-accent); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--c-primary); color: var(--c-primary); }
.btn-danger { background: transparent; border-color: var(--c-danger); color: var(--c-danger); padding: 7px 14px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; }

/* ---------- top bar ---------- */
.top-bar { background: var(--c-navy); color: #b9c8e6; font-size: 12.5px; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; height: 40px; }
.top-bar a:hover { color: #fff; }
.top-bar .sep { margin: 0 10px; opacity: .4; }

/* ---------- header ---------- */
.site-header { background: var(--c-surface); border-bottom: 1px solid var(--c-border); position: sticky; top: 0; z-index: 40; }
.site-header-row { display: flex; align-items: center; gap: 24px; height: 78px; }
.brand { font-size: 22px; font-weight: 800; color: var(--c-primary); white-space: nowrap; }
.quick-search {
    flex: 1; display: flex; max-width: 500px;
    border: 1px solid var(--c-border); border-radius: 999px; overflow: hidden; background: #f1f5f9;
}
.quick-search input { flex: 1; border: 0; background: transparent; padding: 11px 18px; font-family: inherit; font-size: 13.5px; outline: none; }
.quick-search button { border: 0; background: var(--c-primary); color: #fff; padding: 0 22px; cursor: pointer; font-family: inherit; }
.header-actions { display: flex; align-items: center; gap: 14px; margin-inline-start: auto; font-size: 13.5px; }
.header-actions > a:first-child, .header-actions .link-button { color: var(--c-muted); }
.header-actions .btn { padding: 8px 18px; }
.header-actions .cart-link { position: relative; font-weight: 700; }
.header-actions .cart-count { background: var(--c-accent); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; margin-inline-start: 4px; }

/* ---------- icon-driven category nav (عنصر شاخص این تم) ---------- */
.icon-nav { background: var(--c-surface); border-bottom: 1px solid var(--c-border); }
.icon-nav-row { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; scrollbar-width: thin; }
.icon-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 16px; border-radius: var(--radius-sm); white-space: nowrap;
    font-size: 12.5px; font-weight: 700; color: var(--c-text); flex: 0 0 auto;
}
.icon-nav-item:hover { background: #eef4ff; color: var(--c-primary); }
.icon-nav-emoji { font-size: 22px; line-height: 1; }

/* ---------- layout shell ---------- */
main.container { padding-top: 26px; padding-bottom: 46px; min-height: 55vh; }
.breadcrumb { font-size: 12.5px; color: var(--c-muted); margin-bottom: 16px; }
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb .sep { margin: 0 6px; }

/* ---------- hero ---------- */
.hero {
    background: linear-gradient(135deg, #0f2044 0%, #1f5fd1 65%, #3b82f6 130%);
    color: #fff; border-radius: var(--radius); padding: 44px 40px; margin-bottom: 26px; box-shadow: var(--shadow);
}
.hero h1 { font-size: 27px; margin-bottom: 12px; }
.hero p { font-size: 15px; max-width: 640px; opacity: .95; margin-bottom: 22px; }
.hero .btn { background: var(--c-accent); color: #fff; }
.hero .btn:hover { background: var(--c-accent-dark); }

/* ---------- 3-step process ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 28px 0; }
.step {
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
    padding: 24px; text-align: center; box-shadow: var(--shadow-sm); position: relative;
}
.step .n {
    width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 800; font-size: 17px;
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent)); color: #fff;
}
.step .ic { font-size: 26px; margin-bottom: 8px; }
.step h4 { font-size: 15px; margin-bottom: 6px; }
.step p { font-size: 12.5px; color: var(--c-muted); margin: 0; }

/* ---------- section titles ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 34px 0 16px; }
.section-head h2 { font-size: 20px; margin: 0; }
.section-head a { font-size: 12.5px; color: var(--c-primary); }

/* ---------- category grid (home) ---------- */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 30px; }
.category-tile {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
    padding: 22px 14px; text-align: center; font-size: 13.5px; font-weight: 700;
    box-shadow: var(--shadow-sm); transition: .15s;
}
.category-tile-icon { font-size: 28px; line-height: 1; }
.category-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--c-primary); }

/* ---------- product rails / grid / card ---------- */
.rail { margin-bottom: 32px; }
.rail-title { font-size: 19px; margin-bottom: 14px; }
.rail-items, .product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.product-card {
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
    padding: 14px; box-shadow: var(--shadow-sm); position: relative; transition: .15s;
    display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.badge-discount {
    position: absolute; top: 12px; inset-inline-start: 12px;
    background: var(--c-danger); color: #fff; font-size: 11.5px; font-weight: 700;
    border-radius: 999px; padding: 2px 10px;
}
.product-card-cover { aspect-ratio: 1/1; margin-bottom: 12px; border-radius: 12px; overflow: hidden; background: #eef4f8; }
.product-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.product-card-cover-placeholder {
    width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 12px;
    font-size: 12.5px; color: var(--c-muted);
    background: repeating-linear-gradient(45deg, #eef4f8, #eef4f8 12px, #e6eef4 12px, #e6eef4 24px);
}
.product-card-name { font-size: 13.5px; font-weight: 600; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.product-card-price { margin-top: auto; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-old { color: var(--c-muted); text-decoration: line-through; font-size: 12px; }
.price-final { color: var(--c-primary); font-weight: 800; font-size: 14.5px; }
.badge-stock { display: inline-block; margin-top: 10px; font-size: 11.5px; border-radius: 999px; padding: 2px 10px; }
.badge-stock.in-stock { background: #dbeafe; color: var(--c-primary-dark); }
.badge-stock.out-of-stock { background: #ffe4e9; color: var(--c-danger); }
.card-cta { margin-top: 12px; }
.card-cta .btn { width: 100%; padding: 9px; font-size: 13px; }

/* ---------- why-us ---------- */
.why-us { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 34px 0; }
.why-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.why-card .ic { font-size: 26px; margin-bottom: 10px; }
.why-card h4 { font-size: 14.5px; margin-bottom: 4px; }
.why-card p { font-size: 12.5px; color: var(--c-muted); margin: 0; }

/* ---------- popular brands ---------- */
.popular-brands { margin: 30px 0; }
.brand-list { display: flex; flex-wrap: wrap; gap: 12px; }
.brand-chip { display: flex; align-items: center; gap: 8px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 600; }
.brand-chip img { width: 22px; height: 22px; object-fit: contain; }

/* ---------- category page ---------- */
.category-page h1 { font-size: 22px; }
.category-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.filters-sidebar { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); position: sticky; top: 96px; }
.filters-sidebar h4 { font-size: 15px; }
.filters-sidebar label { display: block; font-size: 12.5px; margin: 12px 0 4px; color: var(--c-muted); }
.filters-sidebar input[type=number], .filters-sidebar select { width: 100%; padding: 9px 10px; border: 1px solid var(--c-border); border-radius: 10px; font-family: inherit; font-size: 13px; background: #f1f5f9; }
.filters-sidebar label input { margin-inline-end: 6px; }
.filters-sidebar .btn { width: 100%; margin-top: 16px; }
.category-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.category-toolbar select { padding: 9px 14px; border: 1px solid var(--c-border); border-radius: 999px; font-family: inherit; background: #fff; }

/* ---------- product details ---------- */
.product-details { display: grid; grid-template-columns: 400px 1fr; gap: 32px; align-items: start; }
.product-details-cover { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); aspect-ratio: 1/1; display: grid; place-items: center; }
.product-details-cover .ph { color: var(--c-muted); text-align: center; font-size: 13px; }
.product-details-info h1 { font-size: 21px; }
.product-brand { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-muted); margin-bottom: 8px; }
.product-brand .brand-logo { width: 26px; height: 26px; object-fit: contain; }
.product-price-box { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; background: #eef4ff; border: 1px solid #dbe6fb; border-radius: var(--radius); padding: 16px 20px; margin: 14px 0; }
.product-price-box .price-final { font-size: 20px; }
.product-spec-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 18px 0; font-size: 13px; }
.product-spec-list dt { color: var(--c-muted); }
.product-spec-list dd { margin: 0; font-weight: 600; }
.product-tabs { margin: 20px 0; }
.tab-heads { display: flex; gap: 4px; border-bottom: 2px solid var(--c-border); flex-wrap: wrap; }
.tab-heads button { border: 0; background: none; font: inherit; cursor: pointer; padding: 10px 16px; font-weight: 700; font-size: 13.5px; color: var(--c-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-heads button.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.tab-body { padding: 16px 2px; font-size: 13.5px; }
.tab-body[hidden] { display: none; }
.add-to-cart-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.qty-input { width: 74px; padding: 9px; border: 1px solid var(--c-border); border-radius: 10px; font-family: inherit; text-align: center; }
.recipient-input {
    flex: 1 1 220px; min-width: 180px; padding: 9px 12px; border: 1px solid var(--c-border);
    border-radius: 10px; font-family: inherit; font-size: 13.5px;
}
.recipient-edit-form { display: inline-block; min-width: 160px; }

/* ---------- cart / checkout ---------- */
.cart-page h1, .checkout-page h1 { font-size: 21px; }
.cart-table { width: 100%; border-collapse: collapse; background: var(--c-surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.cart-table th, .cart-table td { padding: 13px 14px; border-bottom: 1px solid var(--c-border); font-size: 13.5px; text-align: start; }
.cart-table th { background: #eef4f8; font-size: 12.5px; color: var(--c-muted); }
.cart-table tr:last-child td { border-bottom: 0; }
.inline-form { display: inline; }
.cart-summary { margin-top: 18px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.cart-summary .total-line { font-size: 16px; }
.discount-form { display: flex; gap: 8px; margin: 16px 0; }
.discount-form input { flex: 1; max-width: 260px; padding: 10px 14px; border: 1px solid var(--c-border); border-radius: 999px; font-family: inherit; }
.payment-method-choice { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.payment-method-choice label { border: 1px solid var(--c-border); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; cursor: pointer; background: var(--c-surface); }
.payment-method-choice input { margin-inline-end: 8px; }

/* invoice lines table (پرداخت/فاکتور) */
.invoice-lines { width: 100%; border-collapse: collapse; margin: 16px 0; }
.invoice-lines th, .invoice-lines td { padding: 10px 12px; border-bottom: 1px solid var(--c-border); font-size: 13px; text-align: start; }
.invoice-lines th { background: #eef4f8; color: var(--c-muted); font-size: 12px; }

/* ---------- auth / content / result ---------- */
.auth-form, .content-page, .result-box, .pay-box { max-width: 620px; margin: 0 auto; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow-sm); }
.content-page { max-width: 880px; }
.auth-form h1, .content-page h1 { font-size: 20px; }
.form-control { display: block; width: 100%; margin-bottom: 14px; padding: 11px 14px; border: 1px solid var(--c-border); border-radius: 10px; font-family: inherit; font-size: 13.5px; background: #f1f5f9; }
.auth-form label, .contact-form label { display: block; font-size: 12.5px; color: var(--c-muted); margin-bottom: 4px; }
.content-block { border-top: 1px solid var(--c-border); padding-top: 16px; margin-top: 16px; }
.content-block:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.content-block h2 { font-size: 16px; color: var(--c-primary); }
.contact-info { font-size: 13.5px; }
.contact-info ul { padding: 0; margin: 0; }
.contact-info li { margin-bottom: 8px; list-style: none; }
.alert-error { background: #ffe4e9; color: var(--c-danger); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.alert-error:empty { display: none; }
.alert-success { background: #dbeafe; color: var(--c-primary-dark); border-radius: 10px; padding: 12px 16px; font-size: 13.5px; }
.result-box { text-align: center; }
.result-box.result-success h1 { color: var(--c-primary); }
.result-box.result-failed h1 { color: var(--c-danger); }
.result-box dl, .pay-box dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; text-align: start; font-size: 13.5px; margin: 16px 0; }
.result-box dt, .pay-box dt { color: var(--c-muted); }
.result-box dd, .pay-box dd { margin: 0; font-weight: 600; }
.pay-actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }

/* ---------- footer ---------- */
.site-footer { background: var(--c-navy); color: #a9b8d6; margin-top: 50px; font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.1fr 1.3fr; gap: 30px; padding: 44px 0 28px; }
.footer-col h4 { color: #fff; font-size: 14.5px; margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a:hover { color: #fff; }
.footer-brand .brand { color: #fff; }
.footer-brand p { margin: 10px 0 0; line-height: 2; }
.trust-badges { display: flex; gap: 12px; flex-wrap: wrap; }
.trust-badge { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 12px; width: 122px; text-align: center; font-size: 11.5px; line-height: 1.7; }
.trust-badge .ic { font-size: 22px; display: block; margin-bottom: 4px; }
.footer-social { display: flex; gap: 10px; margin-top: 12px; }
.footer-social a { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.08); font-size: 15px; }
.footer-social a:hover { background: var(--c-primary); color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 0; text-align: center; font-size: 12px; color: #7d8fad; }

/* ---------- responsive ---------- */
@media (max-width: 992px) {
    .steps, .why-us { grid-template-columns: repeat(2, 1fr); }
    .category-layout { grid-template-columns: 1fr; }
    .filters-sidebar { position: static; }
    .product-details { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .site-header-row { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 12px; }
    .quick-search { order: 3; max-width: 100%; flex-basis: 100%; }
    .steps, .why-us, .footer-grid { grid-template-columns: 1fr; }
    .hero { padding: 30px 22px; }
    .hero h1 { font-size: 22px; }
    .rail-items, .product-grid { grid-template-columns: repeat(2, 1fr); }
    .cart-table { display: block; overflow-x: auto; }
}

/* ===== ویزارد احراز هویت (مشترک همهٔ تم‌ها) ===== */
.auth-form.onboarding { max-width: 640px; }
.wizard-steps { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1.4rem; }
.wizard-steps li { display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: #9aa0a6; flex: 1 1 auto; }
.wizard-steps li .num { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid currentColor; font-weight: 700; }
.wizard-steps li.current { color: #1f5fd1; font-weight: 700; }
.wizard-steps li.done { color: #16a34a; }
.wizard-steps li.done .num::after { content: "✓"; }
.wizard-steps li.done .num { font-size: 0; }
.warn-box { background: #fff7ed; border: 1px solid #fdba74; color: #9a3412; border-radius: 8px; padding: .8rem 1rem; margin-bottom: 1rem; line-height: 1.8; font-size: .9rem; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: 8px; padding: .6rem .9rem; margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; }
.form-grid .col-span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.camera-box { background: #000; border-radius: 12px; overflow: hidden; margin: 1rem 0; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.camera-box video, .camera-box canvas { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.capture-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.challenge-sentence { background: #f1f5f9; border-right: 4px solid #1f5fd1; border-radius: 8px; padding: 1rem 1.2rem; font-size: 1.15rem; font-weight: 700; line-height: 2; margin: 1rem 0; }
.btn-link { background: none; border: none; color: #1f5fd1; cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }
.resend-form { margin-top: .8rem; }
