/* PERSIZ — theme & shared styles */
:root {
  --navy: #1b2a52;
  --navy-dark: #101b3a;
  --red: #c8102e;
  --gold: #c9a15c;
  --cream: #f7f3ec;
  --ink: #23262b;
  --muted: #6b7280;
  --line: #e7e2d8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  line-height: 1.7;
}
html[lang="en"] body { font-family: 'Outfit', 'Segoe UI', sans-serif; }

h1, h2, h3, h4 { color: var(--navy-dark); line-height: 1.3; margin: 0 0 .5em; }
html[lang="fa"] h1, html[lang="fa"] h2, html[lang="fa"] h3 { font-weight: 800; letter-spacing: -0.01em; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--red); }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.red { color: var(--red); }
.navy { color: var(--navy); }
.gold { color: var(--gold); }
.center { text-align: center; }
.section { padding: 56px 0; }
.section-title { font-size: 1.8rem; margin-bottom: 6px; }
.section-sub { color: var(--muted); margin-bottom: 28px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--navy); color: #fff; border: none; cursor: pointer;
  padding: 11px 22px; border-radius: 12px; font-size: .95rem; font-weight: 700;
  font-family: inherit; transition: .2s;
}
.btn:hover { background: var(--red); color: #fff; }
.btn.red { background: var(--red); }
.btn.red:hover { background: var(--navy); }
.btn.ghost { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn.ghost:hover { background: var(--navy); color: #fff; }
.btn.sm { padding: 7px 14px; font-size: .85rem; border-radius: 9px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand img { height: 40px; width: auto; }
.main-nav { display: flex; gap: 4px; margin-inline-start: 10px; flex: 1; }
.main-nav a {
  padding: 8px 13px; border-radius: 10px; font-weight: 600; font-size: .93rem; color: var(--navy);
}
.main-nav a:hover, .main-nav a.active { background: var(--navy); color: #fff; }
.lang-toggle {
  border: 2px solid var(--navy); background: #fff; color: var(--navy);
  font-weight: 800; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-family: inherit;
}
.lang-toggle:hover { background: var(--navy); color: #fff; }

/* Hero */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: var(--navy-dark);
}
.hero img.bg { width: 100%; height: 520px; object-fit: cover; opacity: .55; }
.hero-body { position: absolute; inset: 0; display: flex; align-items: center; }
.hero-content { max-width: 640px; }
html[dir="rtl"] .hero-content { margin-right: auto; } /* keep text block at start side */
.hero h1 { color: #fff; font-size: 2.6rem; margin-bottom: 10px; }
.hero p.lead { font-size: 1.15rem; color: #e8e4da; margin-bottom: 26px; }
.hero .badge {
  display: inline-block; background: var(--red); color: #fff; font-weight: 700;
  font-size: .8rem; padding: 5px 14px; border-radius: 999px; margin-bottom: 16px; letter-spacing: .04em;
}
.stat-strip { background: var(--navy); color: #fff; }
.stat-strip .container { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding: 18px 20px; }
.stat-item { text-align: center; min-width: 130px; }
.stat-item b { display: block; font-size: 1.45rem; color: var(--gold); }
.stat-item span { font-size: .82rem; color: #cfd6ea; }

/* Cards */
.grid { display: grid; gap: 22px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-6 { grid-template-columns: repeat(6, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  transition: transform .18s, box-shadow .18s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(16,27,58,.13); }
.card .thumb { position: relative; aspect-ratio: 1/1; overflow: hidden; background: #eee7da; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .thumb img { transform: scale(1.05); }
.card .body { padding: 15px 17px 17px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .cat-name { font-size: .78rem; font-weight: 700; color: var(--red); letter-spacing: .03em; }
.card .title { font-weight: 700; color: var(--navy-dark); font-size: 1rem; }
.card .meta { font-size: .8rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.card .price { font-weight: 800; color: var(--navy); font-size: 1.05rem; margin-top: auto; }
.card .price small { color: var(--muted); font-weight: 500; }
.tag {
  position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2;
  background: var(--red); color: #fff; font-size: .72rem; font-weight: 800;
  padding: 4px 10px; border-radius: 999px;
}
.tag.gold { background: var(--gold); color: #3a2c10; }
.stars { color: var(--gold); font-size: .85rem; letter-spacing: 1px; }

/* Category circle card (home) */
.cat-card { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; transition: .18s; }
.cat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(16,27,58,.12); }
.cat-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; margin-bottom: 10px; }
.cat-card b { color: var(--navy-dark); font-size: .92rem; display: block; }
.cat-card span { font-size: .75rem; color: var(--muted); }

/* Chips / filters */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 26px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; color: var(--navy);
  padding: 7px 15px; border-radius: 999px; cursor: pointer; font-size: .85rem; font-weight: 600; font-family: inherit;
}
.chip:hover { border-color: var(--navy); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Page hero (inner pages) */
.page-hero { background: linear-gradient(135deg, var(--navy-dark), var(--navy)); color: #fff; padding: 46px 0; }
.page-hero h1 { color: #fff; margin-bottom: 6px; }
.page-hero p { color: #ccd4e8; max-width: 720px; }

/* Tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
.tbl th { background: var(--navy); color: #fff; padding: 11px 14px; text-align: start; font-weight: 700; white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #faf7f1; }
.tbl .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th.num, html[dir="rtl"] .tbl .num { text-align: start; }

.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.pill.delivered { background: #e3f4e5; color: #1d7a2d; }
.pill.shipped { background: #e3ecfb; color: #1c4f9e; }
.pill.processing { background: #fdf0d7; color: #9a6b00; }

/* Detail layouts */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.gallery-main { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.gallery-main img { width: 100%; aspect-ratio: 4/4.4; object-fit: cover; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.panel h3 { margin-top: 0; }
.breakdown-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row.total { font-weight: 800; font-size: 1.08rem; color: var(--navy); }
.breakdown-row.negative span:last-child { color: var(--red); }
.breakdown-row.positive span:last-child { color: #1d7a2d; }

select, input[type=number], input[type=text] {
  font-family: inherit; font-size: .95rem; padding: 10px 13px; border: 1.5px solid var(--line);
  border-radius: 11px; background: #fff; color: var(--ink); width: 100%;
}
label.f { display: block; font-size: .82rem; font-weight: 700; color: var(--navy); margin: 14px 0 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Seller landing */
.seller-hero { background: linear-gradient(135deg, var(--navy-dark), var(--navy) 60%, #31417a); color: #fff; padding: 52px 0; }
.seller-hero h1 { color: #fff; }
.seller-hero .type-pill { background: var(--gold); color: #3a2c10; font-weight: 800; font-size: .78rem; padding: 5px 14px; border-radius: 999px; }
.avatar-badge {
  width: 92px; height: 92px; border-radius: 26px; background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 900; color: var(--navy); box-shadow: 0 8px 22px rgba(0,0,0,.25); overflow: hidden;
}
.avatar-badge img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }

/* Finance widgets */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.kpi b { display: block; font-size: 1.5rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi span { font-size: .8rem; color: var(--muted); }
.kpi.red b { color: var(--red); }
.kpi.green b { color: #1d7a2d; }
.kpi.gold b { color: var(--gold); }

.note-box {
  background: #fdf6e3; border: 1px solid #ecd9a0; border-radius: 14px; padding: 14px 18px; font-size: .88rem; color: #6d5312;
}
.banner-note {
  background: #eef2ff; border-bottom: 1px solid #ccd6f6; color: #273a75; text-align: center;
  font-size: .83rem; padding: 8px 14px; font-weight: 600;
}

/* Footer */
.site-footer { background: var(--navy-dark); color: #b9c2dc; margin-top: 60px; }
.site-footer .container { padding: 44px 20px 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 30px; margin-bottom: 26px; }
.site-footer h4 { color: #fff; font-size: 1rem; }
.site-footer a { color: #b9c2dc; display: block; padding: 3px 0; font-size: .9rem; }
.site-footer a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid #2c3a63; padding-top: 18px; font-size: .82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-logo { height: 46px; width: auto; filter: brightness(0) invert(1); opacity: .9; margin-bottom: 10px; }

/* Subcategory tiles */
.sub-tile { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; transition: .15s; }
.sub-tile:hover { border-color: var(--navy); transform: translateY(-2px); }
.sub-tile img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.sub-tile b { font-size: .9rem; color: var(--navy-dark); display: block; }
.sub-tile span { font-size: .75rem; color: var(--muted); }

/* Responsive */
@media (max-width: 1000px) {
  .grid.cols-4, .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-6 { grid-template-columns: repeat(3, 1fr); }
  .detail-grid, .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.9rem; }
  .hero img.bg { height: 480px; }
  .main-nav { display: none; }
}
@media (max-width: 620px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-6, .kpi-grid, .form-row { grid-template-columns: 1fr; }
  .section { padding: 38px 0; }
  .hero img.bg { height: 430px; }
  .stat-item { min-width: 45%; }
}

/* ---------- MLM network tree ---------- */
.mlm-tree, .mlm-tree ul { list-style: none; margin: 0; padding: 0; }
.mlm-tree ul { margin-inline-start: 16px; padding-inline-start: 18px; border-inline-start: 1px dashed #d9cfae; }
.mlm-tree > ul { margin-inline-start: 0; padding-inline-start: 0; border-inline-start: 0; }
.mlm-node { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 9px 14px; margin: 8px 0; background: #fbf8ef; border: 1px solid var(--line); border-radius: 12px; }
.mlm-node b { color: var(--navy-dark); }
.mlm-node.me { border-color: var(--red); background: #fdf1ec; box-shadow: 0 0 0 1px var(--red) inset; }
.mlm-node .lvl { background: #eef2ff; color: #273a75; }
.mlm-node.me .lvl { background: var(--red); color: #fff; }
.mlm-lvl-block { margin-top: 14px; }
.mlm-lvl-block h4 { margin-bottom: 8px; color: var(--navy); }
.chain { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chain .pill { background: #eef2ff; color: #273a75; }
