@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f3f6f7;
  --surface: #ffffff;
  --ink: #0e2a33;
  --ink-2: #2b444c;
  --muted: #4a636b;
  --line: #dde5e8;
  --line-strong: #cbd7db;
  --teal: #0b6e6e;
  --teal-dark: #0b5c5c;
  --deep: #0b4f52;
  --tint: #e3f1f0;
  --placeholder: #e9eff1;
  --accent: #f2a33a;
  --accent-ink: #1a1206;
  --danger: #a3261d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Vazirmatn", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
}
a { color: var(--teal-dark); text-decoration: none; }
a:hover { color: #083f3f; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
button, input, select { font-family: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 24px; }
.section { padding-block: 32px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 14px; border: 0;
  font-size: 15px; font-weight: 700; text-align: center;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); color: #fff; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(0.95); color: var(--accent-ink); }
.btn-outline { background: transparent; color: var(--teal-dark); border: 1.5px solid var(--teal); }
.btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, 0.6); }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.btn-sm { min-height: 44px; padding: 0 16px; border-radius: 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }

/* top bar + header */
.topbar { background: var(--ink); color: #dce7ea; font-size: 13px; }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-block: 8px; }
.topbar a { color: #dce7ea; }
.header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-main { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; padding-block: 18px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 20px; font-weight: 800; }
.logo-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--teal); display: flex; align-items: center; justify-content: center; flex: none; }
.search { flex: 999 1 300px; min-width: 0; display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 14px; height: 48px; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 15px; color: var(--ink); height: 44px; outline: none; }
.search:focus-within { border-color: var(--teal); }
.cart-link { position: relative; height: 48px; width: 48px; border-radius: 12px; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.cart-link:hover { color: #fff; background: var(--teal-dark); }
.cart-badge { position: absolute; top: -6px; left: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.nav { display: flex; flex-wrap: wrap; gap: 6px 26px; padding-bottom: 14px; font-size: 15px; font-weight: 500; }
.nav a { color: var(--ink-2); padding-block: 4px; }
.nav a.is-strong { color: var(--teal-dark); font-weight: 700; }

/* flash messages */
.flash { margin-top: 16px; padding: 12px 16px; border-radius: 12px; font-weight: 600; background: var(--tint); color: var(--teal-dark); }
.flash.error { background: #fbe9e7; color: var(--danger); }

/* hero */
.hero { background: var(--deep); border-radius: 28px; color: #fff; padding: 56px 48px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.hero-text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hero-pill { align-self: flex-start; background: rgba(255, 255, 255, 0.14); border-radius: 999px; padding: 6px 16px; font-size: 14px; font-weight: 500; }
.hero h1 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.35; font-weight: 800; }
.hero p { font-size: 18px; color: #d5e8e8; max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { flex: 1 1 340px; min-width: 0; min-height: 300px; border-radius: 22px; background: #0e6468; display: grid; place-items: center; }

/* trust strip */
.trust { display: flex; flex-wrap: wrap; gap: 16px; }
.trust-item { flex: 1 1 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; gap: 14px; align-items: flex-start; }
.trust-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--tint); display: flex; align-items: center; justify-content: center; color: var(--teal); }
.trust-item strong { display: block; font-size: 16px; }
.trust-item span { font-size: 14px; color: var(--muted); }

/* section heading */
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 20px; }
.section-head h2, .page-title { font-size: 28px; font-weight: 800; }
.section-head a { font-weight: 600; font-size: 15px; }

/* category cards */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; align-items: center; gap: 14px; color: var(--ink); font-weight: 700; }
.cat:hover { border-color: var(--teal); color: var(--ink); }
.cat-img { flex: none; width: 64px; height: 64px; border-radius: 14px; background: var(--placeholder); overflow: hidden; display: grid; place-items: center; color: var(--teal); }
.cat-img img { width: 100%; height: 100%; object-fit: cover; }

/* product cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card:hover { border-color: var(--line-strong); box-shadow: 0 6px 20px rgba(14, 42, 51, 0.06); }
.card-img { height: 200px; border-radius: 14px; background: var(--placeholder); overflow: hidden; display: grid; place-items: center; color: #9fb3b9; }
.card-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.tag { background: var(--tint); color: var(--teal-dark); font-weight: 600; font-size: 13px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.tag.neutral { background: #eef1f2; color: var(--ink-2); }
.tag.warn { background: #fdf0d9; color: #6b4200; }
.card-title { color: var(--ink); font-size: 16px; font-weight: 700; line-height: 1.6; }
.card-desc { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 8px; }
.price { font-weight: 800; font-size: 18px; white-space: nowrap; }
.price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.price-old { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 20px; padding: 48px 24px; text-align: center; color: var(--muted); }

/* listing layout */
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.filters { flex: 1 1 250px; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.layout-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group + .filter-group { border-top: 1px solid #e6ecee; padding-top: 16px; }
.filter-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); }
.filter-link { min-height: 36px; display: flex; align-items: center; font-size: 15px; color: var(--ink-2); }
.field { height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff; padding: 0 12px; font-size: 14px; color: var(--ink); min-width: 0; }
.price-range { display: flex; gap: 8px; }
.price-range .field { flex: 1; width: 0; }
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding-block: 8px 24px; }
.pager a, .pager span { min-width: 44px; height: 44px; padding: 0 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); font-weight: 600; display: flex; align-items: center; justify-content: center; }
.pager .is-current { background: var(--teal); border-color: var(--teal); color: #fff; }

/* product detail */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; }
.product { display: flex; flex-wrap: wrap; gap: 32px; }
.gallery { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.gallery-main { aspect-ratio: 1 / 1; max-height: 460px; border-radius: 18px; background: var(--placeholder); overflow: hidden; display: grid; place-items: center; color: #9fb3b9; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.thumbs button { padding: 0; height: 84px; border-radius: 12px; border: 2px solid var(--line); background: #fff; overflow: hidden; }
.thumbs button[aria-current="true"] { border-color: var(--teal); }
.thumbs img { width: 100%; height: 100%; object-fit: contain; }
.info { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.info h1 { font-size: 28px; font-weight: 800; line-height: 1.5; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 10px; font-size: 14px; }
.badge { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; color: var(--ink-2); }
.badge svg { color: var(--teal); }
.buybox { background: var(--bg); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.buybox-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.buybox .price { font-size: 28px; }
.qty { display: flex; align-items: center; background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; }
.qty button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 20px; color: var(--ink); }
.qty input { width: 52px; height: 44px; border: 0; text-align: center; font-weight: 700; font-size: 15px; color: var(--ink); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tiers { border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; }
.tiers table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.tiers td { padding: 6px 0; border-top: 1px solid #eef1f2; }
.tiers td:last-child { text-align: left; font-weight: 700; }
.detail-cols { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 24px; align-items: flex-start; }
.detail-main { flex: 2 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.panel h2 { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.specs { display: flex; flex-direction: column; font-size: 15px; }
.specs div { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid #eef1f2; }
.specs dt { flex: 0 0 40%; color: var(--muted); }
.specs dd { flex: 1; margin: 0; font-weight: 600; }
.prose { font-size: 15px; color: var(--ink-2); white-space: pre-line; }
.help { flex: 1 1 300px; min-width: 0; background: var(--deep); color: #fff; border-radius: 24px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.help strong { font-size: 20px; font-weight: 800; }
.help p { font-size: 15px; color: #d5e8e8; }

/* cart */
.cart-lines { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.line { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.line-img { flex: none; width: 100px; height: 100px; border-radius: 14px; background: var(--placeholder); overflow: hidden; display: grid; place-items: center; color: #9fb3b9; }
.line-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.line-info { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.line-info a { color: var(--ink); font-size: 16px; font-weight: 700; }
.line-total { min-width: 130px; text-align: left; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { color: var(--danger); border-color: var(--danger); }
.summary { flex: 1 1 320px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.summary h2 { font-size: 20px; font-weight: 800; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.summary-total .price { font-size: 24px; }
.note { font-size: 14px; color: var(--ink-2); background: var(--bg); border-radius: 12px; padding: 12px 14px; }

/* footer */
.footer { background: var(--ink); color: #dce7ea; margin-top: 40px; }
.footer .wrap { padding-block: 40px 28px; display: flex; flex-wrap: wrap; gap: 32px; }
.footer-col { flex: 1 1 180px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-col.wide { flex: 2 1 280px; }
.footer-col strong { color: #fff; font-size: 16px; }
.footer a { color: #dce7ea; }
.footer-bottom { border-top: 1px solid var(--ink-2); font-size: 13px; color: #b5c6cb; }
.footer-bottom .wrap { padding-block: 16px 24px; }

@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .hero { padding: 36px 24px; border-radius: 22px; }
  .hero-art { display: none; }
  .panel { padding: 20px; }
  .line-total { text-align: right; }
}
