@font-face { font-family: Vazirmatn; src: url("../fonts/Vazirmatn-Regular.cdc140628f11.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("../fonts/Vazirmatn-Medium.dd2193b32cbe.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("../fonts/Vazirmatn-Bold.7958481fe611.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --navy: #1f2a5a; --navy-2: #2d3a78; --ink: #1d2433; --muted: #6b7385; --line: #e3e6ee;
  --bg: #f4f5f9; --card: #ffffff; --ok: #1f8a4c; --ok-bg: #e7f6ed; --err: #c62828; --err-bg: #fdecec;
  --accent: #f2a541; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Vazirmatn, Tahoma, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.7; }
a { color: var(--navy-2); text-decoration: none; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.code { font-family: Vazirmatn, monospace; direction: ltr; unicode-bidi: isolate; font-weight: 700; letter-spacing: .5px; }
.muted { color: var(--muted); font-size: 13px; }

/* سربرگ */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar .in { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 14px; align-items: center; }
.brand { font-weight: 700; font-size: 17px; color: #fff; white-space: nowrap; }
.search { flex: 1; display: flex; }
.search input { flex: 1; border: 0; border-radius: 10px 0 0 10px; padding: 9px 12px; font: inherit; min-width: 0; }
.search button { border: 0; background: var(--accent); color: var(--ink); padding: 0 14px; border-radius: 0 10px 10px 0; font: inherit; font-weight: 700; cursor: pointer; }
.topnav { display: flex; gap: 4px; }
.topnav a { color: #dfe3f5; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.topnav a.on, .topnav a:hover { background: rgba(255,255,255,.12); color: #fff; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 16px 16px 90px; }
h1 { font-size: 20px; margin: 4px 0 14px; }
h2 { font-size: 17px; margin: 0 0 10px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.grid { display: grid; gap: 12px; }
.grid.stats { grid-template-columns: repeat(3, 1fr); }
.stat { text-align: center; }
.stat b { display: block; font-size: 26px; color: var(--navy); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--navy); background: var(--navy); color: #fff;
  padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; min-height: 42px; }
.btn.ghost { background: #fff; color: var(--navy); }
.btn.small { padding: 4px 10px; min-height: 32px; font-size: 13px; }
.btn.big { width: 100%; min-height: 52px; font-size: 16px; }
.btn.danger { background: #fff; color: var(--err); border-color: #f0c3c3; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.space { justify-content: space-between; }

/* فرم‌ها */
label { font-weight: 600; display: block; margin-bottom: 4px; }
input[type=text], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #cfd4e1; border-radius: 10px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fb0ff; border-color: var(--navy-2); }
.field { margin-bottom: 14px; }
.field .help { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.errorlist { color: var(--err); margin: 4px 0; padding: 0; list-style: none; font-size: 13px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: 20px; height: 20px; }

/* انتخاب جنسیت با دکمه‌های بزرگ */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills > div, .pills label { margin: 0; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid #cfd4e1; border-radius: 999px; cursor: pointer; font-weight: 500; background: #fff; }
.pills input:checked + span, .pills label:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }

/* انتخاب سایز */
.sizes details { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fafbfe; }
.sizes summary { padding: 8px 12px; cursor: pointer; font-weight: 600; }
.sizes .chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 12px 12px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; min-width: 44px; text-align: center; padding: 6px 10px; border: 1px solid #cfd4e1; border-radius: 8px; background: #fff;
  direction: ltr; font-weight: 600; cursor: pointer; user-select: none; }
.chip input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip input:focus-visible + span { outline: 2px solid #9fb0ff; }

/* جدول و لیست */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--ink); }
.list-item:last-child { border-bottom: 0; }
.tag { display: inline-block; background: #eef0f8; color: var(--navy); border-radius: 6px; padding: 1px 8px; font-size: 12.5px; font-weight: 600; }
.tag.sport { background: #e7f6ed; color: var(--ok); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid #ccd; vertical-align: -2px; }

.design { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fff; scroll-margin-top: 80px; }
.design:target { outline: 2px solid var(--accent); }
.design-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.variants { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.variants a { border: 1px solid #cfd4e1; border-radius: 8px; padding: 3px 10px; font-weight: 600; direction: ltr; color: var(--ink); background: #fafbfe; }

.bigcode { font-size: 30px; font-weight: 700; color: var(--navy); direction: ltr; text-align: center; letter-spacing: 1px; }
.codepreview { background: #f0f2fa; border: 1px dashed #b9c1dc; border-radius: 10px; padding: 10px; text-align: center; }

.msg { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; }
.msg.success { background: var(--ok-bg); color: var(--ok); }
.msg.error { background: var(--err-bg); color: var(--err); }
.msg.info, .msg.warning { background: #fff6e5; color: #8a5a00; }

.empty { text-align: center; color: var(--muted); padding: 24px 8px; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }

/* منوی پایین گوشی */
.bottomnav { display: none; }
@media (max-width: 720px) {
  .topnav { display: none; }
  .brand { font-size: 15px; }
  .grid.stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat b { font-size: 21px; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 30;
    padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a { flex: 1; text-align: center; padding: 8px 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
  .bottomnav a .ico { display: block; font-size: 20px; line-height: 1.2; }
  .bottomnav a.on { color: var(--navy); }
  .hide-sm { display: none; }
  .bigcode { font-size: 24px; }
}
@media (min-width: 900px) {
  .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}
