/* ==========================================================================
   Store index
   The catalogue for /store and /store/modules: a hero over the mesh, a sticky
   glass toolbar with the category switcher and search, the newest product as
   a spotlight, then glass cards whose whole surface is the link.

   Link rules are prefixed with body.blueva-theme where needed: store.css
   paints every link with the accent colour, which would otherwise win.
   ========================================================================== */

.sx [hidden],
.sx-toolbar [hidden] {
  display: none !important;
}

/* ----------------------------------------------------------------- hero -- */

.sx-hero {
  /* Runs up underneath the floating navbar, like the other page headers. */
  margin-top: calc(var(--navbar-height) * -1);
  padding: calc(var(--navbar-height) + 72px) 0 28px;
  text-align: center;
}

.sx-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: sx-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px 14px;
  border: 1px solid var(--theme-glass-border);
  border-radius: 999px;
  background: var(--theme-glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--theme-text-secondary);
  font-size: 0.8rem;
  font-weight: var(--font-semibold);
  letter-spacing: 0.04em;
}

.sx-eyebrow i {
  color: var(--theme-accent-primary);
}

.sx-hero__title {
  margin: 0 0 16px;
  color: var(--theme-text-primary);
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: var(--font-extrabold);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.sx-hero__lead {
  max-width: 620px;
  margin: 0 auto;
  color: var(--theme-text-secondary);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: var(--leading-relaxed);
}

.sx-hero__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  margin-top: 26px;
  color: var(--theme-text-secondary);
  font-size: 0.95rem;
}

.sx-hero__stats strong {
  color: var(--theme-text-primary);
  font-weight: var(--font-bold);
}

.sx-hero__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--theme-text-tertiary);
  opacity: 0.6;
}

body.blueva-theme .sx-hero__pass {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c4b5fd;
  font-weight: var(--font-semibold);
  text-decoration: none;
  transition: gap 0.2s ease, color 0.2s ease;
}

body.blueva-theme .sx-hero__pass:hover {
  gap: 10px;
  color: #ddd6fe;
}

.sx-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.blueva-pass-name {
  font-family: 'Viga', sans-serif;
  font-size: 1.08em;
}

/* -------------------------------------------------------------- toolbar -- */

/* A positioning wrapper only: the segmented control and search carry their
   own glass, so nothing smears a strip across the cards when it sticks. */
.sx-toolbar {
  position: sticky;
  top: var(--navbar-height);
  z-index: var(--z-sticky);
  padding: 14px 0;
}

.sx-toolbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.sx-toolbar .filter-btn {
  white-space: nowrap;
}

.sx-toolbar__form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sx-search,
.sx-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  color: var(--theme-text-tertiary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  animation: sx-rise 0.5s 0.05s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sx-search:focus-within,
.sx-select:focus-within {
  border-color: rgba(53, 182, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(53, 182, 255, 0.14), 0 12px 34px rgba(0, 0, 0, 0.28);
}

.sx-search {
  width: 260px;
}

.sx-search input,
.sx-select select {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--theme-text-primary);
  font: inherit;
  font-size: 0.92rem;
}

.sx-search input::placeholder {
  color: var(--theme-text-tertiary);
}

.sx-search input::-webkit-search-cancel-button {
  filter: grayscale(1);
  opacity: 0.6;
}

.sx-select {
  padding-right: 16px;
}

.sx-select select {
  padding-right: 22px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.sx-select select option {
  background: #0f172a;
  color: #fff;
}

.sx-select i {
  position: absolute;
  right: 16px;
  font-size: 0.75rem;
  pointer-events: none;
}

/* ------------------------------------------------------------ buttons -- */

body.blueva-theme .sx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0.7rem 1.35rem;
  border: 1px solid var(--theme-glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--theme-text-primary);
  font-size: 0.95rem;
  font-weight: var(--font-semibold);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease, gap 0.2s ease;
}

body.blueva-theme .sx-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--theme-text-primary);
  transform: translateY(-1px);
}

body.blueva-theme .sx-btn--primary,
body.blueva-theme .sx-btn--primary:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #35b6ff, #1567f5);
  color: #fff;
  box-shadow: 0 10px 26px rgba(21, 103, 245, 0.38);
}

body.blueva-theme .sx-btn--primary:hover {
  gap: 12px;
  box-shadow: 0 14px 32px rgba(21, 103, 245, 0.5);
}

body.blueva-theme .sx-btn--pass,
body.blueva-theme .sx-btn--pass:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #9333ea, #4f46e5, #2563eb);
  color: #fff;
  box-shadow: 0 10px 26px rgba(124, 58, 237, 0.4);
}

body.blueva-theme .sx-btn--pass:hover {
  gap: 12px;
  box-shadow: 0 14px 32px rgba(124, 58, 237, 0.55);
}

