/* ══════════════════════════════════════════════════════════
   TST Slider — Curiosidades & Entendiendo el juego
   CSS-scroll-snap nativo, sin librerías externas.
   ══════════════════════════════════════════════════════════ */

/* ── Wrapper que envuelve grid + controles ── */
.tst-slider-wrap {
  position: relative;
}

/* ── El grid existente se convierte en scroll container ── */
.tst-juego-grid,
.tst-curio-grid {
  /* Slider: horizontal scroll */
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: var(--tst-gap-md);
  /* Quitar el clip del padre para que las flechas queden fuera */
  padding-bottom: 4px; /* evita que el box-shadow de las cards se corte */
}

.tst-juego-grid::-webkit-scrollbar,
.tst-curio-grid::-webkit-scrollbar { display: none; }

/* ── Cada card ocupa exactamente 1/3 del ancho en desktop ── */
.tst-juego-grid .tst-j-card,
.tst-curio-grid .tst-c-card {
  flex: 0 0 calc((100% - 2 * var(--tst-gap-md)) / 3);
  min-width: 0;
  scroll-snap-align: start;
}

/* ── Tablet: 2 cards visibles ── */
@media (max-width: 900px) {
  .tst-juego-grid .tst-j-card,
  .tst-curio-grid .tst-c-card {
    flex: 0 0 calc((100% - var(--tst-gap-md)) / 2);
  }
}

/* ── Mobile: 1.15 cards visibles (peek del siguiente) ── */
@media (max-width: 580px) {
  .tst-juego-grid,
  .tst-curio-grid {
    padding-right: 0 !important;
    /* Sangrar del padding del section para que el peek funcione */
    margin-left: calc(-1 * var(--tst-gap-lg));
    margin-right: calc(-1 * var(--tst-gap-lg));
    padding-left: var(--tst-gap-lg);
    padding-right: var(--tst-gap-lg);
  }
  .tst-juego-grid .tst-j-card,
  .tst-curio-grid .tst-c-card {
    flex: 0 0 82vw;
    max-width: 320px;
  }
}

@media (max-width: 480px) {
  .tst-juego-grid,
  .tst-curio-grid {
    margin-left: calc(-1 * var(--tst-gap-md));
    margin-right: calc(-1 * var(--tst-gap-md));
    padding-left: var(--tst-gap-md);
    padding-right: var(--tst-gap-md);
  }
  .tst-juego-grid .tst-j-card,
  .tst-curio-grid .tst-c-card {
    flex: 0 0 80vw;
  }
}

/* ══════════════════════════════════════════════════════════
   CONTROLES — Flechas + dots
   ══════════════════════════════════════════════════════════ */

.tst-slider-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* ── Botones prev/next ── */
.tst-slider-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tst-transition);
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

/* Juego: fondo blanco translúcido sobre azul */
.tst-sec-juego .tst-slider-btn {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.tst-sec-juego .tst-slider-btn:hover:not(:disabled) {
  background: rgba(225, 250, 89, 0.25);
  color: var(--tst-lime);
}
.tst-sec-juego .tst-slider-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

/* Curio: fondo azul translúcido sobre dorado */
.tst-sec-curio .tst-slider-btn {
  background: rgba(30, 58, 95, 0.12);
  color: var(--tst-brand-dark);
}
.tst-sec-curio .tst-slider-btn:hover:not(:disabled) {
  background: rgba(30, 58, 95, 0.22);
}
.tst-sec-curio .tst-slider-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.tst-slider-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

/* ── Dots de paginación ── */
.tst-slider-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
}

.tst-slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
  flex-shrink: 0;
}

/* Juego dots */
.tst-sec-juego .tst-slider-dot {
  background: rgba(255,255,255,0.25);
}
.tst-sec-juego .tst-slider-dot.is-active {
  background: var(--tst-lime);
  width: 18px;
  border-radius: 3px;
}

/* Curio dots */
.tst-sec-curio .tst-slider-dot {
  background: rgba(30,58,95,0.2);
}
.tst-sec-curio .tst-slider-dot.is-active {
  background: var(--tst-brand-dark);
  width: 18px;
  border-radius: 3px;
}

/* ── Ocultar controles en mobile (el swipe es suficiente) ── */
@media (max-width: 580px) {
  .tst-slider-controls {
    justify-content: center;
    margin-top: 14px;
  }
  .tst-slider-btn { display: none; }
}
