/* =============================================================================
   RUTINITAS — PORTADA: sectores con escenas del producto
   =============================================================================
   Sólo lo usa index.html. Beneficios, «Cómo funciona», «Familias» y «Planes»
   muestran el producto en miniatura dentro de tarjetas teñidas por franja.
   Todo sale de los tokens (--rt-franja-*, --theme-*), así el modo oscuro y el
   alto contraste siguen funcionando sin reglas aparte.

   Piezas de disposición, las mismas en todos los sectores:
     .rt-lv-rejilla  columnas iguales, sin huérfanos (3 → 1)
     .rt-lv-tarjeta  bloque teñido: escena arriba, texto abajo
     .rt-lv-escena   la miniatura del producto, sobre papel
     .rt-lv-pila     vertical, un solo gap
     .rt-lv-fila     horizontal, centrada
   ============================================================================= */

.rt-lv-rejilla {
  display: grid;
  gap: var(--rt-space-5);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
}
.rt-lv-rejilla-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 61.9375rem) {
  .rt-lv-rejilla, .rt-lv-rejilla-2 { grid-template-columns: minmax(0, 1fr); }
}

.rt-lv-pila { display: flex; flex-direction: column; gap: var(--rt-space-2); min-width: 0; }
.rt-lv-fila { display: flex; align-items: center; gap: var(--rt-space-2); min-width: 0; }
.rt-lv-fila-entre { justify-content: space-between; }

.rt-lv-tarjeta {
  /* Dos filas compartidas con las tarjetas vecinas (subgrid): la escena mide lo
     mismo en las tres y los títulos arrancan a la misma altura. */
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 2;
  gap: var(--rt-space-5);
  padding: var(--rt-space-5);
  border-radius: var(--rt-radius-lg);
  background: var(--rt-franja-soft);
  min-width: 0;
}
.rt-lv-tarjeta h3 { font-size: var(--rt-text-xl); line-height: 1.25; margin: 0; }
.rt-lv-tarjeta p { margin: 0; }
.rt-lv-texto { display: flex; flex-direction: column; gap: var(--rt-space-2); padding-inline: var(--rt-space-2); }
.rt-lv-texto > p:not(.rt-lv-rotulo) { color: var(--theme-text); line-height: 1.55; }

.rt-lv-rotulo {
  font-family: var(--rt-font-mono);
  font-size: var(--rt-text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rt-franja-deep);
  margin: 0;
}

.rt-lv-escena {
  display: flex;
  flex-direction: column;
  gap: var(--rt-space-3);
  padding: var(--rt-space-4);
  border-radius: var(--rt-radius-md);
  background: var(--theme-bg-elevated);
  box-shadow: var(--rt-elev-2);
  min-width: 0;
  justify-content: space-between;
}

/* Píldora: estado o acción en una palabra */
.rt-lv-pildora {
  display: inline-flex;
  align-items: center;
  gap: var(--rt-space-1);
  align-self: flex-start;
  min-height: 1.875rem;
  padding: 0 var(--rt-space-3);
  border-radius: var(--rt-radius-pill);
  background: var(--rt-franja);
  color: var(--rt-franja-on);
  font-size: var(--rt-text-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.rt-lv-pildora-suave { background: var(--rt-franja-soft); color: var(--rt-franja-deep); }
.rt-lv-pildora svg { width: 1rem; height: 1rem; flex: none; }

/* Tira de actividades: tres fichas con ilustración, del mismo ancho */
.rt-lv-tira { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--rt-space-2); }
.rt-lv-ficha {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--rt-space-1);
  padding: var(--rt-space-2);
  border: 0.125rem solid transparent;
  border-radius: var(--rt-radius-sm);
  background: var(--theme-bg);
  font-size: var(--rt-text-xs);
  font-weight: 600;
  text-align: center;
  min-width: 0;
}
.rt-lv-ficha[data-activa='true'] { background: var(--rt-franja-soft); border-color: var(--rt-franja); }
.rt-lv-ficha .rt-illus { width: 3.5rem; box-shadow: none; }
.rt-lv-ficha span { overflow-wrap: anywhere; line-height: 1.2; }

