/* NEXORA-grade immersive showroom — cinematic glass + subtle matrix (v3) */

.sx-root {
  --sx-mx: #8b5cf6;
  --sx-mx-2: #67e8f9;
  --sx-mx-glow: rgba(139, 92, 246, 0.42);
  --sx-mx-cyan: rgba(103, 232, 249, 0.35);
  --sx-nav-w: min(240px, 44vw);
  --sx-header-h: 92px;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(109, 40, 217, 0.38), transparent 58%),
    radial-gradient(ellipse 50% 40% at 12% 88%, rgba(14, 116, 144, 0.22), transparent 55%),
    radial-gradient(ellipse 45% 35% at 92% 78%, rgba(236, 72, 153, 0.12), transparent 50%),
    #050508 !important;
}

.sx-root .sx-hall,
.sx-root .sx-hotspots,
.sx-root .sx-aisle,
.sx-root .sx-pod,
.sx-root .sx-shape,
.sx-root .sx-shape-face,
.sx-root .sx-card-ph {
  display: none !important;
}

/* Matrix backdrop — subtle, not garish */
.sx-root > .sx-matrix {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.sx-matrix-rain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0 22px,
      rgba(139, 92, 246, 0.04) 22px 23px,
      transparent 23px 44px,
      rgba(103, 232, 249, 0.03) 44px 45px
    ),
    repeating-linear-gradient(
      180deg,
      transparent 0 14px,
      rgba(139, 92, 246, 0.06) 14px 15px,
      transparent 15px 32px
    );
  background-size: 88px 100%, 100% 160px;
  animation: sx-mx-rain 18s linear infinite;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
}

.sx-matrix-glow {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 35%, rgba(139, 92, 246, 0.05) 50%, transparent 65%),
    radial-gradient(ellipse 55% 35% at 50% 100%, rgba(139, 92, 246, 0.14), transparent 72%);
  background-size: 100% 240%, 100% 100%;
  animation: sx-mx-scan 7s linear infinite;
  mix-blend-mode: screen;
  opacity: 0.65;
}

.sx-matrix-grid {
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: -2%;
  height: 42%;
  transform: perspective(820px) rotateX(64deg);
  transform-origin: center top;
  background:
    linear-gradient(180deg, transparent 0%, rgba(5, 5, 8, 0.82) 100%),
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(139, 92, 246, 0.14) 46px 47px),
    repeating-linear-gradient(0deg, transparent 0 46px, rgba(103, 232, 249, 0.08) 46px 47px);
  mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 28%, #000 100%);
  opacity: 0.55;
}

@keyframes sx-mx-rain {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 0, 0 160px; }
}

@keyframes sx-mx-scan {
  from { background-position: 0 -50%, 0 0; }
  to { background-position: 0 150%, 0 0; }
}

.sx-root > .sx-stage {
  z-index: 0 !important;
  opacity: 0.42;
  filter: saturate(0.75) hue-rotate(240deg) brightness(0.45);
}

/* Layout shell */
.sx-root > .sx-top {
  position: relative !important;
  top: auto !important;
  z-index: 30 !important;
  flex: 0 0 auto;
  margin: 14px 16px 0;
  width: auto;
}

.sx-root > .sx-nav {
  position: absolute !important;
  z-index: 25 !important;
  top: calc(var(--sx-header-h) + 10px) !important;
  left: 16px !important;
  bottom: 108px;
  width: var(--sx-nav-w) !important;
  max-height: calc(100dvh - var(--sx-header-h) - 130px);
  overflow: auto;
  border-color: rgba(139, 92, 246, 0.32) !important;
  box-shadow:
    0 0 32px rgba(139, 92, 246, 0.14),
    0 18px 48px rgba(0, 0, 0, 0.55) !important;
  scrollbar-width: thin;
}

.sx-root.is-rtl > .sx-nav {
  left: auto !important;
  right: 16px !important;
}

.sx-root > .sx-nav h2 {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.85);
  margin: 0 0 10px;
}

.sx-root > .sx-nav button {
  border-radius: 12px;
  margin-bottom: 4px;
  font-weight: 600;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.sx-root > .sx-nav button.is-active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.85), rgba(14, 116, 144, 0.75)) !important;
  box-shadow: 0 10px 28px var(--sx-mx-glow) !important;
}