/* --------------------------------------------------------------- price -- */

.sx-price {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.sx-price strong {
  color: var(--theme-text-primary);
  font-size: 1.15rem;
  font-weight: var(--font-extrabold);
  letter-spacing: -0.01em;
}

.sx-price del {
  color: var(--theme-text-tertiary);
  font-size: 0.85rem;
  font-weight: var(--font-medium);
}

.sx-price--lg strong {
  font-size: 1.6rem;
}

.sx-price--lg del {
  font-size: 1rem;
}

.sx-sale {
  align-self: center;
  padding: 3px 9px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  font-size: 0.78rem;
  font-weight: var(--font-bold);
}

/* ------------------------------------------------------------ featured -- */

.sx {
  padding-top: 18px;
  padding-bottom: var(--space-16);
}

.sx-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  margin-bottom: 64px;
  padding: 22px;
  border: 1px solid var(--theme-glass-border);
  border-radius: 28px;
  background: var(--theme-glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  animation: sx-rise 0.6s 0.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sx-featured__art {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  isolation: isolate;
}

/* A blurred copy fills any space the art leaves, so no ratio looks boxed in. */
.sx-featured__art::before {
  content: "";
  position: absolute;
  inset: -30px;
  z-index: -1;
  background: var(--sx-art) center / cover no-repeat;
  filter: blur(34px) saturate(1.3);
  opacity: 0.55;
}

.sx-featured__art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sx-featured__art--video {
  display: block;
  background: #05070d;
}

.sx-featured__art--video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.sx-featured:hover .sx-featured__art--video video {
  transform: scale(1.03);
}

.sx-featured__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.12) 45%, rgba(0, 0, 0, 0.55) 100%);
}

.sx-featured__art img.sx-featured__logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(62%, 26rem);
  height: auto;
  object-fit: contain;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.45));
}

.sx-featured__copy {
  padding: 8px 18px 8px 0;
}

.sx-featured__label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(53, 182, 255, 0.14);
  color: #7dd3fc;
  font-size: 0.78rem;
  font-weight: var(--font-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sx-featured__title {
  margin: 0 0 12px;
  color: var(--theme-text-primary);
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  font-weight: var(--font-extrabold);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.sx-featured__lead {
  margin: 0 0 26px;
  color: var(--theme-text-secondary);
  font-size: 1.05rem;
  line-height: var(--leading-relaxed);
}

.sx-featured__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
}

/* ------------------------------------------------------------ sections -- */

.sx-section {
  margin-bottom: 64px;
}

.sx-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.sx-section__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 6px;
  color: var(--theme-text-primary);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: var(--font-extrabold);
  letter-spacing: -0.02em;
}

.sx-count {
  padding: 3px 10px;
  border: 1px solid var(--theme-glass-border);
  border-radius: 999px;
  background: var(--theme-glass-bg);
  color: var(--theme-text-secondary);
  font-size: 0.8rem;
  font-weight: var(--font-bold);
  letter-spacing: 0;
}

.sx-section__subtitle {
  margin: 0;
  color: var(--theme-text-secondary);
}

.sx-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

/* ---------------------------------------------------------------- card -- */

.sx-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--theme-glass-border);
  border-radius: 22px;
  background: var(--theme-glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  animation: sx-rise 0.55s calc(0.12s + min(var(--sx-i, 0), 8) * 0.05s) cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sx-card:hover {
  border-color: rgba(53, 182, 255, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(53, 182, 255, 0.15), 0 20px 60px -20px rgba(21, 103, 245, 0.45);
  transform: translateY(-6px);
}

.sx-card:focus-within {
  border-color: rgba(53, 182, 255, 0.6);
}

.sx-card__art {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.sx-card__art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.sx-card:hover .sx-card__art img {
  transform: scale(1.05);
}

/* Fades the art into the card body instead of a hard edge. */
.sx-card__art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(to bottom, transparent, rgba(8, 12, 24, 0.45));
  pointer-events: none;
}

.sx-card__fallback {
  display: grid;
  place-items: center;
  height: 100%;
  background: linear-gradient(135deg, rgba(53, 182, 255, 0.25), rgba(21, 103, 245, 0.35));
  color: #fff;
  font-size: 2.4rem;
  font-weight: var(--font-extrabold);
}

.sx-card__version,
.sx-card__sale {
  position: absolute;
  top: 12px;
  z-index: 1;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: var(--font-bold);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sx-card__version {
  left: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 12, 24, 0.55);
  color: #fff;
  font-family: var(--font-mono);
}

.sx-card__sale {
  right: 12px;
  background: rgba(22, 163, 74, 0.9);
  color: #fff;
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35);
}

.sx-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
}

.sx-card__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: var(--font-bold);
  line-height: 1.25;
}

