/* ==========================================================================
   DahuaNet — components.css
   اجزای مشترک همه‌ی صفحه‌ها. هر جزء فقط از توکن‌های base.css رنگ می‌گیرد.
   ========================================================================== */

/* ---------- دکمه ---------- */
.btn {
  --btn-bg: var(--bg-tint);
  --btn-fg: var(--primary);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 46px;
  padding: .6em 1.45em;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform var(--dur-2) var(--ease),
    box-shadow var(--dur-2) var(--ease),
    background-color var(--dur-2) var(--ease),
    color var(--dur-2) var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .5;
  transform: none;
  box-shadow: none;
}

/* نوار نوری که هنگام هاور از روی دکمه رد می‌شود */
.btn--primary::after, .btn--accent::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .32) 50%, transparent 70%);
  transform: translateX(110%);
  transition: transform .8s var(--ease);
}
.btn--primary:hover::after, .btn--accent:hover::after { transform: translateX(-110%); }

.btn--primary {
  --btn-fg: var(--on-primary);
  background: var(--grad-brand);
  box-shadow: var(--sh-glow);
}
.btn--primary:hover { box-shadow: 0 16px 34px -10px rgba(46, 139, 255, .75); }
.btn--accent { --btn-bg: var(--accent); --btn-fg: var(--on-accent); }
.btn--dark { --btn-bg: var(--navy); --btn-fg: #fff; }
.btn--ghost {
  --btn-bg: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.btn--ghost:hover { --btn-bg: var(--bg-tint); box-shadow: inset 0 0 0 1.5px var(--sky); }
.btn--glass {
  --btn-bg: var(--glass);
  --btn-fg: var(--on-dark);
  box-shadow: inset 0 0 0 1px var(--glass-line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn--glass:hover { --btn-bg: rgba(255, 255, 255, .12); }
.btn--link {
  --btn-bg: transparent;
  min-height: auto;
  padding: 0;
  border-radius: 0;
}
.btn--link:hover { transform: none; --btn-fg: var(--azure); }
.btn--sm { min-height: 38px; padding: .45em 1.1em; font-size: var(--fs-xs); }
.btn--lg { min-height: 54px; padding: .7em 1.9em; font-size: var(--fs-md); }
.btn--block { width: 100%; }
.btn .icon { width: 1.15em; height: 1.15em; }

/* دکمه‌ی آیکنی گرد */
.btn-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--fg);
  cursor: pointer;
  transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.btn-icon:hover { background: var(--bg-tint); color: var(--primary); }
.btn-icon--sm { width: 36px; height: 36px; }
.btn-icon--glass { background: var(--glass); color: var(--on-dark); box-shadow: inset 0 0 0 1px var(--glass-line); }
.btn-icon[aria-pressed="true"] { background: var(--primary); color: #fff; }

/* دکمه‌ی گرد افزودن به سبد */
.btn-add {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  transition: background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2) var(--ease);
}
.btn-add:hover { background: var(--grad-brand); transform: rotate(90deg); box-shadow: var(--sh-glow); }
.btn-add[disabled] { background: var(--line); color: var(--fg-subtle); transform: none; box-shadow: none; cursor: not-allowed; }
.btn-add.is-busy .icon { animation: dn-spin .8s linear infinite; }
.btn-add.is-done { background: var(--success); transform: none; }

/* ---------- برچسب بالای عنوان بخش ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px 4px 12px;
  border-radius: var(--r-pill);
  background: var(--bg-tint);
  color: var(--primary);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.8;
}
.eyebrow .icon { width: 1.1em; height: 1.1em; }
.eyebrow--dark { background: var(--glass); color: var(--sky); box-shadow: inset 0 0 0 1px var(--dark-line); }
/* نقطه‌ی ضبط: نشانه‌ی دوربین زنده */
.eyebrow__rec {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff4d4f;
  box-shadow: 0 0 0 3px rgba(255, 77, 79, .2);
  animation: dn-pulse 1.6s ease-in-out infinite;
}

.section-head {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 660px;
  margin: 0 auto clamp(28px, 4vw, 52px);
  text-align: center;
}
.section-head p { color: var(--fg-muted); }
.section-head--start { justify-items: start; margin-inline: 0; text-align: start; }
.section-head--split {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  max-width: none;
  text-align: start;
}
.section-head--split > div:not(.rail-nav):not(.tabs) { display: grid; justify-items: start; gap: 10px; }

/* ---------- نشان ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding-inline: 10px;
  border-radius: var(--r-pill);
  background: var(--bg-tint);
  color: var(--primary);
  font-size: var(--fs-2xs);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.badge--sale { background: var(--accent); color: var(--on-accent); }
.badge--new { background: var(--grad-brand); color: #fff; }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--muted { background: var(--bg-soft); color: var(--fg-muted); }
.badge--dark { background: var(--navy); color: #fff; }

/* ---------- چیپ (فیلتر، تنوع، دسته) ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--fg);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: border-color var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.chip:hover { border-color: var(--sky); }
.chip:active { transform: scale(.97); }
.chip .icon { width: 1.1em; height: 1.1em; color: var(--fg-subtle); transition: color var(--dur-2); }
.chip[aria-pressed="true"], .chip.is-active, input:checked + .chip {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}
.chip[aria-pressed="true"] .icon, .chip.is-active .icon, input:checked + .chip .icon { color: var(--sky); }
input:focus-visible + .chip { outline: 2px solid var(--azure); outline-offset: 3px; }
.chip[aria-disabled="true"], input:disabled + .chip {
  opacity: .45;
  cursor: not-allowed;
  text-decoration: line-through;
}
.chip__count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: var(--r-pill);
  background: var(--bg-tint);
  color: var(--primary);
  font-size: var(--fs-2xs);
  font-weight: 800;
}
.chip[aria-pressed="true"] .chip__count, .chip.is-active .chip__count, input:checked + .chip .chip__count {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}
.chip--square { border-radius: var(--r-sm); }
.chip-swatch { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 4px;
  scroll-snap-type: x proximity;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row > * { scroll-snap-align: start; }

/* ---------- کارت ---------- */
.card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.card--pad { padding: clamp(18px, 2.4vw, 28px); }
.card--soft { background: var(--bg-soft); border-color: transparent; }
.card--hover { transition: transform var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease), border-color var(--dur-3) var(--ease); }
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: transparent; }

/* نور نرمی که دنبال نشانگر می‌آید؛ مختصات را DN.glow می‌نویسد */
[data-glow] { --mx: 50%; --my: 0%; }
[data-glow]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(360px circle at var(--mx) var(--my), rgba(46, 139, 255, .11), transparent 45%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-3) var(--ease);
}
[data-glow]:hover::before { opacity: 1; }

