@font-face {
  font-family: "Satisfy";
  src: url("../fonts/Satisfy-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --rojo-900: #6b1420;
  --rojo-700: #8f1f2b;
  --rojo-600: #b8283a;
  --rojo-100: #fbe6e8;
  --ambar-600: #c97a1a;
  --morado-900: #3d1a52;
  --morado-700: #5c2a73;
  --morado-600: #7a3a94;
  --morado-100: #efe4f5;
  --texto: #22281f;
  --texto-suave: #5b6459;
  --borde: #e3d3d3;
  --fondo: #faf9f5;
  --fondo-tarjeta: #ffffff;
  --radio: 10px;
  --sombra: 0 1px 3px rgba(107, 20, 32, 0.12);
  --sombra-hover: 0 10px 24px rgba(107, 20, 32, 0.18);
  --fuente-display: "Fraunces", Georgia, "Times New Roman", serif;
  --madera-clara: #a97c50;
  --madera-media: #8a5a2e;
  --madera-oscura: #5c3a1e;
  --papel-ficha: #f8f0da;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(rgba(250, 249, 245, 0.55), rgba(250, 249, 245, 0.55)), url("../img/fondo-castillo.webp");
  background-color: var(--fondo);
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--texto);
  line-height: 1.4;
}

a {
  color: var(--rojo-700);
}

h1, h2, h3,
.hero-acerca-titulo,
.tarjeta-plan-historico h3,
.curso-del-plan-titulo,
.grupo-grado h2 {
  font-family: var(--fuente-display);
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ---------- Header ---------- */
.sitio-header {
  background: var(--morado-900);
  color: white;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.btn-menu-movil {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
}

.logo {
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
}

.logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.sitio-header nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.sitio-header nav a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.sitio-header nav a[hidden] {
  display: none;
}

.sitio-header nav a:hover {
  text-decoration: underline;
}

.sitio-header .nav-boton-cuenta {
  background: var(--ambar-600);
  color: #2a1700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  transition: transform 0.12s ease, background 0.12s ease;
}

.sitio-header .nav-boton-cuenta:hover {
  background: #e0912c;
  text-decoration: none;
  transform: translateY(-1px);
}

.badge {
  background: var(--ambar-600);
  color: white;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 720px) {
  .btn-menu-movil {
    display: block;
  }
  .sitio-header nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--rojo-900);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 1.25rem 1.25rem;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
    z-index: 20;
  }
  .sitio-header.nav-abierto nav {
    display: flex;
  }
}

/* ---------- Layout general ---------- */
.contenedor-principal {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
}

.pagina-catalogo {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .pagina-catalogo {
    grid-template-columns: 260px 1fr;
  }
  .panel-valor-emocional {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .pagina-catalogo {
    grid-template-columns: 1fr;
  }
}

/* ---------- Login ---------- */
.contenedor-login {
  max-width: 400px;
  margin: 3rem auto;
  padding: 0 1.25rem;
}

.panel-login {
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.panel-login h1 {
  margin: 0 0 0.15rem;
  color: var(--rojo-900);
}

.panel-login label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.panel-login input {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--borde);
  border-radius: 6px;
  font-size: 0.95rem;
}

.panel-login button {
  margin-top: 1rem;
}

.form-columna:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tabs-cuenta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--borde);
}

.tabs-cuenta button {
  flex: 1;
  background: none;
  border: none;
  padding: 0.6rem 0.5rem;
  font-weight: 600;
  color: var(--texto-suave);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tabs-cuenta button.tab-activo {
  color: var(--rojo-900);
  border-bottom-color: var(--rojo-900);
}

.tarjeta-plan-historico {
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.tarjeta-plan-historico h3 {
  margin: 0 0 0.25rem;
  color: var(--rojo-900);
}

.tarjeta-plan-historico ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.curso-del-plan {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--borde);
}

.curso-del-plan:first-of-type {
  margin-top: 0.5rem;
}

.curso-del-plan-titulo {
  margin: 0;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--rojo-700);
}

.curso-del-plan-titulo small {
  font-weight: 400;
  color: var(--texto-suave);
}

.curso-del-plan ul {
  margin: 0.3rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.85rem;
}

/* ---------- Hero del catálogo ---------- */
.hero-catalogo {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0b1220;
}

.hero-fondo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-fabrica {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: auto;
  max-width: 55%;
  object-fit: contain;
  object-position: right center;
  opacity: 0.88;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 35%, black 65%, black 100%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 35%, black 65%, black 100%);
}

.hero-veladura {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31, 12, 45, 0.3) 0%, rgba(31, 12, 45, 0.7) 100%);
}

.hero-contenido {
  position: relative;
  text-align: center;
  padding: 2.5rem 1.25rem;
}

.hero-logo {
  max-width: min(420px, 80vw);
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
}

.hero-tagline {
  font-family: "Satisfy", cursive;
  color: #f3e6c4;
  font-size: min(2.3rem, 7vw);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0.5rem 0 0;
}

/* ---------- Explorar por grado (hero) ---------- */
.hero-grados {
  background: var(--morado-100);
  padding: 1.5rem 1.25rem 1.75rem;
  text-align: center;
}

.hero-grados-titulo {
  margin: 0 0 1rem;
  color: var(--rojo-900);
  font-size: 1.1rem;
}

.fila-grados-hero {
  max-width: 1180px;
  margin: 0 auto;
}

/* ---------- Estantería de 4 anaqueles (selector de grado), 2 filas de 2 ---------- */
.estanteria-grados {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1.75rem;
  align-items: end;
}

@media (max-width: 560px) {
  .estanteria-grados {
    grid-template-columns: 1fr;
  }
}

.anaquel {
  text-align: center;
  min-width: 0;
}

