/* ============================================================
   سکه مجید — سیستم طراحی مشترک
   تم مشکی-طلایی لوکس — RTL — فونت وزیرمتن
   دو تم: دارک (پیش‌فرض) و لایت — با data-theme روی <html>
   و اسکریپت theme-bootstrap.js (بدون فلش تم)
   ============================================================ */

/* ---------- فونت محلی (بدون CDN) ---------- */
@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Black.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

/* ---------- توکن‌های طراحی — دارک (پیش‌فرض) ---------- */
:root,
:root[data-theme="dark"] {
  --bg: #070707;
  --bg-2: #0c0c0c;
  --panel: #121212;
  --panel-2: #181818;
  --panel-3: #1f1f1f;
  --border: #2a2a2a;
  --border-gold: rgba(212, 175, 55, 0.22);
  --gold: #d4af37;
  --gold-2: #f2c94c;
  --gold-3: #a8842a;
  --gold-soft: rgba(212, 175, 55, 0.12);
  --gold-grad: linear-gradient(135deg, #f6d878 0%, #f2c94c 35%, #d4af37 65%, #a8842a 100%);
  --text: #f2f2f2;
  --text-2: #b8b8b8;
  --text-3: #8a8a8a;
  --green: #34c77b;
  --green-soft: rgba(52, 199, 123, 0.14);
  --amber: #e8b93e;
  --amber-soft: rgba(232, 185, 62, 0.14);
  --red: #e5534b;
  --red-soft: rgba(229, 83, 75, 0.14);
  --blue: #5b9dd9;
  --blue-soft: rgba(91, 157, 217, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --shadow-gold: 0 10px 42px rgba(212, 175, 55, 0.16);
  --container: 1280px;
  --header-h: 78px;

  /* رنگ‌های سطحی وابسته به تم */
  --header-bg: rgba(7, 7, 7, 0.88);
  --nav-open-bg: rgba(7, 7, 7, 0.98);
  --input-bg: #0e0e0e;
  --footer-bg: #050505;
  --placeholder: #5c5c5c;
  --grey-soft: rgba(255, 255, 255, 0.05);
  --overlay: rgba(0, 0, 0, 0.72);
  --img-fade: rgba(7, 7, 7, 0.92);
  --img-fade-side: rgba(7, 7, 7, 0.55);
  --sel-bg: rgba(212, 175, 55, 0.35);
  --sel-text: #ffffff;
  --sb-thumb: #3a3a3a;
  --sb-thumb-hover: #a8842a;
  --skel-1: #141414;
  --skel-2: #1e1e1e;
}

/* ---------- توکن‌های تم لایت — کرم-طلایی هماهنگ با صفحات احراز هویت ---------- */
:root[data-theme="light"] {
  --bg: #f7f3ea;
  --bg-2: #f0eadb;
  --panel: #ffffff;
  --panel-2: #fbf8f1;
  --panel-3: #f2ecdd;
  --border: #e3dcc9;
  --border-gold: rgba(176, 128, 22, 0.3);
  --gold: #c08e14;
  --gold-2: #9a7008;
  --gold-3: #8a6210;
  --gold-soft: rgba(192, 142, 20, 0.11);
  --gold-grad: linear-gradient(135deg, #f6d878 0%, #f2c94c 35%, #d4af37 65%, #a8842a 100%);
  --text: #26200f;
  --text-2: #4f4a3b;
  --text-3: #877f6a;
  --green: #177a48;
  --green-soft: rgba(23, 122, 72, 0.12);
  --amber: #a6750b;
  --amber-soft: rgba(166, 117, 11, 0.12);
  --red: #bb3a31;
  --red-soft: rgba(187, 58, 49, 0.1);
  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, 0.1);
  --shadow: 0 18px 50px rgba(120, 100, 40, 0.18);
  --shadow-gold: 0 10px 42px rgba(192, 142, 20, 0.22);

  --header-bg: rgba(255, 253, 247, 0.92);
  --nav-open-bg: rgba(255, 253, 247, 0.98);
  --input-bg: #f4f0e4;
  --footer-bg: #ece5d3;
  --placeholder: #a39c88;
  --grey-soft: rgba(38, 32, 15, 0.05);
  --overlay: rgba(46, 38, 20, 0.45);
  --img-fade: rgba(247, 243, 234, 0.92);
  --img-fade-side: rgba(247, 243, 234, 0.4);
  --sel-bg: rgba(192, 142, 20, 0.28);
  --sel-text: #26200f;
  --sb-thumb: #cfc5a9;
  --sb-thumb-hover: #a8842a;
  --skel-1: #ece5d3;
  --skel-2: #f6f1e4;
}

/* ---------- ریست و پایه ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 15.5px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main#main { flex: 1; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::selection { background: var(--sel-bg); color: var(--sel-text); }

/* اسکرول‌بار طلایی */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--sb-thumb); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-hover); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- تایپوگرافی ---------- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.5; }