/* ---------- کارت محصول ---------- */
.p-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 10px 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease), border-color var(--dur-3) var(--ease);
}
.p-card:hover { transform: translateY(-5px); box-shadow: var(--sh-2); border-color: transparent; }
.p-card > * { position: relative; z-index: 1; }

.p-card__media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--grad-media);
}
.p-card__media img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  transition: transform .7s var(--ease);
}
.p-card:hover .p-card__media img { transform: scale(1.07); }

/* گوشه‌های کادر فوکوس دوربین، هنگام هاور جمع می‌شوند */
.p-card__focus {
  --c: var(--azure);
  --l: 18px;
  position: absolute;
  inset: 22px;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 2px,
    linear-gradient(var(--c), var(--c)) top left / 2px var(--l),
    linear-gradient(var(--c), var(--c)) top right / var(--l) 2px,
    linear-gradient(var(--c), var(--c)) top right / 2px var(--l),
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 2px,
    linear-gradient(var(--c), var(--c)) bottom left / 2px var(--l),
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 2px,
    linear-gradient(var(--c), var(--c)) bottom right / 2px var(--l);
  background-repeat: no-repeat;
  transition: inset var(--dur-3) var(--ease), opacity var(--dur-3) var(--ease);
}
.p-card:hover .p-card__focus { inset: 12px; opacity: 1; }
/* خط اسکن که یک بار از بالا به پایین رد می‌شود */
.p-card__focus::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(46, 139, 255, .7), transparent);
  opacity: 0;
}
.p-card:hover .p-card__focus::after { animation: dn-scan 1.4s var(--ease) 1 forwards; }
@keyframes dn-scan {
  0% { top: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: calc(100% - 2px); opacity: 0; }
}