.sx-root > .sx-gallery {
  position: relative !important;
  z-index: 12 !important;
  flex: 1 1 auto;
  min-height: 0;
  margin: 14px 16px 108px;
  padding-inline-start: calc(var(--sx-nav-w) + 18px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.sx-root.is-rtl > .sx-gallery {
  padding-inline-start: calc(var(--sx-nav-w) + 18px);
}

.sx-gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  margin-bottom: 18px;
  border-color: rgba(167, 139, 250, 0.28) !important;
}

.sx-gallery-kicker {
  margin: 0 0 5px;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  color: rgba(196, 181, 253, 0.75);
  font-weight: 800;
  text-transform: uppercase;
}

.sx-gallery-head h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2.6vw, 1.65rem);
  font-weight: 800;
  color: #faf5ff;
  text-shadow: 0 0 28px rgba(139, 92, 246, 0.35);
}

.sx-gallery-count {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  height: 46px;
  padding: 0 12px;
  border-radius: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #1e1035;
  background: linear-gradient(145deg, #c4b5fd, #67e8f9);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.45);
}

/* Product cards — studio glass vitrine */
.sx-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.sx-card {
  --hue: 270;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: start;
  border: 1px solid rgba(167, 139, 250, 0.28) !important;
  border-radius: 20px !important;
  padding: 0 !important;
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  background:
    linear-gradient(165deg, rgba(30, 22, 48, 0.72), rgba(8, 8, 14, 0.92)) !important;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.28s ease, border-color 0.28s ease;
  animation: sx-mx-card-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sx-gallery-grid .sx-card:nth-child(1) { animation-delay: 0.03s; }
.sx-gallery-grid .sx-card:nth-child(2) { animation-delay: 0.06s; }
.sx-gallery-grid .sx-card:nth-child(3) { animation-delay: 0.09s; }
.sx-gallery-grid .sx-card:nth-child(4) { animation-delay: 0.12s; }
.sx-gallery-grid .sx-card:nth-child(5) { animation-delay: 0.15s; }
.sx-gallery-grid .sx-card:nth-child(6) { animation-delay: 0.18s; }
.sx-gallery-grid .sx-card:nth-child(n + 7) { animation-delay: 0.21s; }

@keyframes sx-mx-card-in {
  from { opacity: 0; transform: translateY(22px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.sx-card:hover,
.sx-card.is-focus {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(103, 232, 249, 0.45) !important;
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.55),
    0 0 36px hsla(var(--hue), 85%, 55%, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.sx-card-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.1), transparent 42%, transparent 58%, rgba(103, 232, 249, 0.06));
  pointer-events: none;
  z-index: 4;
}

.sx-card-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  min-height: 168px;
  overflow: hidden;
  background: #07070f;
}

.sx-card-art {
  position: absolute;
  inset: 0;
  display: block;
}

.sx-card-art .sx-art,
.sx-card-art svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.sx-card-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.35));
  transition: opacity 0.25s;
}

.sx-card-photo.is-miss {
  opacity: 0;
  pointer-events: none;
}

.sx-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 10px;
  position: relative;
  z-index: 3;
}

.sx-card-body strong {
  font-size: 0.94rem;
  line-height: 1.35;
  color: #faf5ff;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sx-card-body em {
  font-style: normal;
  font-size: 1rem;
  font-weight: 800;
  color: #67e8f9;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 16px rgba(103, 232, 249, 0.25);
}

