:root {
  --navy: #0b1120;
  --navy-soft: #1e293b;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #eff6ff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --white: #ffffff;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #f59e0b;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(15,23,42,.06);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.12);
}

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

html, body { height: 100%; }

body {
  font-family: 'Vazirmatn', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

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

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 50; background: var(--white); box-shadow: 0 1px 0 var(--line); }
.topbar { background: var(--navy); color: #cbd5e1; font-size: .78rem; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 36px; }
.topbar span { display: flex; align-items: center; gap: 6px; }
.topbar a:hover { color: #fff; }

.header-main { display: flex; align-items: center; gap: 20px; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.5rem; color: var(--navy); white-space: nowrap; }
.logo .mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), #06b6d4);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.3rem; box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
.logo small { display: block; font-size: .6rem; font-weight: 500; color: var(--muted); letter-spacing: .05em; }

.search-box { flex: 1; display: flex; background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; transition: .2s; max-width: 560px; }
.search-box:focus-within { border-color: var(--blue); background: #fff; }
.search-box input { flex: 1; border: none; background: transparent; padding: 11px 14px; outline: none; font-size: .92rem; }
.search-box button { padding: 0 18px; background: var(--blue); color: #fff; font-weight: 600; }
.search-box button:hover { background: var(--blue-dark); }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--navy); transition: .2s; }
.icon-btn:hover { background: var(--blue-light); color: var(--blue); }
.icon-btn .label { display: none; }
.badge { position: absolute; top: 6px; left: 6px; background: var(--red); color: #fff; font-size: .62rem; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* nav */
.mainnav { border-top: 1px solid var(--line); background: var(--white); }
.mainnav .container { display: flex; align-items: center; gap: 4px; overflow-x: auto; height: 50px; }
.mainnav a { padding: 8px 14px; border-radius: 10px; font-size: .88rem; font-weight: 500; color: #334155; white-space: nowrap; transition: .15s; }
.mainnav a:hover, .mainnav a.active { background: var(--blue-light); color: var(--blue); }
.mainnav .cats-btn { display: flex; align-items: center; gap: 6px; background: var(--navy); color: #fff; font-weight: 600; }
.mainnav .cats-btn:hover { background: var(--blue); }

.menu-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(120deg, var(--navy) 0%, #16264a 60%, var(--blue-dark) 100%); color: #fff; border-radius: 24px; padding: 44px 40px; margin: 24px 0; position: relative; overflow: hidden; }
.hero::after { content:""; position: absolute; left: -80px; top: -80px; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(6,182,212,.35), transparent 70%); }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.7rem); font-weight: 800; line-height: 1.35; margin-bottom: 14px; max-width: 560px; }
.hero p { color: #cbd5e1; font-size: 1.05rem; max-width: 480px; margin-bottom: 24px; }
.hero .btn-white { background: #fff; color: var(--navy); padding: 12px 28px; border-radius: 12px; font-weight: 700; display: inline-block; }
.hero .btn-white:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.badges-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 14px; margin: 8px 0 28px; }
.trust { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; align-items: center; gap: 12px; }
.trust .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--blue-light); color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.trust b { font-size: .92rem; } .trust small { color: var(--muted); font-size: .78rem; }

/* ---------- Sections ---------- */
.section { margin: 36px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-size: 1.35rem; font-weight: 800; color: var(--navy); position: relative; padding-right: 14px; }
.section-head h2::before { content:""; position: absolute; right: 0; top: 4px; bottom: 4px; width: 5px; border-radius: 5px; background: var(--blue); }
.section-head a { color: var(--blue); font-size: .85rem; font-weight: 600; }

/* categories grid */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 14px; }
.cat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 12px; text-align: center; transition: .2s; }
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--blue); }
.cat-card .emoji { font-size: 2.1rem; margin-bottom: 8px; }
.cat-card b { font-size: .86rem; color: var(--navy); display: block; }
.cat-card small { color: var(--muted); font-size: .72rem; }