.p-card__flags {
  position: absolute;
  top: 18px;
  inset-inline-start: 18px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.p-card__actions {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.p-card__actions .btn-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--sh-1);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), background-color var(--dur-2), color var(--dur-2);
}
.p-card__actions .btn-icon:nth-child(2) { transition-delay: 50ms; }
.p-card__actions .btn-icon:nth-child(3) { transition-delay: 100ms; }
.p-card:hover .p-card__actions .btn-icon,
.p-card:focus-within .p-card__actions .btn-icon,
.p-card__actions .btn-icon[aria-pressed="true"] { opacity: 1; transform: none; }
.p-card__actions .btn-icon[aria-pressed="true"] { background: var(--primary); color: #fff; }
@media (hover: none) {
  .p-card__actions .btn-icon { opacity: 1; transform: none; }
}

.p-card__body { display: grid; gap: 6px; padding-inline: 6px; }
.p-card__cat {
  justify-self: start;
  color: var(--azure);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.p-card__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.75em);
}
.p-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.p-card__title a:hover { color: var(--primary); }
.p-card__model { color: var(--fg-subtle); font-size: var(--fs-2xs); }
.p-card__specs { display: flex; flex-wrap: wrap; gap: 4px; }
.p-card__specs li {
  padding: 2px 8px;
  border-radius: var(--r-xs);
  background: var(--bg-soft);
  color: var(--fg-muted);
  font-size: var(--fs-2xs);
  font-weight: 600;
}
.p-card__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-inline: 6px;
}
.p-card__foot .btn-add { position: relative; z-index: 2; }

.price { display: grid; gap: 2px; line-height: 1.3; }
.price del { color: var(--fg-subtle); font-size: var(--fs-xs); text-decoration-thickness: 1px; }
.price strong { font-size: var(--fs-lg); font-weight: 800; color: var(--fg); font-variant-numeric: tabular-nums; }
.price small { color: var(--fg-muted); font-size: var(--fs-2xs); font-weight: 600; margin-inline-start: 2px; }
.price--lg strong { font-size: var(--fs-2xl); }

.p-card.is-out .p-card__media img { filter: grayscale(1); opacity: .55; }
.p-card.is-out .price strong { color: var(--fg-subtle); font-size: var(--fs-sm); }

/* ---------- دسته‌ی دایره‌ای ---------- */
/* در موبایل یک ردیف افقی مثل استوری؛ در دسکتاپ وسط‌چین و چندخطی */
.orbs {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  padding-block: 6px;
}
.orbs::-webkit-scrollbar { display: none; }
.orbs > * { flex: none; scroll-snap-align: start; }
@media (min-width: 760px) {
  .orbs { flex-wrap: wrap; justify-content: center; gap: 22px 12px; overflow: visible; }
}
.orb {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 104px;
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.6;
}
.orb__ring {
  --dn-angle: 0deg;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(from var(--dn-angle), var(--azure), var(--blue-700), var(--sky-200), var(--azure));
  transition: transform var(--dur-3) var(--ease-spring);
}
.orb__img {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--grad-media);
  color: var(--primary);
  overflow: hidden;
}
.orb__img img { width: 72%; height: 72%; object-fit: contain; }
.orb__img .icon { width: 38px; height: 38px; stroke-width: 1.4; }
.orb:hover .orb__ring { animation: dn-spin-angle 2.2s linear infinite; transform: scale(1.06); }
.orb:hover { color: var(--primary); }

/* ---------- ویژگی (آیکن + عنوان + متن) ---------- */
.feature { display: flex; align-items: flex-start; gap: 14px; }
.feature__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: var(--r);
  background: var(--bg-tint);
  color: var(--primary);
  transition: transform var(--dur-3) var(--ease-spring), background var(--dur-3), color var(--dur-3);
}
.feature__icon .icon { width: 26px; height: 26px; }
.feature:hover .feature__icon { transform: rotate(-8deg) scale(1.06); background: var(--grad-brand); color: #fff; }
.feature__body { display: grid; gap: 2px; }
.feature__title { font-size: var(--fs-md); font-weight: 800; }
.feature__text { color: var(--fg-muted); font-size: var(--fs-sm); line-height: 1.8; }
.feature--stacked { flex-direction: column; }

/* ---------- آمار ---------- */
.stat { display: grid; gap: 2px; }
.stat__value { font-size: var(--fs-3xl); font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--fg-muted); font-size: var(--fs-sm); }

/* ---------- نوار متحرک ---------- */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  align-items: center;
  gap: var(--gap, 40px);
  width: max-content;
  animation: dn-marquee var(--speed, 40s) linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg-muted);
  font-weight: 700;
  white-space: nowrap;
}
.marquee__item .icon { color: var(--azure); }
@keyframes dn-marquee { to { transform: translateX(calc(50% + var(--gap, 40px) / 2)); } }