.gold-text {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: center;
  margin-bottom: 42px;
}
.section-head::before,
.section-head::after {
  content: "";
  height: 1px;
  width: 90px;
  background: linear-gradient(to var(--dir, left), transparent, var(--gold));
}
.section-head::after { background: linear-gradient(to var(--dir, right), transparent, var(--gold)); }
.section-head h2 { font-size: 30px; font-weight: 800; }
.section-sub {
  text-align: center;
  color: var(--text-3);
  margin-top: -28px;
  margin-bottom: 40px;
}

/* ---------- بخش‌ها ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--border); }

/* ============================================================
   هدر سایت
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-gold);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-logo {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #f6d878, #d4af37 55%, #8a6c1e);
  display: grid; place-items: center;
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.35), inset 0 0 8px rgba(255, 255, 255, 0.25);
}
.brand-logo svg { width: 30px; height: 30px; }
/* لوگوی تصویری سفارشی (v19 — پاسخ کارفرما) — بدون برش و با عرض آزاد
   بر اساس نسبت خود تصویر؛ کادر همیشه دقیقاً وسط هدر عمودی می‌نشیند،
   پس هر لوگویی (مربعی/افقی) کامل و وسط دیده می‌شود */
.brand-logo.has-img {
  width: auto;
  height: 46px;
  border-radius: 12px;
  background: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.brand-logo.has-img img {
  width: auto;
  height: 100%;
  max-width: 172px;
  border-radius: 10px;
  object-fit: contain;
  display: block;
}
/* متن برند — ستون عمودی وسط‌چین؛ نام و شعار دقیقاً کنار مرکز لوگو می‌نشینند
   (پاسخ کارفرما v18: تصویر و متن در یک راستای عمودی و وسط هدر) */
.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: 0.2px; line-height: 1.25; }
.brand-tag { font-size: 11px; color: var(--text-3); line-height: 1.3; }

.main-nav { display: flex; align-items: center; gap: 6px; margin-inline-start: 12px; }
.main-nav a {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
  position: relative;
  transition: color 0.2s;
}
.main-nav a:hover { color: var(--gold-2); }
.main-nav a.active { color: var(--gold-2); }
.main-nav a.active::after {
  content: "";
  position: absolute;
  inset-inline: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold-grad);
}

/* سمت انتهایی هدر: دکمه تم + اکشن‌های کاربر */
.header-side { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-2);
  display: grid; place-items: center;
  transition: all 0.2s;
  position: relative;
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold-2); }
.icon-btn svg { width: 20px; height: 20px; }

/* دکمه گرد سوییچ تم — ماه/خورشید (مشابه صفحات احراز هویت) */
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.22s ease;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--gold-2); border-color: var(--gold); transform: rotate(12deg); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* منوی کاربر */
.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 7px 14px 7px 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.2s;
}
.user-chip:hover { border-color: var(--gold); }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--gold-grad);
  color: #1a1405;
  font-weight: 800;
  font-size: 14px;
  display: grid; place-items: center;
  /* آواتار تصویری — جعبه همیشه مربع و برش مرکزی (بدون دفرمه شدن) */
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.user-chip .chev { color: var(--text-3); transition: transform 0.2s; }
.user-menu.open .user-chip .chev { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  min-width: 210px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s;
  z-index: 70;
}
.user-menu.open .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown .dd-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.user-dropdown .dd-head .dd-name { font-weight: 700; font-size: 14px; }
.user-dropdown .dd-head .dd-mail { font-size: 12px; color: var(--text-3); direction: ltr; text-align: right; }
.user-dropdown a, .user-dropdown button {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: none;
  border: 0;
  color: var(--text-2);
  font-size: 14px;
  text-align: start;
  transition: all 0.15s;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--gold-soft); color: var(--gold-2); }
.user-dropdown a.danger:hover, .user-dropdown button.danger:hover { background: var(--red-soft); color: var(--red); }
.user-dropdown svg { width: 18px; height: 18px; flex-shrink: 0; }
.dd-badge { font-size: 10px; background: var(--gold-soft); color: var(--gold-2); border: 1px solid var(--border-gold); padding: 1px 8px; border-radius: 20px; margin-inline-start: auto; }

/* دکمه همبرگری موبایل */
.nav-toggle { display: none; }

