/* ============================================================
   SINOX API — CHROME.CSS
   استایل هدر، منوی کشویی «مدل‌ها»، کشوی موبایل، فوتر و دکمه‌ی
   شناور پشتیبانی — اجزای مشترک همه‌ی صفحات. تزریق‌شده توسط chrome.js.
   وابسته به tokens.css / base.css / components.css.
   ============================================================ */

/* ================= هدر ================= */
.sx-header {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: rgba(7, 7, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(30, 30, 58, 0.9);
  transition: background var(--dur-base) var(--ease-standard),
              backdrop-filter var(--dur-base) var(--ease-standard),
              box-shadow var(--dur-base) var(--ease-standard),
              border-color var(--dur-base) var(--ease-standard);
}
.sx-header.is-scrolled {
  background: rgba(5, 5, 11, 0.88);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom-color: var(--border-1);
  box-shadow: var(--shadow-sticky);
}
.sx-header-inner {
  max-width: var(--container-w-wide);
  margin-inline: auto;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--space-10);
}
@media (max-width: 900px) {
  .sx-header-inner { height: var(--nav-h-mobile); padding-inline: var(--space-4); }
}

.sx-header-start { display: flex; align-items: center; gap: var(--space-8); min-width: 0; }

.sx-brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.sx-brand-mark {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  /* لوگوی واقعی PNG شفاف است — حباب گرادیانی قبلی حذف شد */
  background: none;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: #fff;
}
.sx-brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
@media (max-width: 900px) { .sx-brand-mark { width: 40px; height: 40px; } }
.sx-brand-word { font-size: 18px; font-weight: var(--fw-black); letter-spacing: -0.01em; direction: ltr; color: var(--text-1); white-space: nowrap; }
@media (max-width: 900px) { .sx-brand-word { font-size: 16px; } }

.sx-nav { display: flex; align-items: center; gap: var(--space-7); height: var(--nav-h); }
@media (max-width: 1100px) { .sx-nav { display: none; } }

.sx-nav-link {
  position: relative;
  height: var(--nav-h);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  white-space: nowrap;
}
.sx-nav-link:hover { color: var(--text-1); }
.sx-nav-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 0; }
.sx-nav-link[aria-current="page"] { color: var(--text-1); }
.sx-nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-brand-reverse);
}
.sx-nav-link-status .sx-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: sx-dot-blink 2.4s ease-in-out infinite; flex-shrink: 0; }
@keyframes sx-dot-blink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .sx-nav-link-status .sx-status-dot { animation: none; } }

.sx-nav-item { position: relative; }
.sx-nav-trigger { background: none; border: none; font-family: inherit; cursor: pointer; }
.sx-nav-trigger .sx-chevron { transition: transform var(--dur-base) var(--ease-standard); color: currentColor; }
.sx-nav-trigger[aria-expanded="true"] .sx-chevron { transform: rotate(180deg); }

.sx-dropdown-panel {
  position: absolute;
  top: 100%;
  inset-inline-start: 50%;
  transform: translateX(50%);
  margin-top: 14px;
  width: 880px;
  max-width: 88vw;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-2xl);
  background: var(--elev-3);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  z-index: var(--z-nav);
}
.sx-dropdown-panel[hidden] { display: none; }
.sx-dropdown-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.sx-dropdown-col { padding: var(--space-6); border-inline-start: 1px solid var(--border-2); }
.sx-dropdown-col:first-child { border-inline-start: none; }
.sx-dropdown-col-title { display: flex; align-items: center; gap: 8px; margin-bottom: var(--space-4); font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--text-muted); letter-spacing: .04em; }
.sx-dropdown-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-radius: 9px; font-family: var(--font-mono); font-size: var(--fs-sm); direction: ltr; color: var(--text-1); }
.sx-dropdown-row:hover { background: var(--elev-4); }
.sx-dropdown-more { padding: 10px; font-size: var(--fs-sm); color: var(--text-muted); }
.sx-dropdown-cta {
  padding: var(--space-6);
  background: linear-gradient(200deg, rgba(99, 102, 241, .12), rgba(6, 182, 212, .07));
  display: flex; flex-direction: column; justify-content: space-between;
}
.sx-dropdown-cta-title { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; font-size: var(--fs-md); font-weight: var(--fw-extrabold); }
.sx-dropdown-cta-desc { font-size: var(--fs-sm); line-height: var(--lh-relaxed); color: var(--text-muted); }
.sx-dropdown-cta-link { display: flex; align-items: center; gap: 7px; margin-top: var(--space-5); font-size: var(--fs-base); font-weight: var(--fw-bold); color: var(--primary-light); }