/* ---------- مراحل (ترتیب واقعی دارند) ---------- */
.steps {
  position: relative;
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  counter-reset: dn-step;
}
.step { position: relative; display: grid; justify-items: center; gap: 10px; text-align: center; counter-increment: dn-step; }
.step__num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--primary);
  font-size: var(--fs-lg);
  font-weight: 900;
  box-shadow: inset 0 0 0 2px var(--sky-200), 0 0 0 8px var(--bg);
  transition: background var(--dur-3), color var(--dur-3), box-shadow var(--dur-3);
}
.step__num::before { content: counter(dn-step, persian); }
.step.is-in .step__num { background: var(--grad-brand); color: #fff; box-shadow: var(--sh-glow), 0 0 0 8px var(--bg); }
.step__title { font-weight: 800; }
.step__text { color: var(--fg-muted); font-size: var(--fs-sm); max-width: 30ch; }
@media (min-width: 760px) {
  .steps::before {
    content: "";
    position: absolute;
    top: 27px;
    inset-inline: 12%;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--sky-200) 0 8px, transparent 8px 14px);
  }
  .steps::after {
    content: "";
    position: absolute;
    top: 27px;
    inset-inline: 12%;
    height: 2px;
    background: var(--grad-brand);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 1.6s var(--ease) .2s;
  }
  .steps.is-in::after { transform: scaleX(1); }
}

/* ---------- حلقه‌ی مشخصات کلیدی ---------- */
.ring {
  --size: 92px;
  --p-target: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}
.ring__dial {
  --dn-p: var(--p-target);
  position: relative;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: conic-gradient(var(--azure) calc(var(--dn-p) * 1%), var(--ice) 0);
  transition: --dn-p 1.4s var(--ease);
}
/* بدون جاوااسکریپت حلقه پر است؛ با آن از صفر تا مقدار واقعی پر می‌شود */
.js .ring:not(.is-in) .ring__dial { --dn-p: 0; }
.ring__dial::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--bg);
}
.ring__value { position: relative; font-weight: 900; font-size: var(--fs-lg); line-height: 1.1; }
.ring__value small { display: block; color: var(--fg-muted); font-size: var(--fs-2xs); font-weight: 700; }
.ring__label { color: var(--fg-muted); font-size: var(--fs-xs); font-weight: 700; }

/* ---------- آکاردئون ---------- */
.acc { display: grid; gap: 10px; }
.acc details {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  transition: border-color var(--dur-2), box-shadow var(--dur-2);
}
.acc details[open] { border-color: transparent; box-shadow: var(--sh-2); }
.acc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary .icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 50%;
  background: var(--bg-soft);
  transition: transform var(--dur-3) var(--ease), background var(--dur-2);
}
.acc details[open] summary .icon { transform: rotate(180deg); background: var(--bg-tint); color: var(--primary); }
.acc__body { padding: 0 20px 18px; color: var(--fg-muted); line-height: 2; }
.acc details[open] .acc__body { animation: dn-acc-in var(--dur-3) var(--ease); }
@keyframes dn-acc-in { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- فرم ---------- */
.field { display: grid; gap: 6px; }
.field__label { font-size: var(--fs-sm); font-weight: 700; }
.field__hint { color: var(--fg-subtle); font-size: var(--fs-xs); }
.field__error { color: var(--danger); font-size: var(--fs-xs); font-weight: 600; }

.input, .select, .textarea {
  width: 100%;
  min-height: 50px;
  padding: 10px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--fg);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-2);
}
.input::placeholder, .textarea::placeholder { color: var(--fg-subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--sky-200); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--azure);
  box-shadow: 0 0 0 4px rgba(46, 139, 255, .14);
  outline: none;
}
.input[aria-invalid="true"], .input.input-validation-error { border-color: var(--danger); }
.textarea { min-height: 130px; resize: vertical; line-height: 1.9; }
.select {
  appearance: none;
  padding-inline-end: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237180aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 18px;
  background-position: left 16px center;
}
.input--ltr { direction: ltr; text-align: left; }