/* Fila de tarea terminada + estrellas */
.rt-lv-hecha { display: flex; align-items: center; gap: var(--rt-space-3); font-weight: 600; min-width: 0; }
.rt-lv-hecha .rt-illus { width: 3rem; flex: none; box-shadow: none; }
.rt-lv-hecha > span:first-of-type { flex: 1; min-width: 0; }
.rt-lv-tilde {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border-radius: 50%;
  background: var(--rt-franja);
  color: var(--rt-franja-on);
}
.rt-lv-tilde svg { width: 1.375rem; height: 1.375rem; }
.rt-lv-estrellas { display: flex; gap: var(--rt-space-1); color: var(--rt-estrella); }
.rt-lv-estrellas svg { width: 1.75rem; height: 1.75rem; }
.rt-lv-barra { height: 0.75rem; border-radius: var(--rt-radius-pill); background: var(--rt-franja-soft); overflow: hidden; }
.rt-lv-barra > i { display: block; height: 100%; border-radius: inherit; background: var(--rt-franja); }

/* Tres carriles: mañana, tarde y noche */
.rt-lv-carriles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--rt-space-2); }
.rt-lv-carril {
  display: flex;
  flex-direction: column;
  gap: var(--rt-space-2);
  padding: var(--rt-space-2) var(--rt-space-1);
  border-radius: var(--rt-radius-sm);
  background: var(--rt-franja-soft);
  min-height: 6rem;
  min-width: 0;
}
.rt-lv-carril .rt-lv-rotulo { font-size: 0.6875rem; letter-spacing: 0.04em; text-align: center; }
.rt-lv-tarjetita {
  padding: var(--rt-space-1) 0.375rem;
  border-radius: 0.625rem;
  background: var(--theme-bg-elevated);
  color: var(--theme-text);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.rt-lv-tarjetita[data-moviendo='true'] {
  background: var(--rt-franja);
  color: var(--rt-franja-on);
  transform: rotate(-4deg);
  box-shadow: var(--rt-elev-2);
}
.rt-lv-hueco { height: 1.625rem; border: 0.125rem dashed var(--rt-franja); border-radius: 0.625rem; }

/* Tablet y hoja impresa, lado a lado */
.rt-lv-doble { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--rt-space-3); align-items: stretch; }
.rt-lv-soporte {
  display: flex;
  flex-direction: column;
  gap: var(--rt-space-2);
  padding: var(--rt-space-2);
  border-radius: var(--rt-radius-sm);
  min-width: 0;
  font-size: var(--rt-text-xs);
}
.rt-lv-soporte > .rt-lv-rotulo { text-align: center; margin-top: auto; }
.rt-lv-tablet { background: var(--theme-text); }
.rt-lv-tablet > .rt-lv-rotulo { color: var(--theme-bg-elevated); }
.rt-lv-pantalla { display: flex; flex-direction: column; gap: var(--rt-space-2); padding: var(--rt-space-2); border-radius: 0.625rem; background: var(--theme-bg-elevated); }
.rt-lv-papel { background: var(--theme-bg); border: 0.125rem solid var(--theme-border); transform: rotate(2deg); }
.rt-lv-renglon { display: flex; align-items: center; gap: var(--rt-space-2); font-weight: 600; min-width: 0; }
.rt-lv-renglon .rt-illus { width: 1.75rem; flex: none; box-shadow: none; border-width: 0; }
.rt-lv-renglon > span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rt-lv-casilla { width: 1.125rem; height: 1.125rem; flex: none; border: 0.125rem solid var(--theme-text); border-radius: 0.25rem; display: grid; place-items: center; color: var(--rt-tarde); }
.rt-lv-casilla svg { width: 0.875rem; height: 0.875rem; }
.rt-lv-casilla-estrella { border-radius: 50%; color: var(--rt-estrella); }

/* Bloque de la versión impresa */
.rt-lv-impresa {
  display: grid;
  grid-template-columns: minmax(0, 16rem) minmax(0, 1fr) auto;
  gap: var(--rt-space-6);
  align-items: center;
  margin-top: var(--rt-space-5);
  padding: var(--rt-space-5) var(--rt-space-6);
  border-radius: var(--rt-radius-lg);
  background: var(--theme-bg-elevated);
  border: 0.0625rem solid var(--theme-border);
  box-shadow: var(--rt-elev-1);
}
.rt-lv-impresa h3 { margin: 0; }
.rt-lv-impresa .rt-lv-papel { padding: var(--rt-space-4); gap: var(--rt-space-3); transform: rotate(-2deg); font-size: var(--rt-text-sm); }
.rt-lv-impresa .rt-lv-renglon .rt-illus { width: 2.5rem; }
.rt-lv-impresa .rt-lv-casilla { width: 1.5rem; height: 1.5rem; }
.rt-lv-impresa .rt-lv-casilla svg { width: 1.125rem; height: 1.125rem; }
@media (max-width: 61.9375rem) {
  .rt-lv-impresa { grid-template-columns: minmax(0, 1fr); padding: var(--rt-space-5); gap: var(--rt-space-5); }
  .rt-lv-impresa .rt-lv-papel { max-width: 18rem; }
  .rt-lv-impresa .rt-btn { justify-self: start; }
}