/* product grid */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(215px,1fr)); gap: 16px; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: .2s; position: relative; }
.pcard:hover { box-shadow: var(--shadow-lg); border-color: #cbd5e1; }
.pcard .imgwrap { position: relative; aspect-ratio: 1; background: #fff; overflow: hidden; }
.pcard .imgwrap img { width: 100%; height: 100%; object-fit: cover; transition: .4s; }
.pcard:hover .imgwrap img { transform: scale(1.06); }
.disc-tag { position: absolute; top: 10px; right: 10px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 8px; }
.wish-tag { position: absolute; top: 10px; left: 10px; width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.9); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--muted); box-shadow: var(--shadow); }
.wish-tag.on { color: var(--red); }
.oos { position: absolute; inset: 0; background: rgba(255,255,255,.6); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); }

.pcard .body { padding: 12px; display: flex; flex-direction: column; flex: 1; }
.pcard .cat { font-size: .68rem; color: var(--blue); font-weight: 600; margin-bottom: 4px; }
.pcard .title { font-size: .9rem; font-weight: 600; color: var(--navy); line-height: 1.5; min-height: 2.7em; margin-bottom: 6px; cursor: pointer; }
.pcard .title:hover { color: var(--blue); }
.rating { display: flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--amber); margin-bottom: 8px; }
.rating span { color: var(--muted); }
.price-row { margin-top: auto; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: .78rem; }
.price-now { font-weight: 800; font-size: 1.05rem; color: var(--navy); }
.price-now small { font-size: .72rem; font-weight: 500; color: var(--muted); }
.pcard .actions { display: flex; gap: 6px; margin-top: 10px; }
.btn { border-radius: 10px; font-weight: 600; font-size: .82rem; padding: 9px 12px; transition: .18s; text-align: center; }
.btn-primary { background: var(--blue); color: #fff; flex: 1; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { border: 1.5px solid var(--line); color: var(--navy); flex: 1; }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.stock-ok { font-size: .72rem; color: var(--green); font-weight: 600; }
.stock-no { font-size: .72rem; color: var(--red); font-weight: 600; }

/* ---------- Page layouts ---------- */
.crumbs { font-size: .8rem; color: var(--muted); margin: 18px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--blue); }
.page-title { font-size: 1.6rem; font-weight: 800; color: var(--navy); margin-bottom: 6px; }