/* جستجوی کپسولی */
.search-pill {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: box-shadow var(--dur-2) var(--ease), background var(--dur-2);
}
.search-pill:focus-within { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--azure), 0 0 0 5px rgba(46, 139, 255, .12); }
.search-pill .icon { position: absolute; inset-inline-start: 18px; color: var(--fg-subtle); pointer-events: none; }
.search-pill input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding-inline: 50px 18px;
  border: 0;
  background: transparent;
  outline: none;
}
.search-pill input::placeholder { color: var(--fg-subtle); }
.search-pill .btn { margin-inline-end: 5px; min-height: 42px; }

/* چک‌باکس و رادیو */
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-sm); }
.check input {
  appearance: none;
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 7px;
  background: var(--bg);
  cursor: pointer;
  transition: background var(--dur-2), border-color var(--dur-2);
}
.check input[type="radio"] { border-radius: 50%; }
.check input::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform var(--dur-2) var(--ease-spring);
}
.check input[type="radio"]::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #fff; transform: scale(0); }
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input[type="radio"]:checked::after { transform: scale(1); }

/* سوئیچ */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-sm); }
.switch input {
  appearance: none;
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin: 0;
  border-radius: var(--r-pill);
  background: #cfd8e6;
  cursor: pointer;
  transition: background var(--dur-2);
}
.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--sh-1);
  transition: right var(--dur-2) var(--ease-spring);
}
.switch input:checked { background: var(--primary); }
.switch input:checked::after { right: 21px; }

/* انتخاب تعداد */
.qty {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 4px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg);
}
.qty button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--fg);
  transition: background var(--dur-2), color var(--dur-2);
}
.qty button:hover { background: var(--bg-tint); color: var(--primary); }
.qty input {
  width: 44px;
  border: 0;
  background: transparent;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- پیام ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r);
  background: var(--bg-tint);
  color: var(--primary);
  font-size: var(--fs-sm);
  line-height: 1.9;
}
.alert .icon { margin-top: 3px; }
.alert--success { background: var(--success-bg); color: var(--success); }
.alert--danger { background: var(--danger-bg); color: var(--danger); }
.alert--warning { background: var(--warning-bg); color: var(--warning); }

/* اعلان شناور؛ ناحیه aria-live دارد */
.toast-region {
  position: fixed;
  inset-inline: 0;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 300;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-inline: 16px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, 100%);
  padding: 12px 20px 12px 16px;
  border-radius: var(--r-pill);
  background: var(--night);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: var(--sh-3);
  pointer-events: auto;
  animation: dn-toast-in .45s var(--ease-spring);
}
.toast .icon { color: var(--sky); }
.toast--success .icon { color: #4ade80; }
.toast--error .icon { color: #ff7a70; }
.toast.is-leaving { animation: dn-toast-out .3s var(--ease) forwards; }
@keyframes dn-toast-in { from { opacity: 0; transform: translateY(20px) scale(.95); } }
@keyframes dn-toast-out { to { opacity: 0; transform: translateY(12px); } }

/* ---------- بنر فراخوان ---------- */
.cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(28px, 5vw, 56px);
  border-radius: var(--r-xl);
  background: var(--grad-night);
  color: var(--on-dark);
}
.cta h2, .cta h3 { color: var(--on-dark); }
.cta p { color: var(--on-dark-muted); max-width: 56ch; }
.cta__copy { display: grid; justify-items: start; gap: 12px; flex: 1 1 360px; }
/* حلقه‌های لنز در گوشه */
.cta::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 420px;
  height: 420px;
  inset-inline-end: -120px;
  top: -160px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 34px, rgba(142, 193, 255, .14) 34px 35px);
}
.cta::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 300px;
  height: 300px;
  inset-inline-end: -60px;
  top: -100px;
  border-radius: 50%;
  border: 1.5px dashed rgba(142, 193, 255, .35);
  animation: dn-spin 60s linear infinite;
}

/* ---------- مسیر صفحه ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--fg-subtle); font-size: var(--fs-xs); }
.crumbs a { color: var(--fg-muted); transition: color var(--dur-2); }
.crumbs a:hover { color: var(--primary); }
.crumbs .icon { width: 14px; height: 14px; }
.crumbs [aria-current="page"] { color: var(--fg); font-weight: 700; }

/* ---------- صفحه‌بندی ---------- */
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pager a, .pager span {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding-inline: 10px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line);
  color: var(--fg-muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--dur-2), color var(--dur-2), background var(--dur-2);
}
.pager a:hover { border-color: var(--sky); color: var(--primary); }
.pager [aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.pager span.is-disabled { opacity: .4; }

/* ---------- اسکلت بارگذاری ---------- */
.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--bg-soft) 0%, var(--ice) 50%, var(--bg-soft) 100%);
  background-size: 200% 100%;
  animation: dn-shimmer 1.4s linear infinite;
}

