:root {
  --primary: #e01273;
  --accent: #111111;
  --bg: #f6f6f6;
  --surface: #ffffff;
  --text: #222222;
  --muted: #777777;
  --line: #ececec;
  --success: #24914a;
  --header: #ffffff;
  --sans: "Vazirmatn", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.wrap { width: min(1240px, calc(100% - 32px)); margin-inline: auto; }

.announce {
  background: var(--primary);
  color: #fff;
  text-align: center;
  font-size: 13px;
  padding: 8px 12px;
}
.top { background: var(--header); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.bar { display: flex; align-items: center; gap: 18px; min-height: 74px; }
.logo { display: flex; flex-direction: column; line-height: 1.1; min-width: 92px; }
.logo img, .logo-preview { height: 46px; width: auto; max-width: 180px; object-fit: contain; }
.logo-preview { height: 64px; max-width: 240px; background: var(--bg); border-radius: 10px; padding: 6px; }
.logo b { font-size: 22px; letter-spacing: -0.03em; }
.logo small { color: var(--primary); font-size: 12px; }
.search { flex: 1; display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.search input { flex: 1; border: 0; background: transparent; padding: 11px 14px; outline: none; }
.search button { border: 0; background: var(--primary); color: #fff; padding: 0 16px; cursor: pointer; }
.tools { display: flex; gap: 8px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; font-size: 11px; color: var(--muted); position: relative; background: transparent; border: 0; cursor: pointer; padding: 0; }
.tool em { font-style: normal; }
.tool-pop { position: relative; }
.pop {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; width: min(360px, calc(100vw - 24px));
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .12); padding: 14px; z-index: 45; max-height: min(70vh, 520px); overflow: auto; text-align: right;
}
.pop h3, .pop h4 { margin: 12px 0 6px; }
.slide-edit { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.slide-edit b { display: block; }
.pop-link { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.pop-link::after { content: "‹"; color: var(--muted); }
.pop h3 { margin-top: 0; }
.pop .sum-row { grid-template-columns: 1fr auto; }
.pop .auth, .auth-pop { margin: 0; max-width: none; border: 0; padding: 0; background: transparent; box-shadow: none; }
.trust-seals { display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; padding: 18px 16px 88px; background: var(--surface); border-top: 1px solid var(--line); }
.trust-seals img { height: 96px; width: auto; }
body[data-page="admin"] .desk-nav,
body[data-page="admin"] .search,
body[data-page="admin"] .tools { display: none; }
.ic { position: relative; color: var(--text); display: grid; }
.dot {
  position: absolute; top: -7px; left: -8px; background: var(--primary); color: #fff;
  border-radius: 99px; min-width: 16px; height: 16px; font-size: 10px; display: grid; place-items: center; font-style: normal; padding: 0 4px;
}
.desk-nav { display: flex; gap: 22px; padding: 0 0 10px; font-size: 14px; }
.desk-nav a.on, .desk-nav a:hover { color: var(--primary); }

.hero {
  margin: 16px auto;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: var(--surface);
  min-height: 280px;
  display: grid;
}
.slide {
  display: none;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 280px;
  align-items: center;
  background: var(--surface);
}
.slide.on { display: grid; }
.slide-copy { padding: 36px 40px; }
.slide-copy h2 { margin: 0 0 8px; font-size: 32px; font-weight: 700; line-height: 1.45; }
.slide-copy p { margin: 0 0 16px; color: var(--muted); }
.slide img { width: 100%; height: 280px; object-fit: cover; }
.dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; background: #ccc; padding: 0; }
.dots button.on { background: var(--primary); width: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; font-size: 14px;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.section { padding: 8px 0 22px; }
.section h2 { margin: 8px 0 12px; font-size: 22px; }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.link { color: var(--primary); font-size: 13px; }

.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.cat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  display: grid; grid-template-columns: 84px 1fr; align-items: center; min-height: 84px;
}
.cat img { width: 84px; height: 84px; object-fit: cover; }
.cat b { padding-inline: 12px; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.seo-box { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; margin-top: 12px; }
.seo-box h3 { margin: 0 0 8px; font-size: 15px; }
.seo-preview { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.seo-preview b { display: block; color: #1a0dab; }
.seo-preview span { color: #137333; font-size: 12px; }
.seo-preview p { margin: 4px 0 0; color: var(--muted); }
.cardbox > label { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; }
.pmedia { position: relative; background: var(--bg); border-radius: 10px; overflow: hidden; }
.pmedia img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.tag { position: absolute; top: 8px; right: 8px; color: #fff; border-radius: 6px; font-size: 12px; padding: 2px 7px; }
.tag.sale { background: var(--primary); }
.tag.fresh { background: var(--success); color: #111; }
.tag.fresh.second { top: 34px; }
.ib {
  position: absolute; left: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.ib.wish { top: 8px; }
.ib.cartb { bottom: 8px; }
.ib.on { color: var(--primary); }
.ptitle { display: block; margin-top: 8px; min-height: 44px; font-size: 13.5px; }
.pprice { margin-top: auto; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pprice b { font-size: 14px; }
.pprice s { color: var(--muted); font-size: 12px; }

.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 28px; }
.trust div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.trust b { display: block; }
.trust span { color: var(--muted); font-size: 13px; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; cursor: pointer; }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
select.sel, .field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 12px; outline: none;
}
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

.product { display: grid; grid-template-columns: .9fr 1.1fr; gap: 28px; padding: 18px 0 40px; }
.product-photo { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.product-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.crumb { color: var(--muted); font-size: 12px; }
.product h1 { font-size: 24px; margin: 8px 0; line-height: 1.6; }
.qty { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.qty button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.cart-table, .plain { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; }
.cart-row, .sum-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-row img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.sum { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.layout { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; padding-bottom: 30px; }
.cardbox { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }

.auth { max-width: 440px; margin: 28px auto 48px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.auth h1 { font-size: 22px; margin: 0 0 6px; }
.phone { display: flex; gap: 8px; }
.phone span { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg); }
.steps { display: flex; gap: 6px; margin: 10px 0 14px; }
.steps i { flex: 1; height: 4px; border-radius: 99px; background: var(--line); }
.steps i.on { background: var(--primary); }
.note { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.err { color: #c62828; font-size: 13px; }

.page { padding: 16px 0 40px; }
.page h1 { margin: 0 0 8px; font-size: 26px; }

.foot { background: var(--header); border-top: 1px solid var(--line); padding: 28px 0 80px; margin-top: 10px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 18px; }
.foot a, .foot p { display: block; color: var(--muted); margin: 4px 0; }
.foot b { display: block; margin-bottom: 6px; }

.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--header);
  border-top: 1px solid var(--line); z-index: 40; justify-content: space-around; padding: 6px 0 8px;
}
.bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--muted); gap: 2px; background: transparent; border: 0; cursor: pointer; padding: 0; }
#toast {
  position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%); }

.admin { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 16px 0 40px; }
.side { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; height: fit-content; }
.side button { width: 100%; text-align: right; background: transparent; border: 0; padding: 10px; border-radius: 8px; cursor: pointer; }
.side button.on { background: var(--primary); color: #fff; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme {
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px; text-align: right; cursor: pointer;
}
.theme.on { border-color: var(--primary); outline: 2px solid var(--primary); }
.swatches { display: flex; gap: 4px; margin-top: 6px; }
.swatches i { width: 14px; height: 14px; border-radius: 50%; display: block; }
.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.colors label { font-size: 12px; color: var(--muted); display: block; }
.colors input[type="color"] { width: 100%; height: 42px; border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 4px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { border-bottom: 1px solid var(--line); padding: 8px; text-align: right; vertical-align: middle; font-size: 13px; }
td img { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; }
.mini { display: flex; gap: 8px; }

@media (max-width: 980px) {
  .grid, .grid.cols-2, .grid.cols-3, .grid.cols-4, .themes, .colors { grid-template-columns: 1fr 1fr; }
  .foot-grid, .layout, .product, .admin, .slide { grid-template-columns: 1fr; }
  .cats { grid-template-columns: 1fr 1fr; }
  .trust { grid-template-columns: 1fr; }
  .tools em { display: none; }
  .desk-nav { display: none; }
  .bottom-nav { display: flex; }
  body[data-page="admin"] .bottom-nav { display: none; }
  body[data-page="admin"] .foot { padding-bottom: 24px; }
  .slide img { height: 200px; }
  .slide-copy { padding: 20px; }
  .slide-copy h2 { font-size: 24px; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .bar { flex-wrap: wrap; padding: 8px 0; }
  .search { order: 3; flex-basis: 100%; }
  .ptitle { min-height: 60px; font-size: 12.5px; }
}
