/* ==========================================================================
   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);
  background-size: 160% 100%;
  box-shadow: var(--sh-glow), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition:
    transform var(--dur-2) var(--ease),
    box-shadow var(--dur-2) var(--ease),
    background-position .6s var(--ease);
}
.btn--primary:hover { background-position: 100% 0; box-shadow: var(--sh-glow-lg), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn--accent {
  --btn-bg: var(--accent);
  --btn-fg: var(--on-accent);
  box-shadow: 0 14px 28px -14px rgba(245, 165, 36, .9), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.btn--accent:hover { --btn-bg: #ffb53d; }
.btn--dark { --btn-bg: var(--ink); --btn-fg: #fff; }
.btn--dark:hover { --btn-bg: var(--teal-800); }
.btn--ghost {
  --btn-bg: var(--bg);
  --btn-fg: var(--teal-700);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.btn--ghost:hover { --btn-bg: var(--bg-soft); box-shadow: inset 0 0 0 1.5px var(--brand), 0 10px 22px -14px rgba(13, 148, 136, .6); }
.btn--ghost .icon { transition: transform var(--dur-2) var(--ease); }
.btn--ghost:hover .icon:last-child { transform: translateX(-4px); }
.btn--glass {
  --btn-bg: var(--glass);
  --btn-fg: var(--on-dark);
  box-shadow: inset 0 0 0 1.5px var(--glass-line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.btn--glass:hover { --btn-bg: #fff; --btn-fg: var(--teal-700); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .35); }
.btn--link {
  --btn-bg: transparent;
  min-height: auto;
  padding: 0;
  border-radius: 0;
}
.btn--link:hover { transform: none; --btn-fg: var(--teal-700); }
.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 1.5px var(--glass-line); }
.btn-icon--glass:hover { background: #fff; color: var(--on-white-teal); }
.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(--grad-brand);
  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-hover); transform: rotate(90deg) scale(1.06); 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: 8px;
  padding: 5px 16px 5px 6px;
  border-radius: var(--r-pill);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line), 0 6px 16px -10px rgba(13, 148, 136, .45);
  color: var(--teal-700);
  font-size: var(--fs-xs);
  font-weight: 800;
  line-height: 1.8;
}
.eyebrow > .icon {
  width: 24px;
  height: 24px;
  padding: 5px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  stroke-width: 2;
}
.eyebrow:not(:has(> .icon)) { padding-inline-start: 12px; }
.eyebrow--dark {
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--glass-line);
  color: var(--on-dark);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.eyebrow--dark > .icon { background: #fff; color: var(--on-white-teal); }
/* نقطه‌ی ضبط: نشانه‌ی دوربین زنده */
.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: 14px;
  max-width: 700px;
  margin: 0 auto clamp(32px, 4.5vw, 60px);
  text-align: center;
}
.section-head p { color: var(--fg-muted); font-size: var(--fs-lg); }
.section-head .eyebrow { transition: opacity .7s var(--ease-out), transform .8s var(--ease-out); }
.js .section-head:not(.is-in) .eyebrow { opacity: 0; transform: translateY(14px) scale(.9); }
.section-head > p, .section-head > div > p { transition: opacity .8s var(--ease-out) .35s, transform .9s var(--ease-out) .35s; }
.js .section-head:not(.is-in) > p, .js .section-head:not(.is-in) > div > p { opacity: 0; transform: translateY(14px); }
.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: var(--on-primary); }
.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(--teal); 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: transparent;
  background: var(--grad-brand);
  color: #fff;
}
.chip[aria-pressed="true"] .icon, .chip.is-active .icon, input:checked + .chip .icon { color: var(--mint); }
input:focus-visible + .chip { outline: 2px solid var(--aqua); 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(45, 212, 191, .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(-6px); box-shadow: var(--sh-2); border-color: transparent; }
/* لبه‌ی گرادیانی هنگام هاور */
.p-card::after, .pkg::after, .warranty-card::after, .place::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 1.5px;
  border-radius: inherit;
  background: var(--grad-spectrum);
  -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);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-3) var(--ease);
}
.p-card:hover::after, .pkg:hover::after, .warranty-card:hover::after, .place:hover::before { opacity: 1; }
.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(--aqua);
  --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(45, 212, 191, .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: var(--surface-glass);
  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(--teal-700);
  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);
  box-shadow: inset 0 0 0 1px var(--line);
  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(--aqua), var(--teal-700), var(--sky-200), var(--aqua));
  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); box-shadow: var(--sh-glow); }
