/* PMVNet web shop. Mobile first, RTL, light + dark. No external assets. */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-wght.woff2") format("woff2-variations"), url("../fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f4f7fc;
  --surface: #ffffff;
  --surface-2: #eef3fb;
  --text: #0b1630;
  --muted: #5b6785;
  --line: #dbe3f1;
  --brand: #1e56ff;
  --brand-2: #22d3ee;
  --brand-ink: #ffffff;
  --ok: #0f9d58;
  --warn: #b45309;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(11, 22, 48, .06), 0 8px 24px rgba(11, 22, 48, .06);
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #050e21;
    --surface: #0b1a3a;
    --surface-2: #10224a;
    --text: #e8eeff;
    --muted: #93a3c8;
    --line: #1c2f5c;
    --brand: #4c7bff;
    --ok: #34d399;
    --warn: #fbbf24;
    --danger: #f87171;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { line-height: 1.4; margin: 0 0 .5rem; }
h2 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
code, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
pre.ltr, code.ltr.big { display: block; text-align: left; }
.wrap-any { word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: .85rem; margin: 0; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: .85rem; margin: .4rem 0 0; }
.warn { color: var(--warn); font-size: .9rem; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 16px; padding-bottom: 32px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.logo { width: 32px; height: 32px; }
.nav { display: flex; gap: 14px; font-size: .9rem; }
.nav a { color: var(--muted); white-space: nowrap; }
.nav a:hover { color: var(--text); text-decoration: none; }
.dot { display: inline-block; min-width: 1.3em; padding: 0 .3em; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: .75rem; text-align: center; line-height: 1.5; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 16px; padding-bottom: 16px; }

/* hero */
.hero { padding: 12px 0 20px; }
.hero h1 { font-size: 1.6rem; font-weight: 900; }
.grad { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); max-width: 36em; }
.mini-steps { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-size: .85rem; }
.mini-steps li { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.mini-steps b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--brand); flex: none; }

/* product cards */
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.product {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; color: var(--text); box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.product:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-2px); }
.product-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.product h2 { font-size: 1.05rem; margin: 0; }
.product p { font-size: .9rem; margin: 0; }
.tag { flex: none; font-size: .72rem; padding: 2px 10px; border-radius: 99px; background: var(--surface-2); color: var(--brand); font-weight: 700; }
.facts { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--muted); }
.product-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); }
.price b { font-size: 1.15rem; }

/* buttons, inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 20px; border: 0; border-radius: 12px;
  font: inherit; font-weight: 700; cursor: pointer;
  color: var(--brand-ink); background: linear-gradient(135deg, var(--brand), #3b6bff);
  box-shadow: 0 6px 16px rgba(30, 86, 255, .25);
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .85rem; box-shadow: none; }
.btn-block { width: 100%; }
.btn-ghost { background: var(--surface-2); color: var(--brand); box-shadow: none; }
.btn-danger { background: var(--danger); box-shadow: none; }
.link-btn { background: none; border: 0; padding: 8px 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
}
.input:focus, .choice input:focus-visible + .choice-body, .btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.input.ltr { display: block; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }

/* layout boxes */
.page-title { font-size: 1.35rem; font-weight: 900; }
.back { display: inline-block; font-size: .9rem; margin-bottom: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 0 0 12px; box-shadow: var(--shadow);
}
fieldset.box { margin: 0; min-width: 0; }
legend { font-weight: 800; padding: 0 6px; }
.narrow { max-width: 420px; margin: 24px auto; }
.note { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; font-size: .92rem; }
.flash { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-weight: 600; }
.flash-error { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); }
.flash-ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }

/* radio cards */
.choices { display: grid; gap: 8px; }
.choices-2 { grid-template-columns: 1fr 1fr; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--bg);
  transition: border-color .15s ease, background .15s ease;
}
.choice-col { flex-direction: column; justify-content: center; text-align: center; gap: 2px; min-height: 100%; }
.choice-icon { font-size: 1.5rem; }
.choice-side { text-align: left; display: flex; flex-direction: column; align-items: flex-end; }
.choice-side small { font-size: .75rem; }
.choice input:checked + .choice-body { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }

/* order page */
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.order-head .page-title { margin: 0; }
.ltr-num { direction: ltr; }
.badge { font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 99px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge-awaiting_payment { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
.badge-receipt_sent, .badge-processing { color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.badge-delivered { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.badge-rejected { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, var(--surface)); }

.steps { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); text-align: center; }
.steps li::before { content: ""; display: block; width: 100%; height: 4px; border-radius: 4px; background: var(--line); order: -1; }
.steps b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); }
.steps .now { color: var(--text); font-weight: 700; }
.steps .now::before { background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.steps .now b { background: var(--brand); color: var(--brand-ink); }
.steps .done::before { background: var(--ok); }
.steps .done b { background: var(--ok); color: #fff; }

.summary { display: grid; gap: 8px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; }
.summary b { text-align: left; }
.amount { font-size: 1.5rem; margin: 4px 0; }
.amount b { font-weight: 900; }
.copy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.copy-row code { flex: 1; min-width: 0; font-size: .95rem; }
.copy-row code.big { font-size: 1.15rem; letter-spacing: .04em; }
.copy-row .amount { margin: 0; }
.file input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-ui { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; color: var(--muted); padding: 8px; text-align: center; }
.file input:focus-visible + .file-ui, .file-ui:hover { border-color: var(--brand); color: var(--brand); }
.file.has .file-ui { border-style: solid; border-color: var(--ok); color: var(--ok); }
.cancel-form { text-align: center; margin-top: 4px; }
.spinner { width: 44px; height: 44px; margin: 4px auto 12px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--brand); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.qr { background: #fff; border-radius: 12px; padding: 10px; width: min(280px, 100%); margin: 8px auto 12px; }
.qr svg { display: block; width: 100%; height: auto; }
pre.link, .raw pre { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; white-space: pre-wrap; word-break: break-all; font-size: .8rem; max-height: 220px; overflow: auto; margin: 0 0 10px; }
.raw { margin: 12px 0; }
.raw summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
.deliver .btn-block { margin-bottom: 8px; }
.keep { background: var(--surface-2); box-shadow: none; font-size: .88rem; }

/* lists, admin */
.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.row-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); }
.row-link:hover { text-decoration: none; border-color: var(--brand); }
.howto { padding-inline-start: 1.2rem; margin: 0; }
.howto li { margin-bottom: 6px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: thin; }
.tab { flex: none; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.tab.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.tab:hover { text-decoration: none; }
.receipt { display: block; max-width: 100%; max-height: 70vh; border-radius: 12px; margin: 8px auto 0; }
.decide { display: grid; gap: 8px; }

/* larger screens */
@media (min-width: 640px) {
  .hero { padding: 28px 0 28px; }
  .hero h1 { font-size: 2.2rem; }
  .mini-steps { grid-template-columns: repeat(4, auto); justify-content: start; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .main > form.stack, .main > .box, .order-head, .steps, .main > .back, .main > .page-title, .main > p.muted, .list, .tabs, .admin-head { max-width: 640px; margin-left: auto; margin-right: auto; }
  .main > .page-title, .main > p.muted, .main > .back { display: block; }
  .decide { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
