/* ==========================================================================
   DahuaNet — layout.css
   اسکلت مشترک همه‌ی صفحه‌ها: نوار بالا، هدر، مگامنو، کشوها، نوار پایین موبایل و فوتر.
   ========================================================================== */

:root {
  --header-h: 76px;
  --tabbar-h: 64px;
}

/* ---------- نوار بالا ---------- */
.topbar {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, var(--night) 0%, var(--night-2) 50%, var(--night) 100%);
  color: var(--on-dark-muted);
  font-size: var(--fs-xs);
}
/* درخشش آرامی که از روی نوار رد می‌شود */
.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .14) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: dn-gradient-pan 7s linear infinite;
  pointer-events: none;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
  padding-block: 6px;
}
.topbar__msg {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--on-dark);
  font-weight: 600;
}
.topbar__msg > :last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__msg a:hover { color: var(--mint); }
.topbar__meta { flex: none; }
.topbar__meta a { color: var(--on-dark); font-weight: 800; }
@media (max-width: 760px) {
  .topbar__meta { display: none; }
  .topbar__inner { justify-content: center; }
}

/* ---------- هدر ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--surface-glass-soft);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--dur-2) var(--ease), background var(--dur-2);
}
.site-header.is-scrolled { background: var(--surface-glass); box-shadow: 0 14px 34px -20px rgba(4, 47, 44, .35); }

.site-header__main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(12px, 2.4vw, 32px);
  min-height: var(--header-h);
  padding-block: 10px;
}
.site-header__burger { display: none; }

.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { width: auto; height: 46px; max-width: 180px; object-fit: contain; }
/* دو نسخه‌ی لوگو: روشن برای زمینه‌ی روشن، تیره برای حالت تیره‌ی سایت.
   حالت تیره با <html data-theme="dark"> روشن می‌شود؛ نسخه‌ی پنهان lazy است و دانلود نمی‌شود. */
.brand-logo--dark { display: none; }
:root[data-theme="dark"] .brand-logo--light { display: none; }
:root[data-theme="dark"] .brand-logo--dark { display: block; }

.site-search { width: 100%; max-width: 620px; justify-self: center; }
.site-search .search-pill { min-height: 48px; }
.site-search .search-pill input { height: 48px; }
.site-search .btn { min-height: 38px; }

.site-actions { display: flex; align-items: center; gap: 6px; }

/* ---------- دکمه‌ی حالت روشن / تیره ---------- */
.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-soft);
  color: #e08a00;
  cursor: pointer;
  transition: background var(--dur-2), border-color var(--dur-2), color var(--dur-2), transform var(--dur-3) var(--ease-spring);
}
.theme-toggle:hover { border-color: var(--line-strong); transform: rotate(-12deg) scale(1.06); }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle__svg { width: 22px; height: 22px; overflow: visible; }
.theme-toggle__disc { transform-origin: 12px 12px; transition: transform .5s var(--ease-spring); }
.theme-toggle__bite { transition: transform .5s var(--ease-out); }
.theme-toggle__rays { transform-origin: 12px 12px; transition: transform .5s var(--ease-spring), opacity .3s; }
.theme-toggle__stars { opacity: 0; transform: scale(.4); transform-origin: 18px 17px; transition: opacity .3s, transform .4s var(--ease-spring); }
:root[data-theme="dark"] .theme-toggle { background: #10302c; border-color: #1f4a45; color: #fde68a; }
:root[data-theme="dark"] .theme-toggle:hover { border-color: #2dd4bf; box-shadow: 0 0 0 4px rgba(45, 212, 191, .12), 0 0 18px rgba(253, 230, 138, .25); }
:root[data-theme="dark"] .theme-toggle__disc { transform: scale(1.65); }
:root[data-theme="dark"] .theme-toggle__bite { transform: translate(-6.5px, 5px); }
:root[data-theme="dark"] .theme-toggle__rays { opacity: 0; transform: rotate(-90deg) scale(.4); }
:root[data-theme="dark"] .theme-toggle__stars { opacity: 1; transform: none; transition-delay: .15s; }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle, .theme-toggle * { transition: none !important; }
}

.support {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline-end: 14px;
  margin-inline-end: 6px;
  border-inline-end: 1px solid var(--line);
  line-height: 1.35;
}
.support__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-tint);
  color: var(--primary);
  transition: background var(--dur-2), color var(--dur-2);
}
.support__icon { position: relative; }
.support__icon::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--aqua);
  opacity: 0;
  animation: dn-ring-ping 2.8s var(--ease) infinite;
}
@keyframes dn-ring-ping { 0% { transform: scale(.85); opacity: .7; } 80%, 100% { transform: scale(1.35); opacity: 0; } }
.support:hover .support__icon { background: var(--grad-brand); color: var(--on-primary); }
.support__text { display: grid; }
.support__text b { font-size: var(--fs-sm); font-weight: 800; }
.support__text small { color: var(--fg-subtle); font-size: var(--fs-2xs); }