.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: var(--on-primary); box-shadow: var(--sh-glow); }
.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(--brand); }
@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: var(--on-primary); box-shadow: var(--sh-glow), 0 0 0 8px var(--bg-soft); animation: dn-step-pop .7s var(--ease-spring) calc(var(--i, 0) * 260ms + .2s) both; }
@keyframes dn-step-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: none; } }
.step__title, .step__text { transition: opacity .7s var(--ease-out), transform .8s var(--ease-out); transition-delay: calc(var(--i, 0) * 260ms + .3s); }
.js .step:not(.is-in) .step__title, .js .step:not(.is-in) .step__text { opacity: 0; transform: translateY(12px); }
.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); }
  [dir="ltr"] .steps::after { transform-origin: left; }
}

/* ---------- حلقه‌ی مشخصات کلیدی ---------- */
.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(--aqua) 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(--aqua);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, .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 var(--line);
  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(--aqua), 0 0 0 5px rgba(45, 212, 191, .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: #cddfdc;
  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-2xl);
  background: var(--noise), var(--grad-night);
  color: var(--on-dark);
  box-shadow: var(--sh-3);
}
.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, var(--ring-line) 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(255, 255, 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(--grad-brand); border-color: transparent; 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(94, 234, 212, .55) 0%, rgba(94, 234, 212, 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(204, 251, 241, .06) 300deg, rgba(204, 251, 241, .5) 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(--noise), var(--grad-night);
  overflow: hidden;
}
.pkg__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-radial-gradient(circle at 50% 120%, transparent 0 38px, var(--ring-line) 38px 39px);
}
.pkg__media img { position: relative; z-index: 1; width: 78%; height: 86%; object-fit: contain; border-radius: var(--r); filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .35)); transition: transform .7s var(--ease); }
.pkg:hover .pkg__media img { transform: scale(1.06) translateY(-4px); }
/* عکس واقعی پکیج کل قاب را می‌پوشاند؛ فقط تصویر جایگزین روی زمینه‌ی رنگی شناور می‌ماند */
.pkg__media:has(img[src^="/uploads/"]) { aspect-ratio: 4 / 3; }
.pkg__media img[src^="/uploads/"] { width: 100%; height: 100%; border-radius: 0; object-fit: cover; object-position: 50% 30%; filter: none; }
.pkg:hover .pkg__media img[src^="/uploads/"] { transform: scale(1.05); }
/* نوار نمایشگر روی عکس: نشان PKG و تعداد اقلام */
.pkg__hud {
  position: absolute;
  z-index: 2;
  inset-inline: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.pkg__rec, .pkg__count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(4, 38, 36, .6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: var(--fs-2xs);
  font-weight: 700;
}
.pkg__rec { direction: ltr; letter-spacing: .14em; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.pkg__rec i { width: 6px; height: 6px; border-radius: 50%; background: #ff4d4f; box-shadow: 0 0 8px #ff4d4f; animation: dn-pulse 1.4s ease-in-out infinite; }
.pkg__count .icon { width: 14px; height: 14px; color: var(--mint); }
/* گوشه‌های منظره‌یاب که با هاور روی عکس جمع می‌شوند */
.pkg__media::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 12px;
  --c: rgba(255, 255, 255, .7);
  background:
    linear-gradient(var(--c), var(--c)) top left / 18px 2px,
    linear-gradient(var(--c), var(--c)) top left / 2px 18px,
    linear-gradient(var(--c), var(--c)) top right / 18px 2px,
    linear-gradient(var(--c), var(--c)) top right / 2px 18px,
    linear-gradient(var(--c), var(--c)) bottom left / 18px 2px,
    linear-gradient(var(--c), var(--c)) bottom left / 2px 18px,
    linear-gradient(var(--c), var(--c)) bottom right / 18px 2px,
    linear-gradient(var(--c), var(--c)) bottom right / 2px 18px;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity var(--dur-3), transform .6s var(--ease-out);
  pointer-events: none;
}
.pkg:hover .pkg__media::before { opacity: 1; transform: none; }
/* تخفیف: روبان گوشه با عدد درشت */
.pkg__badge {
  position: absolute;
  z-index: 3;
  top: 0;
  inset-inline-start: 18px;
  display: grid;
  justify-items: center;
  padding: 8px 10px 12px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, #f5a524, #f08c00);
  box-shadow: 0 12px 22px -10px rgba(240, 140, 0, .8);
  color: var(--on-accent);
  font-size: var(--fs-2xs);
  font-weight: 700;
  line-height: 1.2;
}
.pkg__badge b { font-size: var(--fs-md); font-weight: 900; }

.pkg__body { display: flex; flex-direction: column; gap: 14px; padding: 20px 20px 20px; }
.pkg__title { font-size: var(--fs-lg); font-weight: 800; line-height: 1.6; }
.pkg__title a { transition: color var(--dur-2); }
.pkg__title a:hover { color: var(--primary); }

/* اقلام در قاب «محتوای پکیج»، مثل فهرست قطعات */
.pkg__box {
  position: relative;
  padding: 18px 14px 10px;
  border-radius: var(--r-lg);
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}
.pkg__box-label {
  position: absolute;
  top: -10px;
  inset-inline-start: 14px;
  padding: 1px 10px;
  border-radius: var(--r-pill);
  background: var(--grad-brand);
  color: #fff;
  font-size: var(--fs-2xs);
  font-weight: 800;
  box-shadow: 0 6px 14px -8px rgba(13, 148, 136, .9);
}
.pkg__items { display: grid; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--fg); }
.pkg__items li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  transition: transform var(--dur-3) var(--ease-out);
}
.pkg__items li + li { border-top: 1px dashed var(--line-strong); }
.pkg__items .icon {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  padding: 4px;
  border-radius: 6px;
  background: var(--grad-brand);
  color: #fff;
  stroke-width: 2.6;
  transition: transform var(--dur-3) var(--ease-spring);
}
.pkg__items li:hover { transform: translateX(-3px); }
.pkg__items li:hover .icon { transform: rotate(-8deg) scale(1.1); }
.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: 4px;
}
.pkg__price-label { color: var(--fg-muted); font-size: var(--fs-2xs); font-weight: 700; }
.pkg__foot .price strong { font-size: var(--fs-xl); }
/* درخشش که با هاور از روی دکمه رد می‌شود */
.pkg__add { position: relative; overflow: hidden; }
.pkg__add::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(120%);
  pointer-events: none;
}
.pkg:hover .pkg__add::after { transform: translateX(-120%); transition: transform .9s var(--ease-out); }