.shop-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.sidebar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 130px; }
.sidebar h4 { font-size: .95rem; font-weight: 700; margin-bottom: 12px; color: var(--navy); }
.filter-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 20px; }
.filter-list button { text-align: right; padding: 8px 10px; border-radius: 9px; font-size: .85rem; color: #475569; transition: .15s; }
.filter-list button:hover { background: var(--bg); }
.filter-list button.active { background: var(--blue-light); color: var(--blue); font-weight: 700; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.toolbar select { padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: .85rem; }
.result-count { color: var(--muted); font-size: .88rem; }

/* ---------- Product detail ---------- */
.pd-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.pd-gallery { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.pd-gallery img { width: 100%; border-radius: 12px; }
.pd-info h1 { font-size: 1.5rem; font-weight: 800; color: var(--navy); margin-bottom: 10px; line-height: 1.5; }
.pd-meta { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.pd-price { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 18px 0; }
.pd-price .now { font-size: 1.7rem; font-weight: 800; color: var(--navy); }
.pd-price .old { color: var(--muted); text-decoration: line-through; margin-right: 10px; }
.pd-price .save { color: var(--green); font-weight: 700; font-size: .9rem; margin-top: 4px; }
.pd-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.pd-actions .btn { padding: 13px 24px; font-size: .95rem; }
.spec-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.spec-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.spec-table tr:last-child td { border-bottom: none; }
.spec-table td:first-child { color: var(--muted); width: 40%; background: var(--bg); font-weight: 500; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 38px; height: 40px; font-size: 1.2rem; color: var(--navy); }
.qty button:hover { background: var(--bg); }
.qty span { min-width: 44px; text-align: center; font-weight: 700; }

/* ---------- Cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.cart-item { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.cart-item img { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.cart-item .ci-body { flex: 1; min-width: 0; }
.cart-item .ci-title { font-weight: 600; font-size: .95rem; color: var(--navy); }
.cart-item .ci-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; gap: 10px; }
.cart-item .rm { color: var(--red); font-size: .82rem; font-weight: 600; }
.summary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: sticky; top: 130px; }
.summary h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 16px; }
.summary .row { display: flex; justify-content: space-between; padding: 8px 0; font-size: .9rem; color: #475569; }
.summary .row.total { border-top: 2px dashed var(--line); margin-top: 8px; padding-top: 14px; font-size: 1.1rem; font-weight: 800; color: var(--navy); }
.summary .disc { color: var(--green); }
.summary .btn { width: 100%; padding: 13px; margin-top: 16px; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 3.5rem; margin-bottom: 14px; }
.empty h3 { color: var(--navy); font-size: 1.2rem; margin-bottom: 8px; }

/* ---------- Forms / checkout ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.form-card h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 18px; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .84rem; font-weight: 600; color: #334155; }
.field input, .field select, .field textarea { padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; outline: none; font-size: .9rem; transition: .18s; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.field .err { color: var(--red); font-size: .76rem; }
.radio-card { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; transition: .18s; margin-bottom: 10px; }
.radio-card:hover { border-color: var(--blue); }
.radio-card.sel { border-color: var(--blue); background: var(--blue-light); }
.radio-card input { accent-color: var(--blue); width: 18px; height: 18px; }
.radio-card .rc-body { flex: 1; }
.radio-card b { font-size: .92rem; } .radio-card small { color: var(--muted); font-size: .78rem; }
.radio-card .rc-price { font-weight: 700; color: var(--navy); font-size: .88rem; }

.notice { border-radius: 12px; padding: 14px 16px; font-size: .85rem; margin: 14px 0; display: flex; gap: 10px; align-items: flex-start; }
.notice.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.notice.info { background: var(--blue-light); border: 1px solid #bfdbfe; color: #1e40af; }
.notice.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* ---------- Content pages ---------- */
.content-page { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; max-width: 820px; margin: 0 auto; }
.content-page h1 { font-size: 1.7rem; font-weight: 800; color: var(--navy); margin-bottom: 18px; }
.content-page h3 { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin: 22px 0 10px; }
.content-page p { color: #475569; margin-bottom: 12px; }
.content-page ul { padding-right: 22px; color: #475569; margin-bottom: 12px; }
.content-page li { margin-bottom: 6px; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.faq-q { width: 100%; text-align: right; padding: 16px; font-weight: 600; color: var(--navy); display: flex; justify-content: space-between; align-items: center; }
.faq-q:hover { background: var(--bg); }
.faq-a { padding: 0 16px 16px; color: #475569; font-size: .9rem; }

/* ---------- Account ---------- */
.acct-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.acct-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.acct-nav button { width: 100%; text-align: right; padding: 11px 14px; border-radius: 10px; font-size: .88rem; color: #475569; transition: .15s; margin-bottom: 3px; }
.acct-nav button:hover { background: var(--bg); }
.acct-nav button.active { background: var(--blue-light); color: var(--blue); font-weight: 700; }
.order-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.order-head { display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.status-pill { font-size: .74rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-paid { background: #dcfce7; color: #166534; }

/* ---------- Footer ---------- */
.footer { background: var(--navy); color: #94a3b8; margin-top: 48px; padding: 44px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer h5 { color: #fff; font-size: .98rem; margin-bottom: 14px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 8px; font-size: .85rem; }
.footer a:hover { color: #fff; }
.footer .desc { font-size: .85rem; line-height: 1.9; }
.footer-bottom { border-top: 1px solid #1e293b; margin-top: 30px; padding-top: 18px; text-align: center; font-size: .8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-bottom a { color: #60a5fa; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 14px 24px; border-radius: 12px; font-size: .9rem; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 200; animation: toastin .3s ease; display: flex; align-items: center; gap: 10px; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 20px); } }

/* ---------- Mobile drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 90; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 280px; background: #fff; z-index: 100; padding: 20px; overflow-y: auto; box-shadow: var(--shadow-lg); }
.drawer h4 { margin-bottom: 14px; color: var(--navy); }
.drawer a { display: block; padding: 12px 10px; border-radius: 10px; color: #334155; font-size: .92rem; }
.drawer a:hover { background: var(--bg); color: var(--blue); }
.drawer-close { position: absolute; top: 14px; left: 14px; font-size: 1.4rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .shop-layout, .cart-layout, .acct-layout { grid-template-columns: 1fr; }
  .pd-layout { grid-template-columns: 1fr; }
  .sidebar, .summary { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .search-box { order: 3; max-width: 100%; width: 100%; }
  .header-main { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 12px; }
  .mainnav { display: none; }
  .menu-toggle { display: flex; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 30px 22px; }
  .prod-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .pcard .actions { flex-direction: column; }
}
</parameter>