.action {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--fg);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-2), color var(--dur-2);
}
.action:hover, .action[aria-expanded="true"] { background: var(--bg-soft); color: var(--primary); }
.action .icon { width: 22px; height: 22px; }
.action__label { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; }
.action--cart { padding-inline: 11px; }
.count {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding-inline: 5px;
  border: 2px solid var(--bg);
  border-radius: var(--r-pill);
  background: var(--grad-brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.count.is-bumped { animation: dn-bump .5s var(--ease-spring); }
@keyframes dn-bump { 40% { transform: scale(1.35); } }

/* ---------- ردیف منو ---------- */
.site-nav { border-top: 1px solid var(--line); }
.site-nav__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
}
.site-nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-inline-start: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav__links::-webkit-scrollbar { display: none; }
.nav-link {
  position: relative;
  display: inline-flex;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  transition: color var(--dur-2);
}
.nav-link::after {
  content: "";
  position: absolute;
  inset-inline: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-brand);
  transform: scaleX(0);
  transition: transform var(--dur-3) var(--ease);
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--fg); }
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }
/* پیوند برجسته (استعلام گارانتی): همان برچسب REC کادر دوربین در هیرو */
.nav-hl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 10px;
  padding: 5px 12px;
  border-radius: 6px;
  background: linear-gradient(rgba(255, 77, 79, .2), rgba(255, 77, 79, .2)), var(--ink-solid);
  box-shadow: inset 0 0 0 1px rgba(255, 138, 138, .25), 0 6px 16px -10px rgba(255, 77, 79, .8);
  color: #ffd9d9;
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
  position: relative;
  transition: background var(--dur-2), color var(--dur-2), box-shadow var(--dur-2);
}
/* گوشه‌های کادر نمایشگر دوربین دور برچسب؛ با هاور جمع می‌شوند، مثل فوکوس کردن */
.nav-hl::before {
  --c: var(--teal);
  --l: 7px;
  content: "";
  position: absolute;
  inset: -5px -6px;
  pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1.5px,
    linear-gradient(var(--c), var(--c)) top left / 1.5px var(--l),
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1.5px,
    linear-gradient(var(--c), var(--c)) top right / 1.5px var(--l),
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 1.5px,
    linear-gradient(var(--c), var(--c)) bottom left / 1.5px var(--l),
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 1.5px,
    linear-gradient(var(--c), var(--c)) bottom right / 1.5px var(--l);
  background-repeat: no-repeat;
  transition: inset var(--dur-3) var(--ease);
}
.nav-hl:hover::before { inset: -3px -3px; --c: #ff4d4f; }
.nav-hl:hover, .nav-hl[aria-current="page"] {
  background: linear-gradient(rgba(255, 77, 79, .42), rgba(255, 77, 79, .42)), var(--ink-solid);
  box-shadow: inset 0 0 0 1px rgba(255, 138, 138, .45), 0 10px 22px -10px rgba(255, 77, 79, .9);
  color: #fff;
}
/* نقطه‌ی ضبط با درخشش، مثل .hud__rec */
.nav-hl__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d4f;
  box-shadow: 0 0 10px #ff4d4f;
  animation: dn-pulse 1.4s ease-in-out infinite;
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--fg);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-2), color var(--dur-2);
}
.nav-pill .icon:first-child { color: var(--brand); }
.nav-pill:hover, .nav-pill[aria-expanded="true"] { background: var(--bg-tint); color: var(--primary); }

/* ---------- منوی بازشو کوچک (حساب، محل نصب) ---------- */
.pop { position: relative; }
.pop__panel {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-start: 0;
  z-index: 90;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  box-shadow: var(--sh-3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), visibility 0s linear var(--dur-2);
}
.pop__panel--end { inset-inline-start: auto; inset-inline-end: 0; }
.pop.is-open .pop__panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.menu-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: background var(--dur-2), color var(--dur-2);
}
.menu-list a:hover { background: var(--bg-soft); color: var(--primary); }
.menu-list .icon { color: var(--fg-subtle); }
.pop__panel--places { width: min(440px, 90vw); padding: 12px; }
.places-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.places-mini a {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: var(--r);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-align: center;
  transition: background var(--dur-2), color var(--dur-2);
}
.places-mini a:hover { background: var(--bg-tint); color: var(--primary); }
.places-mini .icon { width: 28px; height: 28px; stroke-width: 1.5; color: var(--primary); }

/* ---------- مگامنو ---------- */
.mega { position: static; }
.mega__toggle .mega__chevron { transition: transform var(--dur-2) var(--ease); }
.mega.is-open .mega__toggle .mega__chevron { transform: rotate(180deg); }
.mega__panel {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  z-index: 85;
  display: grid;
  grid-template-columns: 270px 1fr;
  width: min(var(--container), 100% - 2 * var(--gutter));
  max-height: min(70vh, 560px);
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  background: var(--bg);
  box-shadow: var(--sh-3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), visibility 0s linear var(--dur-2);
}
.mega.is-open .mega__panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.mega__cats {
  padding: 12px;
  overflow-y: auto;
  border-inline-end: 1px solid var(--line);
  background: var(--bg-soft);
}
.mega__cat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 700;
  transition: background var(--dur-2), color var(--dur-2);
}
.mega__cat.is-active { background: var(--bg); color: var(--primary); box-shadow: var(--sh-1); }
.mega__cat-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--primary);
}
.mega__cat.is-active .mega__cat-icon { background: var(--bg-tint); }
.mega__cat-icon img { width: 26px; height: 26px; object-fit: contain; }
.mega__cat-name { flex: 1; }
.mega__cat-arrow { color: var(--fg-subtle); }
.mega__panes { position: relative; overflow-y: auto; }
.mega__pane { display: none; padding: 22px 26px 26px; }
.mega__pane.is-active { display: block; animation: dn-pane-in .35s var(--ease); }
@keyframes dn-pane-in { from { opacity: 0; transform: translateX(-8px); } }
.mega__pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.mega__pane-title { font-size: var(--fs-lg); font-weight: 800; }
.mega__pane-title:hover { color: var(--primary); }
.mega__pane-body { display: flex; gap: 24px; align-items: flex-start; }
.mega__children {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px 24px;
}
.mega__child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline-start: 10px;
  border-inline-start: 2px solid var(--aqua);
  font-size: var(--fs-sm);
  font-weight: 800;
  line-height: 1.5;
}
.mega__child:hover { color: var(--primary); }
.mega__leaves { display: grid; gap: 2px; margin-top: 8px; padding-inline-start: 12px; }
.mega__leaves a { color: var(--fg-muted); font-size: var(--fs-sm); transition: color var(--dur-2); }
.mega__leaves a:hover { color: var(--primary); }
.mega__desc { flex: 1; color: var(--fg-muted); max-width: 52ch; }
.mega__visual {
  flex: none;
  display: grid;
  place-items: center;
  width: 200px;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-lg);
  background: var(--grad-media);
}
.mega__visual img { width: 80%; height: 80%; object-fit: contain; transition: transform .6s var(--ease); }
.mega__visual:hover img { transform: scale(1.06); }
.mega__visual { overflow: hidden; }
.mega__visual img[src^="/dahuanet/img/categories/"] { width: 100%; height: 100%; object-fit: cover; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 1100px) {
  .support__text { display: none; }
  .support { padding-inline-end: 6px; }
}
@media (max-width: 960px) {
  .site-nav { display: none; }
  .support { display: none; }
  .site-header__burger { display: inline-grid; }
  .site-header__main {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "burger brand actions" "search search search";
    gap: 10px 12px;
    min-height: 0;
  }
  .site-header__burger { grid-area: burger; }
  .brand { grid-area: brand; justify-self: center; }
  .brand img { height: 38px; }
  .site-actions { grid-area: actions; }
  .site-search { grid-area: search; max-width: none; }
  .site-search .btn { display: none; }
  .site-search .search-pill, .site-search .search-pill input { min-height: 44px; height: 44px; }
  .action__label { display: none; }
  .site-header.is-scrolled .site-search { display: none; }
}

