/* ===== پایه مشترک همه قالب‌ها (راست‌چین، واکنش‌گرا) ===== */
@font-face { font-family: "Vazirmatn"; src: url("/lib/vazirmatn/Vazirmatn-FD-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/lib/vazirmatn/Vazirmatn-FD-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/lib/vazirmatn/Vazirmatn-FD-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/lib/vazirmatn/Vazirmatn-FD-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --font: "Vazirmatn", Tahoma, sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
  --gap: 1.25rem;
  --container: 1200px;
  --danger: #c0392b;
  --success: #1e8449;
  --warning: #b9770e;
  --info: #2466a8;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.8;
  background: var(--bg); color: var(--text); direction: rtl; text-align: right;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link, var(--brand)); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .6em; font-weight: 800; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.75rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul { padding-inline-start: 1.3em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; top: -200px; right: 1rem; background: var(--accent); color: var(--accent-contrast); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { top: 0; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1rem; }
.section { padding-block: clamp(2rem, 5vw, 4rem); }
.section-alt { background: var(--surface-2); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.eyebrow { display: inline-block; font-size: .85rem; font-weight: 700; color: var(--accent); letter-spacing: 0; margin-bottom: .4rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.mono, .ltr { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.stack > * + * { margin-top: 1rem; }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }

/* دکمه‌ها — ارتفاع حداقل ۴۴px برای لمس */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1.25rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer;
  text-decoration: none !important; transition: background .15s, color .15s, border-color .15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-secondary { background: var(--brand); color: var(--brand-contrast); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: inherit; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { min-height: 36px; padding: .3rem .8rem; font-size: .875rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.card h3 { margin-bottom: .4rem; }
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); white-space: nowrap; }
.badge-sample { background: #fff3cd; color: #7a5b00; border-color: #f0d68a; }
.badge-success { background: #e3f4ea; color: var(--success); border-color: #b8e0c7; }
.badge-warning { background: #fdf1dc; color: var(--warning); border-color: #f1d49c; }
.badge-danger { background: #fbe6e3; color: var(--danger); border-color: #f0c1bb; }
.badge-info { background: #e3eef9; color: var(--info); border-color: #b9d2ec; }
.badge-muted { background: var(--surface-2); color: var(--muted); }

.alert { padding: .85rem 1rem; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 1rem; }
.alert-sample { background: #fff8e1; border-color: #f0d68a; color: #5f4700; }
.alert-success { background: #e8f6ee; border-color: #b8e0c7; color: #155c33; }
.alert-danger { background: #fdecea; border-color: #f0c1bb; color: #8e2a1f; }
.alert-info { background: #e8f1fb; border-color: #b9d2ec; color: #1c4f82; }

/* فرم‌ها */
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.form-grid .span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label, .field .label { font-weight: 700; font-size: .92rem; }
.field .hint { font-size: .8rem; color: var(--muted); }
input:not([type]), input[type=text], input[type=tel], input[type=email], input[type=number], input[type=password], input[type=search], input[type=date], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .8rem; font: inherit; font-size: 16px;
  color: var(--text); background: var(--input-bg, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); }
input[type=tel], input.ltr-input { direction: ltr; text-align: right; }
.check { display: flex; gap: .6rem; align-items: flex-start; min-height: 44px; padding-top: .5rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: .25rem; accent-color: var(--accent); flex-shrink: 0; }
.field-validation-error, .text-danger { color: var(--danger); font-size: .85rem; }
.validation-summary-errors ul { margin: 0; }
.input-validation-error { border-color: var(--danger) !important; }
.hp-field { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; opacity: 0; pointer-events: none; }

/* جدول‌ها: در موبایل هر ردیف به کارت تبدیل می‌شود تا هیچ ستونی پنهان نشود */
.table-wrap { width: 100%; overflow-x: auto; }
@media (min-width: 761px) { .price-table td { white-space: nowrap; } .price-table td.cell-title { white-space: normal; min-width: 11rem; } }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); }
table.data th, table.data td { padding: .7rem .8rem; border-bottom: 1px solid var(--border); text-align: right; vertical-align: middle; }
table.data th { font-size: .85rem; color: var(--muted); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.price { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price small { font-weight: 400; color: var(--muted); font-size: .75rem; }
.trend-up { color: var(--danger); } .trend-down { color: var(--success); }
@media (max-width: 760px) {
  table.data.stack-mobile, table.data.stack-mobile tbody, table.data.stack-mobile tr, table.data.stack-mobile td { display: block; width: 100%; }
  table.data.stack-mobile thead { display: none; }
  table.data.stack-mobile tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .75rem; padding: .4rem .2rem; background: var(--surface); }
  table.data.stack-mobile td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .35rem .8rem; text-align: left; }
  table.data.stack-mobile td::before { content: attr(data-label); font-weight: 700; color: var(--muted); text-align: right; flex-shrink: 0; }
  table.data.stack-mobile td.cell-title { display: block; font-weight: 800; font-size: 1.05rem; text-align: right; }
  table.data.stack-mobile td.cell-title::before { display: none; }
  table.data.stack-mobile td.cell-actions { justify-content: stretch; }
  table.data.stack-mobile td.cell-actions::before { display: none; }
  table.data.stack-mobile td.cell-actions .btn { flex: 1; }
}

.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { padding: .5rem .7rem; border-bottom: 1px solid var(--border); text-align: right; }
.spec-table th { width: 45%; font-weight: 500; color: var(--muted); }
.spec-table .en { direction: ltr; unicode-bidi: isolate; }

.filters { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); align-items: end; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: .3rem 1rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 500; text-decoration: none !important; }
.chip.active, .chip:hover { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); }

.pagination { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.pagination a, .pagination span { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.pagination .current { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); }

.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span::before { content: "‹"; margin-inline-end: .3rem; }

.prose { max-width: 75ch; }
.prose h2 { margin-top: 1.6em; font-size: 1.35rem; }
.prose ul li { margin-bottom: .3rem; }

.gallery { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gallery figcaption { padding: .5rem .75rem; font-size: .85rem; color: var(--muted); }

.timeline { list-style: none; padding: 0; margin: 0; border-inline-start: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 1.2rem 1rem; }
.timeline li::before { content: ""; position: absolute; right: -7px; top: .55rem; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }

.preview-bar { background: #222; color: #fff; font-size: .85rem; padding: .4rem 0; }
.preview-bar .container { display: flex; gap: 1rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.preview-bar a { color: #ffd479; }
.sample-strip { background: #fff3cd; color: #5f4700; font-size: .85rem; text-align: center; padding: .35rem 1rem; border-bottom: 1px solid #f0d68a; }

.map-frame { width: 100%; aspect-ratio: 16/9; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.contact-list li { display: flex; gap: .6rem; }
.contact-list strong { min-width: 7.5rem; color: var(--muted); font-weight: 500; }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }
.success-box { text-align: center; max-width: 560px; margin: 0 auto; }
.tracking-code { font-size: 2rem; font-weight: 800; letter-spacing: .08em; direction: ltr; display: inline-block; padding: .4rem 1.2rem; border: 2px dashed var(--accent); border-radius: var(--radius); margin: .5rem 0 1rem; }

.site-footer { background: var(--footer-bg, #1b1e22); color: var(--footer-text, #c9ced6); padding-block: 2.5rem 1.2rem; margin-top: 3rem; font-size: .92rem; }
.site-footer a { color: inherit; }
.site-footer h3 { color: #fff; font-size: 1rem; }
.site-footer .footer-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer .copyright { border-top: 1px solid rgba(255,255,255,.12); margin-top: 1.5rem; padding-top: 1rem; font-size: .8rem; opacity: .8; }

/* منوی موبایل مشترک */
.nav-toggle { display: none; min-width: 44px; min-height: 44px; border: 1px solid currentColor; border-radius: var(--radius-sm); background: transparent; color: inherit; font: inherit; cursor: pointer; }
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: 0 .8rem; }
  [data-nav]:not(.open) { display: none !important; }
}
@media print {
  .site-header, .site-footer, .nav-toggle, .btn, .preview-bar { display: none !important; }
}

details.filter-box > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; padding: .4rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); list-style: none; }
details.filter-box > summary::after { content: "▾"; margin-inline-start: auto; }
details.filter-box[open] > summary { margin-bottom: .6rem; }
@media (min-width: 761px) { details.filter-box > summary { display: none; } }