/* ── Familias: cada voz, un globo del color de su franja ───────────────── */
.rt-lv-voces { align-items: start; }
.rt-lv-voces .rt-quote { padding: 0; background: none; border-radius: 0; gap: var(--rt-space-3); margin: 0; }
.rt-lv-voces .rt-quote blockquote {
  padding: var(--rt-space-5);
  border-radius: var(--rt-radius-lg) var(--rt-radius-lg) var(--rt-radius-lg) var(--rt-space-2);
  background: var(--rt-franja-soft);
}
.rt-lv-voces .rt-quote figcaption { padding-inline-start: var(--rt-space-2); flex-wrap: wrap; }
.rt-lv-voces .rt-avatar { background: var(--rt-franja); color: var(--rt-franja-on); }

/* ── Planes: la prueba, protagonista; el plan Familiar, destacado ──────── */
/* Estos bloques los arma js/premium-dispositivos.js y no llevan data-franja,
   así que los pasteles se resuelven acá. En oscuro el pastel no puede ser el
   pastel: se usan los mismos valores re-derivados que css/tokens.css da a
   [data-franja] en ese tema, para que el texto claro tenga contraste. */
#planes {
  --lv-manana-soft: var(--rt-manana-soft);
  --lv-manana-deep: var(--rt-manana-deep);
  --lv-tarde-soft: var(--rt-tarde-soft);
  --lv-noche-soft: var(--rt-noche-soft);
  --lv-noche-deep: var(--rt-noche-deep);
}
[data-theme='dark'] #planes {
  --lv-manana-soft: #43352a;
  --lv-manana-deep: #f6bd8b;
  --lv-tarde-soft: #393e3c;
  --lv-noche-soft: #2e2c3e;
  --lv-noche-deep: #e5deff;
}
#planes .rt-precios-panel { padding: 0; background: none; border: 0; box-shadow: none; }
#planes .rt-prueba-invitacion {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  column-gap: var(--rt-space-6);
  row-gap: var(--rt-space-3);
  align-items: start;
  padding: var(--rt-space-6);
  border: 0;
  border-radius: var(--rt-radius-lg);
  background: var(--lv-manana-soft);
  color: var(--theme-text);
  margin-bottom: var(--rt-space-6);
}
#planes .rt-prueba-invitacion > * { grid-column: 1; margin: 0; }
#planes .rt-prueba-invitacion .rt-oferta-kicker { font-family: var(--rt-font-mono); color: var(--lv-manana-deep); }
#planes .rt-prueba-invitacion .rt-btn { justify-self: start; }
#planes .rt-prueba-pasos {
  grid-column: 2;
  grid-row: 1 / span 6;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: var(--rt-space-3);
  list-style: none;
  padding: 0;
  counter-reset: paso;
  font-size: var(--rt-text-md);
  font-weight: 600;
}
#planes .rt-prueba-pasos li {
  counter-increment: paso;
  display: flex;
  align-items: center;
  gap: var(--rt-space-3);
  padding: var(--rt-space-3) var(--rt-space-4);
  border-radius: var(--rt-radius-md);
  background: var(--theme-bg-elevated);
  box-shadow: var(--rt-elev-1);
}
#planes .rt-prueba-pasos li::before {
  content: counter(paso);
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  border-radius: 50%;
  font-family: var(--rt-font-display);
  background: var(--rt-manana);
  color: var(--rt-manana-on);
}
#planes .rt-prueba-pasos li:nth-child(2)::before { background: var(--rt-tarde); color: var(--rt-tarde-on); }
#planes .rt-prueba-pasos li:nth-child(3)::before { background: var(--rt-noche); color: var(--rt-noche-on); }
@media (max-width: 61.9375rem) {
  #planes .rt-prueba-invitacion { grid-template-columns: minmax(0, 1fr); padding: var(--rt-space-5); }
  #planes .rt-prueba-pasos { grid-column: 1; grid-row: auto; }
}
#planes .rt-ofertas { gap: var(--rt-space-5); }
#planes .rt-oferta { border-radius: var(--rt-radius-lg); padding: var(--rt-space-5); box-shadow: var(--rt-elev-1); }
#planes .rt-oferta.rt-oferta-destacada {
  background: var(--lv-tarde-soft);
  border: 0.125rem solid var(--rt-tarde);
  box-shadow: var(--rt-elev-2);
  padding: calc(var(--rt-space-5) - 0.0625rem);
}
#planes .rt-oferta-badge { background: var(--lv-noche-soft); color: var(--lv-noche-deep); }
#planes .rt-oferta-destacada .rt-oferta-badge { background: var(--rt-tarde); color: var(--rt-tarde-on); }
#planes .rt-oferta-selector { border-radius: var(--rt-radius-pill); background: var(--theme-bg-elevated); }
#planes .rt-oferta-selector button { border-radius: var(--rt-radius-pill); }
#planes .rt-oferta-selector button[aria-pressed='true'] { background: var(--rt-tarde); color: var(--rt-tarde-on); }
/* Sobre el fondo teñido del plan destacado, el texto secundario no alcanza
   4,5:1 con el gris de siempre: ahí va con la tinta de la franja. */