body.blueva-theme .sx-card__link {
  color: var(--theme-text-primary);
  text-decoration: none;
  outline: 0;
}

/* The title link stretches over the whole card, so any spot opens it while
   the markup keeps a single, well-named link. */
.sx-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}

.sx-card__desc {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--theme-text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.sx-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.sx-card__stat,
.sx-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--theme-text-tertiary);
  font-size: 0.8rem;
  font-weight: var(--font-semibold);
}

.sx-card__tag {
  padding: 3px 9px;
  border: 1px solid var(--theme-glass-border);
  border-radius: 999px;
}

.sx-card__go {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: auto;
  border: 1px solid var(--theme-glass-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--theme-text-primary);
  font-size: 0.85rem;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.sx-card:hover .sx-card__go {
  border-color: transparent;
  background: linear-gradient(135deg, #35b6ff, #1567f5);
  color: #fff;
  transform: translateX(3px);
}

/* --------------------------------------------------------- empty, pass -- */

.sx-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-bottom: 64px;
  padding: 56px 20px;
  border: 1px dashed var(--theme-glass-border);
  border-radius: 22px;
  text-align: center;
}

.sx-empty i {
  margin-bottom: 8px;
  color: var(--theme-text-tertiary);
  font-size: 1.8rem;
}

.sx-empty h3 {
  margin: 0;
  color: var(--theme-text-primary);
}

.sx-empty p {
  margin: 0;
  color: var(--theme-text-secondary);
}

.sx-pass {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  padding: 36px 40px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 28px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(147, 51, 234, 0.28), transparent 60%),
    radial-gradient(120% 140% at 100% 100%, rgba(37, 99, 235, 0.28), transparent 60%),
    var(--theme-glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.sx-pass__copy {
  max-width: 620px;
}

.sx-pass__copy .blueva-pass-name {
  color: #c4b5fd;
  font-size: 1.1rem;
}

.sx-pass__copy h2 {
  margin: 6px 0 8px;
  color: var(--theme-text-primary);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: var(--font-extrabold);
  letter-spacing: -0.02em;
}

.sx-pass__copy p {
  margin: 0;
  color: var(--theme-text-secondary);
}

@keyframes sx-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------------- light mode -- */

:root[data-theme="light"] .sx-search,
:root[data-theme="light"] .sx-select {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .sx-select select option {
  background: #fff;
  color: #0f172a;
}

:root[data-theme="light"] body.blueva-theme .sx-btn,
:root[data-theme="light"] .sx-card__go {
  background: rgba(15, 23, 42, 0.04);
}

:root[data-theme="light"] body.blueva-theme .sx-btn--primary {
  background: linear-gradient(135deg, #35b6ff, #1567f5);
}

:root[data-theme="light"] body.blueva-theme .sx-btn--pass {
  background: linear-gradient(135deg, #9333ea, #4f46e5, #2563eb);
}

:root[data-theme="light"] .sx-card,
:root[data-theme="light"] .sx-featured {
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .sx-card:hover {
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(53, 182, 255, 0.2);
}

:root[data-theme="light"] body.blueva-theme .sx-hero__pass,
:root[data-theme="light"] .sx-pass__copy .blueva-pass-name {
  color: #7c3aed;
}

:root[data-theme="light"] .sx-featured__label {
  color: #0369a1;
}

:root[data-theme="light"] .sx-card__art::after {
  display: none;
}

/* ------------------------------------------------------------ responsive -- */

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

@media (max-width: 900px) {
  .sx-featured {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .sx-featured__copy {
    padding: 0 6px 6px;
  }
}

@media (max-width: 640px) {
  .sx-hero {
    padding-top: calc(var(--navbar-height) + 40px);
  }

  .sx-toolbar {
    position: static;
  }

  .sx-toolbar__inner,
  .sx-toolbar__form,
  .sx-toolbar .filter-group {
    width: 100%;
  }

  .sx-toolbar .filter-btn {
    flex: 1 1 auto;
    padding-inline: 0.8rem;
  }

  .sx-hero__dot {
    display: none;
  }

  .sx-hero__stats {
    column-gap: 18px;
  }

  .sx-search,
  .sx-select {
    width: 100%;
  }

  .sx-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sx-featured {
    padding: 14px;
    border-radius: 22px;
  }

  .sx-pass {
    padding: 26px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sx-hero__inner,
  .sx-search,
  .sx-select,
  .sx-featured,
  .sx-card {
    animation: none;
  }

  .sx-card,
  .sx-card__art img,
  .sx-card__go {
    transition: none;
  }

  .sx-card:hover,
  .sx-card:hover .sx-card__art img,
  .sx-card:hover .sx-card__go,
  .sx-featured:hover .sx-featured__art--video video {
    transform: none;
  }
}