/* ---------- کشو (منوی موبایل و سبد) ---------- */
.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  width: min(400px, 92vw);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg);
  box-shadow: var(--sh-3);
  transition: transform .45s var(--ease), visibility 0s linear .45s;
  visibility: hidden;
}
.drawer--start { inset-inline-start: 0; transform: translateX(105%); }
.drawer--end { inset-inline-end: 0; transform: translateX(-105%); }
[dir="ltr"] .drawer--start { transform: translateX(-105%); }
[dir="ltr"] .drawer--end { transform: translateX(105%); }
.drawer.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer__head .brand img { height: 36px; }
.drawer__title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-lg); font-weight: 800; }
.drawer__title .icon { color: var(--primary); }
.drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px; }
.drawer__foot { display: grid; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.drawer__search { margin-bottom: 20px; }
.drawer__label {
  margin: 18px 0 8px;
  color: var(--fg-subtle);
  font-size: var(--fs-xs);
  font-weight: 800;
}
.drawer-cats > li { border-bottom: 1px solid var(--line); }
.drawer-cats > li > a, .drawer-cats summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.drawer-cats summary::-webkit-details-marker { display: none; }
.drawer-cats summary .icon { transition: transform var(--dur-2) var(--ease); color: var(--fg-subtle); }
.drawer-cats details[open] summary .icon { transform: rotate(180deg); color: var(--primary); }
.drawer-cats details ul { display: grid; gap: 2px; margin: 0; padding: 0 12px 12px; list-style: none; }
.drawer-cats details a { display: block; padding: 6px 0; color: var(--fg-muted); font-size: var(--fs-sm); }
.drawer__places { flex-wrap: wrap; overflow: visible; }
.drawer-links a { display: block; padding: 10px 4px; font-weight: 600; border-bottom: 1px solid var(--line); }
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(11, 59, 55, .45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.drawer-scrim.is-open { opacity: 1; }
.has-drawer { overflow: hidden; }

/* سبد کشویی */
.minicart { display: flex; flex-direction: column; }
.minicart__loading { display: grid; gap: 12px; }
.minicart__empty { display: grid; justify-items: center; gap: 10px; padding: 40px 10px; text-align: center; }
.minicart__empty-icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--bg-tint);
  color: var(--primary);
}
.minicart__empty-icon .icon { width: 36px; height: 36px; }
.minicart__lines { display: grid; gap: 12px; }
.minicart__line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  transition: opacity var(--dur-2);
}
.minicart__line.is-busy { opacity: .45; pointer-events: none; }
.minicart__thumb { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r-sm); background: var(--grad-media); }
.minicart__thumb img { width: 86%; height: 86%; object-fit: contain; }
.minicart__info { display: grid; gap: 2px; min-width: 0; }
.minicart__title { font-size: var(--fs-sm); font-weight: 700; line-height: 1.6; }
.minicart__title:hover { color: var(--primary); }
.minicart__variant, .minicart__price { color: var(--fg-muted); font-size: var(--fs-xs); }
.minicart__foot { display: grid; gap: 12px; margin-top: auto; padding-top: 18px; }
.minicart__total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.minicart__total strong { font-size: var(--fs-xl); font-weight: 900; }
.minicart__actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.minicart__actions [aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ---------- نوار پایین موبایل ---------- */
.tabbar { display: none; }
@media (max-width: 960px) {
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 90;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    border-top: 1px solid var(--line);
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .toast-region { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); }
}
.tabbar__item {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--fg-subtle);
  font-size: var(--fs-2xs);
  font-weight: 700;
  cursor: pointer;
}
.tabbar__item .icon { width: 24px; height: 24px; }
.tabbar__item[aria-current="page"] { color: var(--primary); }
.tabbar__item[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  width: 28px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--grad-brand);
}
.tabbar__icon { position: relative; display: inline-grid; }
.tabbar__icon .count { top: -6px; inset-inline-end: -10px; }

/* ---------- پیام‌های صفحه ---------- */
.page-alerts { display: grid; gap: 10px; padding-top: 20px; }
.alert__body { display: grid; flex: 1; }
.alert__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: .7;
}
.alert__close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }

