/* ==========================================================================
   aliz.space — کامپوننت‌های مشترک (برگرفته از موتور ورنا؛ همه از توکن‌های رنگ تم استفاده می‌کنند)
   استوری، باکس‌های درون‌متنی، فرم‌ساز، FAQ، نوار پایین، گردونه، گنج، دکمهٔ تماس، 404 و کلاب
   ========================================================================== */
/* ============ Floating contact FAB ============ */
.fab-wrap { position: fixed; right: 18px; left: auto; bottom: 18px; z-index: 95; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fab-actions { display: flex; flex-direction: column; gap: 10px; opacity: 0; visibility: hidden; transform: translateY(10px) scale(.9); transition: .2s; }
.fab-wrap.open .fab-actions { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.fab-btn, .fab-item {
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff; box-shadow: 0 8px 22px -8px rgba(0,0,0,.5);
  transition: transform .15s;
}
.fab-item:hover, .fab-btn:hover { transform: scale(1.07); }
.fab-btn { background: var(--c-primary); }
.fab-wrap.open .fab-btn { background: var(--c-primary-dark); }
.fab-item.call { background: #16a34a; }
.fab-item.telegram { background: #229ED9; }
.fab-item.eitaa { background: #ea6a2b; }
.fab-item.whatsapp { background: #25D366; }
@media (max-width: 768px) {
  /* فاصلهٔ افقی؛ فاصلهٔ عمودی را قانونِ پشته‌ایِ پایین فایل تعیین می‌کند */
  .fab-wrap { right: 16px; }
}

/* ============ Cart toast ============ */
.toast {
  position: fixed; inset-inline: 0; bottom: 22px; margin-inline: auto; width: max-content; max-width: calc(100% - 32px);
  z-index: 120; display: flex; align-items: center; gap: 12px;
  background: var(--c-text); color: #fff; padding: 11px 15px; border-radius: 14px;
  box-shadow: 0 16px 42px -12px rgba(0,0,0,.5); opacity: 0; transform: translateY(16px); transition: opacity .3s, transform .3s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast .toast-ico { width: 24px; height: 24px; border-radius: 50%; background: #2c7a5c; color: #fff; display: grid; place-items: center; font-size: 13px; flex: 0 0 auto; }
.toast .toast-msg { font-size: 13.5px; font-weight: 600; }
.toast .toast-cta { background: var(--c-primary); color: #fff; font-size: 12.5px; font-weight: 700; padding: 7px 14px; border-radius: 10px; white-space: nowrap; }
@media (max-width: 768px) { .toast { bottom: 92px; } }

/* ============ In-content product/article embeds ============ */
.embed-products { display: grid; gap: 12px; margin: 22px 0; }
.embed-products.cols-1 { grid-template-columns: 1fr; }
.embed-products.cols-2 { grid-template-columns: 1fr 1fr; }
.embed-products.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.embed-product { display: flex; flex-direction: column; text-decoration: none; color: var(--c-text); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 16px; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.embed-product:hover { transform: translateY(-3px); border-color: var(--c-primary); box-shadow: 0 14px 32px -18px rgba(0,0,0,.3); }
.embed-product .ep-img { display: block; aspect-ratio: 1; background: var(--c-soft); }
.embed-product .ep-img img { width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; }
.embed-product .ep-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.embed-product .ep-name { font-weight: 700; font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.embed-product .ep-price { color: var(--c-primary-dark); font-weight: 800; font-size: 14px; margin-top: auto; }
.embed-product .ep-btn { display: block; text-align: center; background: var(--c-primary); color: #fff; border-radius: 10px; padding: 8px; font-size: 12.5px; font-weight: 700; margin-top: 4px; }
.embed-products.cols-1 .embed-product { flex-direction: row; }
.embed-products.cols-1 .ep-img { flex: 0 0 150px; aspect-ratio: auto; }
.embed-article { margin: 22px 0; }
.embed-article a { display: flex; gap: 14px; text-decoration: none; color: var(--c-text); background: var(--c-soft); border: 1px solid var(--c-border); border-radius: 16px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.embed-article a:hover { border-color: var(--c-primary); box-shadow: 0 14px 32px -18px rgba(0,0,0,.3); }
.embed-article .ea-img { flex: 0 0 130px; }
.embed-article .ea-img img { width: 100%; height: 100%; object-fit: cover; min-height: 120px; margin: 0; border-radius: 0; }
.embed-article .ea-info { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.embed-article .ea-title { font-weight: 800; font-size: 15px; }
.embed-article .ea-desc { font-size: 12.5px; color: var(--c-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.embed-article .ea-btn { align-self: flex-start; margin-top: auto; color: var(--c-primary); font-weight: 700; font-size: 12.5px; border: 1px solid var(--c-border); border-radius: 999px; padding: 5px 13px; }
@media (max-width: 640px) {
  .embed-products.cols-2, .embed-products.cols-3 { grid-template-columns: 1fr 1fr; }
  .embed-products.cols-1 .embed-product { flex-direction: column; }
  .embed-products.cols-1 .ep-img { flex: none; aspect-ratio: 1; }
  .embed-article a { flex-direction: column; }
  .embed-article .ea-img { flex: none; aspect-ratio: 16/9; }
}

/* ============ Embed boxes v2 (pro) ============ */
.embed-product .ep-img { position: relative; }
.embed-product .ep-off { position: absolute; top: 8px; inset-inline-start: 8px; background: var(--c-primary); color:#fff; font-size:11px; font-weight:800; padding:2px 8px; border-radius:999px; }
.embed-product .ep-priceline { display:flex; align-items:baseline; gap:8px; margin-top:auto; flex-wrap:wrap; }
.embed-product .ep-old { text-decoration: line-through; color: var(--c-muted); font-size: 11.5px; }
.embed-article .ea-eyebrow { font-size: 11px; color: var(--c-primary); font-weight: 700; }

/* ============ باکس تک‌محصولی — طراحی حرفه‌ای ============ */
.embed-products.cols-1 { margin: 26px 0; }
.embed-products.cols-1 .embed-product {
  flex-direction: row;
  align-items: stretch;
  gap: 18px;
  padding: 14px;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  background: var(--c-surface);
  background:
    radial-gradient(130% 150% at 100% 0, color-mix(in srgb, var(--c-primary) 8%, transparent) 0%, transparent 52%),
    var(--c-surface);
}
.embed-products.cols-1 .embed-product::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px;
  background: linear-gradient(180deg, var(--c-primary), var(--c-primary-dark));
}
.embed-products.cols-1 .embed-product:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--c-primary) 45%, var(--c-border));
  box-shadow: 0 26px 50px -28px color-mix(in srgb, var(--c-primary) 60%, rgba(0,0,0,.55));
}
.embed-products.cols-1 .ep-img {
  flex: 0 0 190px; aspect-ratio: 1; border-radius: 14px; overflow: hidden; align-self: center;
}
.embed-products.cols-1 .ep-img img { transition: transform .45s ease; }
.embed-products.cols-1 .embed-product:hover .ep-img img { transform: scale(1.06); }
.embed-products.cols-1 .ep-off {
  top: 10px; inset-inline-start: 10px; padding: 4px 11px; font-size: 11px;
  box-shadow: 0 8px 18px -8px var(--c-primary);
}
.embed-products.cols-1 .ep-info { padding: 6px 6px 6px 4px; gap: 9px; justify-content: center; }
.embed-products.cols-1 .ep-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .2px; color: var(--c-primary-dark);
}
.embed-products.cols-1 .ep-eyebrow-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--c-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-primary) 20%, transparent);
}
.embed-products.cols-1 .ep-name {
  font-size: 18px; font-weight: 800; line-height: 1.6; -webkit-line-clamp: 2;
  font-family: var(--font-display, inherit);
}
.embed-products.cols-1 .ep-desc {
  font-size: 13px; color: var(--c-muted); line-height: 1.95;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.embed-products.cols-1 .ep-priceline { margin-top: 4px; align-items: baseline; gap: 10px; }
.embed-products.cols-1 .ep-price { font-size: 21px; font-weight: 800; color: var(--c-primary-dark); }
.embed-products.cols-1 .ep-price small { font-size: 12px; font-weight: 500; color: var(--c-muted); margin-inline-start: 3px; }
.embed-products.cols-1 .ep-old { font-size: 13px; }
.embed-products.cols-1 .ep-btn {
  align-self: flex-start; width: auto; margin-top: 8px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 999px; font-size: 13.5px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  box-shadow: 0 14px 26px -14px var(--c-primary);
}
.embed-products.cols-1 .ep-arrow { font-weight: 900; transition: transform .25s ease; }
.embed-products.cols-1 .embed-product:hover .ep-arrow { transform: translateX(-4px); }

@media (max-width: 640px) {
  .embed-products.cols-1 .embed-product { flex-direction: column; gap: 14px; padding: 12px; }
  .embed-products.cols-1 .embed-product::before { inset-block: auto; inset-inline: 0; inset-block-start: 0; width: auto; height: 4px; }
  .embed-products.cols-1 .ep-img { flex: none; width: 100%; aspect-ratio: 16/10; align-self: stretch; }
  .embed-products.cols-1 .ep-info { padding: 0 4px 6px; }
  .embed-products.cols-1 .ep-btn { align-self: stretch; justify-content: center; }
}

/* ============ استوری‌ها ============ */
.stories-tray {
  display: flex; gap: 16px; overflow-x: auto; padding: 16px 2px 6px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.stories-tray::-webkit-scrollbar { display: none; }
.story-bubble {
  flex: 0 0 auto; background: none; border: 0; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 74px;
}
.sb-ring {
  display: block; width: 68px; height: 68px; border-radius: 50%; padding: 3px;
  background: conic-gradient(from 210deg, var(--c-primary), var(--c-accent), #6B7280, var(--c-primary));
  transition: transform .18s ease;
}
.story-bubble:hover .sb-ring { transform: scale(1.05); }
.sb-img {
  display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: var(--c-soft); border: 2.5px solid var(--c-surface);
}
.sb-img img { width: 100%; height: 100%; object-fit: cover; }
.sb-ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--c-primary); font-size: 20px; }
.sb-label {
  font-size: 11.5px; color: var(--c-text); max-width: 74px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* نمایشگر استوری */
.story-viewer {
  position: fixed; inset: 0; z-index: 1000; background: rgba(10,10,14,.92);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.story-viewer[hidden] { display: none; }
.sv-stage {
  position: relative; width: min(440px, 100vw); height: min(88vh, 860px);
  background: #000; border-radius: 18px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8);
}
.sv-stage img, .sv-stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.sv-progress {
  position: fixed; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: min(420px, 92vw); display: flex; gap: 4px; z-index: 3;
}
.sv-bar { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.32); overflow: hidden; }
.sv-bar > i { display: block; height: 100%; width: 0; background: #fff; border-radius: 3px; }
.sv-title {
  position: fixed; top: max(26px, calc(env(safe-area-inset-top) + 12px)); left: 50%; transform: translateX(-50%);
  width: min(420px, 92vw); color: #fff; font-size: 13.5px; font-weight: 700; z-index: 3;
  text-shadow: 0 1px 6px rgba(0,0,0,.6); padding-top: 10px; text-align: right;
}
.sv-close {
  position: fixed; top: max(20px, env(safe-area-inset-top)); inset-inline-end: 16px; z-index: 4;
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.16); color: #fff; font-size: 22px; line-height: 1;
}
.sv-close:hover { background: rgba(255,255,255,.28); }
.sv-nav {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.16); color: #fff; font-size: 24px; line-height: 1;
  display: grid; place-items: center; transition: background .15s, transform .15s;
  backdrop-filter: blur(2px);
}
.sv-nav:hover { background: rgba(255,255,255,.3); }
.sv-nav:active { transform: translateY(-50%) scale(.92); }
.sv-nav.prev { inset-inline-start: 18px; }   /* هماهنگ با اسلایدر سایت: چپ = قبلی */
.sv-nav.next { inset-inline-end: 18px; }      /* راست = بعدی */
@media (max-width: 480px) { .sv-nav { width: 38px; height: 38px; font-size: 21px; } .sv-nav.prev { inset-inline-start: 10px; } .sv-nav.next { inset-inline-end: 10px; } }
.sv-bottom {
  position: fixed; bottom: max(24px, calc(env(safe-area-inset-bottom) + 14px)); left: 50%; transform: translateX(-50%);
  z-index: 4; width: min(420px, 90vw); display: flex; align-items: center; gap: 12px; justify-content: center;
}
.sv-cta {
  flex: 1; text-align: center; background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff; font-weight: 800; font-size: 14px; padding: 13px 22px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 14px 34px -12px rgba(0,0,0,.7);
}
.sv-cta[hidden] { display: none; }
.sv-like {
  flex: 0 0 auto; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; border: 0; cursor: pointer;
  background: transparent; color: #fff; padding: 4px; font: inherit; font-weight: 700;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.5));
}
.sv-like svg { fill: none; stroke: #fff; stroke-width: 2; transition: fill .18s, transform .18s, stroke .18s; }
.sv-like:hover svg { stroke: #ffd0dc; }
.sv-like:active svg { transform: scale(.85); }
.sv-like.liked svg { fill: #ff3b6b; stroke: #ff3b6b; animation: heartPop .3s ease; }
@keyframes heartPop { 0% { transform: scale(.8); } 50% { transform: scale(1.25); } 100% { transform: scale(1); } }
.sv-like-count { font-size: 11px; }
.sv-like-count:empty { display: none; }
@media (max-width: 480px) {
  .sv-stage { width: 100vw; height: 100dvh; border-radius: 0; }
}

/* ============================================================
   فرم‌ساز — نمایش فرم در صفحه‌ها و مقاله‌ها
   ============================================================ */
.fb-wrap {
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-surface); overflow: hidden; margin: 26px 0;
}
/* دوستونه: فرم و رسانه هم‌ارتفاع */
.fb-wrap.fb-two { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
.fb-wrap.fb-two .fb-media { order: 2; }
.fb-wrap.fb-two.fb-media-start .fb-media { order: 0; }

.fb-media { position: relative; min-height: 100%; background: var(--c-soft); }
.fb-media img, .fb-media video {
  display: block; width: 100%; height: 100%; min-height: 260px;
  object-fit: cover; background: #000;
}
.fb-body { padding: 26px 26px 28px; display: flex; flex-direction: column; justify-content: center; }
.fb-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; margin: 0 0 8px; }
.fb-desc { color: var(--c-muted); font-size: 13.5px; line-height: 2; margin: 0 0 18px; }

.fb-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.fb-field { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.fb-field.fb-half { grid-column: span 1; }
.fb-field > label { font-size: 13px; font-weight: 600; }
.fb-field > label em { color: var(--c-danger); font-style: normal; }
.fb-field input[type="text"], .fb-field input[type="email"], .fb-field input[type="tel"],
.fb-field input[type="number"], .fb-field input[type="date"], .fb-field input[type="file"],
.fb-field select, .fb-field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--c-border); border-radius: 12px;
  font: inherit; background: var(--c-bg); color: var(--c-text);
}
.fb-field textarea { resize: vertical; min-height: 100px; }
.fb-field input:focus, .fb-field select:focus, .fb-field textarea:focus {
  outline: none; border-color: var(--c-primary);
}
.fb-opts { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.fb-opt { display: flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.fb-accept { line-height: 1.9; align-items: flex-start; }
.fb-accept input { margin-top: 4px; }
.fb-hint { font-size: 11.5px; color: var(--c-muted); }
.fb-submit { margin-top: 18px; width: 100%; }
.fb-hp { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; white-space: nowrap; }

.fb-success {
  border: 1px solid var(--c-accent); background: color-mix(in srgb, var(--c-accent) 12%, var(--c-surface));
  color: var(--c-text); border-radius: 12px; padding: 16px 18px; font-size: 14px; line-height: 2;
}
.fb-errors {
  border: 1px solid var(--c-danger); background: color-mix(in srgb, var(--c-danger) 8%, var(--c-surface));
  border-radius: 12px; padding: 12px 16px; margin-bottom: 16px;
}
.fb-errors ul { margin: 0; padding-inline-start: 18px; font-size: 13px; color: var(--c-danger); line-height: 2; }

@media (max-width: 800px) {
  .fb-wrap.fb-two { grid-template-columns: 1fr; }
  .fb-wrap.fb-two .fb-media { order: 0; }
  .fb-media img, .fb-media video { min-height: 200px; max-height: 320px; }
  .fb-body { padding: 20px 18px 22px; }
  .fb-fields { grid-template-columns: 1fr; }
  .fb-field.fb-half { grid-column: 1 / -1; }
}

/* ============ پرسش‌های متداول (FAQ schema) ============ */
.faq-block { margin: 34px 0 10px; }
.faq-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; margin: 0 0 14px; }
.faq-list { display: grid; gap: 10px; }
.faq-item {
  border: 1px solid var(--c-border); border-radius: 14px; background: var(--c-surface);
  padding: 0 16px; transition: border-color .2s;
}
.faq-item[open] { border-color: var(--c-primary); }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 15px 0; font-weight: 700; font-size: 14.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; font-size: 19px; color: var(--c-primary); flex: 0 0 auto; line-height: 1;
  transition: transform .2s;
}
.faq-item[open] summary::after { content: '−'; }
.faq-a { padding: 0 0 16px; font-size: 13.5px; line-height: 2.1; color: var(--c-muted); }

/* ============================================================
   نوار پایین سایت (Bottom Bar) — چهار استایل: کلاسیک، شناور، کپسولی، داک
   ============================================================ */
.bottombar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
  display: none; align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottombar .bb-item {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 9px 4px 8px; color: var(--c-muted); font-size: 11px; font-weight: 600;
  transition: color .18s, background .18s; text-align: center;
}
.bottombar .bb-lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottombar .bb-ic { position: relative; display: grid; place-items: center; line-height: 0; }
.bottombar .bb-badge {
  position: absolute; top: -6px; inset-inline-end: -9px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--c-primary); color: #fff;
  font-size: 10px; font-weight: 800; display: grid; place-items: center; line-height: 1;
}
.bottombar .bb-item.on { color: var(--c-primary); }

/* ---- استایل ۱: کلاسیک (نوار چسبیده به لبه) ---- */
.bottombar.bb-classic {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -4px 22px rgba(0, 0, 0, .07);
}
.bottombar.bb-classic .bb-item.on { background: color-mix(in srgb, var(--c-primary) 8%, transparent); }
.bottombar.bb-classic .bb-item.on::before {
  content: ''; position: absolute; top: 0; inset-inline-start: 18%; width: 64%; height: 3px;
  border-radius: 0 0 4px 4px; background: var(--c-primary);
}
.bottombar.bb-classic .bb-item { position: relative; }

/* ---- استایل ۲: شناور (کارت گرد با فاصله از لبه) ---- */
.bottombar.bb-floating {
  inset-inline: 12px; bottom: 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .14);
  overflow: hidden;
  margin-bottom: env(safe-area-inset-bottom, 0);
  padding-bottom: 0;
}
.bottombar.bb-floating .bb-item { padding: 10px 4px; border-radius: 16px; }
.bottombar.bb-floating .bb-item.on {
  background: var(--c-primary); color: #fff;
}
.bottombar.bb-floating .bb-item.on .bb-badge { background: #fff; color: var(--c-primary); }

/* ---- استایل ۳: کپسولی ----
   همهٔ آیتم‌ها سهم برابر دارند (آیکن‌ها از صفحه‌ای به صفحهٔ دیگر جابه‌جا نمی‌شوند)؛
   آیتم فعال نرم بزرگ می‌شود و عنوانش در یک کپسول رنگی کنار آیکن می‌آید. */
.bottombar.bb-pill {
  background: color-mix(in srgb, var(--c-surface) 94%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -4px 22px rgba(0, 0, 0, .07);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0));
}
.bottombar.bb-pill .bb-item {
  flex: 1 1 0; min-width: 0; flex-direction: row; gap: 6px;
  min-height: 46px; padding: 0 8px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
  transition: flex-grow .3s cubic-bezier(.2,.8,.2,1), background .22s, color .22s;
}
.bottombar.bb-pill .bb-item:not(.on) .bb-lbl {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.bottombar.bb-pill .bb-item.on {
  flex-grow: 2.3; padding: 0 12px;
  background: color-mix(in srgb, var(--c-primary) 13%, transparent); color: var(--c-primary);
}
.bottombar.bb-pill .bb-item.on .bb-lbl { min-width: 0; }
@media (max-width: 360px) {
  .bottombar.bb-pill { padding-inline: 6px; gap: 2px; }
  .bottombar.bb-pill .bb-item { padding: 0 6px; font-size: 11.5px; }
  .bottombar.bb-pill .bb-item.on { flex-grow: 2.1; padding: 0 10px; }
}

/* آیکن‌های نوار پایین در هیچ استایلی کوچک یا کج نمی‌شوند (قانون عمومی svg{max-width:100%} را خنثی می‌کند) */
.bottombar .bb-ic svg { width: 22px; height: 22px; max-width: none; flex-shrink: 0; }
.bottombar .bb-ic { flex-shrink: 0; }

/* ---- استایل ۴: داک (کپسول تیرهٔ شناور، فقط آیکن، نقطهٔ زیر آیتم فعال) ---- */
.bottombar.bb-dock {
  inset-inline: 18px; bottom: 14px;
  justify-content: space-around;
  padding: 6px 8px;
  background: color-mix(in srgb, var(--c-text) 94%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
  margin-bottom: env(safe-area-inset-bottom, 0);
}
.bottombar.bb-dock .bb-item {
  flex: 1 1 0; position: relative; min-height: 50px; padding: 0;
  color: rgba(255, 255, 255, .62); border-radius: 999px;
}
.bottombar.bb-dock .bb-lbl {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.bottombar.bb-dock .bb-ic { isolation: isolate; }
.bottombar.bb-dock .bb-item.on { color: #fff; }
.bottombar.bb-dock .bb-item.on .bb-ic::before {
  content: ''; position: absolute; inset: -8px -14px; z-index: -1;
  border-radius: 999px; background: rgba(255, 255, 255, .14);
}
.bottombar.bb-dock .bb-item.on::after {
  content: ''; position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: #fff;
}
.bottombar.bb-dock .bb-badge { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-text) 94%, #000); }
body.bb-style-dock { --stack-gap: 10px; }
@media (max-width: 768px) {
  body.bb-style-dock.has-bottombar .mobile-buybar,
  body.bb-style-dock.has-bottombar .cart-sticky {
    inset-inline: 12px; border: 1px solid var(--c-border); border-top: 1px solid var(--c-border);
    border-radius: 18px; box-shadow: 0 8px 28px rgba(0,0,0,.14);
    padding-bottom: 10px;
  }
}

/* ---- چیدمان پشته‌ای: نوار پایین → نوار خرید → دکمهٔ تماس ----
   ارتفاع‌ها را جاوااسکریپت اندازه می‌گیرد و در --bb-h و --buybar-h می‌گذارد،
   پس هر ترکیبی از این سه (و هر دو استایل نوار) بدون هم‌پوشانی می‌نشیند. */
:root { --bb-h: 0px; --buybar-h: 0px; --stack-gap: 0px; --bb-safe: env(safe-area-inset-bottom, 0px); }
body.bb-style-floating { --stack-gap: 10px; }

/* در استایل شناور، نوار خرید هم کارتی می‌شود تا با نوار پایین یک‌دست باشد */
@media (max-width: 768px) {
  body.bb-style-floating.has-bottombar .mobile-buybar,
  body.bb-style-floating.has-bottombar .cart-sticky {
    inset-inline: 12px; border: 1px solid var(--c-border); border-top: 1px solid var(--c-border);
    border-radius: 18px; box-shadow: 0 8px 28px rgba(0,0,0,.14);
    padding-bottom: 10px;
  }
}

/* نمایش فقط در موبایل و تبلت کوچک */
@media (max-width: 860px) {
  .bottombar { display: flex; }
  body.has-bottombar { padding-bottom: calc(var(--bb-h, 74px) + 10px); }
}
/* دکمهٔ شناور تماس همیشه بالای هر دو نوار می‌ماند */
body .fab-wrap {
  bottom: calc(var(--bb-h, 0px) + var(--buybar-h, 0px) + var(--stack-gap, 0px) + 18px);
  transition: bottom .18s ease;
}
@media print { .bottombar { display: none !important; } }

/* ============================================================
   گردونهٔ شانس
   ============================================================ */
.wheel-page { max-width: 980px; }
.wheel-head { text-align: center; margin-bottom: 28px; }
.wheel-head h1 { font-family: var(--font-display); font-size: clamp(22px, 3.4vw, 32px); font-weight: 800; margin: 0 0 8px; }
.wheel-head p { color: var(--c-muted); font-size: 14.5px; line-height: 2; margin: 0; }

.wheel-stage { display: grid; grid-template-columns: 1fr 300px; gap: 34px; align-items: center; }
.wheel-box { position: relative; max-width: 420px; margin: 0 auto; width: 100%; }
.wheel-box svg { width: 100%; height: auto; display: block; }
.wheel-spinner { transform: rotate(0deg); position: relative; will-change: transform; }
.wheel-label { font-size: 8.5px; font-weight: 700; fill: #fff; font-family: var(--font-body); }

.wheel-pointer {
  position: absolute; top: -12px; inset-inline-start: 50%; transform: translateX(50%) rotate(180deg);
  z-index: 3; filter: drop-shadow(0 3px 5px rgba(0,0,0,.25));
}
.wheel-hub {
  position: absolute; top: 50%; inset-inline-start: 50%; transform: translate(50%, -50%);
  width: 23%; aspect-ratio: 1; border-radius: 50%; background: #fff;
  display: grid; place-items: center; overflow: hidden; z-index: 2;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.wheel-hub img { width: 76%; height: 76%; object-fit: contain; }
.wheel-hub span { font-weight: 800; font-size: 13px; color: var(--c-primary-dark); text-align: center; padding: 0 4px; }

.wheel-side { display: grid; gap: 12px; align-content: start; }
.wheel-note {
  background: var(--c-soft); border-radius: 13px; padding: 13px 15px;
  font-size: 13.5px; line-height: 2; color: var(--c-text);
}
.wheel-btn { font-size: 16px; font-weight: 800; padding: 14px; }
.wheel-btn:disabled { opacity: .55; cursor: not-allowed; }

.wheel-result {
  border: 2px dashed var(--c-primary); border-radius: 15px; padding: 16px;
  background: color-mix(in srgb, var(--c-primary) 7%, var(--c-surface)); text-align: center;
}
.wheel-result.lose { border-color: var(--c-border); background: var(--c-soft); }
.wheel-result .wr-title { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.wheel-result .wr-reward { font-size: 13.5px; color: var(--c-muted); line-height: 2; }
.wheel-result .wr-code {
  margin-top: 12px; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap;
}
.wheel-result .wr-code code {
  direction: ltr; font-size: 15px; font-weight: 800; letter-spacing: 1px;
  background: #fff; border: 1px dashed var(--c-primary); border-radius: 10px; padding: 8px 14px; color: var(--c-primary-dark);
}
.wr-copy { border: 0; background: var(--c-primary); color: #fff; border-radius: 9px; padding: 8px 13px; cursor: pointer; font-family: inherit; font-size: 12.5px; }

.wheel-history { border-top: 1px solid var(--c-border); padding-top: 12px; }
.wheel-history h3 { font-size: 13.5px; margin: 0 0 9px; font-weight: 800; }
.wh-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 12.5px; padding: 6px 0; border-bottom: 1px dashed var(--c-border); }
.wh-row code { direction: ltr; color: var(--c-primary-dark); font-size: 12px; }

@media (max-width: 820px) {
  .wheel-stage { grid-template-columns: 1fr; gap: 24px; }
  .wheel-box { max-width: 330px; }
}

/* ============================================================
   گنج را پیدا کن — صندوقچهٔ چسبان
   ============================================================ */
/* صندوقچه در گوشهٔ مقابلِ دکمهٔ تماس می‌نشیند (تماس: راست، صندوق: چپ)
   وگرنه روی هم می‌افتادند و صندوق زیر دکمهٔ تماس پنهان و غیرقابل‌کلیک می‌شد. */
.treasure-chest {
  /* ترتیب مهم است: اول ریست منطقی، بعد مقدار فیزیکی — وگرنه شورت‌هند
     inset-inline مقدار left را دوباره auto می‌کند. */
  position: fixed; inset-inline: auto; left: 16px; right: auto; bottom: 16px; z-index: 96;
  width: 58px; height: 58px; border: 0; padding: 0; cursor: pointer;
  border-radius: 16px; background: linear-gradient(155deg, #f7c66a, #d99a2b);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
  display: grid; place-items: center; color: #6b4407;
  animation: chestFloat 2.6s ease-in-out infinite;
}
.treasure-chest:hover { transform: scale(1.06); }
.treasure-chest::after {
  content: ''; position: absolute; inset: -5px; border-radius: 20px;
  border: 2px solid rgba(247, 198, 106, .55); animation: chestPulse 2.2s ease-out infinite;
}
@keyframes chestFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes chestPulse { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) {
  .treasure-chest, .treasure-chest::after { animation: none; }
}
/* هم‌ارتفاع با دکمهٔ تماس، بالای نوار پایین و نوار خرید */
body .treasure-chest {
  bottom: calc(var(--bb-h, 0px) + var(--buybar-h, 0px) + var(--stack-gap, 0px) + 18px);
  transition: bottom .18s ease;
}

.treasure-modal {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(20, 12, 20, .55); padding: 20px; backdrop-filter: blur(2px);
}
.treasure-modal[hidden] { display: none; }
.tm-card {
  width: min(420px, 100%); background: var(--c-surface); border-radius: 20px;
  padding: 26px 24px; text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
.tm-emoji { font-size: 46px; line-height: 1; margin-bottom: 10px; }
.tm-card h3 { font-family: var(--font-display); font-size: 19px; font-weight: 800; margin: 0 0 8px; }
.tm-card p { color: var(--c-muted); font-size: 13.5px; line-height: 2.1; margin: 0 0 16px; }
.tm-code {
  direction: ltr; display: inline-block; font-size: 17px; font-weight: 800; letter-spacing: 1.5px;
  background: var(--c-soft); border: 1px dashed var(--c-primary); border-radius: 12px;
  padding: 11px 18px; color: var(--c-primary-dark); margin-bottom: 14px;
}
.tm-actions { display: grid; gap: 8px; }

/* حالت پیش‌نمایش صندوق برای مدیر */
.treasure-chest.is-preview { background: linear-gradient(155deg, #a8b7f0, #6c8ae4); color: #fff; animation: none; }
.treasure-chest.is-preview::after { display: none; }
.treasure-chest { overflow: visible; }
.treasure-chest .tc-preview {
  position: absolute; inset-inline: auto; top: -9px; left: auto; right: -6px;
  background: #2b2530; color: #fff; font-size: 9px; font-weight: 700;
  border-radius: 999px; padding: 2px 7px; white-space: nowrap;
}
/* ============================================================
   صفحهٔ ۴۰۴ هوشمند
   ============================================================ */
.nf-page { max-width: 1000px; }
.nf-head { text-align: center; margin-bottom: 30px; }
.nf-code {
  font-family: var(--font-display); font-size: clamp(56px, 12vw, 92px); font-weight: 800; line-height: 1;
  background: linear-gradient(180deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 40%, transparent));
  -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 6px;
}
.nf-head h1 { font-family: var(--font-display); font-size: clamp(19px, 3vw, 26px); font-weight: 800; margin: 0 0 8px; }
.nf-head p { color: var(--c-muted); font-size: 14px; line-height: 2.1; margin: 0 auto 20px; max-width: 520px; }

.nf-search {
  display: flex; align-items: center; gap: 9px; max-width: 520px; margin: 0 auto;
  border: 1px solid var(--c-border); background: var(--c-surface);
  border-radius: 999px; padding: 6px 6px 6px 6px; padding-inline-start: 16px;
}
.nf-search svg { color: var(--c-muted); flex: 0 0 auto; }
.nf-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; padding: 10px 0; color: var(--c-text); }
.nf-search .btn { flex: 0 0 auto; border-radius: 999px; }

.nf-exact {
  display: flex; align-items: center; gap: 14px; max-width: 620px; margin: 0 auto 30px;
  border: 1.5px solid var(--c-accent); border-radius: 16px; padding: 14px 16px;
  background: color-mix(in srgb, var(--c-accent) 10%, var(--c-surface)); transition: .2s;
}
.nf-exact:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -18px rgba(0,0,0,.4); }
.nf-exact-ic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; background: var(--c-accent); color: #fff; display: grid; place-items: center; }
.nf-exact-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nf-exact-txt strong { font-size: 12px; color: var(--c-muted); font-weight: 600; }
.nf-exact-txt span { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nf-exact-go { flex: 0 0 auto; font-size: 13px; color: var(--c-primary); font-weight: 700; }

.nf-block { margin-bottom: 34px; }
.nf-block h2 { font-family: var(--font-display); font-size: 17px; font-weight: 800; margin: 0 0 16px; }
.nf-block h3 { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.nf-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.nf-artlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.nf-artlist a { font-size: 13.5px; color: var(--c-muted); }
.nf-artlist a:hover { color: var(--c-primary); }
.nf-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding-top: 8px; }

@media (max-width: 560px) {
  .nf-exact { flex-wrap: wrap; }
  .nf-exact-go { width: 100%; text-align: center; }
  .nf-actions .btn { flex: 1 1 100%; text-align: center; justify-content: center; }
}

/* ============ کلاب مشتریان ============ */
.summary-row.club-row { color: #2c7a5c; font-weight: 700; }

/* ============ کلاب مشتریان — پنل کاربری ============ */
.club-badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 4px 11px;
  color: var(--tier, var(--c-primary));
  background: color-mix(in srgb, var(--tier, var(--c-primary)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier, var(--c-primary)) 34%, transparent);
}
.club-medal-svg { display: block; }

.club-hero { display: flex; gap: 20px; align-items: flex-start; }
.club-hero .ch-medal { flex: 0 0 auto; color: var(--c-muted); }
.club-hero .ch-info { min-width: 0; flex: 1; }
.ch-eyebrow { font-size: 12px; font-weight: 700; color: var(--tier, var(--c-muted)); letter-spacing: .02em; }
.ch-title { font-family: var(--font-display); font-size: 25px; font-weight: 800; margin: 4px 0 8px; }
.ch-desc { font-size: 13.5px; line-height: 2.1; color: var(--c-muted); margin: 0 0 16px; }

.ch-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.ch-stats > div {
  background: var(--c-soft); border: 1px solid var(--c-border); border-radius: 13px; padding: 10px 13px;
}
.ch-stats span { display: block; font-size: 11.5px; color: var(--c-muted); }
.ch-stats strong { display: block; font-size: 14px; margin-top: 3px; white-space: nowrap; }

.ch-next { margin-top: 16px; }
.ch-next-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--c-muted); margin-bottom: 7px; }
.ch-next-top strong { color: var(--c-text); white-space: nowrap; }
.ch-bar { height: 9px; border-radius: 999px; background: var(--c-soft); border: 1px solid var(--c-border); overflow: hidden; }
.ch-bar span { display: block; height: 100%; background: var(--tier, var(--c-primary)); transition: width .4s ease; }

.club-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); gap: 12px; }
.club-tier-card {
  position: relative; text-align: center; padding: 16px 12px 14px;
  border: 1px solid var(--c-border); border-radius: 16px; background: var(--c-surface);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.club-tier-card.is-mine {
  border-color: color-mix(in srgb, var(--tier) 55%, transparent);
  background: color-mix(in srgb, var(--tier) 7%, var(--c-surface));
}
.club-tier-card strong { font-size: 14.5px; margin-top: 6px; }
.club-tier-card .ct-off { font-size: 12.5px; font-weight: 800; color: var(--tier); }
.club-tier-card .ct-min { font-size: 11px; color: var(--c-muted); line-height: 1.8; }
.club-tier-card .ct-mine {
  position: absolute; top: -9px; inset-inline-start: 50%; transform: translateX(50%);
  background: var(--tier); color: #fff; font-size: 10px; font-weight: 800;
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}

.club-board .cb-rank {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
  background: var(--c-soft); font-size: 12.5px; font-weight: 800; color: var(--c-muted);
}
.club-board .cb-rank.rank-1 { background: #C8A24A; color: #fff; }
.club-board .cb-rank.rank-2 { background: #9AA0A6; color: #fff; }
.club-board .cb-rank.rank-3 { background: #B87333; color: #fff; }
.club-board tr.is-me td { background: color-mix(in srgb, var(--c-primary) 7%, transparent); }

@media (max-width: 700px) {
  .club-hero { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .club-hero .ch-info { text-align: center; }
  .ch-title { font-size: 21px; }
  .ch-next-top { justify-content: center; }
}