/* ============================================================
   دکمه‌ها
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 14px;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all 0.22s;
  white-space: nowrap;
}
.btn svg { width: 19px; height: 19px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-gold {
  background: var(--gold-grad);
  color: #191204;
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 50px rgba(212, 175, 55, 0.3); }

.btn-outline {
  background: transparent;
  border-color: var(--border-gold);
  color: var(--gold-2);
}
.btn-outline:hover:not(:disabled) { background: var(--gold-soft); border-color: var(--gold); }

.btn-ghost { background: var(--panel); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-2); }

.btn-danger { background: var(--red-soft); border-color: rgba(229, 83, 75, 0.4); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: rgba(229, 83, 75, 0.25); }

.btn-sm { padding: 8px 16px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { padding: 15px 34px; font-size: 16.5px; border-radius: 16px; }
.btn-block { width: 100%; }

/* ============================================================
   فرم‌ها
   ============================================================ */
.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}
.form-field label .req { color: var(--gold); margin-inline-start: 3px; }

.input, .select, .textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 15px;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
/* فیلد فقط‌خواندنی (مثل شماره موبایل در پروفایل) */
.input[readonly], .input:disabled {
  cursor: not-allowed;
  opacity: 0.85;
  border-style: dashed;
}

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.13);
}
.input.ltr { direction: ltr; text-align: left; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23b8b8b8' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-inline-end: 15px;
  cursor: pointer;
}
.select option { background: var(--panel-2); color: var(--text); }
.textarea { min-height: 120px; resize: vertical; }

.hint { font-size: 12.5px; color: var(--text-3); margin-top: 7px; line-height: 1.9; }

.field-error { font-size: 12.5px; color: var(--red); margin-top: 7px; display: none; }
.field-error.show { display: block; }

.form-alert {
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
  border: 1px solid;
}
.form-alert.show { display: block; }
.form-alert.error { background: var(--red-soft); border-color: rgba(229, 83, 75, 0.45); color: var(--red); }
.form-alert.success { background: var(--green-soft); border-color: rgba(52, 199, 123, 0.45); color: var(--green); }

/* نشانگر قوت رمز */
.strength-bars { display: flex; gap: 6px; margin-top: 9px; }
.strength-bars i { flex: 1; height: 5px; border-radius: 4px; background: var(--panel-3); transition: background 0.25s; }
.strength-label { font-size: 12px; color: var(--text-3); margin-top: 6px; }

/* ============================================================
   کارت‌ها و پنل‌ها
   ============================================================ */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card-hover:hover {
  transform: translateY(-6px);
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ============================================================
   جدول‌ها
   ============================================================ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.data-table thead th {
  background: var(--panel-2);
  color: var(--gold-2);
  font-weight: 700;
  font-size: 13px;
  padding: 14px 18px;
  text-align: start;
  border-bottom: 1px solid var(--border-gold);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(212, 175, 55, 0.04); }
.data-table .num { font-weight: 600; color: var(--text); }

/* ============================================================
   نشان‌ها (Badge)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 13px;
  border-radius: 30px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.badge-gold { background: var(--gold-soft); border-color: var(--border-gold); color: var(--gold-2); }
.badge-green { background: var(--green-soft); border-color: rgba(52, 199, 123, 0.4); color: var(--green); }
.badge-amber { background: var(--amber-soft); border-color: rgba(232, 185, 62, 0.4); color: var(--amber); }
.badge-red { background: var(--red-soft); border-color: rgba(229, 83, 75, 0.4); color: var(--red); }
.badge-blue { background: var(--blue-soft); border-color: rgba(91, 157, 217, 0.4); color: var(--blue); }
.badge-grey { background: var(--grey-soft); border-color: var(--border); color: var(--text-3); }

/* ============================================================
   فوتر
   ============================================================ */
.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--border-gold);
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding: 56px 0 44px;
}
.footer-col h4,
.footer-branches h4 {
  color: var(--gold-2);
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 18px;
  position: relative;
  padding-bottom: 10px;
}
.footer-col h4::after,
.footer-branches h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 34px; height: 2px;
  border-radius: 2px;
  background: var(--gold-grad);
}
.footer-col p { color: var(--text-3); font-size: 13.5px; line-height: 2; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 4px; }
.footer-links a {
  color: var(--text-3);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  transition: color 0.2s, transform 0.2s;
}
.footer-links a::before { content: "›"; color: var(--gold-3); font-weight: 700; }
.footer-links a:hover { color: var(--gold-2); transform: translateX(-3px); }

.newsletter { display: flex; gap: 8px; margin-top: 18px; }
.newsletter .input { padding: 10px 14px; font-size: 13.5px; }
.newsletter .btn { padding: 10px 18px; font-size: 13.5px; border-radius: 10px; }