/* ---------- سربرگ صفحه‌های داخلی ---------- */
.page-head { padding-block: clamp(24px, 4vw, 44px) clamp(16px, 3vw, 28px); }
.page-head__inner { display: grid; gap: 10px; }
.page-head h1 { font-size: var(--fs-3xl); }
.page-head p { color: var(--fg-muted); max-width: 70ch; }

/* ---------- فوتر ----------
   سطح شب سبزآبی با شبکه‌ی محو، دو هاله‌ی شناور و پرتوی اسکن که آرام از بالا به پایین می‌گذرد؛
   ستون‌ها پنل شیشه‌ای‌اند و نور زیر نشانگر را دنبال می‌کند (data-spotlight در layout.js). */
.site-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: var(--section-y);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  background: var(--noise), var(--grad-night);
  color: var(--on-dark-muted);
}
/* حلقه‌های لنز بزرگ در گوشه */
.site-footer::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 720px;
  height: 720px;
  inset-inline-start: -260px;
  bottom: -360px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 46px, var(--ring-line) 46px 47px);
  animation: dn-spin 120s linear infinite;
}
/* خط طیفی روان بالای فوتر */
.site-footer::after {
  content: "";
  position: absolute;
  inset-inline: 8%;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--mint), var(--cyan), var(--accent), var(--mint), transparent) 0 0 / 200% 100%;
  animation: dn-gradient-pan 6s linear infinite;
  opacity: .85;
}
.site-footer a { transition: color var(--dur-2); }
.site-footer a:hover { color: #fff; }

.footer-fx { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.footer-fx__grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 44px 44px;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(80% 70% at 50% 0%, #000 0%, transparent 75%);
}
.footer-fx__orb {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .5;
  animation: dn-drift 22s ease-in-out infinite;
}
.footer-fx__orb--a { top: -120px; inset-inline-end: -80px; background: rgba(34, 211, 238, .55); }
.footer-fx__orb--b { top: 40%; inset-inline-start: 30%; background: rgba(110, 231, 183, .35); animation-duration: 28s; animation-direction: reverse; }
/* پرتوی اسکن: نوار نوری که پایین این لایه است و لایه از بالا تا پایین فوتر جابه‌جا می‌شود */
.footer-fx__scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 70%, rgba(45, 212, 191, .1) 96%, rgba(167, 243, 208, .55) 99.6%, transparent 100%);
  transform: translateY(-100%);
  animation: dn-footer-scan 9s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes dn-footer-scan {
  0% { transform: translateY(-100%); opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(100%); opacity: 0; }
}

/* خبرنامه: شیشه‌ای با لبه‌ی نورانی چرخان */
.footer-cta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(28px, 4vw, 44px);
  padding: clamp(18px, 3vw, 28px);
  border-radius: var(--r-xl);
  background: linear-gradient(120deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05));
  box-shadow: inset 0 0 0 1px var(--glass-line), 0 30px 60px -34px rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.footer-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--dn-angle), transparent 0 55%, var(--mint) 72%, var(--cyan) 84%, var(--accent) 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: dn-spin-angle 7s linear infinite;
  pointer-events: none;
}
.footer-cta__copy { display: flex; align-items: center; gap: 16px; }
.footer-cta__icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: var(--r);
  background: #fff;
  color: var(--on-white-teal);
  box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .4);
}
.footer-cta__icon::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: calc(var(--r) + 6px);
  border: 2px solid var(--mint);
  animation: dn-ring-ping 2.6s var(--ease-out) infinite;
}
.footer-cta__icon .icon { width: 24px; height: 24px; animation: dn-float 4s ease-in-out infinite; }
.footer-cta h2 { color: #fff; font-size: var(--fs-lg); }
.footer-cta p { font-size: var(--fs-sm); }
.footer-newsletter { display: flex; gap: 8px; flex: 1 1 340px; max-width: 460px; }
.footer-newsletter .input {
  min-height: 48px;
  border-color: var(--glass-line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.footer-newsletter .input::placeholder { color: rgba(240, 253, 250, .65); }
.footer-newsletter .input:focus { border-color: #fff; background: rgba(255, 255, 255, .18); box-shadow: 0 0 0 4px rgba(255, 255, 255, .18); }

.footer-main {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  padding-block: clamp(28px, 4vw, 44px);
}
@media (min-width: 760px) { .footer-main { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .footer-main { grid-template-columns: 1.6fr repeat(3, 1fr); } }

/* پنل شیشه‌ای ستون‌ها؛ --mx/--my جای نشانگر است */
.footer-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(18px, 2.2vw, 24px);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .055);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  transition: transform var(--dur-3) var(--ease-out), background var(--dur-2), box-shadow var(--dur-2);
}
.footer-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), rgba(167, 243, 208, .16), transparent 70%);
  opacity: 0;
  transition: opacity var(--dur-2);
}
/* گوشه‌های منظره‌یاب دوربین که با هاور جمع می‌شوند */
.footer-panel::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: calc(var(--r-lg) - 10px);
  --c: rgba(167, 243, 208, .55);
  background:
    linear-gradient(var(--c), var(--c)) top left / 14px 1.5px,
    linear-gradient(var(--c), var(--c)) top left / 1.5px 14px,
    linear-gradient(var(--c), var(--c)) top right / 14px 1.5px,
    linear-gradient(var(--c), var(--c)) top right / 1.5px 14px,
    linear-gradient(var(--c), var(--c)) bottom left / 14px 1.5px,
    linear-gradient(var(--c), var(--c)) bottom left / 1.5px 14px,
    linear-gradient(var(--c), var(--c)) bottom right / 14px 1.5px,
    linear-gradient(var(--c), var(--c)) bottom right / 1.5px 14px;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity var(--dur-2), transform var(--dur-3) var(--ease-out);
  pointer-events: none;
}
.footer-panel:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 0 1px rgba(167, 243, 208, .3), 0 26px 50px -30px rgba(0, 0, 0, .6);
}
.footer-panel:hover::before { opacity: 1; }
.footer-panel:hover::after { opacity: 1; transform: none; }

