/* ===========================
   Drawer derecho TV VoiceS
   =========================== */

*,
*::before,
*::after { box-sizing: border-box; }

/* Botón hamburguesa (visible cuando el menú está cerrado) */
#tvvoicesMenu .menu-btn{
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10003;
  font-size: 2rem;
  line-height: 1;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: transparent;
  cursor: pointer;
  box-shadow: none;
  transition: color .2s ease, transform .2s ease;
}

/* Al abrir el menú, oculta SOLO la hamburguesa */
#tvvoicesMenu.open #menu-toggle { display: none; }

/* Hover hamburguesa */
#tvvoicesMenu .menu-btn:hover {
  color: #9520ff !important;
  transform: scale(1.5);
}

/* Panel lateral */
#menu-drawer{
  position: fixed;
  top: 0;
  right: -380px;
  width: min(92vw, 360px);
  height: 100vh;
  background: rgba(20,20,24,.96);
  backdrop-filter: blur(6px);
  box-shadow: -10px 0 30px rgba(0,0,0,.45);
  border-left: 1px solid rgba(255,255,255,.08);
  z-index: 10002;
  display: flex;
  flex-direction: column;
  padding: 72px 16px 22px;   /* aire superior para que no pisen los iconos */
  transition: right .28s ease-out;
  outline: none;

  /* cerrado: sin eventos ni scroll interno */
  pointer-events: none;
  overflow: hidden;
}

/* Abierto */
#tvvoicesMenu.open #menu-drawer {
  right: 0 !important;
  display: flex !important;
  pointer-events: auto;
  overflow: auto;
}

/* Bloquear scroll de la página cuando el panel está abierto */
body.menu-lock{ overflow: hidden; }

/* ===========================
   Iconos superiores (HOME / CERRAR)
   =========================== */
#tvvoicesMenu .home-btn,
#tvvoicesMenu .menu-btn.close{
  position: absolute;
  top: 14px;                 /* misma altura para ambos */
  width: 40px; height: 40px; /* misma caja */
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 26px;
  color: #fff;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: transform .18s ease, color .18s ease, opacity .18s ease;
  z-index: 10005;
  transform-origin: center;
}
#tvvoicesMenu .home-btn{ left: 16px; text-decoration: none; }
#tvvoicesMenu .menu-btn.close{ right: 16px; }
#tvvoicesMenu .home-btn i{ display:block; line-height:1; }

/* Hover / focus: ampliación */
#tvvoicesMenu .home-btn:hover,
#tvvoicesMenu .home-btn:focus-visible,
#tvvoicesMenu .menu-btn.close:hover,
#tvvoicesMenu .menu-btn.close:focus-visible{
  color: #9520ff !important;
  transform: scale(1.22);
}
/* Tap/click */
#tvvoicesMenu .home-btn:active,
#tvvoicesMenu .menu-btn.close:active{
  transform: scale(0.96);
  opacity: .9;
}

/* ===========================
   Listas y pastillas (base)
   =========================== */
.pill-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .75rem;
  margin-top: .75rem;
}

/* Pastilla base (padres y enlaces) */
.pill{
  display:block;
  width:100%;
  background:#2f2f33;
  color:#fff;
  font-weight: 800;
  padding:.75rem 1rem;
  border-radius: 999px;
  cursor:pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,.15) inset;
  user-select:none;
}
.pill-list .pill:hover{
  /* background: #4a4a52; */
  box-shadow: 0 0 0 2px #865DA4 inset;
  transform: translateY(-1px) scale(1.02);
}
.pill.active{
  background:#865DA4;
  box-shadow: 0 0 0 2px #865DA455 inset;
}

/* Botones “padre” con degradado (Videopodcasts / Artículos CTV / Ver todo) */
.pill.section,
.pill.link{
  display:block;
  width:100%;
  text-align:left;
  padding:.78rem 1rem;              /* un pelín más grandes que las de submenú */
  border-radius:999px;
  background: linear-gradient(135deg, #865DA4 0%, #2CB5FF 100%);
  box-shadow: 0 6px 18px rgba(44,181,255,.25);
  color:#fff;
  font-weight:800;
  font-size: 1.1rem;                  /* tamaño padre */
}
.pill.section{ margin-bottom:.35rem; }
.pill.link{ margin-top:.5rem; }
.pill.section:hover,
.pill.link:hover{ filter:brightness(1.15); }

/* ===========================
   Submenús (compactos)
   =========================== */

/* Sangrado del BLOQUE (no usar margin-left en .pill internas) */
#tvvoicesMenu .submenu{
  display:none;
  margin-top:.55rem;
  padding-left:16px;                 /* sangrado del bloque */
  border-left: none;                 /* sin línea lateral */
}

/* Abrir */
#tvvoicesMenu .submenu.open{ display:block; }

/* Ítems de submenú: MÁS PEQUEÑOS que los padres  */
#tvvoicesMenu .submenu .pill{
  width:100%;
  margin:8px 0 0 0;                 /* separación vertical; sin margen lateral */
  padding:.55rem .9rem;              /* menos padding */
  border-radius: 14px;               /* menos redondeo para diferenciar jerarquía */
  font-size: .94rem;                 /* más pequeño que el padre */
  background:#2f2f33;               /* mismo fondo base */
  box-shadow: 0 2px 8px rgba(0,0,0,.12) inset;
}

/* Separación entre grupos (Videopodcasts / Artículos CTV) */
#tvvoicesMenu .has-submenu + .has-submenu{ margin-top:10px; }

/* Botón padre activo */
#tvvoicesMenu .has-submenu > .submenu-toggle.active{
  /* background: rgba(149,20,255,.12); */
  box-shadow: 0 0 0 2px #865DA433 inset;
}

/* Hover en desktop (el JS pone .hover-mode en el body) */
@media (hover:hover){
  body.hover-mode #tvvoicesMenu .has-submenu:hover > .submenu { display:block; }
  body.hover-mode #tvvoicesMenu .has-submenu:hover > .submenu-toggle{
    /* background: rgba(149,20,255,.12); */
  }
}

/* Normaliza <button.pill> */
button.pill{
  -webkit-appearance:none;
  appearance:none;
  border:0;
  background:transparent;
  padding:0;
  font:inherit;
  line-height:inherit;
  text-align:left;
  cursor:pointer;
}

/* ===========================
   Densidad adaptativa (portátiles)
   - Reduce un poco más el submenú en pantallas bajas
   =========================== */

/* Altura de viewport baja (p.ej. 768px) */
@media (max-height: 820px){
  #menu-drawer{ padding-top: 50px; }
  #tvvoicesMenu .submenu .pill{
    padding: .5rem .85rem;
    font-size: .9rem;
    border-radius: 12px;
    margin-top: 7px;
  }
  .pill.section,
  .pill.link{
    padding: .7rem .95rem;
    /* font-size: .98rem; */
    font-size: 1.1rem;
  }
  /* reducir un pelín los gaps para que quepa todo */
  .pill-list{ gap: .65rem; }
}

/* Aún más compacto si hace falta (muy justo de altura) */
@media (max-height: 720px){
  #tvvoicesMenu .submenu .pill{
    padding: .46rem .8rem;
    font-size: .88rem;
    margin-top: 6px;
  }
  .pill.section,
  .pill.link{
    padding: .66rem .9rem;
    /* font-size: .96rem; */
    font-size: 1.1rem;
  }
  .pill-list{ gap: .6rem; }
}

/* Móvil: hamburguesa ligeramente más pequeña */
@media (max-width:480px){
  #tvvoicesMenu .menu-btn{ font-size:1.7rem; top:10px; right:10px; }
}