/* ---------- کارت مطلب ----------
   تصویر تمام‌قد، برچسب دسته روی تصویر، و یک کارت سفید شناور که لبه‌ی پایین تصویر را می‌پوشاند. */
.post-card {
  --pc-overlap: 30px;
  position: relative;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
.post-card__media {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--grad-media);
  box-shadow: var(--sh-1);
  transition: box-shadow var(--dur-3) var(--ease);
}
.post-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 59, 55, .22), transparent 42%);
  opacity: .7;
  transition: opacity var(--dur-3) var(--ease);
  pointer-events: none;
}
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.06); }
.post-card:hover .post-card__media { box-shadow: var(--sh-2); }
.post-card:hover .post-card__media::after { opacity: 1; }
.post-card__placeholder { display: grid; place-items: center; height: 100%; color: var(--brand); opacity: .55; }
.post-card__placeholder .icon { width: 64px; height: 64px; stroke-width: 1; }
.post-card__cat {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  z-index: 2;
  max-width: calc(100% - 28px);
  overflow: hidden;
  padding: 5px 14px;
  border-radius: 10px;
  background: var(--surface-glass);
  box-shadow: 0 4px 14px -6px rgba(11, 59, 55, .35);
  color: var(--fg);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.post-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  margin: calc(var(--pc-overlap) * -1) 16px 0;
  overflow: hidden;
  padding: 14px 18px 14px;
  border-radius: var(--r);
  background: var(--bg);
  box-shadow: 0 10px 28px -16px rgba(11, 48, 54, .32), 0 1px 2px rgba(11, 48, 54, .05);
  transition: transform var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease);
}
.post-card:hover .post-card__body { transform: translateY(-6px); box-shadow: var(--sh-2); }
/* نور دنبال‌کننده زیر متن می‌ماند؛ بدنه خودش بافت انباشت است */
.post-card__body[data-glow]::before { z-index: -1; }
.post-card__title {
  overflow: hidden;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.8;
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* تصویر خودش پیوند است؛ این لایه کل کارت سفید را پیوند می‌کند */
.post-card__title a::after { content: ""; position: absolute; inset: 0; }
.post-card__title a:hover, .post-card:hover .post-card__title a { color: var(--primary); }
.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  color: var(--fg-subtle);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.post-card__author { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.post-card__author img { flex: none; width: 16px; height: 16px; border-radius: 4px; }
.post-card__meta time { display: inline-flex; align-items: center; gap: 10px; }
.post-card__meta time::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
}

/* ---------- زبانه ---------- */
.tabs { display: flex; gap: 4px; padding: 5px; border-radius: var(--r-pill); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line), var(--sh-1); 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(--grad-brand); color: #fff; box-shadow: var(--sh-glow); }
.tab[aria-selected="true"] .icon { color: var(--mint); }
/* بدون جاوااسکریپت همه‌ی پنل‌ها دیده می‌شوند */
.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: 72px;
  height: 5px;
  margin: 14px auto 0;
  border-radius: var(--r-pill);
  background: var(--grad-spectrum);
  background-size: 200% 100%;
  transition: transform 1s var(--ease-out) .25s;
  animation: dn-gradient-pan 4s linear infinite;
}
.js .section-head:not(.is-in) h2::after { transform: scaleX(0); }
.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: var(--grad-icon); box-shadow: inset 0 0 0 1px rgba(20, 184, 166, .18); }
.hero, .sale, .footer-cta { isolation: isolate; }