.footer-brand { display: grid; align-content: start; gap: 16px; }
@media (min-width: 760px) and (max-width: 1099px) { .footer-brand { grid-column: 1 / -1; } }
.footer-brand__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
/* لوگوی نسخه‌ی روشن روی خود سطح تیره‌ی فوتر می‌نشیند، بی کارت سفید */
.footer-brand__logo {
  display: inline-block;
  border-radius: var(--r);
  transition: transform var(--dur-3) var(--ease-spring), filter var(--dur-3);
}
.footer-brand__logo:hover { transform: scale(1.04); filter: drop-shadow(0 0 14px rgba(94, 234, 212, .35)); }
.footer-brand__logo img { width: auto; height: 44px; max-width: 100%; }
.footer-brand__text { max-width: 52ch; line-height: 2; font-size: var(--fs-sm); }

/* «پشتیبانی فعال» با نقطه‌ی سبز تپنده */
.footer-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: rgba(110, 231, 183, .12);
  box-shadow: inset 0 0 0 1px rgba(110, 231, 183, .35);
  color: var(--mint);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.footer-live__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 10px var(--emerald); }
.footer-live__dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--emerald);
  animation: dn-ring-ping 1.8s var(--ease-out) infinite;
}

.footer-contact { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
@media (min-width: 520px) { .footer-contact { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.footer-contact li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border-radius: var(--r-sm);
  background: rgba(4, 47, 44, .22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: background var(--dur-2), box-shadow var(--dur-2);
}
.footer-contact li:hover { background: rgba(4, 47, 44, .34); box-shadow: inset 0 0 0 1px rgba(167, 243, 208, .3); }
.footer-contact__wide { grid-column: 1 / -1; }
.footer-contact .icon {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 10px;
  background: var(--grad-brand);
  box-shadow: inset 0 0 0 1px var(--glass-line), 0 8px 18px -10px rgba(0, 0, 0, .6);
  color: #fff;
  transition: transform var(--dur-3) var(--ease-spring);
}
.footer-contact li:hover .icon { transform: rotate(-8deg) scale(1.08); }
.footer-contact__body { display: grid; gap: 2px; min-width: 0; line-height: 1.6; }
.footer-contact__body > :last-child { color: #fff; overflow-wrap: anywhere; }
.footer-contact__label { color: var(--on-dark-muted); font-size: var(--fs-2xs); opacity: .8; }

.footer-col h2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  color: #fff;
  font-size: var(--fs-md);
}
/* خط زیر تیتر با تکه‌ای کهربایی که رفت‌وبرگشت می‌کند */
.footer-col h2::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background:
    linear-gradient(90deg, transparent, var(--accent), transparent) 0 0 / 35% 100% no-repeat,
    var(--dark-line);
  animation: dn-footer-line 4.5s ease-in-out infinite alternate;
}
@keyframes dn-footer-line { to { background-position: 100% 0, 0 0; } }
.footer-col__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--glass-line);
  color: var(--mint);
  transition: transform var(--dur-3) var(--ease-spring), background var(--dur-2), color var(--dur-2);
}
.footer-col__icon .icon { width: 18px; height: 18px; }
.footer-panel:hover .footer-col__icon { transform: rotate(-10deg) scale(1.08); background: #fff; color: var(--on-white-teal); }

.footer-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: var(--fs-sm); }
.footer-col a {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline: -10px;
  padding: 7px 10px;
  border-radius: 10px;
  transition: color var(--dur-2), background var(--dur-2), padding var(--dur-3) var(--ease-out);
}
/* نقطه‌ای که با هاور به خط بلند تبدیل می‌شود */
.footer-col a::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 3px;
  background: var(--mint);
  opacity: .55;
  transition: width var(--dur-3) var(--ease-out), opacity var(--dur-2), background var(--dur-2);
}
.footer-col a span { flex: 1; min-width: 0; }
.footer-col a .icon {
  flex: none;
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity var(--dur-2), transform var(--dur-3) var(--ease-out);
}
[dir="ltr"] .footer-col a .icon { scale: -1 1; transform: translateX(-8px); }
.footer-col a:hover, .footer-col a:focus-visible { background: rgba(255, 255, 255, .07); color: #fff; }
.footer-col a:hover::before, .footer-col a:focus-visible::before { width: 16px; opacity: 1; background: linear-gradient(90deg, var(--accent), #ffd27a); }
.footer-col a:hover .icon, .footer-col a:focus-visible .icon { opacity: 1; transform: none; }

.footer-badges { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; align-items: center; }
.footer-badges img { max-height: 96px; width: auto; border-radius: var(--r-sm); background: #fff; transition: transform var(--dur-3) var(--ease-spring); }
.footer-badges img:hover { transform: translateY(-4px); }

.footer-bottom {
  position: relative;
  border-top: 1px solid var(--dark-line);
  background: rgba(4, 47, 44, .28);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.footer-bottom__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block: 16px;
  font-size: var(--fs-xs);
}
.footer-copy { display: flex; align-items: center; gap: 10px; }
.footer-copy__rec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 77, 79, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 138, 138, .4);
  color: #ffb4b4;
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: .12em;
  direction: ltr;
}
.footer-copy__rec::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff4d4f;
  box-shadow: 0 0 8px #ff4d4f;
  animation: dn-pulse 1.4s ease-in-out infinite;
}
.footer-socials { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.footer-social {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--glass-line);
  color: #fff;
  transition: transform var(--dur-3) var(--ease-spring), box-shadow var(--dur-2), color var(--dur-2);
}
.footer-social::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #fff, var(--ice));
  transform: translateY(101%);
  transition: transform var(--dur-3) var(--ease-out);
}
.footer-social .icon { position: relative; width: 18px; height: 18px; transition: transform var(--dur-3) var(--ease-spring); }
.site-footer .footer-social:hover, .footer-social:focus-visible {
  transform: translateY(-4px);
  box-shadow: inset 0 0 0 1px #fff, 0 14px 26px -12px rgba(0, 0, 0, .55);
  color: var(--teal-700);
}
.footer-social:hover::before, .footer-social:focus-visible::before { transform: none; }
.footer-social:hover .icon, .footer-social:focus-visible .icon { transform: rotate(-12deg) scale(1.12); }

