/* ════════════════════════════════════════════════════════════════════════
   NeuroArsho — Landing page + storefront navigation
   (loaded by every page that uses _CatalogLayout)
   ──────────────────────────────────────────────────────────────────────── */
:where(a, button, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--nm-cyan);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── Ambient glows ──────────────────────────────────────────────────────
   On the storefront these two circles live on <body> (not inside an
   overflow:hidden shell like the panel), so their fixed 520px/460px sizes
   stuck out past a 360–414px viewport and created a horizontal scrollable
   area. That is exactly the sideways "shake" the installed PWA showed on
   / and /catalog. Keep them inside the viewport at every width. */
.nm-glow--cyan   { width: min(520px, 92vw); height: min(520px, 92vw); }
.nm-glow--violet { width: min(460px, 84vw); height: min(460px, 84vw); }

/* ── Hero (neuroscience visual plane) ──────────────────────────────────── */
.nh-hero {
  position: relative; text-align: center; padding: 48px 16px 40px;
  overflow: hidden; isolation: isolate;
}
.nh-hero__art {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  display: grid; place-items: center; opacity: 0.9;
}
.nh-hero__svg {
  width: min(920px, 118%); height: auto; max-height: 420px;
  transform: translateY(-6%);
}
.nh-hero__wave--a { animation: nh-wave 7.5s ease-in-out infinite; }
.nh-hero__wave--b { animation: nh-wave 9s ease-in-out infinite reverse; }
.nh-hero__wave--c { animation: nh-wave 11s ease-in-out infinite; }
.nh-hero__net { animation: nh-pulse 5.5s ease-in-out infinite; transform-origin: 320px 200px; }
@keyframes nh-wave {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-6px); opacity: 1; }
}
@keyframes nh-pulse {
  0%, 100% { opacity: 0.88; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.015); }
}
.nh-hero__inner {
  position: relative; z-index: 1;
  max-width: 820px; margin: 0 auto; display: grid; justify-items: center; gap: 16px;
}
.nh-hero__title {
  margin: 0; font-size: clamp(1.75rem, 4.6vw, 2.85rem); font-weight: 800; line-height: 1.7;
  background: linear-gradient(100deg, #EAF7FF 10%, #19D3F3 48%, #8EB0FF 88%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  max-width: 18ch;
}
.nh-hero__en {
  margin: 0; font-family: Inter, system-ui, sans-serif; font-size: clamp(0.82rem, 1.8vw, 1rem);
  font-weight: 600; letter-spacing: 0.02em; color: var(--nm-cyan-soft); opacity: 0.92; line-height: 1.6;
}
.nh-hero__sub { max-width: 640px; margin: 0; font-size: 1rem; color: var(--nm-muted); line-height: 2.2; }
.nh-hero__ctas { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.nh-btn { width: auto; padding: 13px 30px; font-size: 0.95rem; text-decoration: none; }
.nh-hero__stats {
  display: flex; gap: 34px; flex-wrap: wrap; justify-content: center; margin-top: 28px;
  padding-top: 24px; border-top: 1px solid var(--nm-border); width: 100%;
}
.nh-stat { display: grid; justify-items: center; gap: 4px; }
.nh-stat b { font-size: 1.5rem; font-weight: 800; color: var(--nm-cyan-soft); }
.nh-stat span { font-size: 0.78rem; color: var(--nm-muted); }
@media (max-width: 640px) {
  .nh-hero { padding-top: 36px; }
  .nh-hero__svg { max-height: 280px; opacity: 0.75; }
  .nh-hero__stats { gap: 18px; }
}

/* ── Shared section scaffolding ────────────────────────────────────────── */
.nh-sec { margin-top: 46px; }
.nh-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.nh-head__eyebrow { margin: 0 0 6px; font-size: 0.72rem; font-weight: 700; color: var(--nm-cyan); letter-spacing: 0.12em; }
.nh-head__title { margin: 0; font-size: 1.45rem; font-weight: 800; }
.nh-head__sub { margin: 4px 0 0; font-size: 0.84rem; color: var(--nm-muted); }
.nh-head__more { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700; color: var(--nm-cyan-soft); text-decoration: none; }
.nh-head__more svg { width: 15px; height: 15px; }
.nh-head__more:hover { color: var(--nm-cyan); }

/* ── Category chips ────────────────────────────────────────────────────── */
.nh-cats { display: flex; flex-wrap: wrap; gap: 10px; }
.nh-cat {
  display: inline-flex; align-items: center; gap: 10px; padding: 11px 16px;
  background: var(--nm-card); border: 1px solid var(--nm-border); border-radius: 14px;
  text-decoration: none; transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.nh-cat:hover { border-color: var(--nm-cyan-border); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); }
.nh-cat__name { font-size: 0.9rem; font-weight: 700; color: var(--nm-text); }
.nh-cat__count {
  font-size: 0.72rem; color: var(--nm-cyan-soft); background: rgba(0, 212, 255, 0.08);
  border: 1px solid var(--nm-cyan-border); padding: 2px 9px; border-radius: 999px;
}

/* ── Continue reading ──────────────────────────────────────────────────── */
.nh-continue { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.nh-continue__card {
  display: flex; gap: 14px; align-items: center; padding: 12px;
  background: var(--nm-card); border: 1px solid var(--nm-border); border-radius: 16px;
  text-decoration: none; transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.nh-continue__card:hover { border-color: var(--nm-cyan-border); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4); }
.nh-continue__art { width: 72px; height: 94px; flex-shrink: 0; border-radius: 10px; background: rgba(0, 212, 255, 0.06) center/cover no-repeat; }
.nh-continue__body { display: grid; gap: 3px; min-width: 0; }
.nh-continue__kind { font-size: 0.64rem; font-weight: 700; color: var(--nm-muted); }
.nh-continue__title { font-size: 0.88rem; font-weight: 800; color: var(--nm-text); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nh-continue__author { font-size: 0.72rem; color: var(--nm-muted); }
.nh-continue__pct { margin-top: 4px; font-size: 0.68rem; font-weight: 700; color: var(--nm-cyan-soft); }
.nh-continue__bar { display: block; height: 5px; margin-top: 2px; border-radius: 999px; background: rgba(0, 212, 255, 0.12); overflow: hidden; }
.nh-continue__bar i { display: block; height: 100%; border-radius: 999px; background: var(--nm-gradient, linear-gradient(135deg, #19D3F3 0%, #3B6BFF 100%)); }
.nh-continue__cta {
  justify-self: start; margin-top: 6px; font-size: 0.7rem; font-weight: 700; color: var(--nm-cyan-soft);
  border: 1px solid var(--nm-cyan-border); background: rgba(0, 212, 255, 0.08);
  padding: 6px 12px; border-radius: 999px;
}

/* ── Card grid CTA row ─────────────────────────────────────────────────── */
.nc-card__go { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 0.76rem; font-weight: 700; color: var(--nm-cyan-soft); }
.nc-card__go svg { width: 15px; height: 15px; }

/* ── Why NeuroArsho ─────────────────────────────────────────────────── */
.nh-why { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 16px; }
.nh-why__card { display: grid; gap: 10px; padding: 22px 20px; background: var(--nm-card); border: 1px solid var(--nm-border); border-radius: 18px; }
.nh-why__icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(0, 212, 255, 0.1); color: var(--nm-cyan-soft); }
.nh-why__icon svg { width: 24px; height: 24px; }
.nh-why__title { font-size: 1rem; font-weight: 800; }
.nh-why__text { margin: 0; font-size: 0.82rem; color: var(--nm-muted); line-height: 1.9; }

/* ── Final CTA band ────────────────────────────────────────────────────── */
.nh-cta {
  margin-top: 52px; border-radius: 22px; padding: 44px 24px; text-align: center;
  background: linear-gradient(120deg, rgba(0, 212, 255, 0.16), rgba(59, 107, 255, 0.16));
  border: 1px solid var(--nm-cyan-border);
}
.nh-cta__title { margin: 0 0 8px; font-size: clamp(1.3rem, 3.4vw, 1.8rem); font-weight: 800; }
.nh-cta__text { margin: 0 auto 22px; max-width: 560px; color: var(--nm-muted); font-size: 0.92rem; line-height: 2; }
.nh-cta__btn { width: auto; padding: 13px 34px; text-decoration: none; }

/* ── Mobile storefront navigation ──────────────────────────────────────── */
.nm-nav__burger {
  display: none; align-items: center; justify-content: center; width: 42px; height: 42px;
  border: 1px solid var(--nm-border); background: var(--nm-card); color: var(--nm-text);
  border-radius: 12px; cursor: pointer; padding: 0;
}
.nm-nav__burger svg { width: 20px; height: 20px; }

.nm-nav-mobile {
  position: fixed; top: 0; bottom: 0; right: 0; width: min(330px, 86%); z-index: 60;
  display: flex; flex-direction: column; background: rgba(5, 11, 24, 0.98);
  border-left: 1px solid var(--nm-border); box-shadow: -18px 0 44px rgba(0, 0, 0, 0.5);
  transform: translateX(105%); visibility: hidden;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.26s;
}
.nm-cat-nav-open .nm-nav-mobile { transform: none; visibility: visible; }

.nm-nav-mobile__head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--nm-border); }
.nm-nav-mobile__head b { font-size: 0.95rem; font-weight: 800; }
.nm-nav-mobile__links { display: flex; flex-direction: column; gap: 4px; padding: 14px; overflow-y: auto; flex: 1; }
.nm-nav-mobile__link {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
  color: var(--nm-muted); text-decoration: none; font-size: 0.9rem; font-weight: 600;
}
.nm-nav-mobile__link svg { width: 19px; height: 19px; }
.nm-nav-mobile__link:hover { color: var(--nm-text); background: rgba(0, 212, 255, 0.06); }
.nm-nav-mobile__link.is-active {
  color: var(--nm-cyan-soft); background: linear-gradient(90deg, rgba(0, 212, 255, 0.14), rgba(59, 107, 255, 0.08));
}
.nm-nav-mobile__bottom { display: grid; gap: 10px; padding: 14px; border-top: 1px solid var(--nm-border); }
.nm-nav-mobile__account {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 14px;
  border-radius: 999px; background: var(--nm-gradient); color: #fff; font-weight: 700;
  font-size: 0.86rem; text-decoration: none;
}
.nm-nav-mobile__cart {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 14px; color: var(--nm-muted);
  text-decoration: none; font-size: 0.84rem; border: 1px solid var(--nm-border); border-radius: 999px;
}
/* These two buttons carry an inline PanelIcons SVG (viewBox only, no intrinsic
   size) — without an explicit size the browser inflates it to ~150–210px.
   19px matches .nm-nav-mobile__link so the whole drawer stays on one rhythm. */
.nm-nav-mobile__account svg,
.nm-nav-mobile__cart svg { width: 19px; height: 19px; flex-shrink: 0; }
.nm-nav-mobile__backdrop {
  position: fixed; inset: 0; z-index: 55; background: rgba(2, 6, 14, 0.6);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity 0.26s, visibility 0.26s;
}
.nm-cat-nav-open .nm-nav-mobile__backdrop { opacity: 1; visibility: visible; }

/* ── Account dropdown (authenticated header) ───────────────────────────── */
.nm-account { position: relative; }
.nm-account summary { list-style: none; cursor: pointer; }
.nm-account summary::-webkit-details-marker { display: none; }
.nm-account__menu {
  position: absolute; top: calc(100% + 10px); left: 0; width: 215px; padding: 8px;
  background: rgba(8, 18, 36, 0.98); border: 1px solid var(--nm-border); border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); display: grid; gap: 2px; z-index: 40;
}
.nm-account__menu a,
.nm-account__menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 12px; text-align: right;
  border: none; background: none; color: var(--nm-muted); font-family: inherit; font-size: 0.84rem;
  font-weight: 600; border-radius: 10px; text-decoration: none; cursor: pointer;
}
.nm-account__menu a:hover,
.nm-account__menu button:hover { background: rgba(0, 212, 255, 0.08); color: var(--nm-text); }
.nm-account__menu svg { width: 17px; height: 17px; }
.nm-account__menu .is-danger { color: var(--nm-danger-text); }
.nm-account__menu .is-danger:hover { background: rgba(255, 90, 118, 0.1); color: var(--nm-danger-text); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.nc-foot__grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 26px; text-align: right;
  max-width: 1200px; margin: 0 auto 20px; padding: 0 24px;
}
.nc-foot__brand b { font-size: 0.98rem; }
.nc-foot__brand p { margin: 8px 0 0; font-size: 0.78rem; color: var(--nm-muted); line-height: 2; max-width: 320px; }
.nc-foot__col { display: grid; gap: 8px; align-content: start; }
.nc-foot__col b { font-size: 0.82rem; color: var(--nm-text); }
.nc-foot__col a { font-size: 0.78rem; color: var(--nm-muted); text-decoration: none; transition: color 0.18s; }
.nc-foot__col a:hover { color: var(--nm-cyan-soft); }
.nc-foot__copy { display: block; text-align: center; font-size: 0.74rem; }
.nc-foot__trust {
  display: flex; justify-content: center; padding: 8px 24px 18px;
}
.nc-foot__trust .nh-trust__link { gap: 8px; }
.nc-foot__trust .nh-trust__img { height: 80px; max-height: 80px; }

/* ── E-namad trust seal ────────────────────────────────────────────────── */
.nh-trust {
  display: grid; justify-items: center; gap: 14px;
  max-width: 1200px; margin: 46px auto 0; padding: 26px 20px;
  background: var(--nm-card); border: 1px solid var(--nm-border); border-radius: 18px;
  text-align: center;
}
.nh-trust__title {
  margin: 0; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.12em; color: var(--nm-cyan);
}
.nh-trust__link {
  display: grid; justify-items: center; gap: 10px;
  text-decoration: none; color: inherit;
}
/* Fixed height: the badge is loading="lazy" with no intrinsic size, so it
   used to reserve 0×0 and jump to its real size near the bottom of the home
   page — a visible layout shift while scrolling. */
.nh-trust__img { height: 96px; max-height: 96px; width: auto; border-radius: 8px; }
.nh-trust__badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 14px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px dashed var(--nm-cyan-border);
  color: var(--nm-cyan-soft); font-size: 0.95rem; font-weight: 700;
  transition: border-color 0.18s, background 0.18s;
}
.nh-trust__badge svg { width: 26px; height: 26px; }
.nh-trust__hint { font-size: 0.76rem; color: var(--nm-muted); }
.nh-trust__link:hover .nh-trust__badge {
  border-color: var(--nm-cyan); background: rgba(0, 212, 255, 0.14);
}
.nh-trust__link:hover .nh-trust__img { opacity: 0.9; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nm-nav__burger { display: inline-flex; }
  .nh-hero { padding: 44px 8px 28px; }
  .nh-head { align-items: flex-start; }

  /* App-style top bar: the bottom tab bar already carries خانه/فروشگاه/
     سبد خرید/ورود, so the header only needs the brand, the two icon
     buttons and the burger. The desktop tagline pill + full account label
     pushed the header past the viewport and cut the burger off-screen. */
  .nm-nav__inner { gap: 10px; padding: 11px 14px; }
  .nm-nav__tag { display: none; }
  .nm-nav__brand { min-width: 0; }
  .nm-nav__brand b { white-space: nowrap; }
  .nm-nav__account-group { gap: 8px; }
  .nm-nav__account span,
  .nm-nav__cart span { display: none; }
  .nm-nav__account,
  .nm-nav__cart { padding: 9px 11px; }
}

@media (max-width: 560px) {
  .nh-hero__stats { gap: 16px; }
  .nh-cat { flex-wrap: wrap; }
  .nc-foot__grid { grid-template-columns: 1fr; gap: 18px; padding: 0 14px; }
  .nh-cta { padding: 34px 16px; }
  .nh-trust { padding: 20px 14px; }
  .nh-trust__badge { padding: 12px 18px; font-size: 0.88rem; }
}

/* ── Floating chat widget ──────────────────────────────────────────────── */
.np-chat {
  position: fixed; z-index: 80; left: max(16px, env(safe-area-inset-left));
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: grid; justify-items: start; gap: 10px;
}
body.has-tabbar .np-chat { bottom: calc(72px + env(safe-area-inset-bottom)); }
.np-chat__fab {
  width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--nm-cyan-border);
  background: linear-gradient(145deg, #19D3F3, #3B6BFF); color: #041018;
  box-shadow: 0 12px 28px rgba(25, 211, 243, 0.35); cursor: pointer;
  display: grid; place-items: center; transition: transform 0.18s, box-shadow 0.18s;
}
.np-chat__fab:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(59, 107, 255, 0.4); }
.np-chat.is-open .np-chat__fab { background: var(--nm-card); color: var(--nm-cyan-soft); }
.np-chat__panel {
  min-width: 188px; padding: 12px; border-radius: 16px;
  background: rgba(8, 14, 28, 0.96); border: 1px solid var(--nm-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); display: grid; gap: 8px;
}
.np-chat__label { margin: 0 0 2px; font-size: 0.72rem; color: var(--nm-muted); font-weight: 700; }
.np-chat__opt {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  text-decoration: none; font-weight: 700; font-size: 0.88rem; color: var(--nm-text);
  border: 1px solid var(--nm-border); background: rgba(255, 255, 255, 0.03);
}
.np-chat__opt--wa:hover { border-color: rgba(37, 211, 102, 0.55); color: #7dffb0; }
.np-chat__opt--tg:hover { border-color: rgba(34, 158, 217, 0.55); color: #7ad7ff; }
.np-chat__ico { display: grid; place-items: center; width: 28px; height: 28px; }

/* ── PWA install banner ────────────────────────────────────────────────── */
.np-pwa {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: end center;
  padding: 16px; padding-bottom: calc(18px + env(safe-area-inset-bottom));
  background: rgba(2, 6, 16, 0.45); backdrop-filter: blur(4px);
}
body.has-tabbar .np-pwa { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
.np-pwa__card {
  position: relative; width: min(420px, 100%); padding: 22px 20px 18px;
  border-radius: 20px; background: linear-gradient(160deg, rgba(12, 22, 44, 0.98), rgba(8, 14, 28, 0.98));
  border: 1px solid var(--nm-cyan-border); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: np-pwa-in 0.35s ease-out;
}
@keyframes np-pwa-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.np-pwa__close {
  position: absolute; top: 10px; left: 12px; border: 0; background: transparent;
  color: var(--nm-muted); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.np-pwa__brand { margin: 0; font-size: 0.72rem; font-weight: 800; color: var(--nm-cyan); letter-spacing: 0.08em; }
.np-pwa__title { margin: 8px 0 6px; font-size: 1.15rem; font-weight: 800; }
.np-pwa__text { margin: 0 0 16px; font-size: 0.88rem; color: var(--nm-muted); line-height: 1.9; }
.np-pwa__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.np-pwa__install, .np-pwa__later { width: auto; padding: 11px 18px; font-size: 0.88rem; }
.np-pwa__ios { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--nm-border); }
.np-pwa__ios-title { margin: 0 0 8px; font-size: 0.82rem; font-weight: 700; color: var(--nm-cyan-soft); }
.np-pwa__ios-steps { margin: 0; padding-inline-start: 18px; font-size: 0.8rem; color: var(--nm-muted); line-height: 1.9; }

@media (prefers-reduced-motion: reduce) {
  .nm-nav-mobile, .nm-nav-mobile__backdrop,
  .nh-cat, .nh-continue__card, .nh-why__card, .nc-card { transition-duration: 0.001ms !important; }
  .nh-hero__wave--a, .nh-hero__wave--b, .nh-hero__wave--c, .nh-hero__net { animation: none !important; }
  .np-pwa__card { animation: none !important; }
}

/* No lift-on-hover on touch: :hover fires while scrolling on mobile. */
@media (hover: none) {
  .nh-cat:hover,
  .nh-continue__card:hover { transform: none; }
}