.footer-contact { list-style: none; }
.footer-contact li {
  display: flex; align-items: flex-start; gap: 12px;
  color: var(--text-3);
  font-size: 13.5px;
  margin-bottom: 14px;
  line-height: 1.9;
}
.footer-contact svg { width: 18px; height: 18px; color: var(--gold); flex-shrink: 0; margin-top: 5px; }

/* ---------- شعبه‌های مجموعه در فوتر (v19 — پاسخ کارفرما) ----------
   با سوییچ پنل مدیریت فعال/غیرفعال می‌شود؛ خالی یا خاموش = کاملاً مخفی */
.footer-branches { padding: 0 0 46px; }
.footer-branches[hidden] { display: none; }
.footer-branches .fb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.footer-branches .fb-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--panel-2);
}
.footer-branches .fb-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}
.footer-branches .fb-name svg { width: 16px; height: 16px; color: var(--gold); flex-shrink: 0; }
.footer-branches .fb-addr { font-size: 12.5px; color: var(--text-2); line-height: 1.8; margin-top: 5px; }
.footer-branches .fb-meta { font-size: 11.5px; color: var(--text-3); margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.footer-branches .fb-meta .ltr { direction: ltr; text-align: right; }

.social-row { display: flex; gap: 10px; margin-top: 20px; }
.social-row a {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text-3);
  transition: all 0.2s;
}
.social-row a:hover { border-color: var(--gold); color: var(--gold-2); transform: translateY(-3px); }
.social-row svg { width: 18px; height: 18px; }

.copyright-bar {
  border-top: 1px solid var(--border);
  padding: 20px 0;
}
.copyright-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text-3);
  font-size: 13px;
}

/* ============================================================
   اعلان (Toast)
   ============================================================ */
#toast-root {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 50%;
  transform: translateX(50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 20px;
  font-size: 14px;
  color: var(--text);
  box-shadow: var(--shadow);
  min-width: 280px;
  max-width: min(92vw, 480px);
  animation: toast-in 0.3s ease;
  pointer-events: auto;
}
.toast svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- بنر پیشنهاد اعلان‌های ویندوز/موبایل (v34) ---------- */
.push-ask {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 900; /* زیر توست‌ها و پنل چت */
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  max-width: min(92vw, 440px);
  box-shadow: var(--shadow);
  animation: toast-in 0.3s ease;
}
.push-ask-ic {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--gold-grad);
  color: #191204;
  flex-shrink: 0;
}
.push-ask-ic svg { width: 20px; height: 20px; }
.push-ask-txt { display: flex; flex-direction: column; gap: 3px; }
.push-ask-txt b { font-size: 14px; color: var(--text); }
.push-ask-txt span { font-size: 12.5px; color: var(--text-3); line-height: 1.9; }
.push-ask-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
@media (max-width: 640px) {
  .push-ask { bottom: 84px; left: 12px; right: 12px; max-width: none; }
  .push-ask-actions { flex-direction: row; }
}
.toast.success { border-color: rgba(52, 199, 123, 0.5); }
.toast.success svg { color: var(--green); }
.toast.error { border-color: rgba(229, 83, 75, 0.5); }
.toast.error svg { color: var(--red); }
.toast.info svg { color: var(--gold-2); }
.toast.leaving { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(16px); } }

/* ============================================================
   مودال
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade-in 0.2s ease;
}
.modal-box {
  background: var(--panel-2);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow);
  animation: modal-in 0.25s ease;
  max-height: 88vh;
  overflow-y: auto;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(20px) scale(0.97); } }

/* ============================================================
   حالت‌های خالی و اسکلتون
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-3);
}
.empty-state svg { width: 56px; height: 56px; color: var(--gold-3); margin-bottom: 16px; }
.empty-state .t { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, var(--skel-1) 40%, var(--skel-2) 50%, var(--skel-1) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================================================
   ابزارهای عمومی
   ============================================================ */
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 18px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 20px; }
.mt-6 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 20px; }
.text-center { text-align: center; }
.text-3 { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.gold { color: var(--gold-2); }
.green { color: var(--green); }
.red { color: var(--red); }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fw-7 { font-weight: 700; }
.ltr { direction: ltr; unicode-bidi: embed; }
.hidden { display: none !important; }

/* اعداد و مبالغ */
.money { font-weight: 700; color: var(--text); }
.money-unit { font-size: 0.72em; color: var(--text-3); font-weight: 500; margin-inline-start: 5px; }
.price-up { color: var(--green); }
.price-down { color: var(--red); }

/* نقطه چشمک‌زن «زنده» */
.live-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 199, 123, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(52, 199, 123, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 199, 123, 0); }
}