/* ---------- ریل افقی (کاروسل بدون کتابخانه) ---------- */
.rail {
  --rail-item: 248px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(var(--rail-item), 78%);
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-block: 8px 24px;
  margin-block-end: -16px;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
.rail-nav { display: flex; gap: 8px; }
.rail-nav .btn-icon { box-shadow: inset 0 0 0 1.5px var(--line); background: var(--bg); }
.rail-nav .btn-icon:disabled { opacity: .35; cursor: default; }
.rail-nav .btn-icon--glass { background: var(--glass); color: var(--on-dark); box-shadow: inset 0 0 0 1px var(--glass-line); }
.rail-nav .btn-icon--glass:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* ---------- لنز متحرک (هیرو و صفحه‌ی ورود) ---------- */
.lens {
  position: relative;
  width: 86%;
  aspect-ratio: 1 / 1;
  transition: translate .4s var(--ease);
}
.lens::before {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 139, 255, .45) 0%, rgba(46, 139, 255, 0) 65%);
  animation: dn-lens-glow 6s ease-in-out infinite;
}
@keyframes dn-lens-glow { 50% { opacity: .55; transform: scale(.94); } }
.lens svg { width: 100%; height: 100%; overflow: visible; }
.lens__spin, .lens__spin-rev, .lens__iris { transform-box: fill-box; transform-origin: center; }
.lens__spin { animation: dn-spin 90s linear infinite; }
.lens__spin-rev { animation: dn-spin 50s linear infinite reverse; }
.lens__iris { animation: dn-iris 7s ease-in-out infinite; }
@keyframes dn-iris {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(14deg); }
}
/* جاروی رادار روی شیشه */
.lens__sweep {
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 290deg, rgba(142, 193, 255, .05) 300deg, rgba(160, 215, 255, .42) 360deg);
  mix-blend-mode: screen;
  animation: dn-spin 5.5s linear infinite;
  pointer-events: none;
}

/* ---------- جزئیات کارت محصول (فاز ۲) ---------- */
.p-card__cat { position: relative; z-index: 2; }
.p-card__cat:hover { color: var(--primary); }
.p-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 18px; }
.p-card__rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--fg-muted);
  font-size: var(--fs-2xs);
  font-weight: 700;
}
.p-card__rating .icon { width: 13px; height: 13px; color: var(--amber); fill: var(--amber); }
.price__note { color: var(--fg-muted); font-size: var(--fs-sm); font-weight: 700; }
.btn-add--soft { background: var(--bg-tint); color: var(--primary); }
.btn-add--soft:hover { color: #fff; }
a.btn-add:hover { transform: translateX(-3px); }
[data-toggle-favorite][aria-pressed="true"] .icon { fill: currentColor; }

/* ---------- کارت پکیج ---------- */
.pkg {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--bg);
  transition: transform var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease);
}
.pkg:hover { transform: translateY(-5px); box-shadow: var(--sh-2); }
.pkg > * { position: relative; z-index: 1; }
.pkg__media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  max-width: 100%;
  background: var(--grad-night);
  overflow: hidden;
}
.pkg__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-radial-gradient(circle at 50% 120%, transparent 0 38px, rgba(142, 193, 255, .1) 38px 39px);
}
.pkg__media img { position: relative; z-index: 1; width: 62%; height: 80%; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .45)); transition: transform .7s var(--ease); }
.pkg:hover .pkg__media img { transform: scale(1.06) translateY(-4px); }
.pkg__badge { position: absolute; top: 16px; inset-inline-start: 16px; z-index: 2; }
.pkg__body { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 22px; }
.pkg__title { font-size: var(--fs-lg); line-height: 1.6; }
.pkg__title a:hover { color: var(--primary); }
.pkg__items { display: grid; gap: 8px; font-size: var(--fs-sm); color: var(--fg-muted); }
.pkg__items li { display: flex; align-items: flex-start; gap: 8px; }
.pkg__items .icon { flex: none; width: 18px; height: 18px; margin-top: 4px; padding: 3px; border-radius: 50%; background: var(--success-bg); color: var(--success); stroke-width: 2.4; }
.pkg__excerpt { color: var(--fg-muted); font-size: var(--fs-sm); }
.pkg__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

