/* ShopKit – پایهٔ مشترک همهٔ قالب‌ها. رنگ‌ها از متغیرهای قالب فعال می‌آیند. */
@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-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(/fonts/Vazirmatn-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(/fonts/Vazirmatn-ExtraBold.woff2) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --primary: #2f5bea; --primary-text: #fff; --accent: #ffb020; --bg: #f6f8fc; --surface: #fff;
  --text: #1b2333; --muted: #6b7385; --border: #e3e8f0; --header-bg: #fff; --header-text: #1b2333;
  --footer-bg: #0f1b3d; --footer-text: #c9d2e8; --sale: #e5484d; --ok: #12a150; --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06);
  --font: Vazirmatn, Tahoma, sans-serif; --container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.8; font-size: 15px; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.5; margin: 0 0 .6em; }
h1 { font-size: 1.7rem; font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ltr { direction: ltr; unicode-bidi: embed; }

/* ===== دکمه و فرم ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: calc(var(--radius) * .7);
  padding: 10px 20px; font: inherit; font-weight: 700; cursor: pointer; background: var(--primary); color: var(--primary-text); transition: filter .15s, transform .05s; text-decoration: none !important; line-height: 1.6; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-accent { background: var(--accent); color: #1b1b1b; }
.btn-danger { background: var(--sale); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }

label { display: block; font-weight: 500; margin-bottom: 4px; font-size: .92rem; }
.field { margin-bottom: 14px; }
.input, input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=hidden]), select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) * .6);
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.alert { padding: 12px 16px; border-radius: calc(var(--radius) * .6); margin-bottom: 16px; border: 1px solid; }
.alert ul { margin: 0; padding-right: 18px; }
.alert-ok { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: color-mix(in srgb, var(--ok) 70%, var(--text)); }
.alert-error { background: color-mix(in srgb, var(--sale) 9%, var(--surface)); border-color: color-mix(in srgb, var(--sale) 35%, transparent); color: color-mix(in srgb, var(--sale) 75%, var(--text)); }
.alert-info { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.badge { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.badge.info { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.badge.warn { background: color-mix(in srgb, var(--accent) 22%, transparent); color: color-mix(in srgb, var(--accent) 55%, #000); }
.badge.bad { background: color-mix(in srgb, var(--sale) 14%, transparent); color: var(--sale); }

/* ===== هدر ===== */
.topbar { background: var(--primary); color: var(--primary-text); font-size: .82rem; }
.topbar .container { display: flex; gap: 16px; padding-top: 4px; padding-bottom: 4px; }
.topbar a { color: inherit; }
.site-header { background: var(--header-bg); color: var(--header-text); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.site-header .bar { display: flex; align-items: center; gap: 20px; min-height: 70px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--header-text); text-decoration: none !important; white-space: nowrap; }
.brand img { max-height: 44px; width: auto; }
.brand .mark { width: 38px; height: 38px; border-radius: 10px; background: var(--primary); color: var(--primary-text); display: grid; place-items: center; font-size: 1.1rem; }
.search { flex: 1; max-width: 460px; position: relative; }
.search input { padding-left: 42px; background: color-mix(in srgb, var(--bg) 70%, var(--surface)); }
.search button { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; }
.header-actions { display: flex; align-items: center; gap: 6px; margin-right: auto; }
.icon-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--header-text); font-weight: 500; white-space: nowrap; }
button.icon-btn { background: none; border: 0; font: inherit; cursor: pointer; }
.icon-btn:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); text-decoration: none; }
.icon-btn .count { position: absolute; top: 0; right: 2px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--sale); color: #fff; font-size: .7rem; display: grid; place-items: center; padding: 0 4px; }
.icon { width: 22px; height: 22px; flex: none; }
.main-nav { border-top: 1px solid var(--border); }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.main-nav a { display: block; padding: 10px 14px; color: var(--header-text); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--primary); border-bottom-color: var(--primary); text-decoration: none; }
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .site-header .bar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; min-height: 0; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .header-actions .label { display: none; }
  .main-nav { display: none; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .menu-toggle { display: inline-flex; }
  body { padding-bottom: 64px; }
}

/* نوار پایین موبایل */
.bottom-nav { display: none; }
@media (max-width: 860px) {
  .bottom-nav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; inset-inline: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0,0,0,.05); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; font-size: .72rem; color: var(--muted); position: relative; }
  .bottom-nav a:hover { text-decoration: none; color: var(--primary); }
  .bottom-nav .count { position: absolute; top: 4px; right: calc(50% - 20px); min-width: 16px; height: 16px; border-radius: 99px; background: var(--sale); color: #fff; font-size: .65rem; display: grid; place-items: center; }
}

main { min-height: 50vh; }
.page { padding: 28px 0 48px; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span { margin: 0 6px; }

/* ===== صفحهٔ اصلی ===== */
.hero { padding: 48px 0; }
.hero .inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.45; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero p { font-size: 1.05rem; color: var(--muted); max-width: 520px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero .visual { border-radius: calc(var(--radius) * 1.6); overflow: hidden; aspect-ratio: 4/3; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 40%, var(--accent))); display: grid; place-items: center; }
.hero .visual img { width: 100%; height: 100%; object-fit: cover; }
.hero .visual .placeholder { color: var(--primary-text); font-size: 5rem; opacity: .85; }
@media (max-width: 860px) { .hero { padding: 24px 0; } .hero .inner { grid-template-columns: 1fr; } .hero .visual { order: -1; aspect-ratio: 16/9; } }