.anaquel-nivel {
  display: block;
  font-family: var(--fuente-display);
  font-weight: 700;
  font-size: clamp(0.72rem, 2.3vw, 0.95rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: #f3e6c4;
  background: var(--morado-900);
  padding: 0.35rem 0.5rem;
  border-radius: 6px 6px 0 0;
}

.anaquel-cuerpo {
  position: relative;
}

.anaquel-libros {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.9rem 0.6rem 0;
}

.anaquel-tabla {
  height: 16px;
  margin-top: -1px;
  background: linear-gradient(180deg, #9a6a35 0%, #6b4420 55%, #4a2e14 100%);
  border-radius: 0 3px 4px 4px;
  box-shadow: 0 6px 10px rgba(31, 12, 45, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.18);
}

.libro-grado-boton {
  border: none;
  cursor: pointer;
  width: 18%;
  flex: 1 1 0;
  max-width: 58px;
  min-width: 0;
  border-radius: 4px 7px 7px 4px;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.25rem;
  box-shadow: 3px 6px 10px rgba(0, 0, 0, 0.3), inset -3px 0 6px rgba(0, 0, 0, 0.22), inset 2px 0 3px rgba(255, 255, 255, 0.18);
  transform-origin: bottom center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.libro-grado-boton:hover {
  transform: translateY(-6px) rotate(-2deg);
}

.libro-grado-boton:active {
  transform: translateY(-1px);
}

.libro-grado-boton.seleccionada {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--rojo-900), 3px 6px 10px rgba(0, 0, 0, 0.3);
  transform: translateY(-6px);
}

.libro-grado-boton:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: inset -3px 0 6px rgba(0, 0, 0, 0.22);
}

.grado-hero-info {
  margin-top: 0.75rem;
}

.grado-hero-info .enlace-modo {
  color: var(--rojo-700);
}

/* ---------- Estante: libros que vas eligiendo para el plan ---------- */
.hero-destacados {
  position: relative;
  height: 240px;
  overflow: hidden;
}

.estante-fondo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

.estante-titulo {
  position: relative;
  margin: 0.75rem 0 0;
  text-align: center;
  color: #f3e6c4;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.estante-vacio {
  position: relative;
  text-align: center;
  color: #f3e6c4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  padding: 0 1.5rem;
}

.estante-libros {
  position: relative;
  display: flex;
  gap: 1.5rem;
  justify-content: safe center;
  align-items: flex-end;
  height: 100%;
  /* ancho tope de ~7-8 libros: en pantallas anchas no queremos que la fila
     se estire de punta a punta, el resto se ve igual desplazando con las
     flechas. */
  max-width: 980px;
  margin: 0 auto;
  /* padding-bottom en px, NO %: el % de padding se calcula sobre el ancho
     del contenedor (no el alto) y en pantallas anchas se volvia enorme,
     empujando los libros fuera del area visible del estante. */
  padding: 0 3.5rem 24px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
}

.estante-libros::-webkit-scrollbar {
  height: 6px;
}

.estante-libros::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

.estante-flecha {
  position: absolute;
  top: 50%;
  transform: translateY(-15%);
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: none;
  background: rgba(31, 12, 45, 0.55);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.estante-flecha:hover {
  background: rgba(31, 12, 45, 0.8);
}

.estante-flecha-izq {
  left: 0.75rem;
}

.estante-flecha-der {
  right: 0.75rem;
}

.libro-destacado {
  background: none;
  border: none;
  cursor: pointer;
  width: 100px;
  flex-shrink: 0;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  perspective: 600px;
}

.libro-destacado-portada {
  width: 88px;
  height: 128px;
  border-radius: 3px 9px 9px 3px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.6rem;
  box-shadow: 5px 10px 18px rgba(0, 0, 0, 0.45);
  transform: rotateY(-20deg);
  transition: transform 0.2s ease;
}

.libro-destacado:hover .libro-destacado-portada,
.libro-destacado:focus-visible .libro-destacado-portada {
  transform: rotateY(0deg);
}

.libro-destacado-portada-img {
  object-fit: cover;
  object-position: top center;
}

.libro-destacado-titulo {
  color: #fff;
  font-size: 0.7rem;
  text-align: center;
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 640px) {
  .hero-catalogo {
    min-height: 240px;
  }
  .hero-destacados {
    display: none;
  }
}

/* ---------- Seccion de resultados con ambientacion de libreria ---------- */
.seccion-libreria {
  background-image: linear-gradient(rgba(239, 228, 245, 0.8), rgba(239, 228, 245, 0.8)), url("../img/estante-nichos.webp");
  background-repeat: repeat;
  background-size: 380px auto;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1.25rem;
}

/* ---------- Acerca del Plan Lector ---------- */
.hero-acerca {
  min-height: 220px;
}

.hero-acerca-titulo {
  margin: 0;
  color: var(--rojo-900);
  background: #fff;
  display: inline-block;
  padding: 0.3rem 1.2rem;
  border-radius: 999px;
  font-size: 1.8rem;
}

.pagina-acerca {
  max-width: 980px;
}

.panel-acerca-intro {
  background-image: linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)), url("../img/textura-madera.webp");
  background-repeat: repeat;
  background-size: 320px auto;
}

.panel-metodologia {
  background-image: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), url("../img/estante-nichos.webp");
  background-repeat: repeat;
  background-size: 320px auto;
}

.icono-avion {
  height: 1.3em;
  width: auto;
  vertical-align: middle;
  margin-right: 0.2rem;
}

.panel-perfil {
  background-image: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), url("../img/estante-biblioteca.webp");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
}

.texto-intro {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--texto);
}

.rejilla-pilares {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.tarjeta-pilar {
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1rem;
  background: var(--rojo-100);
}

.tarjeta-pilar .pilar-icono {
  font-size: 1.6rem;
}

.tarjeta-pilar h3 {
  margin: 0.4rem 0 0.4rem;
  color: var(--rojo-900);
  font-size: 1rem;
}

.tarjeta-pilar p {
  font-size: 0.85rem;
  margin: 0 0 0.4rem;
}

.pilar-detalle {
  color: var(--texto-suave);
  font-size: 0.78rem !important;
}

.rejilla-info-institucional {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.info-institucional {
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radio);
  padding: 0.75rem 0.9rem;
}

.info-institucional h3 {
  margin: 0 0 0.4rem;
  color: var(--rojo-900);
  font-size: 1rem;
}

.info-institucional p {
  font-size: 0.88rem;
}

.nota-institucional {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--borde);
  color: var(--texto-suave);
  font-size: 0.85rem;
}

.rejilla-perfil-lector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.item-perfil {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}