/* بازگشت به بالا: شناور در سمت چپ (روبه‌روی گفت‌وگو)، فقط پس از کمی اسکرول؛
   حلقه‌ی دورش پیشرفت اسکرول را نشان می‌دهد (جایی که مرورگر پشتیبانی کند) */
.to-top {
  position: fixed;
  z-index: 94;
  inset-inline-end: max(18px, env(safe-area-inset-left, 0px));
  bottom: calc(23px + env(safe-area-inset-bottom, 0px));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  color: var(--teal-700);
  box-shadow: 0 12px 26px -12px rgba(4, 47, 44, .55), 0 0 0 1px var(--line);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.9);
  transition: opacity var(--dur-2), transform var(--dur-2) var(--ease-spring), visibility 0s linear var(--dur-2);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
@media (max-width: 960px) {
  .to-top { bottom: calc(var(--tabbar-h) + 19px + env(safe-area-inset-bottom, 0px)); }
}
.to-top::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(var(--mint) calc(var(--dn-p) * 360deg), rgba(4, 47, 44, .08) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
}
@supports (animation-timeline: scroll()) {
  .to-top::before { animation: dn-to-top-progress linear both; animation-timeline: scroll(root); }
}
@keyframes dn-to-top-progress { from { --dn-p: 0; } to { --dn-p: 1; } }
.to-top .icon { transition: transform var(--dur-3) var(--ease-spring); }
.to-top.is-visible:hover { transform: translateY(-3px); }
.to-top:hover .icon { transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
  .footer-fx__scan, .footer-fx__orb { display: none; }
}

/* ---------- چیدمان متمرکز (ورود) ---------- */
.focus-layout { min-height: 100vh; display: grid; background: var(--bg-soft); }
@media (min-width: 960px) { .focus-layout { grid-template-columns: 1fr 1.05fr; } }
.focus-aside {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: none;
  padding: 48px clamp(32px, 5vw, 72px);
  background: var(--noise), var(--grad-night);
  color: var(--on-dark-muted);
}
@media (min-width: 960px) { .focus-aside { display: grid; align-content: space-between; gap: 40px; } }
.focus-aside h2 { color: #fff; font-size: var(--fs-3xl); line-height: 1.4; }
.focus-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 55%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 55%, #000 20%, transparent 75%);
}
.focus-aside .lens { width: min(300px, 70%); margin-inline: auto; }
.focus-aside__list { display: grid; gap: 12px; font-size: var(--fs-sm); }
.focus-aside__list li { display: flex; align-items: center; gap: 10px; }
.focus-aside__list .icon { color: var(--mint); }
.focus-main {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 24px;
  padding: 32px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px));
}
.focus-main__top { display: flex; align-items: center; justify-content: space-between; width: min(440px, 100%); }
.focus-main__top .brand img { height: 42px; }
.focus-main__actions { display: flex; align-items: center; gap: 4px; }
.focus-card {
  display: grid;
  gap: 20px;
  width: min(440px, 100%);
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--bg);
  box-shadow: var(--sh-2);
}
.focus-card__head { display: grid; gap: 6px; }
.focus-card__head h1 { font-size: var(--fs-2xl); }
.focus-card__head p { color: var(--fg-muted); font-size: var(--fs-sm); }
.focus-card form { display: grid; gap: 16px; }
.focus-note { color: var(--fg-subtle); font-size: var(--fs-xs); text-align: center; }
.focus-note a { color: var(--primary); font-weight: 700; }

/* زبانه‌های ورود (بدون جاوااسکریپت؛ با رادیو) */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--r-pill); background: var(--bg-soft); }
.auth-tabs label {
  display: grid;
  place-items: center;
  min-height: 40px;
  border-radius: var(--r-pill);
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-2), color var(--dur-2), box-shadow var(--dur-2);
}
#auth-tab-otp:checked ~ .auth-tabs label[for="auth-tab-otp"],
#auth-tab-staff:checked ~ .auth-tabs label[for="auth-tab-staff"] { background: var(--bg); color: var(--fg); box-shadow: var(--sh-1); }
#auth-tab-otp:focus-visible ~ .auth-tabs label[for="auth-tab-otp"],
#auth-tab-staff:focus-visible ~ .auth-tabs label[for="auth-tab-staff"] { outline: 2px solid var(--aqua); outline-offset: 2px; }
.auth-pane { display: none; }
#auth-tab-otp:checked ~ .auth-pane--otp, #auth-tab-staff:checked ~ .auth-pane--staff { display: grid; gap: 16px; animation: dn-pane-in .3s var(--ease); }

/* ورودی کد یکبارمصرف */
.otp-input {
  height: 60px;
  font-family: var(--font-code);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: .6em;
  text-align: center;
  direction: ltr;
}
.otp-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); }
.otp-meta a, .otp-meta button { color: var(--primary); font-weight: 700; }
.otp-meta button { border: 0; background: none; padding: 0; cursor: pointer; }
.otp-meta button:disabled { color: var(--fg-subtle); cursor: default; }