.section { padding: 28px 0; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.section-head h2 { margin: 0; }
.section-head a { margin-right: auto; font-weight: 500; font-size: .92rem; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.feature { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.feature .dot { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font-weight: 800; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-weight: 700; text-align: center; transition: transform .15s, box-shadow .15s; }
.cat:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.cat .img { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); font-size: 1.6rem; }
.cat .img img { width: 100%; height: 100%; object-fit: cover; }

.banner { border-radius: calc(var(--radius) * 1.4); padding: 36px; background: linear-gradient(120deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #000)); color: var(--primary-text); display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.banner h2 { color: inherit; margin-bottom: .3em; }
.banner p { margin: 0; opacity: .9; }
.banner .btn { margin-right: auto; background: var(--accent); color: #1b1b1b; }

.rich { line-height: 2; }
.rich img { border-radius: var(--radius); margin: 1em 0; }
.rich ul, .rich ol { padding-right: 22px; }

/* ===== کارت محصول ===== */
.products { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1024px) { .products { --cols: 3 !important; } }
@media (max-width: 720px) { .products { --cols: 2 !important; gap: 10px; } }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; position: relative; }
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card .thumb { aspect-ratio: 1; background: color-mix(in srgb, var(--bg) 60%, var(--surface)); display: block; overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover .thumb img { transform: scale(1.04); }
.product-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card .title { color: var(--text); font-weight: 700; font-size: .95rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.4em; }
.product-card .kind { font-size: .75rem; color: var(--muted); }
.product-card .foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.product-card .ribbon { position: absolute; top: 10px; right: 10px; background: var(--sale); color: #fff; font-size: .75rem; font-weight: 800; border-radius: 8px; padding: 2px 8px; z-index: 2; }
.product-card .add { width: 38px; height: 38px; padding: 0; border-radius: 10px; flex: none; }
.price { font-weight: 800; color: var(--text); white-space: nowrap; }
.price .cur { font-size: .75rem; font-weight: 500; color: var(--muted); margin-right: 2px; }
.price del { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); }
.price .suffix { font-size: .75rem; color: var(--muted); font-weight: 500; }
.out { color: var(--sale); font-weight: 700; font-size: .85rem; }

/* ===== فهرست محصولات ===== */
.shop-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.sidebar .card { padding: 16px; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text); }
.sidebar li a.active, .sidebar li a:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); text-decoration: none; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select { width: auto; }
@media (max-width: 860px) { .shop-layout { grid-template-columns: 1fr; } .sidebar { display: none; } }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.pager .current { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .big { font-size: 3rem; }

/* ===== صفحهٔ محصول ===== */
.product-page { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.gallery .main { border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border); aspect-ratio: 1; }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery .thumbs button { width: 70px; height: 70px; border-radius: 10px; overflow: hidden; border: 2px solid var(--border); padding: 0; cursor: pointer; background: var(--surface); }
.gallery .thumbs button.active { border-color: var(--primary); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.buy-box .price { font-size: 1.6rem; }
.buy-box .price del { font-size: 1rem; display: inline; margin-left: 8px; }
.buy-box .short { color: var(--muted); }
.buy-box form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 18px 0; }
.qty { width: 90px !important; text-align: center; }
.meta-list { list-style: none; padding: 0; margin: 16px 0 0; border-top: 1px dashed var(--border); padding-top: 12px; font-size: .9rem; }
.meta-list li { display: flex; gap: 8px; padding: 3px 0; }
.meta-list li b { min-width: 80px; color: var(--muted); font-weight: 500; }
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.trust div { text-align: center; font-size: .8rem; color: var(--muted); background: color-mix(in srgb, var(--bg) 60%, var(--surface)); border-radius: 10px; padding: 10px 4px; }
.tabs-box { margin-top: 32px; }
@media (max-width: 860px) { .product-page { grid-template-columns: 1fr; gap: 18px; } }

/* ===== سبد و تسویه ===== */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-item { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: var(--bg); }
.cart-item .name { font-weight: 700; color: var(--text); }
.summary .line { display: flex; justify-content: space-between; padding: 6px 0; }
.summary .total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; font-weight: 800; font-size: 1.1rem; }

table.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: middle; }
.table th { font-weight: 700; color: var(--muted); font-size: .85rem; background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

/* ===== حساب کاربری ===== */
.auth-box { max-width: 440px; margin: 0 auto; }
.account-layout { display: grid; grid-template-columns: 230px 1fr; gap: 24px; align-items: start; }
.account-nav a { display: block; padding: 10px 14px; border-radius: 10px; color: var(--text); font-weight: 500; }
.account-nav a.active, .account-nav a:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); text-decoration: none; }
@media (max-width: 860px) { .account-layout { grid-template-columns: 1fr; } .account-nav { display: flex; overflow-x: auto; gap: 4px; } .account-nav form { flex: none; } }
.downloads li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); }

/* ===== تماس ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; }
.contact-info li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.contact-info { list-style: none; padding: 0; margin: 0; }
.map iframe { width: 100%; min-height: 260px; border: 0; border-radius: var(--radius); margin-top: 16px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ===== فوتر ===== */
.site-footer { background: var(--footer-bg); color: var(--footer-text); margin-top: 32px; padding: 40px 0 0; font-size: .92rem; }
.site-footer a { color: var(--footer-text); }
.site-footer a:hover { color: #fff; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 24px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { padding: 3px 0; }
.badges { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.badges img { max-height: 90px; background: #fff; border-radius: 10px; padding: 4px; }
.copyright { border-top: 1px solid rgba(255,255,255,.1); margin-top: 28px; padding: 14px 0; text-align: center; font-size: .82rem; opacity: .75; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

.result-icon { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; font-size: 2.4rem; color: #fff; }
.result-icon.ok { background: var(--ok); }
.result-icon.bad { background: var(--sale); }
.result-icon.warn { background: var(--accent); }
