/* =========================
   DASHBOARD / ROWS (Netflix-like)
   ========================= */
html, body { overflow-x: hidden; }
.dash{
  padding: 6px 0 28px;
  display:flex;
  flex-direction:column;
  gap:18px;
}
.dash-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  padding: 6px 4px 10px;
}
.dash-head .h1{
  font-size:26px;
  font-weight:900;
  letter-spacing:-.3px;
  line-height:1.1;
}
.dash-head .muted{
  margin-top:4px;
  font-size:13px;
}
.dash-rows{
  display:flex;
  flex-direction:column;
  gap:22px;
}

/* =========================
   ROW
   ========================= */

/* TÍTULO arriba y subtítulo abajo */
/* ===== FIX: TÍTULO ARRIBA, CARRUSEL ABAJO ===== */

.row-head{
  display:block;      /* 🔑 deja de ser horizontal */
  padding: 0 4px 8px;
}
.row{
  flex-direction: column;
}
.row-title{
  display:block;      /* 🔑 una sola columna */
  font-size:16px;
  font-weight:900;
  letter-spacing:.2px;
  margin-bottom:6px;  /* separación del carrusel */
}

.row-sub{
  margin: 0;             /* por si hereda márgenes raros */
}

/* flechas */
.row-actions{
  display:flex;
  gap:8px;
  align-items:center;
}
.rowbtn{
  width:40px;
  height:40px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(10,14,22,.35);
  color: var(--txt);
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.rowbtn:hover{
  background: rgba(255,255,255,.10);
  transform: scale(1.05);
  border-color: rgba(255,255,255,.18);
}
.rowbtn:active{ transform: scale(0.98); }

/* =========================
   RAIL (horizontal)
   ========================= */

/* wrapper para el fade (ponlo en el HTML/JS: <div class="railWrap"> <div class="rail">...</div> </div> ) */
.railWrap{
  position:relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;     /* clave: quita el scroll del BODY */
  position: relative;
  border-radius: 18px;
}

/* fade izquierda + derecha */
.railWrap::before,
.railWrap::after{
  content:"";
  pointer-events:none;
  position:absolute;
  top:0;
  width:44px;
  height:100%;
  z-index:6;
}
.railWrap::before{
  left:0;
  background: linear-gradient(90deg, rgba(7,10,18,.95), rgba(7,10,18,0));
  border-radius: 18px;
}
.railWrap::after{
  right:0;
  background: linear-gradient(270deg, rgba(7,10,18,.95), rgba(7,10,18,0));
  border-radius: 18px;
}

.rail{
  display:flex;
  gap:12px;

  overflow-x:auto;
  overflow-y:hidden;

  padding: 6px 4px 10px;

  scroll-snap-type: x proximity;
  scroll-behavior: smooth;

  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;

  scrollbar-width: none;
}
.rail::-webkit-scrollbar{ display:none; }

/* =========================
   CARDS
   ========================= */

.cardx{
  flex: 0 0 auto;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(10,14,22,.35);
  color: var(--txt);
  text-align: left;
  cursor: pointer;

  scroll-snap-align: start;

  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.cardx:hover{
  transform: translateY(-4px) scale(1.03);
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
}

/* poster */
.cardx.poster{ width: 168px; }

.cardx .thumb{
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.05);
}

.cardx .thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.cardx .ph{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 28px;
  background: rgba(255,255,255,.06);
}

.cardx-title{
  padding: 8px 6px 0;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
  min-height: 32px;
}

.cardx-meta{
  padding: 2px 6px 10px;
  font-size: 11px;
  opacity: .75;
}

/* live */
.cardx.live{ width: 230px; }
.cardx.live .thumb{ aspect-ratio: 16/9; }

/* =========================
   Hover title dentro del poster (Dashboard)
   ========================= */

.cardx.poster .thumb{ position: relative; }

.cardx-hover{
  position:absolute;
  inset:0;
  z-index:2;

  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  gap:6px;
  padding:12px;

  opacity:0;
  transition: opacity .15s ease;

  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.75) 100%);
  color:#fff;
}

.cardx:hover .cardx-hover,
.cardx:focus-visible .cardx-hover{
  opacity:1;
}

.cardx-hover-title{
  font-weight:950;
  font-size:13px;
  line-height:1.2;

  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;

  text-shadow:0 2px 10px rgba(0,0,0,.65);
}

.cardx-hover-sub{
  font-size:12px;
  color: rgba(255,255,255,.80);

  display:-webkit-box;
  -webkit-line-clamp:1;
  -webkit-box-orient:vertical;
  overflow:hidden;

  text-shadow:0 2px 10px rgba(0,0,0,.65);
}

/* badge */
.badge{
  position:absolute;
  top:8px;
  left:8px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 900;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
  z-index: 3;
}

/* responsive */
@media (max-width: 900px){
  .dash-head .h1{ font-size: 22px; }
  .cardx.poster{ width: 150px; }
}
@media (max-width: 560px){
  .row-title{ font-size: 15px; }
  .cardx.poster{ width: 138px; }
  .cardx.live{ width: 200px; }
}

/* en Dashboard: ocultar texto de abajo en posters */
.cardx.poster .cardx-title,
.cardx.poster .cardx-meta{
  display:none;
}

/* ✅ rail wrapper correcto (tu CSS usa railWrap) */
.railWrap{
  position: relative;
  border-radius: 18px;
}

/* ✅ flechas pegadas a los extremos del carril */
.rowbtn--prev,
.rowbtn--next{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  z-index: 5;
}

.rowbtn--prev{ left: 6px; }
.rowbtn--next{ right: 6px; }

/* para que no tapen la primera/última card */
.railWrap .rail{
  padding-left: 52px;
  padding-right: 52px;
}
