@font-face {
  font-family: Vazirmatn;
  src: url(/static/fonts/vazirmatn-var.woff2) format("woff2-variations"), url(/static/fonts/vazirmatn-var.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #f6f5f2;
  --card: #fff;
  --ink: #141414;
  --muted: #6b6b6b;
  --line: #e4e2dc;
  --accent: #e0262c;
  --accent-ink: #fff;
  --soft: #efeee9;
  --ok: #157347;
  --tg: #229ed9;
  --ble: #00a884;
  --rubika: #7b3fe4;
  --radius: 14px;
  --tap: 44px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: Vazirmatn, Tahoma, sans-serif; background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.7; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 14px; }
.muted { color: var(--muted); }
.code { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 10px; }
.logo { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 800; font-size: 20px; }
.logo-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fff; font-weight: 900; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.hbtn {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; text-decoration: none; cursor: pointer; list-style: none;
}
.hbtn::-webkit-details-marker { display: none; }
.hbtn svg { width: 22px; height: 22px; }
.hbtn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge { position: absolute; top: -4px; left: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.account-menu { position: relative; }
.account-menu .hbtn-label { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu .menu { position: absolute; left: 0; top: calc(100% + 6px); min-width: 190px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.08); padding: 6px; }
.account-menu .menu a, .account-menu .menu button { display: block; width: 100%; text-align: right; padding: 10px 12px; border-radius: 8px; text-decoration: none; background: none; border: 0; cursor: pointer; min-height: var(--tap); }
.account-menu .menu a:hover, .account-menu .menu button:hover { background: var(--soft); }
.menu-phone { padding: 6px 12px; color: var(--muted); font-size: 13px; direction: ltr; text-align: right; }
@media (max-width: 480px) { .hbtn-label { display: none; } .hbtn { padding: 0 11px; } }

.main { padding-block: 16px 24px; min-height: 60vh; }
.page-title { font-size: 20px; margin: 4px 0 14px; }

/* filters */
.filters { margin-bottom: 14px; }
.filters-title { font-size: 18px; margin: 0 0 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 14px 8px; margin-inline: -14px; }
.chips::after { content: ""; flex: 0 0 6px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; text-decoration: none; white-space: nowrap;
}
.chip[aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips.chips-l2 .chip { min-height: 36px; font-size: 14px; background: var(--soft); border-color: transparent; }
.chips.chips-l2 .chip[aria-current="true"] { background: var(--accent); color: #fff; }

.catalog-search { display: grid; gap: 8px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.catalog-search label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.catalog-search input { min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; }
.catalog-search .btn { min-height: 40px; }
@media (min-width: 600px) { .catalog-search { grid-template-columns: 2fr 1fr 1fr auto auto; align-items: end; } }

/* cards */
.cards { display: grid; gap: 16px; }
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; display: grid; gap: 0; scroll-margin-top: 76px; }
.card-media { padding: 10px 10px 0; }
.cover { position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--soft); border-radius: 10px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 5; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .count { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.cover.placeholder { display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--muted); cursor: default; font-weight: 800; }
.cover.placeholder .logo-mark { width: 56px; height: 56px; font-size: 28px; border-radius: 14px; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs button { flex: none; width: 64px; aspect-ratio: 4 / 5; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--soft); cursor: zoom-in; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.card-info { padding: 12px 14px 4px; }
.card-title { font-size: 17px; margin: 0 0 6px; line-height: 1.6; }
.specs { margin: 0; display: grid; gap: 2px; font-size: 14px; }
.specs div { display: flex; gap: 6px; }
.specs dt { color: var(--muted); flex: none; }
.specs dt::after { content: ":"; }
.specs dd { margin: 0; }
.prices { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--soft); display: grid; gap: 2px; }
.prices div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.prices dt { color: var(--muted); }
.prices dd { margin: 0; font-weight: 700; }
.prices .pack dd { color: var(--accent); font-size: 16px; }
.price-gate { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--line); }
.price-gate { text-align: center; }
.price-gate a { font-weight: 700; color: var(--accent); text-underline-offset: 6px; text-decoration-thickness: 1px; }
.card-actions { padding: 12px 14px 14px; display: grid; gap: 8px; }
.inquiry { display: grid; gap: 6px; grid-template-columns: 1fr 1fr 1fr; }
.inquiry-caption { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.inquiry .btn { padding: 6px 4px; }
.inquiry .long { display: none; }

@media (min-width: 760px) {
  .card { grid-template-columns: minmax(260px, 340px) 1fr minmax(200px, 240px); align-items: start; }
  .card-media { padding: 12px; }
  .card-info { padding: 16px 6px; }
  .card-actions { padding: 16px 12px 16px 16px; }
  .inquiry { grid-template-columns: 1fr; }
  .inquiry .btn { font-size: 14px; }
  .inquiry .long { display: inline; }
  .inquiry-caption { display: none; }
  .thumbs button { width: 72px; }
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 8px 16px;
  border-radius: 12px; border: 1px solid var(--line); background: #fff; text-decoration: none; cursor: pointer; text-align: center; font-weight: 600;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 16px; }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-ghost { background: transparent; }
.btn-telegram { background: var(--tg); color: #fff; border-color: var(--tg); }
.btn-bale { background: var(--ble); color: #fff; border-color: var(--ble); }
.btn-rubika { background: var(--rubika); color: #fff; border-color: var(--rubika); }
.btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.link-danger { background: none; border: 0; color: var(--accent); cursor: pointer; min-height: var(--tap); padding: 0; }

/* empty / notice */
.empty { text-align: center; padding: 40px 16px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.empty p { font-size: 17px; margin: 0 0 14px; }
.notice { padding: 10px 14px; border-radius: 10px; background: #fff6e0; border: 1px solid #f3dca0; margin-bottom: 12px; }
.error { color: var(--accent); margin: 0; }

/* cart */
.cart-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cart-line { display: grid; grid-template-columns: 92px 1fr; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.cart-line.unavailable { opacity: .55; }
.cart-img img, .cart-img .placeholder { width: 92px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; background: var(--soft); display: grid; place-items: center; }
.cart-title { font-weight: 700; }
.tag-out { display: inline-block; font-size: 12px; background: var(--accent); color: #fff; border-radius: 6px; padding: 0 6px; font-weight: 500; }
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.qty-label { font-size: 14px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stepper form { margin: 0; }
.stepper button { width: var(--tap); height: var(--tap); border: 0; background: var(--soft); font-size: 20px; cursor: pointer; }
.stepper output { min-width: 40px; text-align: center; font-weight: 700; line-height: 1; padding-top: 2px; }
.calc { font-size: 13px; }
.line-prices { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; margin-top: 2px; }
.remove { margin: 0; }
.summary { margin: 16px 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 4px; }
.summary div { display: flex; justify-content: space-between; }
.summary .total { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; font-size: 17px; }
.summary .total b { color: var(--accent); }
.send { display: grid; gap: 10px; }
.send-buttons { display: grid; gap: 8px; }
@media (min-width: 760px) { .send-buttons { grid-template-columns: repeat(3, 1fr); } }

/* sticky cart bar (mobile) */
.sticky-cart {
  position: fixed; inset-inline: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 30; display: flex; justify-content: center; align-items: center;
  min-height: 52px; border-radius: 14px; background: var(--ink); color: #fff; text-decoration: none; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
@media (min-width: 760px) { .sticky-cart { display: none !important; } }

/* auth */
.auth { max-width: 460px; margin-inline: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; }
.field > span { font-size: 14px; color: var(--muted); }
.field input, .field select { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: #fff; width: 100%; }
.field input[dir="ltr"] { text-align: left; }
.field input:focus, .field select:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.field input[aria-invalid="true"] { border-color: var(--accent); }
.otp-input { letter-spacing: .5em; font-size: 22px; text-align: center !important; }
.field-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 380px) { .field-row { grid-template-columns: 1fr; } }
.resend { margin-top: 10px; }

/* confirm */
.confirm { max-width: 640px; margin-inline: auto; display: grid; gap: 12px; }
.message { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; margin: 0; }
.items ul { margin: 6px 0 0; padding-inline-start: 18px; }

/* footer */
.site-footer { background: #1b1b1b; color: #ddd; padding: 28px 0; margin-top: 24px; }
.has-sticky .site-footer { padding-bottom: 96px; }
.site-footer .muted { color: #a9a9a9; }
.footer-brand { font-weight: 800; display: flex; align-items: center; gap: 8px; color: #fff; }
.footer-brand .logo-mark { background: #fff; color: #111; }
.footer-links { display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 760px) { .has-sticky .site-footer { padding-bottom: 28px; } }

/* toast */
.toast { position: fixed; top: 72px; inset-inline: 0; margin-inline: auto; width: max-content; max-width: calc(100% - 24px); z-index: 60; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }

/* gallery */
.gallery { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: #fff; overflow: hidden; }
.gallery::backdrop { background: #000; }
.gallery-bar { position: absolute; top: 0; inset-inline: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: max(8px, env(safe-area-inset-top)) 12px 8px; background: linear-gradient(rgba(0,0,0,.6), transparent); }
.gallery-close { width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 20px; cursor: pointer; }
.gallery-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: grid; place-items: center; overflow: auto; touch-action: pan-x pan-y pinch-zoom; }
.gallery-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.gallery-nav.prev { right: 10px; }
.gallery-nav.next { left: 10px; }
@media (hover: none) { .gallery-nav { display: none; } }