.sx-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
@media (max-width: 1100px) { .sx-header-actions { display: none; } }

/* هدر — نسخه‌ی مینیمال صفحات ورود/ثبت‌نام */
.sx-header.is-minimal .sx-header-inner { justify-content: space-between; }
.sx-header-back { display: flex; align-items: center; gap: 7px; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-muted); }
.sx-header-back:hover { color: var(--text-1); }

/* ================= همبرگر موبایل ================= */
.sx-hamburger {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  background: var(--elev-1);
  color: var(--text-1);
  flex-shrink: 0;
}
@media (max-width: 1100px) {
  .sx-hamburger { display: flex; }
  /* موبایل/تبلت: لوگو و نام سایت سمت چپ، دکمهٔ همبرگری سمت راست.
     در RTL فرزند اول راست می‌افتد؛ row-reverse ترتیب دیداری را برمی‌گرداند. */
  .sx-header:not(.is-minimal) .sx-header-inner { flex-direction: row-reverse; }
  /* داخل برند هم: لوگو بیرونی‌ترین المان سمت چپ، متن کنارش */
  .sx-header:not(.is-minimal) .sx-brand { flex-direction: row-reverse; }
}
.sx-hamburger:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sx-hamburger-icon { position: relative; width: 18px; height: 13px; }
.sx-hamburger-icon span {
  position: absolute; inset-inline: 0; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform var(--dur-base) var(--ease-standard), opacity var(--dur-base) var(--ease-standard), top var(--dur-base) var(--ease-standard);
}
.sx-hamburger-icon span:nth-child(1) { top: 0; }
.sx-hamburger-icon span:nth-child(2) { top: 5.5px; }
.sx-hamburger-icon span:nth-child(3) { top: 11px; }
.sx-hamburger[aria-expanded="true"] .sx-hamburger-icon span:nth-child(1) { top: 5.5px; transform: rotate(45deg); }
.sx-hamburger[aria-expanded="true"] .sx-hamburger-icon span:nth-child(2) { opacity: 0; }
.sx-hamburger[aria-expanded="true"] .sx-hamburger-icon span:nth-child(3) { top: 5.5px; transform: rotate(-45deg); }

/* ================= کشوی موبایل ================= */
.sx-drawer-backdrop {
  position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1);
  background: rgba(4, 4, 10, 0.62);
  backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-standard);
}
.sx-drawer-backdrop.show { opacity: 1; pointer-events: auto; }

.sx-drawer {
  position: fixed;
  top: 0; bottom: 0;
  inset-inline-start: 0;
  width: min(var(--drawer-w), 86vw);
  z-index: var(--z-drawer);
  background: var(--elev-1);
  border-inline-start: 1px solid var(--border-1);
  box-shadow: var(--shadow-drawer);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-standard);
}
.sx-drawer.open { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) { .sx-drawer { transition: none; } .sx-drawer-backdrop { transition: none; } }

.sx-drawer-head {
  height: var(--nav-h-mobile);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: var(--space-4);
  border-bottom: 1px solid var(--border-1);
}
.sx-drawer-close {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-2); border-radius: var(--radius-md);
  background: var(--elev-3); color: var(--text-1); flex-shrink: 0;
}
.sx-drawer-close:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.sx-drawer-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sx-drawer-link {
  height: 52px; flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding-inline: 12px;
  border-radius: var(--radius-md);
  font-size: var(--fs-md); font-weight: var(--fw-semibold);
  color: var(--text-muted);
}
.sx-drawer-link svg { flex-shrink: 0; color: var(--text-muted); }
.sx-drawer-link[aria-current="page"] { background: var(--primary-tint); color: var(--text-1); font-weight: var(--fw-bold); }
.sx-drawer-link[aria-current="page"] svg { color: var(--primary-light); }
.sx-drawer-link .sx-status-dot { margin-inline-start: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.sx-drawer-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.sx-drawer-foot {
  margin-top: auto; flex-shrink: 0;
  padding: var(--space-4) var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-1);
  display: flex; flex-direction: column; gap: 10px;
}
.sx-drawer-foot-note { text-align: center; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }

/* ================= فوتر ================= */
.sx-footer {
  background: linear-gradient(180deg, var(--bg), #0a0a1a);
  border-top: 1px solid var(--border-1);
}
.sx-footer-inner { max-width: var(--container-w-wide); margin-inline: auto; padding: var(--space-16) var(--space-10) 0; }
@media (max-width: 900px) { .sx-footer-inner { padding: var(--space-8) var(--space-4) 0; } }

.sx-footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1.25fr 1fr; gap: var(--space-14); }
.sx-footer-grid > * { min-width: 0; }
@media (max-width: 900px) { .sx-footer-grid { display: block; } }

.sx-footer-brand-desc { margin-top: var(--space-4); max-width: 330px; font-size: var(--fs-md); line-height: var(--lh-snug); color: var(--text-muted); }
.sx-footer-status {
  margin-top: var(--space-5);
  display: flex; width: fit-content; align-items: center; gap: 10px;
  padding: 9px 16px; border-radius: var(--radius-full);
  border: 1px solid var(--green-border-tint);
  background: var(--green-tint);
}
.sx-footer-status .sx-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: sx-pulse-ring 2.2s infinite; }
.sx-footer-status span:last-child { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--green-light); }

.sx-footer-col-title { font-size: var(--fs-sm); font-weight: var(--fw-extrabold); color: var(--text-1); margin-bottom: var(--space-5); }
.sx-footer-links { display: flex; flex-direction: column; gap: 13px; font-size: var(--fs-base); }
.sx-footer-links a { color: var(--text-muted); }
.sx-footer-links a:hover { color: var(--text-1); }
.sx-footer-links.sx-footer-links-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 20px; }

@media (max-width: 900px) {
  .sx-footer-col + .sx-footer-col { border-top: 1px solid var(--border-1); }
  .sx-footer-col .sx-footer-col-title { margin-bottom: 0; }
  .sx-footer-col .accordion-trigger { padding-block: 13px; }
  .sx-footer-brand-desc { margin-top: var(--space-3); font-size: var(--fs-sm); }
  .sx-footer-status { margin-top: var(--space-3); padding: 7px 13px; }
  .sx-footer-links { padding-bottom: var(--space-3); gap: 10px; font-size: var(--fs-sm); }
  .sx-footer-links.sx-footer-links-2col { gap: 10px 16px; }
}
@media (min-width: 901px) {
  .sx-footer-col .accordion-trigger { pointer-events: none; cursor: default; }
  .sx-footer-col .accordion-trigger .chevron { display: none; }
  .sx-footer-col .accordion-panel { max-height: none !important; overflow: visible; }
}

.sx-footer-bottom {
  margin-top: var(--space-10);
  border-top: 1px solid var(--border-1);
  padding: var(--space-5) 0 var(--space-16);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap;
  font-size: var(--fs-sm); color: var(--text-muted);
}
.sx-footer-legal { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.sx-footer-legal a { color: var(--text-muted); }
.sx-footer-legal a:hover { color: var(--text-1); }
.sx-footer-legal-sep { color: var(--border-1); }
@media (max-width: 640px) {
  .sx-footer-bottom { flex-direction: column; align-items: center; text-align: center; padding-bottom: var(--space-12); gap: 14px; }
  .sx-footer-legal { justify-content: center; gap: 8px; }
  .sx-footer-legal-sep { display: none; }
  .sx-footer-legal a { padding: 7px 13px; border: 1px solid var(--border-1); border-radius: var(--radius-full); background: var(--elev-1); font-size: 12px; }
}

/* ================= دکمه‌ی شناور پشتیبانی ================= */
.sx-support-fab {
  position: fixed;
  bottom: var(--space-6);
  inset-inline-end: var(--space-6);
  z-index: 90;
  display: flex; align-items: center; gap: 9px;
  height: 48px; padding-inline: 20px;
  border-radius: var(--radius-full);
  background: var(--grad-brand);
  color: #fff;
  font-size: 14.5px; font-weight: var(--fw-bold);
  box-shadow: 0 14px 34px -12px rgba(99, 102, 241, .85);
}
.sx-support-fab:hover { filter: brightness(1.08); color: #fff; }
.sx-support-fab:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 640px) {
  .sx-support-fab { width: 52px; height: 52px; padding: 0; justify-content: center; bottom: var(--space-5); inset-inline-end: var(--space-4); }
  .sx-support-fab span { display: none; }
}

/* نماد اعتماد (هات‌فیکس ۴۵) */
.sx-enamad { display: flex; margin-top: 16px; padding: 8px; background: #fff; border-radius: 12px; line-height: 0; width: fit-content; }
.sx-enamad img { width: 90px; height: auto; display: block; }