/* ---------- صفحه‌ی خطا ---------- */
.error-page { display: grid; justify-items: center; gap: 18px; padding-block: clamp(40px, 8vw, 96px); text-align: center; }
.error-page__code {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: clamp(160px, 30vw, 220px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--grad-night);
  color: #fff;
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  font-weight: 900;
  box-shadow: var(--sh-3), inset 0 0 0 6px rgba(255, 255, 255, .22);
}
.error-page__code::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1.5px dashed var(--sky-200);
  animation: dn-spin 40s linear infinite;
}
.error-page__code::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 290deg, rgba(204, 251, 241, .45) 360deg);
  z-index: -1;
  animation: dn-spin 4s linear infinite;
}
.error-page .error-page__code { color: #fff; text-shadow: 0 4px 18px rgba(0, 0, 0, .25); }
.error-page h1 { font-size: var(--fs-3xl); }
/* دوربین دیواری که دنبال صفحه‌ی گمشده می‌گردد (_TrackerCam) */
.error-page__stage { position: relative; padding-top: 30px; }
.error-page__stage .tracker-cam { top: -14px; right: clamp(-150px, -16vw, -110px); width: 170px; }
.error-page p { color: var(--fg-muted); max-width: 52ch; }
.error-page .search-pill { width: min(520px, 100%); }
.error-page__cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.focus-main .page-alerts { width: min(440px, 100%); padding: 0; }

/* ---------- پیشنهاد جستجو ---------- */
.has-suggest { position: relative; }
.suggest {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline: 0;
  z-index: 95;
  display: grid;
  gap: 2px;
  max-height: min(70vh, 480px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--sh-3);
  animation: dn-suggest-in .25s var(--ease);
}
@keyframes dn-suggest-in { from { opacity: 0; transform: translateY(-6px); } }
.suggest__cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 6px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.suggest__cats .chip { min-height: 32px; padding: 4px 12px; font-size: var(--fs-xs); }
.suggest__cats .chip.is-active { border-color: var(--aqua); }
.suggest__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  transition: background var(--dur-1);
}
.suggest__item:hover, .suggest__item.is-active { background: var(--bg-soft); }
.suggest__item img { flex: none; width: 48px; height: 48px; object-fit: contain; border-radius: var(--r-xs); background: var(--grad-media); }
.suggest__body { display: grid; flex: 1; min-width: 0; line-height: 1.5; }
.suggest__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); font-weight: 700; }
.suggest__model { color: var(--fg-subtle); font-size: var(--fs-2xs); text-align: start; }
.suggest__price { flex: none; color: var(--primary); font-size: var(--fs-xs); font-weight: 800; }
.suggest__all {
  display: block;
  margin-top: 4px;
  padding: 10px;
  border-radius: var(--r-sm);
  background: var(--bg-tint);
  color: var(--primary);
  font-size: var(--fs-sm);
  font-weight: 800;
  text-align: center;
}
.suggest__all.is-active, .suggest__all:hover { background: var(--primary); color: #fff; }
.suggest__empty { padding: 14px; color: var(--fg-muted); font-size: var(--fs-sm); text-align: center; }

/* ---------- دکمه‌ی شناور گفت‌وگو ---------- */
.chat-fab {
  position: fixed;
  z-index: 95;
  inset-inline-start: max(18px, env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 960px) {
  .chat-fab { bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom, 0px)); }
}
/* دکمه عمداً از سطح‌های سبزآبی (بنر، فوتر) جداست: بدنه‌ی تیره، حاشیه‌ی طیفی چرخان کهربایی ← فیروزه‌ای،
   نشان کهربایی با نقطه‌ی «آنلاین» و هاله‌ی گرم؛ روی سفید، سبزآبی و حالت تیره هر سه دیده می‌شود. */