/* صفحه‌بندی */
.load-more-wrap { text-align: center; margin-top: 28px; }
.page-info { text-align: center; color: var(--text-3); font-size: 13px; margin-top: 14px; }

/* تب‌ها */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  overflow-x: auto;
}
.tab-btn {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-3);
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 18px;
  white-space: nowrap;
  transition: color 0.2s;
}
.tab-btn:hover { color: var(--text-2); }
.tab-btn.active { color: var(--gold-2); border-bottom-color: var(--gold); }

/* ============================================================
   واکنش‌گرایی
   ============================================================ */
@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; }
  .nav-toggle { display: grid; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background: var(--nav-open-bg);
    border-bottom: 1px solid var(--border-gold);
    padding: 14px 24px 20px;
    gap: 4px;
  }
  .main-nav.open a { padding: 12px 10px; border-radius: 10px; }
  .main-nav.open a.active::after { display: none; }
  .main-nav.open a.active { background: var(--gold-soft); }
}

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .container { padding-inline: 18px; }
  .section { padding: 52px 0; }
  .section-head h2 { font-size: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; padding: 40px 0 30px; }
  .brand-tag { display: none; }
  .user-chip .user-name { display: none; }
  .btn { padding: 11px 20px; font-size: 14px; }
  .header-actions .btn-register { display: none; }
}

/* ============================================================
   زنگ اعلان‌ها + آواتار هدر (v6)
   ============================================================ */
.bell-wrap { position: relative; display: inline-flex; }

.bell-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: linear-gradient(135deg, #f2c94c, #d4af37);
  color: #241a04;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  display: none;
  box-shadow: 0 2px 6px rgba(212, 175, 55, 0.45);
}
.bell-badge.show { display: block; }

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--panel);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  z-index: 300;
  overflow: hidden;
  animation: dropIn 0.18s ease;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  font-weight: 700;
  font-size: 14px;
}

.notif-list { max-height: 380px; overflow-y: auto; }

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.05));
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: rgba(212, 175, 55, 0.06); }
.notif-item.unread { background: rgba(212, 175, 55, 0.08); }
.notif-item.unread .notif-title::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d4af37;
  margin-inline-end: 7px;
  vertical-align: middle;
}
.notif-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.notif-body { font-size: 12px; color: var(--text-3, #999); line-height: 1.7; }
.notif-time { font-size: 11px; color: var(--text-3, #777); margin-top: 5px; }
.notif-empty {
  padding: 34px 16px;
  text-align: center;
  color: var(--text-3, #888);
  font-size: 13px;
}

/* اعلان‌های زنده (v32) — سوییچ صدا در سربرگ زنگ + ردیف فعال‌سازی
   اعلان مرورگر؛ هر دو تم‌محور از متغیرهای سایت */
.notif-head-row { display: flex; align-items: center; gap: 6px; }

.notif-mini-btn {
  background: none;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  color: var(--text-3, #999);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.notif-mini-btn:hover {
  color: var(--gold, #d4af37);
  border-color: rgba(212, 175, 55, 0.5);
}

.notif-enable {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: 0;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  color: var(--gold, #d4af37);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}
.notif-enable:hover { background: rgba(212, 175, 55, 0.08); }

/* ---------- وضعیت اعلان مرورگر در پنل زنگ (v35) ----------
   چهار حالت: در دسترس نیست / فعال + آزمایشی / مسدودشده / فعال‌سازی
   (هم در زنگ سایت و هم زنگ پنل مدیریت — main.css در هر دو لود می‌شود) */
.notif-push-state {
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--text-3);
  text-align: right;
  border-top: 1px solid var(--border);
}
.notif-push-on {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--green);
}
.notif-push-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-3);
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.notif-push-btn:hover { color: var(--text); border-color: var(--text-3); }
.notif-push-denied { color: var(--red); }

/* تصویر آواتار — با جانمایی مطلق داخل جعبه مربعِ والد، نسبت تصویر
   هرچه باشد (مربعی یا مستطیلی) با object-fit: cover از مرکز برش
   می‌خورد و در دایره نشان داده می‌شود؛ هیچ‌گاه کشیده/دفرمه نمی‌شود. */
.user-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  display: block;
}

/* دکمه ریز مشترک */
.btn.btn-xs {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 8px;
}

/* ================= هشدار کهنگی قیمت — صفحه محصول (v9) ================= */
.form-alert.warn {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.42);
  color: var(--gold, #d4af37);
}
