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

:root {
  color-scheme: dark;
  --bg: #080a0d;
  --surface: #111419;
  --surface-raised: #171b21;
  --surface-soft: #1d2229;
  --line: #292f38;
  --line-strong: #3a424d;
  --accent: #e7b94f;
  --accent-bright: #ffd778;
  --accent-ink: #211a09;
  --cyan: #69d5d2;
  --text: #f4f6f8;
  --muted: #98a1ac;
  --danger: #ff746d;
  --success: #58d198;
  --max: 1180px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px) 0 0 / 100% 48px, var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  letter-spacing: 0;
}
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
svg { display: block; width: 20px; height: 20px; stroke-width: 1.8; }
.hidden { display: none !important; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 68px;
  padding: 10px max(20px, calc((100vw - var(--max)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 10, 13, .88);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
}
.brand { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 12px; direction: ltr; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(231,185,79,.46); border-radius: 8px; color: var(--accent); background: linear-gradient(145deg, rgba(231,185,79,.14), rgba(105,213,210,.04)); }
.brand-mark svg { width: 23px; height: 23px; }
.brand b, .brand small { display: block; line-height: 1.1; }
.brand b { font-size: 18px; font-weight: 850; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 9px; direction: rtl; }
.icon-button { width: 42px; height: 42px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: #dce1e6; background: var(--surface); transition: border-color .18s, background .18s, color .18s; }
.icon-button:hover { color: var(--accent-bright); border-color: rgba(231,185,79,.52); background: var(--surface-raised); }

.visual-header { position: relative; min-height: min(360px, 42vh); display: flex; align-items: flex-end; isolation: isolate; overflow: hidden; background: #101216 url('/assets/starwar-hangar.webp') center 48% / cover no-repeat; border-bottom: 1px solid rgba(231,185,79,.35); }
.visual-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8,10,13,.2), rgba(8,10,13,.68) 58%, rgba(8,10,13,.9)), linear-gradient(0deg, #080a0d 0, transparent 46%); }
.visual-copy { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 70px 0 40px; text-shadow: 0 3px 24px #000; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: var(--accent-bright); font-size: 12px; font-weight: 700; margin-bottom: 9px; }
.eyebrow svg { width: 16px; height: 16px; }
.visual-copy h1 { max-width: 680px; margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1.35; font-weight: 900; }
.visual-copy p { margin: 9px 0 0; color: #d4d9df; font-size: 15px; }

.login-band, .store-view { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.login-band { padding: 38px 0 88px; }
.login-shell { max-width: 640px; margin: 0 auto; padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.section-title { display: flex; align-items: center; gap: 14px; padding-bottom: 21px; border-bottom: 1px solid var(--line); }
.section-title h2, .section-title p { margin: 0; }
.section-title h2 { font-size: 20px; font-weight: 800; }
.section-title p { color: var(--muted); font-size: 12px; margin-top: 5px; }
.section-icon { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: rgba(231,185,79,.1); }
.section-icon svg { width: 24px; height: 24px; }
.login-form { margin-top: 24px; }
.login-form label { display: block; color: #cbd1d8; margin-bottom: 9px; font-size: 13px; }
.field-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
input { width: 100%; min-height: 50px; padding: 0 15px; border: 1px solid var(--line); border-radius: 7px; outline: none; color: var(--text); background: #0b0e12; transition: border-color .18s, box-shadow .18s; }
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(105,213,210,.11); }
.primary-button, .gateway-button, .danger-button { min-height: 46px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 7px; border: 1px solid transparent; font-weight: 750; transition: transform .15s, background .18s, border-color .18s; }
.primary-button { color: var(--accent-ink); background: var(--accent); }
.primary-button:hover { background: var(--accent-bright); transform: translateY(-1px); }
.primary-button:disabled { opacity: .46; cursor: not-allowed; transform: none; }
.primary-button svg { width: 17px; height: 17px; }
.text-button { margin-top: 14px; padding: 0; border: 0; color: var(--cyan); background: transparent; }
.status-line { min-height: 24px; margin-top: 13px; color: var(--muted); font-size: 13px; }
.status-line.error { color: var(--danger); }

.store-view { padding: 24px 0 130px; }
.account-strip { display: grid; grid-template-columns: 1.6fr .8fr 1.2fr; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: rgba(17,20,25,.9); }
.account-strip > div { min-height: 76px; display: flex; flex-direction: column; justify-content: center; padding: 14px 20px; border-left: 1px solid var(--line); }
.account-strip > div:last-child { border-left: 0; }
.account-strip span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.account-strip span svg { width: 14px; height: 14px; color: var(--cyan); }
.account-strip strong { margin-top: 7px; font-size: 15px; font-weight: 750; }
.category-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 26px 0 16px; }
.category-tabs::-webkit-scrollbar { display: none; }
.category-button { flex: 0 0 auto; min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: #aeb6bf; transition: color .18s, border-color .18s, background .18s; }
.category-button svg { width: 17px; height: 17px; }
.category-button:hover { color: var(--text); border-color: var(--line-strong); }
.category-button.active { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); font-weight: 800; }
.catalog-section { padding-top: 15px; border-top: 1px solid var(--line); }
.catalog-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 5px 0 20px; }
.catalog-heading h2, .catalog-heading p { margin: 0; }
.catalog-heading h2 { font-size: 23px; font-weight: 850; }
.catalog-heading p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.result-label { display: flex; align-items: baseline; gap: 5px; color: var(--muted); font-size: 11px; }
.result-label b { color: var(--text); font-size: 18px; }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.product-card { position: relative; min-width: 0; min-height: 214px; padding: 19px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(145deg, rgba(255,255,255,.018), transparent 44%), var(--surface); transition: border-color .18s, transform .18s, background .18s, box-shadow .18s; }
.product-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: transparent; transition: background .18s; }
.product-card:hover { border-color: var(--line-strong); transform: translateY(-2px); background-color: var(--surface-raised); box-shadow: 0 16px 34px rgba(0,0,0,.18); }
.product-card.selected { border-color: rgba(105,213,210,.7); background: linear-gradient(145deg, rgba(105,213,210,.08), transparent 48%), var(--surface); box-shadow: 0 0 0 1px rgba(105,213,210,.17), 0 16px 36px rgba(0,0,0,.23); }
.product-card.selected::before { background: var(--cyan); }
.product-card.unavailable { opacity: .58; }
.product-top { min-height: 54px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.product-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border: 1px solid rgba(231,185,79,.34); border-radius: 8px; color: var(--accent); background: rgba(231,185,79,.08); font-size: 19px; }
.product-title { margin: 0; font-size: 15px; line-height: 1.75; font-weight: 750; overflow-wrap: anywhere; }
.product-content { min-height: 64px; margin: 13px 0; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 7px; }
.item-chip { padding: 5px 8px; border: 1px solid rgba(255,255,255,.045); border-radius: 5px; background: var(--surface-soft); color: #cbd1d7; font-size: 11px; }
.product-footer { padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price { color: var(--accent-bright); font-size: 17px; font-weight: 850; direction: rtl; }
.price small { color: var(--muted); font-size: 10px; font-weight: 400; }
.select-button { min-width: 84px; min-height: 38px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 6px; color: #e1e5e9; background: var(--surface-raised); font-weight: 700; transition: color .18s, background .18s, border-color .18s; }
.select-button:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent); }
.selected .select-button { color: #062323; border-color: var(--cyan); background: var(--cyan); }
.unavailable-note { min-height: 38px; margin: 12px 0 0; color: var(--danger); font-size: 11px; line-height: 1.7; }
.level-card { grid-column: 1 / -1; min-height: 126px; display: grid; grid-template-columns: 1fr minmax(180px, 250px) auto; align-items: center; gap: 22px; }
.level-control label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 7px; }
.level-control input { direction: ltr; }

.selection-bar { position: fixed; z-index: 30; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(790px, calc(100% - 28px)); min-height: 78px; padding: 12px 14px; display: grid; grid-template-columns: 42px 1fr auto auto; align-items: center; gap: 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(17,20,25,.96); box-shadow: 0 20px 55px rgba(0,0,0,.55); backdrop-filter: blur(18px); }
.selection-check { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; color: #062323; background: var(--cyan); }
.selection-check svg { width: 19px; height: 19px; stroke-width: 2.5; }
.selection-bar span, .selection-bar small { display: block; color: var(--muted); font-size: 10px; }
.selection-bar strong { display: block; max-width: 320px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selection-price { color: var(--accent-bright); font-size: 17px; font-weight: 850; text-align: left; }

dialog { width: min(520px, calc(100% - 28px)); padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(7px); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 20px; }
.checkout-summary, .account-details { padding: 20px; }
.summary-row { display: flex; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.summary-row span { color: var(--muted); }
.summary-row strong { text-align: left; }
.gateway-button { width: calc(100% - 40px); margin: 0 20px 20px; color: #858d96; background: var(--surface-soft); border-color: var(--line); cursor: not-allowed; }
.danger-button { width: calc(100% - 40px); margin: 0 20px 20px; color: #ffd8d5; background: #392020; border-color: #63312e; }
.toast { position: fixed; z-index: 50; top: 80px; left: 50%; transform: translate(-50%, -18px); max-width: calc(100% - 30px); padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 7px; background: #20252c; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { border-color: #8a403c; color: #ffd1ce; }

@media (max-width: 860px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visual-header { min-height: 290px; background-position: 58% 50%; }
}
@media (max-width: 560px) {
  .topbar { min-height: 60px; padding-inline: 14px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand b { font-size: 16px; }
  .visual-header { min-height: 248px; background-position: 62% 50%; }
  .visual-header::before { background: linear-gradient(90deg, rgba(8,10,13,.18), rgba(8,10,13,.82)), linear-gradient(0deg, #080a0d, transparent 55%); }
  .visual-copy { width: calc(100% - 28px); padding-bottom: 24px; }
  .visual-copy h1 { font-size: 32px; }
  .visual-copy p { font-size: 13px; }
  .login-band, .store-view { width: calc(100% - 24px); }
  .login-shell { padding: 20px; }
  .field-row { grid-template-columns: 1fr; }
  .account-strip { grid-template-columns: 1.25fr .75fr; }
  .account-strip > div { min-height: 70px; padding: 12px 14px; }
  .account-strip > div:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .category-tabs { margin-inline: -12px; padding-inline: 12px; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card { min-height: 0; }
  .level-card { grid-template-columns: 1fr; }
  .product-content { min-height: 0; }
  .selection-bar { bottom: 8px; grid-template-columns: 36px 1fr auto; gap: 10px; padding: 10px; }
  .selection-check { width: 34px; height: 34px; }
  .selection-bar > div:nth-child(2) { min-width: 0; }
  .selection-price { display: none; }
  .selection-bar .primary-button { min-height: 42px; padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