/* ---------- استعلام گارانتی ---------- */
.wlookup { display: grid; gap: 16px; }
.wlookup--band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
  padding: clamp(24px, 5vw, 52px);
  border-radius: var(--r-2xl);
  background: var(--noise), var(--grad-night);
  color: var(--on-dark);
  box-shadow: var(--sh-3);
}
.wlookup--band::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-inline-start: -140px;
  bottom: -180px;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 34px, var(--ring-line) 34px 35px);
}
.wlookup--band h2 { color: var(--on-dark); font-size: var(--fs-2xl); }
.wlookup--band p { color: var(--on-dark-muted); }
.wlookup__copy { display: grid; justify-items: start; gap: 12px; }
.wlookup--band .wlookup__form, .wlookup--band .wlookup__result { grid-column: 2; }
.wlookup--band .wlookup__result:empty { display: none; }
.wlookup--band .wlookup__copy { grid-row: span 2; }
@media (max-width: 860px) {
  .wlookup--band { grid-template-columns: 1fr; }
  .wlookup--band .wlookup__form, .wlookup--band .wlookup__result { grid-column: auto; }
  .wlookup--band .wlookup__copy { grid-row: auto; }
}
.wlookup--page { max-width: 760px; margin-block: clamp(24px, 4vw, 40px); }
.wlookup-page { display: grid; gap: clamp(24px, 4vw, 40px); padding-block: clamp(24px, 4vw, 40px); }
.wlookup-page > .wlookup--page, .wlookup-page > .section { margin-block: 0; padding-block: 0; }
.wlookup__pill { background: var(--bg); box-shadow: var(--sh-2); }
.wlookup__pill input { color: var(--fg); font-family: var(--font-code); letter-spacing: .04em; }
.wlookup__hint { display: flex; gap: 8px; color: var(--fg-muted); font-size: var(--fs-sm); }
.wlookup__error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.wlookup__result.is-loading { opacity: .55; transition: opacity var(--dur-2); }