.sx-card-cta {
  display: block;
  margin-top: auto;
  padding: 11px 16px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
  background: linear-gradient(90deg, rgba(109, 40, 217, 0.95), rgba(14, 116, 144, 0.9));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sx-gallery-empty {
  margin: 24px 0 0;
  padding: 32px 22px;
  text-align: center;
  color: rgba(250, 245, 255, 0.88);
  border-color: rgba(167, 139, 250, 0.25) !important;
}

/* Product detail panel */
.sx-root > .sx-product {
  z-index: 50 !important;
  top: calc(var(--sx-header-h) + 8px) !important;
  bottom: 108px !important;
  max-height: calc(100dvh - var(--sx-header-h) - 120px);
  overflow: auto;
  width: min(320px, 92vw) !important;
  border-color: rgba(167, 139, 250, 0.35) !important;
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(139, 92, 246, 0.18) !important;
}

.sx-root.is-rtl > .sx-product {
  right: auto !important;
  left: 16px !important;
}

.sx-root.is-ltr > .sx-product {
  left: auto !important;
  right: 16px !important;
}

.sx-spin-stage {
  height: 200px !important;
  position: relative;
}

.sx-spin-art {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.sx-spin-art svg,
.sx-spin-art .sx-art {
  width: 100% !important;
  height: 100% !important;
}

.sx-spin-card {
  z-index: 2;
}

.sx-spin-card.is-miss {
  display: none !important;
}

.sx-root .sx-cta {
  background: linear-gradient(135deg, #7c3aed, #0e7490) !important;
  box-shadow: 0 10px 32px var(--sx-mx-glow) !important;
}

.sx-root .sx-brand-mark {
  background: linear-gradient(145deg, #8b5cf6, #0e7490) !important;
  box-shadow: 0 0 24px var(--sx-mx-glow) !important;
}

.sx-root .sx-search-hero {
  border-color: rgba(167, 139, 250, 0.32) !important;
}

/* Bottom dock */
.sx-root > .sx-dock {
  z-index: 45 !important;
  bottom: 18px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  padding: 8px 14px !important;
  gap: 6px !important;
  border-color: rgba(167, 139, 250, 0.35) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 28px rgba(139, 92, 246, 0.2) !important;
}

.sx-root > .sx-dock button {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.sx-root > .sx-dock button.is-on {
  background: rgba(139, 92, 246, 0.35) !important;
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.45);
}

/* Rail catalog */
.sx-rail-card {
  position: relative;
  overflow: hidden;
}

.sx-rail-art {
  display: block;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 6px;
}

.sx-rail-art svg {
  width: 100%;
  height: 100%;
}

.sx-rail-photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 4px;
  border-radius: 10px;
}

.sx-rail-photo.is-miss {
  display: none;
}

/* Chat FAB — edge dock, no overlap with grid center */
.sx-root > .sx-bot {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: min(380px, calc(100vw - 28px)) !important;
  pointer-events: none !important;
}

.sx-root > .sx-bot > * {
  pointer-events: auto !important;
}

.sx-root.is-rtl > .sx-bot {
  position: fixed !important;
  left: 16px !important;
  right: auto !important;
  bottom: 88px !important;
  z-index: 9999 !important;
  align-items: flex-start !important;
}

.sx-root.is-ltr > .sx-bot {
  position: fixed !important;
  right: 16px !important;
  left: auto !important;
  bottom: 88px !important;
  z-index: 9999 !important;
  align-items: flex-end !important;
}

.sx-root > .sx-bot .sx-bot-fab {
  width: 68px !important;
  height: 68px !important;
  border: 2px solid rgba(167, 139, 250, 0.55) !important;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.45), transparent 42%),
    linear-gradient(145deg, #c4b5fd, #8b5cf6 45%, #4c1d95) !important;
  box-shadow:
    0 14px 36px rgba(109, 40, 217, 0.55),
    0 0 0 8px rgba(139, 92, 246, 0.12),
    0 0 32px rgba(103, 232, 249, 0.28) !important;
  animation: sx-mx-fab-pulse 3s ease-in-out infinite !important;
}

@keyframes sx-mx-fab-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.sx-root > .sx-bot .sx-bot-hello {
  max-width: 220px !important;
  border-color: rgba(167, 139, 250, 0.35) !important;
  color: #faf5ff !important;
}

.sx-root > .sx-map,
.sx-root > .sx-rail {
  z-index: 48 !important;
}

/* Responsive */
@media (max-width: 900px) {
  .sx-root {
    --sx-nav-w: 0px;
  }

  .sx-root > .sx-nav {
    display: none !important;
  }

  .sx-root > .sx-gallery {
    padding-inline-start: 0 !important;
    margin-bottom: 118px;
  }

  .sx-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .sx-root > .sx-product {
    width: min(300px, 94vw) !important;
  }
}

@media (max-width: 560px) {
  .sx-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .sx-card-media {
    min-height: 130px;
  }

  .sx-root > .sx-bot {
    bottom: 82px !important;
    width: min(300px, calc(100vw - 20px)) !important;
  }

  .sx-root > .sx-bot .sx-bot-fab {
    width: 60px !important;
    height: 60px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sx-matrix-rain,
  .sx-matrix-glow,
  .sx-card,
  .sx-root > .sx-bot .sx-bot-fab {
    animation: none !important;
  }
}

/* Cart line art in immersive drawer */
.sf-root.sf-immersive .sf-line-art {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.28);
  background: #07070f;
}

.sf-root.sf-immersive .sf-line-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.sf-root.sf-immersive .sf-line-art-fallback {
  background: linear-gradient(145deg, rgba(109, 40, 217, 0.35), rgba(14, 116, 144, 0.25));
}

.sf-root.sf-immersive .sf-mono {
  display: none !important;
}

.sf-root.sf-immersive .sf-modal-art {
  width: 100%;
  min-height: 280px;
  border-radius: 14px;
  overflow: hidden;
  background: #07070f;
  border: 1px solid rgba(167, 139, 250, 0.25);
}

.sf-root.sf-immersive .sf-modal-art svg {
  width: 100%;
  height: auto;
  display: block;
}