#planes .rt-oferta-destacada .rt-oferta-periodo,
#planes .rt-oferta-destacada .rt-oferta-disponibilidad,
#planes .rt-oferta-destacada .rt-oferta-contexto { color: var(--rt-tarde-deep); }
[data-theme='dark'] #planes .rt-oferta-destacada .rt-oferta-periodo,
[data-theme='dark'] #planes .rt-oferta-destacada .rt-oferta-disponibilidad,
[data-theme='dark'] #planes .rt-oferta-destacada .rt-oferta-contexto { color: #d6f1e4; }

/* ── Planes: tarjetas alineadas (revisión del 1/12) ─────────────────────────
   Las tarjetas las arma js/premium-dispositivos.js (también para planes.html,
   club.html y ajustes): acá sólo se acomodan, con CSS acotado a la portada.
   Familiar trae «título → selector → insignia…» y las demás «insignia → título…»;
   con filas compartidas (subgrid) cada parte cae en la misma fila en las tres:
   insignia · título · selector · precio · contexto · lista · aclaración · botón · disponibilidad.
   Separaciones de la escala (--rt-space-*), sin los márgenes en px de precios.css. */
/* Una sola separación entre las partes de la tarjeta (--rt-space-4); cada parte lleva la suya abajo. */
#planes .rt-oferta-badge,
#planes .rt-oferta h4,
#planes .rt-oferta-selector,
#planes .rt-oferta .rt-oferta-precio,
#planes .rt-oferta .rt-oferta-contexto,
#planes .rt-oferta-beneficios,
#planes .rt-oferta .rt-oferta-aclaracion { margin: 0 0 var(--rt-space-4); padding-top: 0; }
#planes .rt-oferta-contenido { gap: 0; }
#planes .rt-oferta-periodo { margin-top: var(--rt-space-1); }
#planes .rt-oferta-beneficios { gap: var(--rt-space-3); }
#planes .rt-oferta-disponibilidad { margin-top: var(--rt-space-4); }
/* El mismo alto que todo botón del sitio (44 px; acá medían 48). */
#planes .rt-oferta .rt-btn, #planes .rt-prueba-invitacion .rt-btn { min-height: 2.75rem; }
@media (min-width: 64rem) { /* desde 1024 px, las tres tarjetas en fila */
  #planes .rt-ofertas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #planes .rt-ofertas { grid-auto-rows: auto; }
  #planes .rt-oferta { display: grid; grid-row: span 9; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
  #planes .rt-oferta-contenido { display: contents; }
  #planes .rt-oferta-badge { grid-row: 1; justify-self: start; align-self: start; }
  #planes .rt-oferta h4 { grid-row: 2; }
  #planes .rt-oferta-selector { grid-row: 3; align-self: start; }
  #planes .rt-oferta-precio { grid-row: 4; }
  #planes .rt-oferta-contexto { grid-row: 5; }
  #planes .rt-oferta-beneficios { grid-row: 6; }
  #planes .rt-oferta-aclaracion { grid-row: 7; }
  #planes .rt-oferta button[data-oferta-seleccion] { grid-row: 8; align-self: end; }
  #planes .rt-oferta-disponibilidad { grid-row: 9; }
}