/* ---------- کارت مطلب ---------- */
.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  transition: transform var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease);
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--sh-2); }
.post-card > * { position: relative; z-index: 1; }
.post-card__media { position: relative; display: block; aspect-ratio: 16 / 10; max-width: 100%; overflow: hidden; background: var(--grad-media); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.05); }
.post-card__placeholder { display: grid; place-items: center; height: 100%; color: var(--sky-200); }
.post-card__placeholder .icon { width: 64px; height: 64px; stroke-width: 1; }
.post-card__date {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .92);
  color: var(--fg);
  font-size: var(--fs-2xs);
  font-weight: 700;
}
.post-card__body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 16px 18px 18px; }
.post-card__cat { color: var(--azure); font-size: var(--fs-xs); font-weight: 700; }
.post-card__title { font-size: var(--fs-md); line-height: 1.75; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.post-card__title a:hover { color: var(--primary); }
.post-card__excerpt {
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  line-height: 1.9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; }
.post-card__more { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: var(--fs-sm); font-weight: 700; transition: gap var(--dur-2) var(--ease); }
.post-card:hover .post-card__more { gap: 10px; }

/* ---------- زبانه ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-2), color var(--dur-2), box-shadow var(--dur-2);
}
.tab .icon { width: 1.05em; height: 1.05em; }
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { background: var(--navy); color: #fff; box-shadow: var(--sh-1); }
.tab[aria-selected="true"] .icon { color: var(--sky); }
/* بدون جاوااسکریپت همه‌ی پنل‌ها دیده می‌شوند */
.js .tabpanel:not(.is-active) { display: none; }
.js .tabpanel.is-active { animation: dn-tab-in .4s var(--ease); }
@keyframes dn-tab-in { from { opacity: 0; transform: translateY(8px); } }
.rail-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }

/* ---------- نوار شناور مقایسه ---------- */
.compare-bar {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border-radius: var(--r-pill);
  background: var(--night);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 700;
  box-shadow: var(--sh-3);
  transform: translate(-50%, 160%);
  visibility: hidden;
  transition: transform .45s var(--ease-spring), visibility 0s linear .45s;
}
[dir="rtl"] .compare-bar { padding: 8px 16px 8px 8px; }
.compare-bar.is-visible { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }
.compare-bar__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--grad-brand); }
.compare-bar__clear { background: rgba(255, 255, 255, .08); color: #fff; }
.compare-bar__clear:hover { background: rgba(255, 255, 255, .16); color: #fff; }
@media (max-width: 960px) {
  .compare-bar { bottom: calc(var(--tabbar-h, 64px) + 14px + env(safe-area-inset-bottom, 0px)); }
}
[data-compare-toggle][aria-pressed="true"] { background: var(--primary); color: #fff; }

/* ---------- دکمه در حال ارسال ---------- */
.btn.is-busy { position: relative; pointer-events: none; color: transparent !important; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 20px;
  height: 20px;
  margin: auto;
  border: 2.5px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dn-spin .7s linear infinite;
}
.btn--ghost.is-busy::after { border-color: var(--line-strong); border-top-color: var(--primary); }

/* ---------- جلا و طیف رنگی ---------- */
/* خط طیفی زیر تیتر بخش‌ها */
.section-head h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin: 12px auto 0;
  border-radius: var(--r-pill);
  background: var(--grad-spectrum);
}
.section-head--start h2::after, .section-head--split h2::after { margin-inline: 0; }

/* کارت محصول: لبه‌ی طیفی هنگام شناور شدن */
.p-card { position: relative; }
.p-card::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 2;
  height: 3px;
  border-radius: var(--r) var(--r) 0 0;
  background: var(--grad-spectrum);
  opacity: 0;
  transition: opacity var(--dur-2);
  pointer-events: none;
}
.p-card:hover::before { opacity: 1; }

/* دکمه‌ی اصلی: درخشش نرم و بالا آمدن */
.btn--primary { background: var(--grad-brand); }
.btn--primary:hover { filter: saturate(1.1) brightness(1.04); }

/* آیکن ویژگی‌ها و مراحل: زمینه‌ی طیفی روشن */
.feature__icon { background: linear-gradient(135deg, #e7f1ff 0%, #d4f1fd 100%); }
.hero, .sale, .footer-cta { isolation: isolate; }