.item-perfil .perfil-icono {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.item-perfil strong {
  color: var(--rojo-900);
  font-size: 0.9rem;
}

.item-perfil p {
  margin: 0.1rem 0 0;
  font-size: 0.85rem;
  color: var(--texto-suave);
}

.lista-competencias {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
}

.lista-competencias li {
  margin-bottom: 0.2rem;
}

/* ---------- Filtros ---------- */
.panel-filtros {
  background: var(--papel-ficha);
  background-image: repeating-linear-gradient(
    180deg,
    rgba(139, 94, 52, 0.07) 0px,
    rgba(139, 94, 52, 0.07) 1px,
    transparent 1px,
    transparent 26px
  );
  border: 2px solid var(--madera-media);
  border-radius: var(--radio);
  padding: 1rem;
  position: sticky;
  top: 1rem;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(31, 12, 45, 0.2), inset 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.panel-filtros h2 {
  margin: -1rem -1rem 1rem;
  padding: 0.65rem 1rem;
  font-family: var(--fuente-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f3e6c4;
  background: var(--morado-900);
}

.grupo-filtro {
  margin-bottom: 0.9rem;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 3px 7px rgba(31, 12, 45, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.grupo-filtro > summary,
.grupo-filtro-titulo {
  margin: 0;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--fuente-display);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: #fdf3e0;
  background: linear-gradient(180deg, var(--madera-clara) 0%, var(--madera-media) 100%);
}

.grupo-filtro > summary::before,
.grupo-filtro-titulo::before {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fbe9b0, #a8781f 75%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.grupo-filtro > summary {
  list-style: none;
  justify-content: flex-start;
}

.grupo-filtro > summary::-webkit-details-marker {
  display: none;
}

.grupo-filtro > summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1rem;
  color: #fdf3e0;
}

.grupo-filtro[open] > summary::after {
  content: "\2212";
}

.grupo-filtro > summary + *,
.grupo-filtro-titulo + * {
  display: block;
  margin: 0.65rem 0.75rem 0.7rem;
  width: calc(100% - 1.5rem);
}

.filtro-buscar {
  width: 100%;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.4rem;
  border: 1px solid rgba(90, 58, 30, 0.35);
  border-radius: 6px;
  background: var(--papel-ficha);
  font-size: 0.85rem;
}

.filtro-lista {
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid rgba(90, 58, 30, 0.3);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  background-color: var(--papel-ficha);
  background-image: repeating-linear-gradient(
    180deg,
    rgba(139, 94, 52, 0.09) 0px,
    rgba(139, 94, 52, 0.09) 1px,
    transparent 1px,
    transparent 24px
  );
}

.filtro-opcion {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  padding: 0.15rem 0;
  cursor: pointer;
}

select.filtro-select,
input.filtro-texto {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(90, 58, 30, 0.35);
  border-radius: 6px;
  background: var(--papel-ficha);
  font-size: 0.9rem;
}

#btn-limpiar-filtros {
  width: 100%;
  margin-top: 0.5rem;
}

.btn-descartar-elegidos {
  width: 100%;
  margin-bottom: 1.1rem;
  font-size: 0.8rem;
  padding: 0.5rem 0.6rem;
  background: none;
  border: 1px dashed var(--rojo-700);
  color: var(--rojo-700);
  border-radius: 8px;
  cursor: pointer;
}

.btn-descartar-elegidos:disabled {
  border-style: solid;
  border-color: var(--borde);
  color: var(--texto-suave);
  cursor: not-allowed;
}

.btn-descartar-elegidos.activo {
  background: var(--rojo-700);
  border-style: solid;
  color: white;
}

/* ---------- Estado del plan (guardar / crear otro / finalizar), debajo del librero ---------- */
.seccion-estado-plan {
  text-align: center;
  padding: 1.5rem 1.25rem 0;
}

.seccion-estado-plan:not(:has(.panel-estado-plan:not([hidden]))) {
  padding: 0;
}

.panel-estado-plan {
  max-width: 480px;
  margin: 0 auto 1.5rem;
}

.panel-estado-plan.panel-checkpoint {
  padding: 1rem 1.25rem;
  text-align: left;
}

.panel-estado-plan.panel-checkpoint p {
  font-size: 0.9rem;
}

.panel-estado-plan .botones {
  justify-content: center;
}

.btn-guardar-libro {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  padding: 1.15rem 1.5rem;
  border: none;
  border-radius: 4px 10px 10px 4px;
  background: linear-gradient(135deg, var(--rojo-600), var(--rojo-900));
  color: #fff;
  font-family: var(--fuente-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 6px 10px 18px rgba(31, 12, 45, 0.4), inset -4px 0 8px rgba(0, 0, 0, 0.25), inset 3px 0 3px rgba(255, 255, 255, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-guardar-libro::before {
  content: "";
  position: absolute;
  top: 0;
  right: 26px;
  width: 14px;
  height: 28px;
  background: var(--ambar-600);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
}

.btn-guardar-libro:hover:not(:disabled) {
  transform: translateY(-5px) rotate(-1deg);
  box-shadow: 8px 16px 22px rgba(31, 12, 45, 0.45), inset -4px 0 8px rgba(0, 0, 0, 0.25), inset 3px 0 3px rgba(255, 255, 255, 0.2);
}

.btn-guardar-libro:active:not(:disabled) {
  transform: translateY(-2px);
}

/* ---------- Modo de plan (un solo curso / varios cursos) ---------- */
.indicador-modo {
  font-size: 0.85rem;
  color: var(--texto-suave);
  margin: 0 0 0.25rem;
}

.enlace-modo {
  border: none;
  background: none;
  color: var(--rojo-700);
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: underline;
  margin-bottom: 1rem;
}

.opciones-modo {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.opcion-modo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  text-align: left;
}

.opcion-modo strong {
  color: var(--rojo-900);
  font-size: 1rem;
}

.opcion-modo span {
  font-weight: 400;
  color: var(--texto-suave);
  font-size: 0.85rem;
}

.filtro-opcion-bloqueada {
  opacity: 0.45;
}

#btn-cambiar-curso {
  width: 100%;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

/* ---------- Botones ---------- */
button,
.boton {
  cursor: pointer;
  border: 1px solid var(--rojo-600);
  background: white;
  color: var(--rojo-700);
  padding: 0.45rem 0.8rem;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

button:hover:not(:disabled) {
  background: var(--rojo-100);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(107, 20, 32, 0.15);
}

button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.primario {
  background: var(--rojo-600);
  color: white;
}

button.primario:hover:not(:disabled) {
  background: var(--rojo-700);
}

button.peligro {
  border-color: #a33;
  color: #a33;
}

button.peligro:hover:not(:disabled) {
  background: #fbe9e9;
}

/* ---------- Resultados / barra superior ---------- */
.barra-resultados {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#total-resultados {
  color: var(--texto-suave);
  font-size: 0.9rem;
}

.rejilla-libros {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

/* ---------- Tarjeta de libro ---------- */
.tarjeta-libro {
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tarjeta-libro:hover {
  transform: translateY(-3px);
  box-shadow: var(--sombra-hover);
}

.tarjeta-libro.tarjeta-recomendada {
  border-color: var(--ambar-600);
  box-shadow: 0 0 0 2px rgba(201, 122, 26, 0.25);
}

.portada-placeholder {
  height: 200px;
  background: linear-gradient(135deg, var(--rojo-600), var(--rojo-900));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
}

.portada-marco {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: #1c1a22;
}

.portada-fondo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(16px) brightness(0.65) saturate(1.1);
  transform: scale(1.2);
}

.portada-img {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.portada-detalle {
  display: block;
  max-height: 280px;
  margin: 0 auto 1rem;
  border-radius: 6px;
  box-shadow: var(--sombra);
}

.tarjeta-cuerpo {
  padding: 0.75rem 0.9rem;
  flex: 1;
}

.tarjeta-cuerpo h3 {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
  text-transform: capitalize;
  line-height: 1.25;
}

.tarjeta-cuerpo .autor {
  margin: 0 0 0.5rem;
  color: var(--texto-suave);
  font-size: 0.85rem;
  text-transform: capitalize;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 0.5rem;
}

.chip {
  background: var(--rojo-100);
  color: var(--rojo-900);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.chip-grado {
  background: #fdeecd;
  color: var(--ambar-600);
}

.chip-recomendado {
  background: var(--ambar-600);
  color: white;
}

.chip-restriccion {
  background: #fbdede;
  color: #a52a2a;
}

.chip-info {
  background: #eee;
  color: #555;
  font-weight: 600;
}

.precio {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  margin: 0;
}

.estado {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  background: #eee;
  color: #555;
}

.estado-nuevo {
  background: #e1f3e5;
  color: #1f7a3c;
}

.estado-medio {
  background: #fdeecd;
  color: var(--ambar-600);
}

.estado-antiguo {
  background: #f1eae0;
  color: #7a6b4f;
}

.tarjeta-acciones {
  display: flex;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  border-top: 1px solid var(--borde);
}

.tarjeta-acciones button {
  flex: 1;
  font-size: 0.8rem;
  padding: 0.4rem 0.4rem;
}

.btn-plan.en-plan {
  background: var(--rojo-600);
  color: white;
}

/* ---------- Paginacion ---------- */
#paginacion {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.paginacion-numeros {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-pagina {
  min-width: 2.2rem;
  padding: 0.45rem 0.5rem;
  text-align: center;
}

.btn-pagina.actual {
  background: var(--rojo-600);
  color: white;
  border-color: var(--rojo-600);
  opacity: 1;
  cursor: default;
}

.paginacion-puntos {
  color: var(--texto-suave);
  padding: 0 0.2rem;
}

/* ---------- Mensajes de estado ---------- */
.vacio,
.error {
  padding: 2rem;
  text-align: center;
  color: var(--texto-suave);
}

.error {
  color: #a33;
}

/* ---------- Modal de detalle ---------- */
dialog#detalle-libro,
dialog#dialogo-modo,
dialog#dialogo-duplicado,
dialog#dialogo-identidad {
  border: none;
  border-radius: var(--radio);
  padding: 0;
  width: min(640px, 92vw);
  max-height: 86vh;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

dialog#detalle-libro::backdrop,
dialog#dialogo-modo::backdrop,
dialog#dialogo-duplicado::backdrop,
dialog#dialogo-identidad::backdrop {
  background: rgba(20, 30, 20, 0.55);
}

.opciones-duplicado {
  flex-direction: row;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.opciones-duplicado button {
  padding: 0.5rem 1rem;
}

.detalle-contenido {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: 86vh;
}

.detalle-contenido h2 {
  margin-top: 0;
  text-transform: capitalize;
}

#dialogo-identidad h2 {
  text-transform: none;
}

.detalle-cerrar {
  float: right;
}

.detalle-seccion {
  margin-top: 1rem;
}

.video-contenedor {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.video-contenedor iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.detalle-seccion h4 {
  margin: 0 0 0.35rem;
  color: var(--rojo-900);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.lista-valores {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lista-valores li {
  display: flex;
  justify-content: space-between;
  padding: 0.15rem 0;
  font-size: 0.9rem;
  border-bottom: 1px dashed var(--borde);
}

/* ---------- Pagina de plan ---------- */
.panel-checkpoint {
  background: var(--rojo-100);
  border: 1px solid #bfe0cb;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.panel-checkpoint p {
  margin-top: 0;
  font-weight: 600;
  color: var(--rojo-900);
}

.panel-checkpoint .botones {
  display: flex;
  gap: 0.6rem;
}

.resumen-planes-guardados {
  margin-bottom: 1.25rem;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1rem 1.25rem;
  box-shadow: var(--sombra);
}

.resumen-planes-guardados h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--texto-suave);
  margin-bottom: 0.4rem;
}

.lista-resumen-planes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lista-resumen-planes li {
  background: var(--rojo-100);
  border: 1px solid var(--borde);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
}

.lista-resumen-planes strong {
  color: var(--rojo-900);
}

.acciones-finalizado {
  margin-top: 1.5rem;
  text-align: center;
}

.nota-fijado {
  background: #fdeecd;
  color: var(--ambar-600);
  border: 1px solid #f3d9a4;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.leyenda-colores {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--texto-suave);
}

.leyenda-colores .punto {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 0.6rem;
}

.leyenda-colores .punto:first-child {
  margin-left: 0;
}

.punto-verde {
  background: #2f9e44;
}

.punto-amarillo {
  background: #e8a33d;
}

.punto-rojo {
  background: #d64545;
}

.grupo-grado {
  margin-bottom: 1.5rem;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1.1rem 1.25rem 0.5rem;
  box-shadow: var(--sombra);
}

.grupo-grado h2 {
  color: var(--rojo-900);
  border-bottom: 2px solid var(--rojo-100);
  padding-bottom: 0.3rem;
}

.lista-plan {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lista-plan li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.2rem 0.5rem 0.6rem;
  border-bottom: 1px solid var(--borde);
  border-left: 4px solid transparent;
}

.lista-plan li.fila-no-repetido {
  border-left-color: #2f9e44;
}

.lista-plan li.fila-repetido-1 {
  border-left-color: #e8a33d;
  background: #fffaf0;
}

.lista-plan li.fila-repetido-mas {
  border-left-color: #d64545;
  background: #fdf1f1;
}

.chip-repeticion {
  display: inline-block;
  position: relative;
  margin-left: 0.5rem;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  text-transform: none;
  cursor: help;
}

/* Tooltip propio (en vez del title nativo del navegador, que tarda en
   aparecer y se ve chico): instantaneo y con buen tamaño de letra. */
.chip-repeticion[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--morado-900);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  padding: 0.5rem 0.85rem;
  border-radius: 7px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 30;
}

.chip-repeticion[data-tooltip]::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--morado-900);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 30;
}

.chip-repeticion[data-tooltip]:hover::after,
.chip-repeticion[data-tooltip]:hover::before,
.chip-repeticion[data-tooltip]:focus::after,
.chip-repeticion[data-tooltip]:focus::before {
  opacity: 1;
  visibility: visible;
}

.chip-repetido-1 {
  background: #fdeecd;
  color: #a5690a;
}

.chip-repetido-mas {
  background: #fbdede;
  color: #a52a2a;
}

.lista-plan li > span:first-child {
  text-transform: capitalize;
}

.lista-plan li em {
  font-style: normal;
  color: var(--texto-suave);
}

.acciones-fila {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  text-transform: none;
}

.btn-fijar {
  font-size: 0.78rem;
  white-space: nowrap;
}

.chip-fijado {
  background: var(--rojo-100);
  color: var(--rojo-900);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.plan-acciones-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.plan-acciones-top .botones {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.pila-exportar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.enlace-crear-cuenta {
  text-align: center;
  text-decoration: none;
  border-color: var(--ambar-600);
  color: var(--ambar-600);
}

.enlace-crear-cuenta:hover {
  background: #fdf3e0;
  color: var(--ambar-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(201, 122, 26, 0.2);
}

.enlace-crear-cuenta:active {
  transform: translateY(0);
  box-shadow: none;
}

.panel-grafico {
  background-color: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1.25rem;
  margin-top: 2rem;
}

.panel-grafico h2 {
  margin-top: 0;
}

#grafico-nota {
  color: var(--texto-suave);
  font-size: 0.85rem;
}

.grafico-contenedor {
  max-width: 640px;
}

.texto-suave {
  color: var(--texto-suave);
  font-size: 0.85rem;
}

.rejilla-graficos-curso {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.tarjeta-grafico-curso {
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1rem;
  background: var(--fondo);
}

.tarjeta-grafico-curso h3 {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
  color: var(--rojo-900);
}

.tarjeta-grafico-curso h3 small {
  font-weight: 400;
  color: var(--texto-suave);
}

.nota-chica {
  color: var(--texto-suave);
  font-size: 0.78rem;
  margin: 0 0 0.5rem;
}

/* ---------- Landing (portada publica) ---------- */
.pagina-landing {
  max-width: 980px;
}

.hero-landing-botones {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.btn-cta-hero {
  display: inline-block;
  background: var(--ambar-600);
  color: #2a1700;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-cta-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}

.btn-cta-hero-secundario {
  display: inline-block;
  color: #fdf3e0;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.68rem 1.3rem;
  border-radius: 999px;
  border: 1.5px solid rgba(253, 243, 224, 0.6);
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-cta-hero-secundario:hover {
  background: rgba(253, 243, 224, 0.15);
  transform: translateY(-2px);
}

.btn-cta-hero-oscuro {
  color: #fff;
  background: var(--morado-900);
}

.btn-cta-hero-secundario-oscuro {
  color: var(--morado-900);
  border-color: var(--morado-700);
}

.btn-cta-hero-secundario-oscuro:hover {
  background: var(--morado-100);
}

.seccion-video h2 {
  margin-top: 0;
}

.video-marco {
  margin-top: 1rem;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--sombra-hover);
  background: #0b1220;
}

.video-marco video {
  display: block;
  width: 100%;
  height: auto;
}

.rejilla-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.stat-tarjeta {
  background: var(--morado-900);
  color: #fdf3e0;
  border-radius: var(--radio);
  padding: 1.1rem 1rem;
  text-align: center;
}

.stat-tarjeta strong {
  display: block;
  font-family: var(--fuente-display);
  font-size: 2rem;
  color: var(--ambar-600);
}

.stat-tarjeta span {
  font-size: 0.85rem;
}

.seccion-cta-final {
  text-align: center;
  background: var(--morado-100);
}

/* ---------- Seccion Pastoral (banner fijo al final del catalogo) ---------- */
.seccion-pastoral {
  max-width: 1200px;
  margin: 2.5rem auto 0;
  padding: 0 1.25rem 2.5rem;
}

.pastoral-banner {
  background: linear-gradient(135deg, var(--ambar-600), #8a5a2e);
  color: #fff;
  border-radius: var(--radio) var(--radio) 0 0;
  padding: 1.1rem 1.5rem;
  text-align: center;
}

.pastoral-banner h2 {
  margin: 0 0 0.3rem;
  font-family: var(--fuente-display);
  color: #fff;
  letter-spacing: 0.02em;
}

.pastoral-banner p {
  margin: 0;
  font-size: 0.88rem;
  color: #fdf3e0;
}

.rejilla-pastoral {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  background: #fdf6e8;
  border: 1px solid #f0d9a8;
  border-top: none;
  border-radius: 0 0 var(--radio) var(--radio);
  padding: 1.25rem;
}

.rejilla-pastoral .vacio,
.rejilla-pastoral .error {
  grid-column: 1 / -1;
}

.pastoral-paginacion {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--texto-suave);
}

@media (max-width: 640px) {
  .rejilla-pastoral {
    grid-template-columns: 1fr;
  }
}

/* ---------- Seccion "Creá tu cuenta" (landing) ---------- */
.seccion-cuenta h2 {
  text-align: center;
}

.beneficios-cuenta {
  list-style: none;
  margin: 0 auto 1rem;
  padding: 0;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.seccion-cuenta .contenedor-login {
  margin: 1rem auto 0;
}

/* ---------- Panel de administracion (admin.html) ---------- */
.admin .error,
.admin .exito {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-radius: 6px;
}

.admin .error {
  background: var(--rojo-100);
}

.admin .exito {
  background: #e6f4ea;
  color: #1e6b34;
}

.admin-barra {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.admin-buscador {
  position: relative;
  flex: 1;
}

.admin input[type="text"],
.admin input[type="search"],
.admin input[type="number"],
.admin input[type="url"],
.admin select,
.admin textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--borde);
  border-radius: 6px;
  font: inherit;
  font-size: 0.95rem;
  background: var(--fondo-tarjeta);
}

.admin-resultados {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  margin: 0.25rem 0 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra-hover);
  max-height: 360px;
  overflow-y: auto;
}

.admin-resultados button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
}

.admin-resultados button:hover {
  background: var(--rojo-100);
}

.admin-resultados img,
.admin-sin-portada {
  width: 32px;
  height: 46px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.admin-sin-portada {
  display: grid;
  place-items: center;
  background: var(--rojo-100);
  color: var(--rojo-900);
  font-size: 0.7rem;
  font-weight: 700;
}

.admin-resultados strong,
.admin-resultados small {
  display: block;
}

.admin-resultados small {
  color: var(--texto-suave);
}

.admin-resultado-vacio {
  padding: 0.5rem;
  color: var(--texto-suave);
}

.admin-form {
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1.25rem;
}

.admin-form h2 {
  margin-top: 0;
  color: var(--rojo-900);
}

.admin-form fieldset {
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  margin: 0 0 1rem;
  padding: 0.75rem 1rem 1rem;
}

.admin-form legend {
  font-weight: 700;
  padding: 0 0.35rem;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.admin-ancho {
  grid-column: 1 / -1;
}

.admin-form label.admin-check {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.admin-portada {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.admin-portada img,
.admin-stock-libro img {
  width: 110px;
  border-radius: 4px;
  box-shadow: var(--sombra);
}

.admin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.admin-chips .chip {
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.admin-chips .chip button,
.admin-valor button {
  border: none;
  background: none;
  padding: 0 0.2rem;
  font-size: 1rem;
  line-height: 1;
  color: inherit;
}

.admin-tabla-grados {
  border-collapse: collapse;
  width: 100%;
  max-width: 480px;
}

.admin-tabla-grados th,
.admin-tabla-grados td {
  padding: 0.3rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid var(--borde);
}

.admin-tabla-grados td:first-child {
  text-align: left;
}

.admin-tabla-grados .admin-nivel th {
  text-align: left;
  background: var(--fondo);
  color: var(--rojo-900);
}

.admin-filtro {
  margin-bottom: 0.5rem;
}

.admin-lista-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.25rem 1rem;
  max-height: 260px;
  overflow-y: auto;
}

.admin-form .admin-lista-checks label {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
}

.admin-form .admin-lista-checks label[hidden] {
  display: none;
}

.admin-valores {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.admin-valor {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-valor > span {
  flex: 1;
}

.admin-form .admin-valor label {
  flex-direction: row;
  align-items: center;
  font-weight: 400;
}

.admin-valor input {
  width: 4.5rem !important;
}

.admin-acciones {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-stock {
  margin-top: 1rem;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-stock[hidden] {
  display: none;
}

.admin-stock-libro {
  display: flex;
  gap: 1rem;
}

.admin-stock-libro h2 {
  margin-bottom: 0.25rem;
}

.admin-stock-modo {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.admin-form .admin-stock-modo label {
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
}

@media (max-width: 600px) {
  .admin-barra,
  .admin-portada {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---------- Cuentas de colegio (admin.html pestaña Usuarios, cuenta.html del rector) ---------- */
.tabla-scroll {
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.tabla-cuentas {
  width: 100%;
  border-collapse: collapse;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  font-size: 0.9rem;
}

.tabla-cuentas th,
.tabla-cuentas td {
  padding: 0.5rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--borde);
  vertical-align: middle;
}

.tabla-cuentas th {
  background: var(--fondo);
  color: var(--rojo-900);
  font-size: 0.8rem;
}

.tabla-cuentas td button {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}

.tabla-cuentas select {
  max-width: 260px;
}

.cuenta-inactiva td {
  color: var(--texto-suave);
}

.admin-invitar {
  margin-bottom: 1.25rem;
}

.admin-ancho-2 {
  grid-column: span 2;
}

.admin-form label[hidden] {
  display: none;
}

.admin-filtros-cuentas select {
  width: auto;
}

.seccion-colegio {
  margin-bottom: 2rem;
}

.panel-invitar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1rem;
  margin-bottom: 1rem;
  max-width: 640px;
}

.panel-invitar label {
  font-weight: 600;
}

.panel-invitar textarea {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--borde);
  border-radius: 6px;
  font: inherit;
}

.panel-invitar button {
  align-self: flex-start;
}

.mensaje-inline.error,
.mensaje-inline.exito {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-radius: 6px;
}

.mensaje-inline.error {
  background: var(--rojo-100);
}

.mensaje-inline.exito {
  background: #e6f4ea;
  color: #1e6b34;
}

@media (max-width: 600px) {
  .admin-ancho-2 {
    grid-column: 1 / -1;
  }
}

/* ---------- Planes guardados: listas (cuenta.html) y detalle (plan-detalle.html) ---------- */
.estado-plan {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  background: #eee;
  color: #555;
}

.estado-en_revision {
  background: #fff3d6;
  color: #8a5a00;
}

.estado-aprobado {
  background: #e6f4ea;
  color: #1e6b34;
}

.estado-devuelto {
  background: var(--rojo-100);
  color: var(--rojo-900);
}

.cabecera-seccion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.cabecera-seccion select {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--borde);
  border-radius: 6px;
}

.lista-planes {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lista-planes a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  color: inherit;
  text-decoration: none;
}

.lista-planes a:hover {
  box-shadow: var(--sombra-hover);
}

.plan-comentario {
  flex-basis: 100%;
  color: var(--rojo-900);
}

.plan-detalle .plan-acciones-top {
  align-items: flex-start;
}

.plan-detalle h1 {
  margin-bottom: 0.25rem;
}

.pd-comentario {
  padding: 0.75rem 1rem;
  border-radius: var(--radio);
  margin-bottom: 1rem;
  background: #e6f4ea;
}

.pd-comentario-devuelto {
  background: var(--rojo-100);
}

.pd-comentario p {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
}

.pd-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.pd-barra-edicion {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: #fff3d6;
  border: 1px solid #e8c77a;
  border-radius: var(--radio);
}

.pd-barra-edicion[hidden],
.pd-agregar-curso[hidden] {
  display: none;
}

.pd-barra-edicion .botones {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}

.pd-grupo {
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1rem;
  margin-bottom: 1rem;
}

.pd-grupo h2 {
  margin: 0 0 0.5rem;
  color: var(--rojo-900);
  font-size: 1.15rem;
}

.pd-grupo h2 small {
  color: var(--texto-suave);
  font-weight: 400;
  font-size: 0.85rem;
}

.pd-grupo ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pd-libro {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--borde);
}

.pd-libro:last-child {
  border-bottom: none;
}

.pd-libro img,
.pd-sin-portada {
  width: 36px;
  height: 52px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.pd-sin-portada {
  display: grid;
  place-items: center;
  background: var(--rojo-100);
  color: var(--rojo-900);
  font-size: 0.7rem;
  font-weight: 700;
}

.pd-libro div {
  flex: 1;
  min-width: 0;
}

.pd-libro strong,
.pd-libro small {
  display: block;
}

.pd-libro small {
  color: var(--texto-suave);
}

.pd-libro button {
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
}

.pd-buscador {
  position: relative;
  margin-top: 0.75rem;
}

.pd-buscador input,
.pd-agregar-curso select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--borde);
  border-radius: 6px;
  font: inherit;
}

.pd-agregar-curso {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 360px;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.pd-historial {
  margin-top: 1.5rem;
}

.pd-historial summary {
  cursor: pointer;
  font-weight: 700;
}

.pd-historial li {
  margin: 0.4rem 0;
}

.pd-detalle {
  word-break: break-word;
}

.pd-dialogo {
  border: none;
  border-radius: var(--radio);
  padding: 1.25rem;
  width: min(480px, calc(100vw - 32px));
  box-shadow: var(--sombra-hover);
}

.pd-dialogo h2 {
  margin-top: 0;
  color: var(--rojo-900);
}

.pd-dialogo form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pd-dialogo textarea {
  padding: 0.5rem;
  border: 1px solid var(--borde);
  border-radius: 6px;
  font: inherit;
}

.pd-dialogo .botones {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.acciones-cuenta {
  white-space: nowrap;
}

.acciones-cuenta button + button {
  margin-left: 0.25rem;
}

.pd-dialogo label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.pd-dialogo input {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--borde);
  border-radius: 6px;
  font: inherit;
}

.pd-dialogo fieldset {
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.pd-dialogo fieldset label {
  align-self: stretch;
}

.pd-dialogo legend {
  font-weight: 700;
}

button.enlace-boton {
  background: none;
  border: none;
  padding: 0.25rem 0;
  color: var(--rojo-700);
  text-decoration: underline;
  font-size: 0.85rem;
  align-self: center;
}

/* ---------- Perfil y reglas del colegio (cuenta.html) ---------- */
.perfil-columnas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.perfil-columnas .panel-invitar {
  max-width: none;
}

.panel-invitar h3 {
  margin: 0;
}

.panel-invitar input {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--borde);
  border-radius: 6px;
  font: inherit;
}

.panel-invitar input[readonly] {
  background: var(--fondo);
  color: var(--texto-suave);
}

.panel-reglas {
  max-width: 820px;
}

.panel-reglas fieldset {
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  margin: 0;
}

.panel-reglas legend {
  font-weight: 700;
}

.reglas-fila {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.reglas-fila label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.reglas-fila input {
  width: 5rem;
}

.reglas-cursos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.reglas-nivel {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.reglas-nivel strong {
  font-size: 0.85rem;
  color: var(--rojo-900);
}

.panel-reglas label.regla-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
}

.pd-avisos {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radio);
  background: #fff3d6;
  border: 1px solid #e8c77a;
}

.pd-avisos ul {
  margin: 0.35rem 0 0;
}

.pd-reglas {
  margin-top: 0;
}

/* ---------- Libros marcados por el rector y modo reemplazo ---------- */
.pd-libro-marcado {
  background: #fff3d6;
  border-radius: 6px;
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

.pd-marca {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: #8a5a00;
  font-weight: 600;
}

.pd-libro button + button {
  margin-left: 0.25rem;
}

.banner-reemplazo {
  max-width: 1200px;
  margin: 1rem auto 0;
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #fff3d6;
  border: 1px solid #e8c77a;
  border-radius: var(--radio);
  box-sizing: border-box;
}

.banner-reemplazo[hidden] {
  display: none;
}

.banner-reemplazo p {
  margin: 0.2rem 0 0;
}

@media (max-width: 1240px) {
  .banner-reemplazo {
    margin-left: 16px;
    margin-right: 16px;
  }
}

/* ---------- Limite de libros por curso (catalogo, modo un solo curso) ---------- */
.nota-limite-curso {
  grid-column: 1 / -1;
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radio);
  font-weight: 600;
  background: #eef4fb;
  color: #2f4f6f;
}

.nota-limite-curso.falta {
  background: #fff3d6;
  color: #8a5a00;
}

.nota-limite-curso.lleno {
  background: #e6f4ea;
  color: #1e6b34;
}

/* ---------- Banner de cursos pendientes (cuenta.html) ---------- */
.banner-pendientes {
  margin: 0 0 1.25rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radio);
  background: #fff3d6;
  border: 1px solid #e8c77a;
  color: #6b4700;
  font-size: 0.92rem;
}

.banner-pendientes.completo {
  background: #e6f4ea;
  border-color: #a8d5b5;
  color: #1e6b34;
}

.banner-pendientes a {
  margin-left: 0.35rem;
  font-weight: 600;
}

/* ---------- Dialogo "Guardar en mi cuenta" (plan.html) ---------- */
.pd-dialogo label.opcion-guardar {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.pd-dialogo .opcion-guardar-sub {
  margin-left: 1.6rem;
  font-weight: 400;
}

.pd-dialogo .opcion-guardar-sub[hidden],
.pd-dialogo [data-existentes][hidden] {
  display: none;
}

.pd-dialogo select {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--borde);
  border-radius: 6px;
  font: inherit;
}

.pd-dialogo [data-existente].texto-suave {
  margin: 0 0 0 1.6rem;
}

/* ---------- Vendedores (ventas.html) ---------- */
.ventas-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.ventas-colegios {
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: sticky;
  top: 1rem;
}

.ventas-colegios input[type="search"] {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--borde);
  border-radius: 6px;
  font: inherit;
}

.ventas-colegios .regla-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.ventas-colegios ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 65vh;
  overflow-y: auto;
}

.ventas-colegios li button {
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 0.5rem;
  border-radius: 6px;
}

.ventas-colegios li button:hover,
.ventas-colegios li button.activo {
  background: var(--rojo-100);
}

.ventas-colegios li button strong,
.ventas-colegios li button small {
  display: block;
}

.ventas-colegios li button small {
  color: var(--texto-suave);
}

.ventas-detalle .cabecera-seccion {
  margin-bottom: 1rem;
}

.ventas-detalle .cabecera-seccion h2 {
  margin: 0;
}

@media (max-width: 860px) {
  .ventas-layout {
    grid-template-columns: 1fr;
  }
  .ventas-colegios {
    position: static;
  }
}

a.boton {
  display: inline-block;
  text-decoration: none;
}

a.boton.primario {
  background: var(--rojo-600);
  color: white;
}

a.boton.primario:hover {
  background: var(--rojo-700);
}

/* ---------- Año lectivo ---------- */
.chip-anio {
  background: #eef4fb;
  color: #2f4f6f;
}

.titulo-anio {
  margin: 1.25rem 0 0.5rem;
  color: var(--rojo-900);
  font-size: 1.05rem;
  border-bottom: 1px solid var(--borde);
  padding-bottom: 0.25rem;
}

.ventas-anio {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.ventas-anio select {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--borde);
  border-radius: 6px;
  font: inherit;
}

#tab-colegios .admin-filtros-cuentas select {
  max-width: 100%;
}

#col-planes .tarjeta-plan-historico button {
  margin-top: 0.5rem;
}

/* ---------- Eventos (admin) ---------- */
.admin-titulo-seccion {
  margin: 0;
  flex: 1;
  color: var(--rojo-900);
}

.tabla-evento-libros input {
  width: 6rem !important;
}

.aviso-stock {
  display: block;
  color: #8a5a00;
  font-size: 0.75rem;
}

.estado-evento-en_curso {
  background: #e6f4ea;
  color: #1e6b34;
}

.estado-evento-programado {
  background: #eef4fb;
  color: #2f4f6f;
}

.estado-evento-finalizado,
.estado-evento-inactivo {
  background: #eee;
  color: #666;
}

/* ---------- Eventos: piezas compartidas (evento.html) ---------- */
.evento-etiqueta {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ambar-600);
}

.evento-descuento {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--rojo-600);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
}

.evento-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--rojo-600);
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

/* ---------- Explorador tipo catalogo para eventos (admin) ---------- */
.explorador-evento {
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--fondo);
}

.explorador-evento summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--rojo-900);
}

.explorador-filtros {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.5rem;
  margin: 0.75rem 0 0.25rem;
}

@media (max-width: 700px) {
  .explorador-filtros {
    grid-template-columns: 1fr;
  }
}

.explorador-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.exp-tarjeta {
  background: var(--fondo-tarjeta);
  border: 2px solid transparent;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.exp-tarjeta.en-evento {
  border-color: #6cbf84;
  background: #f3fbf5;
}

.exp-tarjeta img,
.exp-sin-portada {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 4px;
}

.exp-sin-portada {
  display: grid;
  place-items: center;
  background: var(--rojo-100);
  color: var(--rojo-900);
  font-weight: 700;
}

.exp-tarjeta h4 {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.exp-tarjeta small {
  font-size: 0.72rem;
}

.exp-datos {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
}

.exp-tarjeta button {
  margin-top: auto;
  font-size: 0.8rem;
}

.explorador-paginacion {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.explorador-isbn {
  margin-bottom: 0.25rem;
}

/* ---------- Pagina del evento (evento.html) ---------- */
.pagina-evento {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 16px 3rem;
}

.ev-hero {
  padding: 1.75rem;
  border-radius: var(--radio);
  background: linear-gradient(135deg, #fff3d6 0%, #fbe6e8 100%);
  border: 1px solid #e8c77a;
  box-shadow: var(--sombra);
  margin-bottom: 1.25rem;
}

.ev-hero h1 {
  margin: 0.25rem 0 0.5rem;
  font-family: var(--fuente-display);
  color: var(--rojo-900);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.ev-descripcion {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  white-space: pre-wrap;
}

.ev-datos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  font-weight: 600;
}

.ev-quedan {
  color: var(--rojo-700);
}

.ev-herramientas {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.ev-herramientas input,
.ev-herramientas select {
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--borde);
  border-radius: 6px;
  font: inherit;
  background: var(--fondo-tarjeta);
}

.ev-herramientas p {
  grid-column: 1 / -1;
  margin: 0;
}

.ev-libros {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ev-libro {
  display: grid;
  grid-template-columns: 150px 1fr 200px;
  gap: 1.25rem;
  padding: 1rem;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}

.ev-libro.agotado {
  opacity: 0.6;
}

.ev-portada {
  position: relative;
}

.ev-portada img,
.ev-portada .portada-placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 6px;
}

.ev-info h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  color: var(--rojo-900);
}

.ev-info p {
  margin: 0 0 0.5rem;
}

.ev-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.ev-sinopsis {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.45;
}

.ev-compra {
  border-left: 1px solid var(--borde);
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
}

.ev-compra p {
  margin: 0;
}

.ev-pvp {
  color: var(--texto-suave);
}

.ev-final {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--rojo-700);
  line-height: 1.1;
}

.ev-ahorro {
  display: inline-block;
  align-self: flex-start;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #e6f4ea;
  color: #1e6b34;
  font-weight: 700;
  font-size: 0.85rem;
}

.ev-stock {
  margin-top: 0.5rem !important;
  font-size: 0.88rem;
  color: var(--texto-suave);
}

@media (max-width: 760px) {
  .ev-herramientas {
    grid-template-columns: 1fr;
  }
  .ev-libro {
    grid-template-columns: 100px 1fr;
  }
  .ev-compra {
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px solid var(--borde);
    padding: 0.75rem 0 0;
  }
}

/* pestaña de la cabecera (js/eventos-nav.js) */
.sitio-header nav a.nav-eventos {
  font-weight: 700;
  color: var(--ambar-600);
}

/* lista de eventos vigentes (evento.html sin id) */
.ev-lista {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.ev-lista a {
  display: block;
  padding: 1.25rem;
  border-radius: var(--radio);
  background: linear-gradient(135deg, #fff3d6 0%, #fbe6e8 100%);
  border: 1px solid #e8c77a;
  box-shadow: var(--sombra);
  color: inherit;
  text-decoration: none;
}

.ev-lista a:hover {
  box-shadow: var(--sombra-hover);
}

.ev-lista h2 {
  margin: 0.25rem 0;
  font-family: var(--fuente-display);
  color: var(--rojo-900);
}

.sitio-header nav a.nav-eventos {
  max-width: 14rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Ventas concretadas (evento.html, admin/vendedor) ---------- */
.ev-modo-venta {
  padding: 0.6rem 0.9rem;
  border-radius: var(--radio);
  background: #eef4fb;
  color: #2f4f6f;
  font-weight: 600;
  margin: 0 0 1rem;
}

.ev-venta {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--borde);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ev-vendidos {
  margin: 0;
  font-size: 0.9rem;
}

.ev-venta button.primario {
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
}

.ev-libro.agotado .ev-venta {
  opacity: 1;
}

.ventas-eventos {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
}

.ventas-eventos summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--rojo-900);
}

.ventas-eventos .tabla-scroll {
  margin: 0.75rem 0 0;
}

/* ---------- Catalogo sin sesion (solo lectura) ---------- */
a.btn-candado {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  text-decoration: none;
  background: #f1eeee;
  color: var(--texto-suave);
  border: 1px dashed var(--borde);
  border-radius: 7px;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

a.btn-candado:hover {
  background: var(--rojo-100);
  color: var(--rojo-700);
  border-style: solid;
}

.aviso-modo-lectura {
  background: #eef4fb;
  border-color: #b9cfe6;
}

.aviso-modo-lectura .botones {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