/* Planes: hasta 1023 px, una tarjeta por fila (a 768 quedaban 2+1 y a 900 «Elegir Familiar mensual» se partía). */
@media (max-width: 63.9375rem) { #planes .rt-ofertas { grid-template-columns: minmax(0, 1fr); } }

/* Beneficios y Cómo funciona: tres tarjetas en fila recién desde 1180 px; a 1024 y 1047 las palabras de las miniaturas
   se cortaban («Merend/ar», «Dib…»). Antes, una por fila. Con tres en fila, los títulos reservan dos renglones para que
   el texto de las tres arranque a la misma altura. */
@media (max-width: 73.6875rem) { .rt-lv-rejilla:not(.rt-lv-rejilla-2) { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 73.75rem) { .rt-lv-rejilla:not(.rt-lv-rejilla-2) .rt-lv-tarjeta h3 { min-height: 2lh; } }

/* Familias: las burbujas de una fila miden lo mismo; avatar y nombre al pie (quedaban desfasados 26 px). */
.rt-lv-voces { align-items: stretch; }
.rt-lv-voces .rt-quote { display: flex; flex-direction: column; }
.rt-lv-voces .rt-quote blockquote { flex: 1; }

/* Miniaturas en oscuro: el papel impreso sigue siendo papel (claro), así el tilde y las casillas se leen; el hueco
   punteado del carril, con el contraste de un borde de control. */
[data-theme='dark'] .rt-lv-papel {
  /* adentro del papel, los colores del tema claro: es una hoja impresa */
  --theme-text: #2b2419; --theme-text-secondary: #6b5d4b; --theme-border: #d9cdb9; --rt-franja-deep: #7a4a1c;
  background: #fbf6ee; color: var(--theme-text); border-color: var(--theme-border);
}
[data-theme='dark'] .rt-lv-hueco { border-color: var(--theme-text-secondary); }

/* 320 px: los dos botones largos entran en un renglón. */
@media (max-width: 22.5rem) {
  #como-funciona .rt-btn, #planes .rt-oferta .rt-btn { font-size: var(--rt-text-sm); padding-inline: var(--rt-space-3); }
}

/* ── Teléfono (revisión del 1/12; hasta ahora nadie lo había mirado) ───────── */
/* Fichas de las miniaturas: la palabra entera, nunca partida al medio («Meren/dar»). */
.rt-lv-ficha span { overflow-wrap: normal; word-break: keep-all; hyphens: none; }
@media (max-width: 30rem) {
  .rt-lv-ficha span { font-size: 0.625rem; }
  .rt-lv-ficha .rt-illus { width: 2.75rem; }
  /* Fichas de los carriles: en dos renglones si hace falta, sin «Desa…». */
  .rt-lv-tarjetita { font-size: 0.625rem; white-space: normal; overflow: visible; text-overflow: clip; word-break: keep-all; padding-inline: var(--rt-space-1); }
  /* Soporte y tablet del paso 3, uno debajo del otro: la pantalla tenía 50 px útiles. */
  .rt-lv-doble { grid-template-columns: minmax(0, 1fr); }
}
/* «¡Tarde completa!» baja a su renglón antes que tapar la tercera estrella. */
.rt-lv-fila-entre { flex-wrap: wrap; row-gap: var(--rt-space-2); }
/* Marca de la cabecera centrada con los enlaces y el botón (quedaba 4-5 px más arriba). */
.rt-marketing-nav .rt-brand { display: inline-flex; align-items: center; }
/* Tablet en oscuro: marco oscuro (con el color del texto quedaba casi blanco y encandilaba). */
[data-theme='dark'] .rt-lv-tablet { background: #3a3632; }
[data-theme='dark'] .rt-lv-tablet > .rt-lv-rotulo { color: #f3ece2; }
@media (max-width: 22.5rem) {
  .rt-lv-impresa { padding: var(--rt-space-4); }
  #como-funciona .rt-btn { padding-inline: var(--rt-space-2); }
}