.wcard {
  display: grid;
  gap: 14px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--sh-2);
  animation: dn-rise .45s var(--ease);
}
@keyframes dn-rise { from { opacity: 0; transform: translateY(8px); } }
.wcard__head { display: grid; justify-items: start; gap: 4px; }
.wcard__title { margin: 4px 0 0; font-size: var(--fs-lg); color: var(--fg); }
.wcard__model, .wlookup--band .wcard__model { margin: 0; color: var(--fg-muted); font-size: var(--fs-sm); }
.wcard__state {
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 800;
  background: var(--bg-tint);
  color: var(--primary);
}
.wcard--active .wcard__state { background: var(--success-bg); color: var(--success); }
.wcard--expired .wcard__state { background: var(--bg-soft); color: var(--fg-muted); }
.wcard--voided .wcard__state { background: var(--danger-bg); color: var(--danger); }
.wcard__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0; }
.wcard__facts div { display: grid; gap: 2px; }
.wcard__facts dt { color: var(--fg-muted); font-size: var(--fs-xs); }
.wcard__facts dd { margin: 0; font-weight: 800; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.wcard__meter { height: 10px; border-radius: var(--r-pill); background: var(--bg-tint); overflow: hidden; }
.wcard__meter span { display: block; height: 100%; border-radius: inherit; background: var(--grad-spectrum); }
.wcard__remain, .wlookup--band .wcard__remain { margin: 0; color: var(--fg-muted); font-size: var(--fs-sm); }
.wcard__remain b { color: var(--primary); font-size: var(--fs-lg); }

/* ---------- کارت گارانتی‌ها ----------
   کارت عمودی مثل یک گواهی: لوگو در لنزی با حلقه‌ی چرخان، مهر «معتبر»، حلقه‌های مُهر در پس‌زمینه
   و درخشش هولوگرامی که با هاور از روی کارت رد می‌شود. */
.warranties {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.warranty-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(45, 212, 191, .1), transparent 60%),
    var(--bg);
  color: var(--fg);
  transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3), border-color var(--dur-2);
}
/* حلقه‌های مُهر در گوشه */
.warranty-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 190px;
  height: 190px;
  inset-inline-start: -70px;
  bottom: -80px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 14px, rgba(13, 148, 136, .09) 14px 15px);
  transition: transform 1.2s var(--ease-out);
}
.warranty-card:hover { transform: translateY(-6px); border-color: transparent; box-shadow: var(--sh-2); }
.warranty-card:hover::before { transform: rotate(40deg) scale(1.15); }
/* درخشش هولوگرامی */
.warranty-card__head::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: -50% -30%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .7) 48%, rgba(167, 243, 208, .45) 52%, transparent 60%);
  transform: translateX(80%);
  pointer-events: none;
}
.warranty-card:hover .warranty-card__head::after { transform: translateX(-80%); transition: transform 1s var(--ease-out); }
.warranty-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.warranty-card__logo {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 12px 24px -14px rgba(4, 47, 44, .5), inset 0 0 0 1px var(--line);
  color: var(--on-white-teal);
}
.warranty-card__logo::before {
  content: "";
  --dn-angle: 0deg;
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from var(--dn-angle), var(--aqua), var(--cyan), transparent 35%, var(--mint) 60%, transparent 80%, var(--aqua));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  opacity: .45;
  transition: opacity var(--dur-3);
}
.warranty-card:hover .warranty-card__logo::before { opacity: 1; animation: dn-spin-angle 2.4s linear infinite; }
.warranty-card__logo img { width: 52px; height: 52px; border-radius: 50%; object-fit: contain; transition: transform .6s var(--ease-spring); }
.warranty-card:hover .warranty-card__logo img { transform: scale(1.08); }
.warranty-card__logo .icon { width: 30px; height: 30px; }
.warranty-card__seal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--success-bg);
  box-shadow: inset 0 0 0 1px rgba(21, 128, 61, .2);
  color: var(--success);
  font-size: var(--fs-2xs);
  font-weight: 800;
}
.warranty-card__seal .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.warranty-card__body { display: grid; align-content: start; gap: 6px; flex: 1; min-width: 0; }
.warranty-card__body b { font-size: var(--fs-md); font-weight: 800; line-height: 1.6; transition: color var(--dur-2); }
.warranty-card:hover .warranty-card__body b { color: var(--primary-strong); }
.warranty-card__body small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--fg-muted);
  font-size: var(--fs-xs);
  line-height: 1.9;
}
.warranty-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
  color: var(--primary-strong);
  font-size: var(--fs-xs);
  font-weight: 800;
}
.warranty-card__arrow {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 7px;
  border-radius: 50%;
  background: var(--bg-tint);
  color: var(--primary);
  transition: background var(--dur-2), color var(--dur-2), transform var(--dur-3) var(--ease-spring);
}
.warranty-card:hover .warranty-card__arrow { background: var(--grad-brand); color: #fff; transform: translateX(-4px); }
[dir="ltr"] .warranty-card__arrow { scale: -1 1; }

/* ==========================================================================
   دوربین ردیاب (_TrackerCam)
   ========================================================================== */
.tracker-cam { position: absolute; z-index: 3; width: 220px; pointer-events: none; }
.tracker-cam svg { width: 100%; height: auto; overflow: visible; }
.tracker-cam__head {
  transform-origin: 176px 59px;
  transform: rotate(var(--rot, 0deg));
  transition: transform .35s var(--ease);
}
.tracker-cam:not(.is-tracking) .tracker-cam__head { animation: dn-cam-pan 8s ease-in-out infinite; }
.tracker-cam__fov { animation: dn-fov 3s ease-in-out infinite alternate; }
.tracker-cam__led { animation: dn-pulse 1.2s ease-in-out infinite; }
.tracker-cam--flip svg { transform: scaleX(-1); }
@keyframes dn-cam-pan { 0%, 100% { transform: rotate(-16deg); } 50% { transform: rotate(14deg); } }
@keyframes dn-fov { from { opacity: .55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tracker-cam__head { animation: none !important; } }