@property --fab-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.chat-fab__toggle {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding-inline: 7px 22px;
  border: 2px solid transparent;
  border-radius: var(--r-pill);
  background:
    linear-gradient(135deg, #0a2f2b 0%, #04201d 60%, #0b1f2e 100%) padding-box,
    conic-gradient(from var(--fab-angle), #f5a524, #ffd27a, #2dd4bf, #22d3ee, #6ee7b7, #f5a524) border-box;
  color: #fff;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 18px 38px -14px rgba(245, 165, 36, .55), 0 10px 26px -12px rgba(0, 0, 0, .6);
  cursor: pointer;
  animation: dn-fab-spin 6s linear infinite;
  transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2);
}
@keyframes dn-fab-spin { to { --fab-angle: 360deg; } }
.chat-fab__toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 44px -14px rgba(245, 165, 36, .75), 0 0 0 6px rgba(245, 165, 36, .14), 0 12px 28px -12px rgba(0, 0, 0, .6);
}
.chat-fab__toggle:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.chat-fab__badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(140deg, #ffd27a 0%, #f5a524 55%, #e08a00 100%);
  color: #3b2300;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 6px 14px -4px rgba(245, 165, 36, .7);
  transition: transform var(--dur-3) var(--ease-spring);
}
.chat-fab__toggle:hover .chat-fab__badge { transform: rotate(-12deg) scale(1.06); }
.chat-fab__badge .icon { width: 22px; height: 22px; }
.chat-fab__online {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  width: 12px;
  height: 12px;
  border: 2px solid #04201d;
  border-radius: 50%;
  background: #22c55e;
}
.chat-fab__online::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  animation: dn-ring-ping 1.8s var(--ease) infinite;
}
.chat-fab__label { display: grid; gap: 0; line-height: 1.35; text-align: start; }
.chat-fab__label small { color: #a7f3d0; font-size: var(--fs-2xs); font-weight: 600; }
/* موج کهربایی که هر چند ثانیه از دکمه بیرون می‌زند */
.chat-fab__toggle::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(245, 165, 36, .6), rgba(45, 212, 191, .5));
  animation: dn-fab-pulse 3s var(--ease) infinite;
}
@keyframes dn-fab-pulse { 0% { transform: scale(.96); opacity: .55; } 60%, 100% { transform: scale(1.22, 1.45); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .chat-fab__toggle, .chat-fab__toggle::before, .chat-fab__online::after { animation: none; }
}
@media (max-width: 560px) {
  .chat-fab__toggle { width: 58px; padding: 0; justify-content: center; }
  .chat-fab__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* پنل جمع‌وجور: سربرگ تیره هم‌خانواده‌ی دکمه، تلفن‌ها یک‌خطی، پیام‌رسان‌ها چیپ دوستونه، دنباله‌ای رو به دکمه */
.chat-fab__panel {
  position: absolute;
  inset-inline-start: 0;
  bottom: calc(100% + 14px);
  width: min(292px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 24px 60px -24px rgba(4, 47, 44, .45), 0 4px 14px -6px rgba(4, 47, 44, .12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(.96);
  transform-origin: bottom right;
  text-align: start;
  transition: opacity var(--dur-2), transform .35s var(--ease-out), visibility 0s linear var(--dur-2);
}
[dir="ltr"] .chat-fab__panel { transform-origin: bottom left; }
.chat-fab.is-open .chat-fab__panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.chat-fab__panel::after {
  content: "";
  position: absolute;
  bottom: -7px;
  inset-inline-start: 26px;
  width: 14px;
  height: 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 4px 0;
  background: var(--surface);
  transform: rotate(45deg);
}
.chat-fab__head {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 13px 16px 12px;
  border-radius: 19px 19px 0 0;
  background: linear-gradient(135deg, #0a2f2b 0%, #04201d 60%, #0b1f2e 100%);
  color: #fff;
}
.chat-fab__head::after {
  content: "";
  position: absolute;
  inset-inline: 16px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #f5a524, #2dd4bf, #6ee7b7);
  opacity: .9;
}
.chat-fab__head h2 { display: flex; align-items: center; gap: 8px; margin: 0; color: #fff; font-size: var(--fs-md); line-height: 1.5; }
.chat-fab__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.chat-fab__dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1.5px solid #22c55e; animation: dn-ring-ping 1.8s var(--ease) infinite; }
.chat-fab__head p { margin: 0; color: rgba(240, 253, 250, .78); font-size: var(--fs-2xs); line-height: 1.7; }
.chat-fab__hours {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-self: start;
  margin-top: 6px !important;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .08);
  color: #a7f3d0 !important;
}
.chat-fab__hours .icon { width: 12px; height: 12px; flex: none; }
.chat-fab__body { display: grid; gap: 2px; padding: 8px 8px 10px; max-height: min(52vh, 420px); overflow-y: auto; }
.chat-fab__group { margin: 4px 8px 2px; color: var(--fg-subtle); font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .02em; }
.chat-fab__list, .chat-fab__chips { margin: 0; padding: 0; list-style: none; }
.chat-fab__list { display: grid; gap: 1px; }
.chat-fab__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 5px 8px;
  border-radius: 12px;
  color: var(--fg);
  transition: background var(--dur-1), color var(--dur-1);
}
.chat-fab__item:hover, .chat-fab__item:focus-visible { background: var(--bg-soft); color: var(--primary); }
.chat-fab__name { flex: 1; min-width: 0; overflow: hidden; font-size: var(--fs-xs); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.chat-fab__num { flex: none; color: var(--fg-muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; }
.chat-fab__item:hover .chat-fab__num { color: var(--primary); }
.chat-fab__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--bg-tint);
  color: var(--primary);
  transition: transform var(--dur-2) var(--ease-spring);
}
.chat-fab__icon .icon { width: 16px; height: 16px; }
.chat-fab__item:hover .chat-fab__icon, .chat-fab__chip:hover .chat-fab__icon { transform: scale(1.08) rotate(-6deg); }
.chat-fab__icon--phone { background: var(--grad-brand); color: var(--on-primary); }
.chat-fab__icon--whatsapp { background: #e3f8ea; color: #128c4a; }
.chat-fab__icon--bale { background: #e2f4f1; color: #0b8a76; }
.chat-fab__icon--telegram { background: #e4f3fd; color: #1b8ad3; }
.chat-fab__icon--instagram { background: #fdeaf3; color: #c1306f; }
.chat-fab__chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 2px 4px 0; }
.chat-fab__chip {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--fg);
  transition: border-color var(--dur-1), background var(--dur-1), transform var(--dur-2) var(--ease-spring);
}
.chat-fab__chip:hover, .chat-fab__chip:focus-visible { border-color: var(--line-strong); background: var(--bg-soft); transform: translateY(-1px); }
.chat-fab__chip .chat-fab__icon { width: 26px; height: 26px; border-radius: 8px; }
.chat-fab__chip .chat-fab__icon .icon { width: 14px; height: 14px; }
.chat-fab__chip-text { display: -webkit-box; min-width: 0; overflow: hidden; font-size: var(--fs-2xs); font-weight: 700; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
:root[data-theme="dark"] .chat-fab__panel { box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8); }
:root[data-theme="dark"] .chat-fab__icon--whatsapp { background: rgba(37, 211, 102, .14); color: #4ade80; }
:root[data-theme="dark"] .chat-fab__icon--bale { background: rgba(45, 212, 191, .14); color: #5eead4; }
:root[data-theme="dark"] .chat-fab__icon--telegram { background: rgba(56, 189, 248, .14); color: #7dd3fc; }
:root[data-theme="dark"] .chat-fab__icon--instagram { background: rgba(236, 72, 153, .14); color: #f9a8d4; }
@media (prefers-reduced-motion: reduce) { .chat-fab__dot::after { animation: none; } }
