/* ── FUENTES (Cargadas vía HTML <link>) ── */

/* ── VARIABLES ── */
:root {
  --fondo: #f4ede4;
  --fondo-tarjeta: #faf7f2;
  --fondo-header: #0e2a24; /* Teal profundo para cabecera */
  --fondo-input: #fff9f3;
  /* Paleta Secundaria / Acento: Vino (para badges de Terror/Romance y acentos muy específicos) */
  --vino: #7a1a2e;
  --vino-claro: #a83248;
  --vino-suave: rgba(122, 26, 46, 0.10);
  --vino-hover: rgba(122, 26, 46, 0.18);
  /* Paleta Primaria de Marca: Teal */
  --teal-profundo: #1a5c50;
  --teal-medio: #2a7b6a;
  --teal-claro: #3d9b88;
  --teal-suave: rgba(26, 92, 80, 0.10);
  --teal-hover: rgba(26, 92, 80, 0.18);
  /* Fuentes */
  --fuente-titulo: 'Playfair Display', Georgia, serif;
  --fuente-cuerpo: 'DM Sans', system-ui, -apple-system, sans-serif;
  --fuente-ui: var(--fuente-cuerpo);
  --fuente-literaria: 'EB Garamond', Georgia, serif;
  --fuente-marca: 'Cormorant Garamond', Georgia, serif;
  --hover: var(--teal-suave);
  --dorado: #b8892a;
  --dorado-claro: #d4a94a;
  --dorado-suave: #e8d5a3;
  --dorado-glow: rgba(184, 137, 42, 0.15);
  --dorado-texto: #7d5912; /* WCAG AA > 5:1 sobre beige claro */
  --texto: #2c1810;
  --texto-suave: #574837; /* WCAG AA 5.5:1 sobre fondo claro */
  --texto-medio: #443023; /* WCAG AA 8.2:1 sobre fondo claro */
  --borde: #d4c4a8;
  --borde-suave: #e8dcc8;
  --sombra: rgba(44, 24, 16, 0.08);
  --sombra-media: rgba(44, 24, 16, 0.14);
  --sombra-hover: rgba(44, 24, 16, 0.22);
  --sombra-glow: rgba(26, 92, 80, 0.15);
  --sombra-glow-border: rgba(26, 92, 80, 0.08);
  --fondo-footer-end: #ede5d8;
  --radio: 6px;
}

/* ── MODO OSCURO ── */
:root[data-theme="dark"] {
  --fondo: #0f1a17; /* Carbón Teal */
  --fondo-tarjeta: #162420; /* Carbón Medio */
  --fondo-header: #081411; /* Negro Teal */
  --fondo-input: #1b2e29; /* Input Teal Oscuro */
  /* Paleta Secundaria / Acento: Vino */
  --vino: #c94a64;
  --vino-claro: #e0687e;
  --vino-suave: rgba(201, 74, 100, 0.12);
  --vino-hover: rgba(201, 74, 100, 0.20);
  /* Paleta Primaria de Marca: Teal */
  --teal-profundo: #3db29b;
  --teal-medio: #4bc5ae;
  --teal-claro: #78dcc7;
  --teal-suave: rgba(75, 197, 174, 0.12);
  --teal-hover: rgba(75, 197, 174, 0.20);
  /* Fuentes */
  --fuente-titulo: 'Playfair Display', Georgia, serif;
  --fuente-cuerpo: 'DM Sans', system-ui, -apple-system, sans-serif;
  --fuente-ui: var(--fuente-cuerpo);
  --fuente-literaria: 'EB Garamond', Georgia, serif;
  --fuente-marca: 'Cormorant Garamond', Georgia, serif;
  --hover: var(--teal-suave);
  --dorado: #d4a94a;
  --dorado-claro: #e8c56a;
  --dorado-suave: #2b3d39; /* Adaptado a teal oscuro */
  --dorado-glow: rgba(212, 169, 74, 0.12);
  --dorado-texto: #e8c56a; /* WCAG AA > 9:1 sobre fondo oscuro */
  --texto: #e8dcc8;
  --texto-suave: #b8a890;
  --texto-medio: #c8b8a0;
  --borde: #223832; /* Bordes teal oscuros */
  --borde-suave: #182824;
  --sombra: rgba(0, 0, 0, 0.20);
  --sombra-media: rgba(0, 0, 0, 0.30);
  --sombra-hover: rgba(0, 0, 0, 0.40);
  --sombra-glow: rgba(75, 197, 174, 0.18);
  --sombra-glow-border: rgba(75, 197, 174, 0.12);
  --fondo-footer-end: #081411; /* Negro Teal */
}

/* ── ACCESIBILIDAD ── */
.skip-link {
  position: absolute;
  top: -60px;
  left: 20px;
  background: var(--teal-profundo);
  color: white;
  padding: 10px 20px;
  z-index: 10000;
  transition: top 0.3s;
  text-decoration: none;
  font-family: var(--fuente-cuerpo);
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.skip-link:focus {
  top: 0;
}

/* ── BOTÓN TEMA ── */
.btn-tema {
  background: none;
  border: 1.5px solid rgba(212, 169, 74, 0.3);
  color: var(--dorado-claro);
  font-size: 1.1rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-tema:hover {
  background: rgba(212, 169, 74, 0.15);
  border-color: rgba(212, 169, 74, 0.5);
  transform: rotate(20deg);
}

/* ── RESET ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--fuente-cuerpo);
  background-color: var(--fondo);
  /* Textura sutil de papel */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 0%, rgba(184, 137, 42, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(122, 26, 46, 0.04) 0%, transparent 50%);
  color: var(--texto);
  min-height: 100vh;
  line-height: 1.7;
}

/* ══════════════════════════════════════════════════════ */
/* ENCABEZADO                                             */
/* ══════════════════════════════════════════════════════ */
/* ── SECCIÓN HÉROE UNIFICADA ── */
.hero-seccion {
  background: linear-gradient(170deg, #1a5c50 0%, #0e2a24 50%, #060f0d 100%);
  position: relative;
  overflow: hidden;
  padding: 0.65rem 2.5rem;
}

.hero-background-deco {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, transparent, transparent 48px, rgba(184, 137, 42, 0.03) 48px, rgba(184, 137, 42, 0.03) 49px),
    radial-gradient(circle at 50% 30%, rgba(26, 92, 80, 0.18) 0%, transparent 60%);
  pointer-events: none;
}

.hero-seccion::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(10, 5, 2, 0.8) 100%);
  pointer-events: none;
}

.hero-contenido {
  position: relative;
  z-index: 5;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1.8fr auto;
  grid-template-rows: auto auto;
  gap: 0.4rem 2rem;
  align-items: center;
}

.hero-marca {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
}

.header-home-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-decoration: none;
  color: inherit;
  gap: 0.6rem;
  transition: transform 0.3s ease;
}

.header-home-link:hover {
  transform: scale(1.02);
}

.hero-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--dorado-claro);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 12px rgba(184, 137, 42, 0.15);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  animation: respiracionLogo 4s ease-in-out 2;
  flex-shrink: 0;
}

.header-home-link:hover .hero-logo {
  transform: rotate(5deg) scale(1.05);
  border-color: var(--dorado);
  box-shadow: 0 6px 20px rgba(26, 92, 80, 0.4);
}

@keyframes respiracionLogo {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 0 0px rgba(201, 152, 46, 0);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(26, 92, 80, 0.35), 0 0 0 3px rgba(212, 169, 74, 0.4);
  }
}

.hero-seccion h1 {
  font-family: var(--fuente-marca);
  font-size: 2.3rem;
  font-weight: 800;
  color: #f5eedf;
  letter-spacing: 1.2px;
  line-height: 1.1;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.hero-subtitulo {
  font-family: var(--fuente-cuerpo);
  font-size: 0.78rem;
  color: rgba(236, 217, 198, 0.7);
  font-style: italic;
  font-weight: 400;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hero-propuesta-valor {
  grid-column: 1;
  grid-row: 2;
  font-family: var(--fuente-cuerpo);
  font-size: 0.76rem;
  color: rgba(236, 217, 198, 0.85);
  line-height: 1.3;
  margin-top: -0.2rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  max-width: 270px;
}

.hero-propuesta-valor strong {
  color: var(--dorado-claro);
  font-weight: 600;
}

/* Buscador Caja y Autocompletado */
.hero-buscador-caja {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  width: 100%;
  z-index: 10;
}

/* Grupo utilidades y botones derechos */
.hero-derecha-grupo {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  justify-self: end;
}

.buscador-contenedor {
  position: relative;
  width: 100%;
}

.buscador-icono {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: #7a6052;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.hero-buscador-caja input {
  width: 100%;
  padding: 0.7rem 5.2rem 0.7rem 3.2rem; /* Aumentado padding-right para dar espacio a los dos botones de la derecha */
  font-size: 1rem;
  font-family: var(--fuente-cuerpo);
  background: rgba(255, 249, 243, 0.95);
  border: 1px solid var(--borde);
  border-radius: 50px;
  color: #2c1810;
  outline: none;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 3px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(4px);
}

.hero-buscador-caja input::placeholder {
  color: #8a7060;
}

.hero-buscador-caja input:focus {
  border-color: var(--dorado-claro);
  background: #ffffff;
  box-shadow: 0 6px 28px rgba(184, 137, 42, 0.25), 0 0 0 3px rgba(184, 137, 42, 0.15);
}

/* Autocompletar Predictivo */
.autocompletar-panel {
  position: absolute;
  top: 105%;
  left: 0;
  right: 0;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  max-height: 420px;
  overflow-y: auto;
  z-index: 100;
  animation: deslizarAbajo 0.25s ease-out;
  text-align: left;
}

@keyframes deslizarAbajo {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.autocompletar-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--borde-suave);
  cursor: pointer;
  transition: background-color 0.2s;
  min-width: 0;
}

.autocompletar-item:last-child {
  border-bottom: none;
}

.autocompletar-item:hover,
.autocompletar-item.autocompletar-activo {
  background-color: var(--teal-suave);
}

.autocompletar-item.autocompletar-activo {
  outline: 2px solid var(--teal-medio);
  outline-offset: -2px;
}

.autocompletar-item.vacio {
  justify-content: center;
  color: var(--texto-suave);
  font-style: italic;
  padding: 1rem;
  cursor: default;
}

.autocompletar-portada {
  width: 32px;
  height: 45px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  background: var(--fondo);
}

.autocompletar-portada-vacia {
  width: 32px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--borde-suave);
  border-radius: 2px;
  font-size: 0.8rem;
}

.autocompletar-info {
  flex: 1;
  min-width: 0;
}

.autocompletar-titulo {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--texto);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocompletar-titulo strong,
.autocompletar-autor strong,
.autocompletar-saga strong {
  color: var(--teal-profundo);
  font-weight: 700;
}

:root[data-theme="dark"] .autocompletar-titulo strong,
:root[data-theme="dark"] .autocompletar-autor strong,
:root[data-theme="dark"] .autocompletar-saga strong {
  color: var(--dorado-claro);
}

.autocompletar-autor {
  font-size: 0.82rem;
  color: var(--texto-suave);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocompletar-genero {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  background: var(--borde-suave);
  color: var(--texto-medio);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.autocompletar-saga {
  background: rgba(184, 137, 42, 0.15);
  color: var(--dorado);
  border: 1px solid rgba(184, 137, 42, 0.3);
  text-transform: none;
  font-weight: 600;
}

.autocompletar-ver-todos {
  justify-content: center;
  font-size: 0.84rem;
  color: var(--teal-profundo);
  background: rgba(26, 92, 80, 0.06);
  font-weight: 600;
  padding: 0.65rem 1rem;
}

:root[data-theme="dark"] .autocompletar-ver-todos {
  color: var(--dorado-claro);
  background: rgba(212, 169, 74, 0.08);
}

.hero-acciones {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.65rem 0.8rem;
  margin-top: 0;
  width: 100%;
}

.btn-ia-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  min-height: 42px;
  white-space: nowrap;
  box-sizing: border-box;
  font-family: var(--fuente-cuerpo);
  font-size: 0.92rem;
  font-weight: 600;
  color: #fffef9;
  background: linear-gradient(135deg, #227a68 0%, #1a5c50 100%);
  border: 1.5px solid rgba(184, 137, 42, 0.55);
  border-radius: var(--radio);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(26, 92, 80, 0.45), 0 0 10px rgba(184, 137, 42, 0.1);
  transition: all 0.3s;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-ia-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(26, 92, 80, 0.6), 0 0 16px rgba(184, 137, 42, 0.3);
  border-color: rgba(184, 137, 42, 0.8);
  background: linear-gradient(135deg, #289177 0%, #1e6d59 100%);
}

/* CTA secundario: premium outline / menor peso visual */
.btn-azar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 1.2rem;
  min-height: 42px;
  white-space: nowrap;
  box-sizing: border-box;
  font-family: var(--fuente-cuerpo);
  font-size: 0.88rem;
  font-weight: 500;
  color: #ecd9c6;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(236, 217, 198, 0.25);
  border-radius: var(--radio);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-azar:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(212, 169, 74, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-azar:active {
  transform: translateY(0);
}

/* CTA de compra en hero — dorado para máxima visibilidad */
.btn-comprar-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 1rem;
  font-family: var(--fuente-cuerpo);
  font-size: 0.82rem;
  font-weight: 700;
  color: #1a0f08;
  background: var(--dorado);
  border-radius: var(--radio);
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(184, 137, 42, 0.25);
  transition: all 0.3s;
}

.btn-comprar-hero:hover {
  background: var(--dorado-claro);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(184, 137, 42, 0.4);
}

.btn-comprar-hero:active {
  transform: translateY(0);
}

.btn-azar-icono {
  font-size: 1.1rem;
}

.hero-linea-inferior {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--dorado) 20%, var(--teal-profundo) 50%, var(--dorado) 80%, transparent);
}

/* ══════════════════════════════════════════════════════ */
/* FILTROS — TAGS HORIZONTALES                            */
/* ══════════════════════════════════════════════════════ */
.filtros-wrapper {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.35rem 0 0.6rem;
}

.filtros-tags {
  display: flex;
  gap: 0.45rem;
  padding: 0.35rem 2.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.filtros-tags::-webkit-scrollbar {
  display: none;
}

.filtros-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50px;
  z-index: 2;
  pointer-events: none;
}

.filtros-fade-izq {
  left: 0;
  background: linear-gradient(90deg, var(--fondo), transparent);
}

.filtros-fade-der {
  right: 0;
  background: linear-gradient(-90deg, var(--fondo), transparent);
}

.tag-genero {
  flex-shrink: 0;
  padding: 0.35rem 0.85rem;
  font-family: var(--fuente-cuerpo);
  font-size: 0.86rem;
  min-height: 36px;
  color: var(--texto-medio);
  background: var(--fondo-tarjeta);
  border: 1.5px solid var(--borde);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.22s;
  white-space: nowrap;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 3px var(--sombra);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tag-genero:hover {
  border-color: var(--teal-medio);
  color: var(--teal-profundo);
  background: var(--teal-suave);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px var(--sombra-media);
}

.tag-genero.activo {
  background: var(--teal-profundo);
  border-color: var(--teal-profundo);
  color: #fff8f0;
  font-weight: 500;
  box-shadow: 0 3px 12px rgba(26, 92, 80, 0.28);
}

.tag-separador {
  width: 2px;
  height: 22px;
  background: var(--dorado-suave);
  opacity: 0.7;
  flex-shrink: 0;
  margin: 0 0.5rem;
  align-self: center;
  border-radius: 1px;
}

/* ══════════════════════════════════════════════════════ */
/* CONTADOR (Legible y sobrio en cabecera de catálogo)    */
/* ══════════════════════════════════════════════════════ */
.contador {
  font-family: var(--fuente-cuerpo);
  font-size: 0.92rem;
  color: var(--texto-suave);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.2px;
  margin: 0;
  padding: 0;
}

/* ── BREADCRUMBS ── */
.breadcrumbs-container {
  max-width: 1400px;
  margin: 0 auto 1.5rem;
  padding: 0.8rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  font-family: var(--fuente-cuerpo);
  background: rgba(184, 137, 42, 0.03);
  border-bottom: 1px solid var(--borde-suave);
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  background: var(--teal-suave);
  color: var(--teal-profundo);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.88rem;
  animation: aparecer 0.3s ease-out;
  border: 1px solid rgba(26, 92, 80, 0.15);
}

.breadcrumb-label {
  font-weight: 600;
  margin-right: 0.4rem;
  opacity: 0.8;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.breadcrumb-btn-remove {
  background: none;
  border: none;
  color: var(--teal-profundo);
  margin-left: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.breadcrumb-btn-remove:hover {
  opacity: 1;
}

.breadcrumb-clear-all {
  color: var(--texto-suave);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  text-decoration: underline;
  padding: 0.4rem 0.8rem;
  font-family: var(--fuente-cuerpo);
  transition: color 0.2s;
}

.breadcrumb-clear-all:hover {
  color: var(--teal-profundo);
}

/* ══════════════════════════════════════════════════════ */
/* GALERÍA                                                */
/* ══════════════════════════════════════════════════════ */
.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.5rem;
  padding: 0.5rem 2.5rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════════════ */
/* TARJETA                                                */
/* ══════════════════════════════════════════════════════ */
.tarjeta {
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde-suave);
  border-radius: var(--radio);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px var(--sombra), 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: aparecer 0.4s ease both;
  position: relative;
}

/* Portada del libro (thumbnail de Google Drive) */
.tarjeta-portada {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  display: block;
  background: var(--fondo);
  border-bottom: 1px solid var(--borde-suave);
}

/* Placeholder para libros sin portada */
.tarjeta-portada-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--fondo) 0%, var(--borde-suave) 100%);
  color: var(--texto-suave);
  opacity: 0.5;
}

.tarjeta-portada-placeholder svg,
.tarjeta-portada-placeholder i {
  width: 40px;
  height: 40px;
  stroke-width: 1.5px;
}

.galeria.vista-lista .tarjeta-portada-placeholder svg,
.galeria.vista-lista .tarjeta-portada-placeholder i {
  width: 24px;
  height: 24px;
}

/* ── ESTILOS VISTA LISTA ── */
.galeria.vista-lista {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-width: 1100px;
}

.galeria.vista-lista .tarjeta {
  flex-direction: row;
  align-items: center;
  padding: 0.6rem 1rem;
  gap: 1.2rem;
  height: auto;
}

.galeria.vista-lista .tarjeta::before {
  display: none; /* Eliminar adorno superior */
}

.galeria.vista-lista .tarjeta-portada {
  width: 50px;
  height: 70px;
  flex-shrink: 0;
  border-radius: 4px;
}

.galeria.vista-lista .tarjeta-info {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
}

.galeria.vista-lista .tarjeta-titulo {
  font-size: 1.05rem;
  margin-bottom: 0;
  flex: 2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.galeria.vista-lista .tarjeta-autor {
  font-size: 0.92rem;
  margin-bottom: 0;
  flex: 1.2;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.galeria.vista-lista .tarjeta-anio {
  font-size: 0.85rem;
  width: 60px;
  text-align: center;
  margin-bottom: 0;
}

.galeria.vista-lista .tarjeta-descripcion,
.galeria.vista-lista .tarjeta-genero-badge {
  display: none;
}

.galeria.vista-lista .btn-ver {
  margin: 0;
  padding: 0.45rem 1.2rem;
  font-size: 0.82rem;
  width: auto;
  min-width: 160px;
}

/* Línea superior decorativa */
.tarjeta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal-suave), var(--dorado), var(--teal-suave));
  opacity: 0.6;
  transition: opacity 0.3s;
}

.tarjeta:hover::before {
  opacity: 1;
  background: linear-gradient(90deg, var(--dorado), var(--teal-profundo), var(--dorado));
}

@keyframes aparecer {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tarjeta:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px var(--sombra-glow), 0 4px 12px var(--sombra-hover), 0 0 0 1px var(--sombra-glow-border);
}

.tarjeta-info {
  padding: 1.3rem 1.3rem 0.8rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* Badge de género con colores diferenciados */
.tarjeta-genero-badge {
  display: inline-block;
  font-family: var(--fuente-cuerpo);
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  width: fit-content;
  margin-bottom: 0.5rem;
  /* Default */
  color: var(--teal-profundo);
  background: var(--teal-suave);
  border: 1px solid rgba(26, 92, 80, 0.2);
}

.badge-preview {
  display: inline-block;
  font-family: var(--fuente-cuerpo);
  font-size: 0.6rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: 100px;
  margin-bottom: 0.5rem;
  margin-left: 0.3rem;
  color: var(--dorado-claro);
  background: rgba(184, 137, 42, 0.12);
  border: 1px solid rgba(184, 137, 42, 0.25);
}

/* ── Minimalismo Editorial: Tarjetas de cuadrícula limpias, uniformes y enfocadas en la portada ── */
.galeria:not(.vista-lista) .badge-preview,
.galeria:not(.vista-lista) .tarjeta-descripcion {
  display: none !important;
}

.galeria:not(.vista-lista) .tarjeta-info {
  padding: 1rem 1.15rem 0.6rem;
}

.galeria:not(.vista-lista) .btn-ver {
  margin: 0.5rem 1.15rem 1.15rem;
}

.tarjeta-fav-btn {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 6;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(2px);
}

.tarjeta-fav-btn i,
.tarjeta-fav-btn svg {
  width: 18px;
  height: 18px;
}

.tarjeta-fav-btn:hover {
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  transform: scale(1.1);
}

.tarjeta-fav-btn.favorito {
  background: var(--dorado);
  color: #1a0f08;
}

.tarjeta-fav-btn.favorito:hover {
  background: var(--dorado-claro);
}

/* Insignias Editoriales en Tarjetas (Bestseller / Clásico / Imprescindible) */
.tarjeta-insignia-editorial {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 6;
  font-family: var(--fuente-cuerpo);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  line-height: 1;
}

.tarjeta-insignia-editorial svg,
.tarjeta-insignia-editorial i {
  width: 12px;
  height: 12px;
}

/* Bestseller: Dorado cálido de prestigio */
.insignia-bestseller {
  background: rgba(26, 20, 10, 0.9);
  color: #f7d070;
  border: 1px solid rgba(247, 208, 112, 0.5);
}

/* Clásico: Verde agua / Sage editorial */
.insignia-clasico {
  background: rgba(14, 28, 24, 0.9);
  color: #a3e6cb;
  border: 1px solid rgba(163, 230, 203, 0.4);
}

/* Imprescindible: Terracota fuego */
.insignia-imprescindible {
  background: rgba(35, 16, 20, 0.9);
  color: #fca5a5;
  border: 1px solid rgba(252, 165, 165, 0.4);
}

/* En vista de detalle (modal): posición estática */
.detalle-badges-grupo .tarjeta-insignia-editorial {
  position: static;
  box-shadow: none;
  backdrop-filter: none;
}

/* En vista lista: oculta para mantener limpieza */
.galeria.vista-lista .tarjeta-insignia-editorial {
  display: none !important;
}

/* Colores por género */
.tarjeta-genero-badge.genero-ciencia-ficcion {
  color: #1a5f7a;
  background: rgba(26, 95, 122, 0.1);
  border-color: rgba(26, 95, 122, 0.2);
}

.tarjeta-genero-badge.genero-fantasia {
  color: #6b3fa0;
  background: rgba(107, 63, 160, 0.1);
  border-color: rgba(107, 63, 160, 0.2);
}

.tarjeta-genero-badge.genero-terror {
  color: #4a1a2e;
  background: rgba(74, 26, 46, 0.12);
  border-color: rgba(74, 26, 46, 0.2);
}

.tarjeta-genero-badge.genero-romance {
  color: #c24a6b;
  background: rgba(194, 74, 107, 0.1);
  border-color: rgba(194, 74, 107, 0.2);
}

.tarjeta-genero-badge.genero-filosofia {
  color: #5a6a3a;
  background: rgba(90, 106, 58, 0.1);
  border-color: rgba(90, 106, 58, 0.2);
}

.tarjeta-genero-badge.genero-poesia {
  color: #8a5a8a;
  background: rgba(138, 90, 138, 0.1);
  border-color: rgba(138, 90, 138, 0.2);
}

.tarjeta-genero-badge.genero-historia {
  color: #7a6a2a;
  background: rgba(122, 106, 42, 0.1);
  border-color: rgba(122, 106, 42, 0.2);
}

.tarjeta-genero-badge.genero-misterio {
  color: #3a4a6a;
  background: rgba(58, 74, 106, 0.1);
  border-color: rgba(58, 74, 106, 0.2);
}

.tarjeta-genero-badge.genero-teatro {
  color: #8a4a2a;
  background: rgba(138, 74, 42, 0.1);
  border-color: rgba(138, 74, 42, 0.2);
}

.tarjeta-genero-badge.genero-divulgacion {
  color: #2a6a5a;
  background: rgba(42, 106, 90, 0.1);
  border-color: rgba(42, 106, 90, 0.2);
}

.tarjeta-genero-badge.genero-psicologia {
  color: #5a7a6a;
  background: rgba(90, 122, 106, 0.1);
  border-color: rgba(90, 122, 106, 0.2);
}

.tarjeta-genero-badge.genero-biografia {
  color: #6a5a4a;
  background: rgba(106, 90, 74, 0.1);
  border-color: rgba(106, 90, 74, 0.2);
}

.tarjeta-genero-badge.genero-latinoamericana {
  color: #3a7a4a;
  background: rgba(58, 122, 74, 0.1);
  border-color: rgba(58, 122, 74, 0.2);
}

.tarjeta-titulo {
  font-family: var(--fuente-titulo);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--texto);
  line-height: 1.35;
  margin-bottom: 0.15rem;
}

.tarjeta-autor {
  font-family: var(--fuente-cuerpo);
  font-size: 0.92rem;
  color: var(--teal-medio);
  font-style: italic;
  font-weight: 400;
}

.tarjeta-anio {
  font-family: var(--fuente-cuerpo);
  font-size: 0.75rem;
  color: var(--texto-suave);
  letter-spacing: 1px;
}

.tarjeta-descripcion {
  font-size: 0.88rem;
  color: var(--texto-medio);
  margin-top: 0.6rem;
  line-height: 1.65;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── BOTÓN VER ── */
.btn-ver {
  display: block;
  margin: 0.8rem 1.3rem 1.3rem;
  padding: 0.65rem;
  background: linear-gradient(135deg, var(--teal-profundo) 0%, var(--fondo-header) 100%);
  color: #fff8f0 !important;
  text-align: center;
  text-decoration: none;
  font-family: var(--fuente-cuerpo);
  font-size: 0.88rem;
  border: 1.2px solid rgba(212, 169, 74, 0.35); /* Dorado border */
  border-radius: var(--radio);
  transition: all 0.3s ease;
  letter-spacing: 0.8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.btn-ver:hover {
  background: linear-gradient(135deg, var(--teal-medio) 0%, var(--teal-profundo) 100%);
  border-color: var(--dorado-claro);
  box-shadow: 0 5px 16px var(--sombra-glow), 0 0 0 2px rgba(212, 169, 74, 0.15);
  transform: translateY(-1px);
}



/* ══════════════════════════════════════════════════════ */
/* FOOTER                                                 */
/* ══════════════════════════════════════════════════════ */
footer {
  text-align: center;
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--borde);
  background: linear-gradient(to bottom, var(--fondo), var(--fondo-footer-end));
  position: relative;
}

.footer-ornamento {
  display: inline-block;
  width: 36px;
  height: 2px;
  background: var(--dorado);
  opacity: 0.45;
  margin-bottom: 1rem;
  border-radius: 2px;
}

.footer-stats {
  font-family: var(--fuente-cuerpo);
  font-size: 0.95rem;
  color: var(--texto-medio);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.footer-creditos {
  font-family: var(--fuente-cuerpo);
  font-size: 0.78rem;
  color: var(--texto-suave);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.footer-enlaces {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.footer-link-btn {
  background: none;
  border: none;
  color: var(--texto-suave);
  font-family: var(--fuente-cuerpo);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: all 0.2s;
  padding: 0.2rem 0.4rem;
}

.footer-link-btn:hover {
  color: var(--teal-profundo);
  text-decoration-color: currentColor;
}

:root[data-theme="dark"] .footer-link-btn:hover {
  color: var(--dorado-claro);
}

.footer-sep {
  color: var(--texto-suave);
  opacity: 0.4;
  font-size: 0.82rem;
}

/* ── Estilos Modal Información (Acerca de / FAQ) ── */
.modal-info-panel {
  max-width: 650px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.info-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--borde-suave);
  padding: 0 1.5rem;
  background: rgba(0, 0, 0, 0.05);
}

:root[data-theme="dark"] .info-tabs {
  background: rgba(255, 255, 255, 0.02);
}

.info-tab-btn {
  background: none;
  border: none;
  color: var(--texto-suave);
  font-family: var(--fuente-cuerpo);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.8rem 1.2rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.info-tab-btn:hover {
  color: var(--texto);
}

.info-tab-btn.activo {
  color: var(--teal-profundo);
  border-bottom-color: var(--teal-profundo);
  font-weight: 600;
}

:root[data-theme="dark"] .info-tab-btn.activo {
  color: var(--dorado);
  border-bottom-color: var(--dorado);
}

.info-modal-body {
  overflow-y: auto;
  padding: 1.5rem;
  max-height: 60vh;
}

.info-tab-content {
  display: none;
}

.info-tab-content.activo {
  display: block;
  animation: aparecerContenido 0.35s ease both;
}

@keyframes aparecerContenido {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.info-tab-content h3 {
  font-family: var(--fuente-titulo);
  font-size: 1.15rem;
  color: var(--texto);
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
}

.info-tab-content h3:first-of-type {
  margin-top: 0;
}

.info-tab-content p {
  font-family: var(--fuente-cuerpo);
  font-size: 0.92rem;
  color: var(--texto-medio);
  line-height: 1.6;
  margin-bottom: 1.2rem;
}

.faq-item {
  margin-bottom: 1.5rem;
  border-bottom: 1px dashed var(--borde-suave);
  padding-bottom: 1.2rem;
}

.faq-item:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.faq-item h4 {
  font-family: var(--fuente-titulo);
  font-size: 1.05rem;
  color: var(--texto);
  margin-bottom: 0.4rem;
}

.faq-item p {
  margin-bottom: 0;
}

/* ── Estilos Modal Contacto ── */
.modal-contacto-panel {
  max-width: 480px;
  width: 90%;
}

.contacto-descripcion {
  font-family: var(--fuente-cuerpo);
  font-size: 0.92rem;
  color: var(--texto-medio);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.contacto-opciones {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.contacto-opcion-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem;
  border: 1.5px solid var(--borde-suave);
  border-radius: var(--radio);
  text-decoration: none;
  color: var(--texto);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--fondo-tarjeta);
}

.contacto-opcion-card:hover {
  border-color: var(--dorado);
  background: var(--teal-suave);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--sombra);
}

.contacto-icono-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s;
}

/* Colores específicos para los iconos de contacto */
.contacto-opcion-card.opcion-email .contacto-icono-wrapper {
  background: rgba(26, 92, 80, 0.1);
  color: var(--teal-profundo);
}

:root[data-theme="dark"] .contacto-opcion-card.opcion-email .contacto-icono-wrapper {
  background: rgba(212, 169, 74, 0.15);
  color: var(--dorado);
}

.contacto-opcion-card.opcion-whatsapp .contacto-icono-wrapper {
  background: rgba(37, 211, 102, 0.1);
  color: #25d366;
}

.contacto-opcion-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.contacto-opcion-titulo {
  font-family: var(--fuente-titulo);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--texto);
}

.contacto-opcion-valor {
  font-family: var(--fuente-cuerpo);
  font-size: 0.86rem;
  color: var(--texto-suave);
}

/* ── PAGINACIÓN ── */
/* ══════════════════════════════════════════════════════ */
.paginacion {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 2rem 3rem;
  flex-wrap: wrap;
}

.btn-pagina {
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 0.7rem;
  border: 1.5px solid var(--borde);
  background: var(--fondo-tarjeta);
  color: var(--texto-medio);
  font-family: var(--fuente-cuerpo);
  font-size: 1rem;
  border-radius: var(--radio);
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-pagina:hover {
  border-color: var(--teal-medio);
  color: var(--teal-profundo);
  background: var(--teal-suave);
  transform: translateY(-1px);
}

.btn-pagina.activo {
  background: var(--teal-profundo);
  border-color: var(--teal-profundo);
  color: #fff8f0;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(26, 92, 80, 0.25);
}

.btn-pagina.desactivado {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.pagina-elipsis {
  color: var(--texto-suave);
  font-size: 1rem;
  padding: 0 0.3rem;
  user-select: none;
  display: flex;
  align-items: center;
  height: 2.6rem;
}

/* ═══════════════════════════════════════════════════ */
/* MODAL OVERLAY                                        */
/* ═══════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 8, 4, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeOverlay 0.25s ease;
}

.modal-overlay.abierto {
  display: flex;
}

@keyframes fadeOverlay {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════ */
/* PANEL DEL MODAL                                      */
/* ═══════════════════════════════════════════════════ */
.modal-panel {
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(15, 8, 4, 0.6);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Encabezado del modal ── */
.modal-header {
  background: linear-gradient(170deg, var(--teal-profundo) 0%, var(--fondo-header) 100%);
  padding: 2rem 2rem 1.5rem;
  position: relative;
  text-align: center;
  border-bottom: 2px solid rgba(184, 137, 42, 0.2);
}

.modal-ornamento {
  font-family: var(--fuente-cuerpo);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: #d4a94a;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  opacity: 0.9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.modal-titulo {
  font-family: var(--fuente-titulo);
  font-size: 1.8rem;
  font-weight: 700;
  color: #f0e8da;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.modal-subtitulo {
  font-family: var(--fuente-cuerpo);
  font-size: 0.92rem;
  color: #ecd9c6;
  font-style: italic;
  font-weight: 300;
}

.modal-cerrar {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: #ecd9c6;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radio);
  transition: color 0.2s, background 0.2s;
}

.modal-cerrar:hover {
  color: #f0e8da;
  background: rgba(255, 255, 255, 0.1);
}

/* ── Cuerpo del modal ── */
.modal-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

/* ═══════════════════════════════════════════════════ */
/* PREGUNTAS                                            */
/* ═══════════════════════════════════════════════════ */
.pregunta-grupo {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.pregunta-label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--fuente-titulo);
  font-size: 1rem;
  font-weight: 600;
  color: var(--texto);
}

.pregunta-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  background: var(--teal-profundo);
  color: #fff8f0;
  font-family: var(--fuente-cuerpo);
  font-size: 0.75rem;
  border-radius: 50%;
  flex-shrink: 0;
  letter-spacing: 0;
}

.opcional {
  font-family: var(--fuente-cuerpo);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--texto-suave);
  font-style: italic;
}

/* ── Grid de opciones ── */
.opciones-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.opcion-btn {
  padding: 0.5rem 1rem;
  font-family: var(--fuente-cuerpo);
  font-size: 0.92rem;
  color: var(--texto-medio);
  background: var(--fondo);
  border: 1.5px solid var(--borde);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.2px;
}

.opcion-btn:hover {
  border-color: var(--teal-medio);
  color: var(--teal-profundo);
  background: var(--teal-suave);
}

.opcion-btn.seleccionado {
  background: var(--teal-profundo);
  border-color: var(--teal-profundo);
  color: #fff8f0;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(26, 92, 80, 0.3);
}

/* ── Input de tema ── */
.ia-input-tema {
  width: 100%;
  padding: 0.85rem 1.2rem;
  font-size: 0.95rem;
  font-family: var(--fuente-cuerpo);
  background: var(--fondo-input);
  border: 1.5px solid var(--borde);
  border-radius: var(--radio);
  color: var(--texto);
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.ia-input-tema:focus {
  border-color: var(--teal-profundo);
  box-shadow: 0 0 0 3px var(--teal-suave);
}

.ia-input-tema::placeholder {
  color: var(--texto-suave);
  font-style: italic;
}

/* Validación visual */
.campo-incompleto {
  outline: 2px solid var(--vino);
  outline-offset: 6px;
  border-radius: 8px;
  animation: sacudir 0.4s ease;
}

.validacion-msg {
  display: block;
  font-size: 0.8rem;
  color: var(--vino);
  font-style: italic;
  margin-top: 0.4rem;
  animation: aparecerMensaje 0.3s ease;
}

@keyframes sacudir {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

@keyframes aparecerMensaje {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════ */
/* BOTONES DE ACCIÓN DEL MODAL                          */
/* ═══════════════════════════════════════════════════ */
.modal-acciones {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--borde-suave);
}

.btn-cancelar {
  padding: 0.7rem 1.5rem;
  font-family: var(--fuente-cuerpo);
  font-size: 0.95rem;
  color: var(--texto-suave);
  background: transparent;
  border: 1.5px solid var(--borde);
  border-radius: var(--radio);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancelar:hover {
  border-color: var(--teal-medio);
  color: var(--teal-profundo);
}

.btn-recomendar {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 2rem;
  font-family: var(--fuente-cuerpo);
  font-size: 1rem;
  font-weight: 600;
  color: #fff8f0;
  background: linear-gradient(135deg, var(--teal-profundo) 0%, #0c362e 100%);
  border: none;
  border-radius: var(--radio);
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 3px 12px rgba(26, 92, 80, 0.3);
}

.btn-recomendar:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(26, 92, 80, 0.4);
}

.btn-recomendar:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-flecha {
  font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════ */
/* ESTADO DE CARGA                                      */
/* ═══════════════════════════════════════════════════ */
.modal-estado {
  align-items: center;
  text-align: center;
  padding: 3rem 2rem;
  gap: 1rem;
}

.cargando-icono {
  font-size: 3rem;
  animation: pulsar 1.8s ease-in-out infinite;
}

@keyframes pulsar {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }
}

.cargando-texto {
  font-family: var(--fuente-titulo);
  font-size: 1.3rem;
  color: var(--texto);
}

.cargando-subtexto {
  font-size: 0.9rem;
  color: var(--texto-suave);
  font-style: italic;
}

.cargando-puntos {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.cargando-puntos span {
  width: 8px;
  height: 8px;
  background: var(--teal-profundo);
  border-radius: 50%;
  animation: brincar 1.2s ease-in-out infinite;
}

.cargando-puntos span:nth-child(2) {
  animation-delay: 0.2s;
}

.cargando-puntos span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes brincar {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  40% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════ */
/* TARJETAS DE RESULTADOS                               */
/* ═══════════════════════════════════════════════════ */
.resultados-header {
  text-align: center;
}

.resultados-intro {
  font-family: var(--fuente-titulo);
  font-style: italic;
  color: var(--texto-suave);
  font-size: 0.95rem;
}

.resultados-lista {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.resultado-tarjeta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.2rem 1.4rem;
  background: var(--fondo);
  border: 1px solid var(--borde-suave);
  border-left: 4px solid var(--teal-profundo);
  border-radius: var(--radio);
  animation: aparecer 0.4s ease both;
}

.resultado-tarjeta:nth-child(2) {
  animation-delay: 0.1s;
}

.resultado-tarjeta:nth-child(3) {
  animation-delay: 0.2s;
}

.resultado-num {
  font-family: var(--fuente-cuerpo);
  font-size: 0.62rem;
  letter-spacing: 3px;
  color: #d4a94a;
  text-transform: uppercase;
  font-weight: 600;
}

.resultado-titulo {
  font-family: var(--fuente-titulo);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--texto);
  line-height: 1.3;
}

.resultado-autor {
  font-family: var(--fuente-cuerpo);
  font-size: 0.88rem;
  color: var(--teal-medio);
  font-style: italic;
}

.resultado-razon {
  font-size: 0.9rem;
  color: var(--texto-medio);
  line-height: 1.6;
  margin-top: 0.2rem;
}

.resultado-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.5rem 1.2rem;
  font-family: var(--fuente-cuerpo);
  font-size: 0.88rem;
  color: var(--teal-profundo);
  border: 1.5px solid var(--teal-profundo);
  border-radius: var(--radio);
  text-decoration: none;
  transition: all 0.2s;
  width: fit-content;
}

.resultado-btn:hover {
  background: var(--teal-profundo);
  color: #fff8f0;
}

.ia-resultado-cta {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  background: linear-gradient(135deg, rgba(184, 137, 42, 0.08) 0%, rgba(26, 92, 80, 0.06) 100%);
  border: 1px solid rgba(184, 137, 42, 0.2);
  border-radius: var(--radio);
  text-align: center;
}

.ia-resultado-cta p {
  font-family: var(--fuente-cuerpo);
  font-size: 0.85rem;
  color: var(--texto-medio);
  margin: 0 0 0.7rem 0;
}

.btn-comprar-ia {
  display: inline-block;
  padding: 0.55rem 1.5rem;
  font-family: var(--fuente-cuerpo);
  font-size: 0.88rem;
  font-weight: 700;
  color: #1a0f08;
  background: var(--dorado);
  border-radius: 30px;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(184, 137, 42, 0.25);
  transition: all 0.3s;
}

.btn-comprar-ia:hover {
  background: var(--dorado-claro);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(184, 137, 42, 0.4);
}

/* ══════════════════════════════════════════════════════ */
/* BOTÓN LIMPIAR BÚSQUEDA                                */
/* ══════════════════════════════════════════════════════ */
.buscador-botones-derecha {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-limpiar-busqueda,
.btn-buscar-click {
  background: none;
  border: none;
  color: #6b5344;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 50%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
}

.btn-limpiar-busqueda:hover,
.btn-buscar-click:hover {
  background: rgba(26, 92, 80, 0.14);
  color: #1a5c50;
}

.btn-buscar-click.busqueda-ejecutada {
  color: #1a5c50;
  transform: scale(1.2);
  transition: transform 0.15s ease;
}

/* ══════════════════════════════════════════════════════ */
/* BOTÓN LIBRO AL AZAR                                    */
/* ══════════════════════════════════════════════════════ */
.ia-botones-grupo {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

/* ══════════════════════════════════════════════════════ */
/* BARRA DE CONTROLES (contador + orden)                  */
/* ══════════════════════════════════════════════════════ */
.controles-derecha {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.btn-favoritos-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.9rem;
  font-family: var(--fuente-cuerpo);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--texto-medio);
  background: var(--fondo-tarjeta);
  border: 1.5px solid var(--borde);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-favoritos-toggle i,
.btn-favoritos-toggle svg {
  width: 16px;
  height: 16px;
}

.btn-favoritos-toggle:hover {
  border-color: var(--dorado);
  color: var(--dorado);
}

.btn-favoritos-toggle.activo {
  background: var(--dorado);
  border-color: var(--dorado);
  color: #1a0f08;
  font-weight: 600;
}

.select-orden {
  padding: 0.45rem 2rem 0.45rem 0.8rem;
  font-family: var(--fuente-cuerpo);
  font-size: 0.88rem;
  color: var(--texto-medio);
  background: var(--fondo-tarjeta);
  border: 1.5px solid var(--borde);
  border-radius: var(--radio);
  cursor: pointer;
  transition: all 0.25s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a7060' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 10px;
}

.select-orden:hover {
  border-color: var(--teal-medio);
}

.select-orden:focus {
  outline: none;
  border-color: var(--teal-profundo);
  box-shadow: 0 0 0 3px var(--teal-suave);
}

/* ── CONTROLES DE VISTA ── */
.vista-controles {
  display: flex;
  background: var(--fondo-tarjeta);
  border: 1.5px solid var(--borde);
  border-radius: var(--radio);
  overflow: hidden;
}

.btn-vista {
  background: none;
  border: none;
  padding: 0.45rem 0.65rem;
  color: var(--texto-suave);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border-right: 1px solid var(--borde);
}

.btn-vista:last-child {
  border-right: none;
}

.btn-vista:hover {
  color: var(--teal-profundo);
  background: var(--teal-suave);
}

.btn-vista.activo {
  color: #fff;
  background: var(--teal-profundo);
}

.btn-vista .lucide {
  width: 1rem;
  height: 1rem;
  stroke-width: 2.5px;
}

/* ══════════════════════════════════════════════════════ */
/* SIN RESULTADOS (mejorado)                              */
/* ══════════════════════════════════════════════════════ */
.sin-resultados {
  text-align: center;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.sin-resultados-icono {
  font-size: 3rem;
  opacity: 0.6;
}

.sin-resultados-texto {
  color: var(--texto-suave);
  font-style: italic;
  font-size: 1.15rem;
  font-family: var(--fuente-titulo);
}

.btn-limpiar-todo {
  padding: 0.6rem 1.5rem;
  font-family: var(--fuente-cuerpo);
  font-size: 0.92rem;
  color: var(--teal-profundo);
  background: transparent;
  border: 1.5px solid var(--teal-profundo);
  border-radius: var(--radio);
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.5px;
}

.btn-limpiar-todo:hover {
  background: var(--teal-profundo);
  color: #fff8f0;
  box-shadow: 0 4px 14px rgba(26, 92, 80, 0.25);
}

/* ══════════════════════════════════════════════════════ */
/* ERROR DE CARGA                                         */
/* ══════════════════════════════════════════════════════ */
.error-carga {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.error-carga .error-icono {
  font-size: 3rem;
}

.error-carga h2 {
  font-family: var(--fuente-titulo);
  color: var(--texto);
  font-size: 1.3rem;
}

.error-carga p {
  color: var(--texto-suave);
  font-style: italic;
}

/* ══════════════════════════════════════════════════════ */
/* MODAL: DETALLE DEL LIBRO                               */
/* ══════════════════════════════════════════════════════ */
.modal-panel-detalle {
  max-width: 560px;
}

.detalle-body {
  gap: 0.8rem;
}

.detalle-grid {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.detalle-portada-wrapper {
  flex-shrink: 0;
  width: 190px;
}

.detalle-portada {
  width: 100%;
  height: auto;
  max-height: 290px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 6px 18px var(--sombra);
  display: block;
}

.detalle-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detalle-genero-fav-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
}

.detalle-badges-grupo {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .detalle-grid {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .detalle-portada-wrapper {
    width: 165px;
    margin: 0 auto;
  }

  .detalle-portada {
    max-height: 245px;
  }

  .detalle-info {
    width: 100%;
  }
}

.detalle-autor {
  font-family: var(--fuente-cuerpo);
  font-size: 1.1rem;
  color: var(--teal-medio);
  font-style: italic;
  font-weight: 500;
}

/* Botón enlace para autor y género en detalle */
.detalle-enlace {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s, color 0.2s;
  text-align: left;
}

.detalle-enlace:hover,
.detalle-enlace:focus-visible {
  text-decoration-color: currentColor;
  color: var(--dorado);
  outline: none;
}

.detalle-enlace-badge {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s, color 0.2s, filter 0.2s;
  letter-spacing: inherit;
  text-transform: inherit;
}

.detalle-enlace-badge:hover,
.detalle-enlace-badge:focus-visible {
  text-decoration-color: currentColor;
  outline: none;
  filter: brightness(1.25);
}

.detalle-anio {
  font-family: var(--fuente-cuerpo);
  font-size: 0.85rem;
  color: var(--texto-suave);
  letter-spacing: 1px;
}

.detalle-descripcion {
  font-size: 0.95rem;
  color: var(--texto-medio);
  line-height: 1.75;
  margin: 0.5rem 0;
}

.detalle-pdf-btn {
  align-self: flex-start;
  text-decoration: none;
  display: inline-flex;
  margin-top: 0.3rem;
}

.detalle-fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1.5px solid var(--borde);
  border-radius: 50%;
  background: var(--fondo-tarjeta);
  color: var(--texto-suave);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.detalle-fav-btn i,
.detalle-fav-btn svg {
  width: 18px;
  height: 18px;
}

.detalle-fav-btn:hover {
  border-color: var(--dorado);
  color: var(--dorado);
}

.detalle-fav-btn.favorito {
  background: var(--dorado);
  border-color: var(--dorado);
  color: #1a0f08;
}

.detalle-fav-btn.favorito:hover {
  background: var(--dorado-claro);
}

.detalle-relacionados-seccion {
  margin-top: 1rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--borde-suave);
}

.detalle-relacionados-titulo {
  font-family: var(--fuente-titulo);
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--dorado);
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.detalle-relacionados-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.relacionado-item {
  padding: 0.7rem 0.9rem;
  background: var(--fondo);
  border: 1px solid var(--borde-suave);
  border-radius: var(--radio);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.relacionado-portada {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--fondo-tarjeta);
  box-shadow: 0 1px 4px var(--sombra);
}

.relacionado-item:hover {
  border-color: var(--teal-medio);
  transform: translateY(-2px);
  box-shadow: 0 3px 10px var(--sombra-media);
}

.relacionado-titulo {
  font-family: var(--fuente-titulo);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--texto);
  line-height: 1.3;
  margin-bottom: 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.relacionado-autor {
  font-family: var(--fuente-cuerpo);
  font-size: 0.75rem;
  color: var(--texto-suave);
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}



/* ══════════════════════════════════════════════════════ */
/* RESPONSIVE                                             */
/* ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hero-seccion {
    padding: 0.6rem 1rem;
  }

  .hero-contenido {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto auto;
    gap: 0.5rem 0.8rem;
  }

  .hero-marca {
    grid-column: 1;
    grid-row: 1;
  }

  .hero-derecha-grupo {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    justify-self: end;
  }

  .hero-propuesta-valor {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: center;
    justify-self: center;
    white-space: normal;
    max-width: none;
  }

  .hero-buscador-caja {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .hero-acciones {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: 0.3rem;
  }

  .hero-seccion h1 {
    font-size: 1.6rem;
    letter-spacing: 1px;
  }

  .hero-subtitulo {
    font-size: 0.7rem;
  }

  .hero-propuesta-valor {
    font-size: 0.72rem;
  }

  .hero-logo {
    width: 60px;
    height: 60px;
  }

  .btn-codigo-donador span {
    display: none;
  }

  .btn-comprar-hero {
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
  }

  .galeria {
    padding: 0.5rem 1rem 3rem;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
  }

  .destacados-seccion {
    padding: 1.5rem 0 0.5rem;
  }
  .seccion-titulo-destacados {
    padding: 0 1rem;
  }
  .destacados-fin-banner {
    padding: 0 1rem;
    margin: 1rem 0 0.6rem;
  }
  .destacados-fin-banner::before {
    left: 1rem;
    right: 1rem;
  }

  .catalogo-header-barra {
    padding: 0 1rem 0.5rem;
    margin: 1.5rem auto 0.8rem;
  }
  .catalogo-barra-titulo {
    font-size: 1.2rem;
  }

  .tarjeta-portada {
    object-fit: contain;
    background: var(--fondo-tarjeta);
    height: auto;
    aspect-ratio: auto;
  }

  .galeria.vista-lista .tarjeta-portada {
    object-fit: cover;
  }

  .filtros-tags {
    padding: 0.5rem 1rem;
  }

  .buscador {
    padding: 1.5rem 1rem 0.8rem;
  }

  .controles-barra {
    padding: 0.3rem 1rem 0.5rem;
  }

  .ia-botones-grupo {
    flex-direction: column;
    gap: 0.6rem;
  }

  .detalle-relacionados-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Hero responsive: layout apilado en pantallas pequeñas ── */
@media (max-width: 600px) {
  .hero-seccion {
    padding: 0.6rem 0.8rem;
  }

  .hero-contenido {
    position: relative; /* Posicionamiento de la luna y la llave absolute */
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
    gap: 0.5rem;
  }

  .hero-marca {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 1.5rem; /* Margen para no chocar con los botones absolutos */
  }

  .hero-marca .header-home-link {
    justify-content: center;
    flex-direction: column; /* Apilar logo y texto para simetría */
    gap: 0.5rem;
  }

  .hero-logo {
    width: 72px !important;
    height: 72px !important;
  }

  .hero-seccion h1 {
    font-size: 2.0rem !important;
    letter-spacing: 1px;
  }

  .hero-propuesta-valor {
    grid-column: 1;
    grid-row: 2;
    text-align: center;
    justify-self: center;
    white-space: normal;
  }

  .hero-derecha-grupo {
    position: static; /* Para que los absolutos se posicionen sobre .hero-contenido */
    grid-column: 1;
    grid-row: 3;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
  }

  .btn-tema {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    width: 2.2rem !important;
    height: 2.2rem !important;
    z-index: 10;
  }

  .btn-codigo-donador {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 2.2rem !important;
    height: 2.2rem !important;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center;
    align-items: center;
    display: inline-flex;
    z-index: 10;
  }

  .btn-codigo-donador span {
    display: none !important;
  }

  .btn-comprar-hero {
    margin: 0 auto;
    font-size: 0.78rem !important;
    padding: 0.45rem 1.0rem !important;
    text-align: center;
    display: inline-block;
  }

  .hero-buscador-caja {
    grid-column: 1;
    grid-row: 4;
  }

  .hero-acciones {
    grid-column: 1;
    grid-row: 5;
    width: 100%;
    margin-top: 0.3rem;
  }
}

@media (max-width: 480px) {
  .hero-propuesta-valor {
    font-size: 0.68rem;
  }

  .hero-acciones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
  }

  .btn-ia-trigger,
  .btn-hero-whatsapp {
    justify-content: center;
    padding: 0.55rem 1.0rem;
    font-size: 0.85rem;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
  }

  /* Grid de 2 columnas fijas en móvil para mejor legibilidad */
  .galeria {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    padding: 0.5rem 0.5rem 3rem;
  }

  .destacados-seccion {
    padding: 0.8rem 0 0.5rem;
  }

  .destacados-header-fila {
    padding: 0 1.0rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .seccion-titulo-destacados,
  .destacados-header-fila .seccion-titulo-destacados {
    font-size: 1.15rem !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
    white-space: nowrap;
    gap: 0.35rem;
  }

  .destacados-guia-scroll {
    font-size: 0.74rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .guia-scroll-extra {
    display: none;
  }
  .destacados-fin-banner,
  .colecciones-fin-banner {
    padding: 0 1.2rem;
    margin: 0.8rem 0 0.5rem;
  }
  .destacados-fin-banner::before,
  .colecciones-fin-banner::before {
    left: 1.2rem;
    right: 1.2rem;
  }

  .catalogo-header-barra {
    padding: 0 1.2rem 0.4rem;
    margin: 1.2rem auto 1rem;
  }
  .catalogo-barra-titulo {
    font-size: 1.3rem;
  }

  .tarjeta-info {
    padding: 0.8rem 0.8rem 0.5rem;
  }

  .tarjeta-titulo {
    font-size: 0.88rem;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .tarjeta-descripcion {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    font-size: 0.8rem;
    margin-top: 0.4rem;
  }

  .tarjeta-autor {
    font-size: 0.8rem;
  }

  .btn-ver {
    margin: 0.5rem 0.8rem 0.8rem;
    padding: 0.5rem;
    font-size: 0.82rem;
  }

}

/* Ultra peque\u00f1o: iPhone SE y similares */
@media (max-width: 360px) {
  .galeria {
    grid-template-columns: 1fr;
  }

  .tarjeta {
    flex-direction: row;
    gap: 0;
  }

  .tarjeta-portada {
    width: 100px;
    height: auto;
    aspect-ratio: 3/4;
    border-radius: var(--radio) 0 0 var(--radio);
    border-bottom: none;
    border-right: 1px solid var(--borde-suave);
  }
}

/* ── Responsive modal ── */
@media (max-width: 600px) {
  .galeria.vista-lista .tarjeta {
    flex-direction: row;
    align-items: center;
    padding: 0.5rem 0.8rem;
    gap: 0.8rem;
  }
  
  .galeria.vista-lista .tarjeta-portada {
    width: 45px;
    height: 60px;
    margin-bottom: 0;
    border-radius: 4px;
  }
  
  .galeria.vista-lista .tarjeta-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    width: auto;
    flex: 1;
    min-width: 0;
  }
  
  .galeria.vista-lista .tarjeta-titulo {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    font-weight: 600;
    width: 100%;
    line-height: 1.2;
  }

  .galeria.vista-lista .tarjeta-autor {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8rem;
    width: 100%;
    opacity: 0.7;
  }
  
  .galeria.vista-lista .tarjeta-anio {
    text-align: left;
    width: auto;
    font-size: 0.75rem;
    opacity: 0.6;
  }

  .galeria.vista-lista .btn-ver {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border-radius: 50%;
    margin-top: 0;
    font-size: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .galeria.vista-lista .btn-ver i,
  .galeria.vista-lista .btn-ver svg {
    margin: 0;
    width: 16px;
    height: 16px;
  }

  .modal-panel {
    max-height: 95vh;
  }
  
  .modal-panel-lector {
    max-width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  
  .header-lector {
    padding: 1rem 1.2rem;
  }

  .modal-body {
    padding: 1.2rem;
  }

  .modal-header {
    padding: 1.5rem 1.2rem 1.2rem;
  }

  .modal-titulo {
    font-size: 1.4rem;
  }

  .modal-acciones {
    flex-direction: column;
  }

  .btn-cancelar,
  .btn-recomendar {
    width: 100%;
    justify-content: center;
  }
}

/* ══════════════════════════════════════════════════════ */
/* CONTROLES CUSTOMIZADOS Y MOOD TAGS                    */
/* ══════════════════════════════════════════════════════ */

.controles-barra {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.controles-izq {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* ── Control Segmentado: Vistas de Biblioteca (Catálogo / Favoritos / Leyendo) ── */
.segmento-biblioteca {
  display: inline-flex;
  align-items: center;
  background: var(--fondo-tarjeta);
  border: 1.5px solid var(--borde);
  border-radius: 28px;
  padding: 3px;
  gap: 3px;
  box-shadow: 0 1px 4px var(--sombra);
}

.btn-segmento {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.95rem;
  min-height: 38px;
  border: none;
  background: transparent;
  color: var(--texto);
  font-family: var(--fuente-cuerpo);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn-segmento:hover {
  color: var(--teal-profundo);
  background: var(--teal-suave);
}

.btn-segmento.activo {
  background: var(--teal-profundo);
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(26, 92, 80, 0.28);
}

.btn-segmento.activo i,
.btn-segmento.activo [data-lucide] {
  color: #ffffff !important;
}

:root[data-theme="dark"] .btn-segmento.activo {
  background: var(--teal-medio);
  color: #0b1a16 !important;
}

:root[data-theme="dark"] .btn-segmento.activo i,
:root[data-theme="dark"] .btn-segmento.activo [data-lucide] {
  color: #0b1a16 !important;
}

.controles-derecha {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.chip-count {
  font-size: 0.72rem;
  background: rgba(26, 92, 80, 0.12);
  color: var(--teal-profundo);
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  margin-left: 0.4rem;
  font-weight: 600;
  display: inline-block;
  vertical-align: middle;
}

.custom-dropdown .dropdown-item.seleccionado .chip-count {
  background: rgba(26, 92, 80, 0.25);
}

/* Custom Dropdown Menus */
.custom-dropdown {
  position: relative;
  font-family: var(--fuente-cuerpo);
}

.custom-dropdown .dropdown-btn {
  font-family: var(--fuente-cuerpo);
  font-size: 0.88rem;
  padding: 0.4rem 2.3rem 0.4rem 1.1rem;
  background: var(--fondo-tarjeta);
  border: 1.5px solid var(--borde);
  border-radius: 30px;
  color: var(--texto);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  outline: none;
  transition: all 0.22s;
  box-shadow: 0 1px 4px var(--sombra);
  min-width: 165px;
  min-height: 42px;
  box-sizing: border-box;
}

#dropdownOrden .dropdown-btn {
  min-width: 195px;
}

.custom-dropdown .dropdown-input {
  font-family: var(--fuente-cuerpo);
  font-size: 0.88rem;
  padding: 0.4rem 1.1rem;
  background: var(--fondo-tarjeta);
  border: 1.5px solid var(--borde);
  border-radius: 30px;
  color: var(--texto);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  outline: none;
  transition: all 0.22s;
  box-shadow: 0 1px 4px var(--sombra);
  min-width: 155px;
  min-height: 42px;
  box-sizing: border-box;
}

.custom-dropdown.searchable .dropdown-input {
  cursor: text;
  padding-right: 2.2rem;
}

.custom-dropdown .dropdown-trigger {
  position: relative;
  display: flex;
  align-items: center;
}

.custom-dropdown .dropdown-clear-btn {
  position: absolute;
  right: 2.2rem;
  background: none;
  border: none;
  color: var(--texto-suave);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.2s;
  width: 20px;
  height: 20px;
}

.custom-dropdown .dropdown-clear-btn:hover {
  opacity: 1;
  color: var(--teal-profundo);
}

.custom-dropdown .dropdown-arrow {
  position: absolute;
  right: 0.8rem;
  color: var(--texto-suave);
  pointer-events: none;
  transition: transform 0.3s;
  display: flex;
  align-items: center;
}

.custom-dropdown.abierto .dropdown-arrow {
  transform: rotate(180deg);
}

.custom-dropdown .dropdown-btn:hover,
.custom-dropdown .dropdown-input:focus,
.custom-dropdown .dropdown-input:hover {
  border-color: var(--teal-medio);
  box-shadow: 0 2px 10px var(--sombra-media);
}

.custom-dropdown .dropdown-menu {
  position: absolute;
  top: 115%;
  left: 0;
  right: auto;
  width: 220px;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: 8px;
  box-shadow: 0 6px 24px var(--sombra-media);
  list-style: none;
  padding: 0.4rem 0;
  max-height: 250px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  z-index: 1000;
}

#dropdownOrden .dropdown-menu {
  left: auto;
  right: 0;
}

#dropdownSaga .dropdown-menu {
  width: 285px;
  max-height: 310px;
}

.custom-dropdown.searchable .dropdown-menu {
  width: 260px;
  left: 0;
  right: auto;
}

.custom-dropdown.abierto .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-dropdown .dropdown-item {
  padding: 0.45rem 1.2rem;
  font-size: 0.9rem;
  color: var(--texto);
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.custom-dropdown .dropdown-item:hover {
  background-color: var(--teal-suave);
  color: var(--teal-profundo);
}

.custom-dropdown .dropdown-item.seleccionado {
  font-weight: 600;
  color: var(--teal-profundo);
  background-color: var(--teal-suave);
  position: relative;
}

.custom-dropdown .dropdown-item.seleccionado::after {
  content: '✓';
  position: absolute;
  right: 1rem;
  font-size: 0.8rem;
  color: var(--teal-profundo);
}

/* ── Panel de Más Filtros Consolidados ── */
#dropdownMasFiltros .dropdown-menu.dropdown-mas-filtros-panel {
  width: 295px;
  max-height: none;
  padding: 1.1rem;
  left: auto;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.mas-filtros-seccion {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.mas-filtros-titulo {
  font-family: var(--fuente-cuerpo);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--texto-suave);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mas-filtros-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-filtro {
  font-family: var(--fuente-cuerpo);
  font-size: 0.8rem;
  padding: 0.32rem 0.72rem;
  border-radius: 20px;
  background: var(--fondo);
  border: 1.5px solid var(--borde);
  color: var(--texto-medio);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.chip-filtro:hover {
  border-color: var(--teal-medio);
  color: var(--teal-profundo);
  background: var(--teal-suave);
}

.chip-filtro.seleccionado {
  background: var(--teal-profundo);
  border-color: var(--teal-profundo);
  color: #fff8f0;
  font-weight: 600;
}

.badge-mas-filtros {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--dorado);
  color: #1a0f08;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.15rem;
}

#dropdownMasFiltros .dropdown-btn.filtro-activo {
  border-color: var(--dorado);
  background: rgba(184, 137, 42, 0.1);
  color: var(--dorado-texto);
}

/* Mood Tags Específicos — Contraste Optimizado WCAG 2.1 AA (> 5.5:1) */
.filtros-tags .tag-genero.tag-mood-btn {
  background: linear-gradient(135deg, #fdfaf4 0%, #faedd3 100%);
  border-color: #d1b87d;
  color: #5c420b;
  font-weight: 600;
}

.filtros-tags .tag-genero.tag-mood-btn:hover {
  background: linear-gradient(135deg, #faedd3 0%, #ebd4a4 100%);
  color: #3d2c07;
  border-color: #b8984e;
  box-shadow: 0 4px 12px rgba(184, 137, 42, 0.22);
}

.filtros-tags .tag-genero.tag-mood-btn.activo {
  background: linear-gradient(135deg, #b8892a 0%, #7d5912 100%);
  border-color: #7d5912;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(184, 137, 42, 0.35);
}

:root[data-theme="dark"] .filtros-tags .tag-genero.tag-mood-btn {
  background: linear-gradient(135deg, #262019 0%, #3d3222 100%);
  border-color: #7a6336;
  color: #f7d282;
}

:root[data-theme="dark"] .filtros-tags .tag-genero.tag-mood-btn:hover {
  background: linear-gradient(135deg, #3d3222 0%, #52432c 100%);
  color: #ffffff;
  border-color: #f7d282;
}

:root[data-theme="dark"] .filtros-tags .tag-genero.tag-mood-btn.activo {
  background: linear-gradient(135deg, var(--dorado) 0%, #8c6a1b 100%);
  border-color: var(--dorado);
  color: #1a0f08;
}

/* Responsive para Controles Rediseñados */
@media (max-width: 768px) {
  .controles-barra {
    display: none !important;
  }

  .controles-izq {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .btn-toggle-filtros-movil {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
    background: rgba(184, 137, 42, 0.12);
    border: 1.5px solid rgba(184, 137, 42, 0.45);
    color: var(--dorado-texto) !important;
    font-family: var(--fuente-cuerpo);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.32rem 0.65rem;
    border-radius: 14px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .btn-toggle-filtros-movil:hover {
    background: rgba(184, 137, 42, 0.22);
    border-color: var(--dorado);
    color: var(--dorado-texto);
  }
  .btn-toggle-filtros-movil[aria-expanded="true"] {
    background: var(--dorado);
    border-color: var(--dorado);
    color: #1a0f08 !important;
  }
  .btn-toggle-filtros-movil .flecha-toggle {
    transition: transform 0.25s ease;
  }
  .btn-toggle-filtros-movil[aria-expanded="true"] .flecha-toggle {
    transform: rotate(180deg);
  }

  .controles-derecha {
    display: none !important;
  }

  .controles-derecha.abierto {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
    margin-top: 0.8rem;
    width: 100%;
  }

  .controles-derecha.abierto > * {
    flex: none !important;
  }

  .custom-dropdown {
    width: 100%;
  }

  .custom-dropdown .dropdown-btn,
  .custom-dropdown .dropdown-input {
    width: 100%;
    justify-content: space-between;
  }

  .custom-dropdown .dropdown-menu,
  #dropdownOrden .dropdown-menu {
    width: 100%;
    min-width: 100%;
    left: 0;
    right: 0;
  }

  .catalogo-header-barra {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }

  .catalogo-barra-info {
    justify-content: space-between;
    width: 100%;
  }

  .catalogo-barra-acciones {
    justify-content: space-between;
    width: 100%;
  }

  .catalogo-barra-acciones #dropdownOrden {
    flex: 1;
  }

  .catalogo-barra-acciones #dropdownOrden .dropdown-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .controles-barra {
    padding: 0.5rem 0.9rem !important;
  }

  .controles-izq {
    gap: 0.35rem;
  }

  .segmento-biblioteca {
    padding: 2px;
    gap: 2px;
  }

  .btn-segmento {
    padding: 0.3rem 0.48rem;
    font-size: 0.76rem;
    min-height: 32px;
    gap: 0.25rem;
  }

  .btn-toggle-filtros-movil {
    padding: 0.3rem 0.55rem !important;
    font-size: 0.76rem !important;
    gap: 0.28rem !important;
  }
}

@media (max-width: 380px) {
  .btn-segmento span {
    display: none;
  }
  .btn-segmento {
    padding: 0.3rem 0.45rem;
  }
}

/* ════════════════════════════════════════════════════════
   BOTÓN CÓDIGO DONADOR (HERO)
════════════════════════════════════════════════════════ */
.btn-codigo-donador {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: 1px solid rgba(212, 169, 74, 0.4);
  border-radius: 20px;
  color: var(--dorado-claro);
  font-family: var(--fuente-cuerpo);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-codigo-donador:hover {
  background: rgba(184, 137, 42, 0.16);
  border-color: var(--dorado);
  transform: scale(1.02);
}
.btn-codigo-donador.activo {
  background: var(--dorado);
  border-color: var(--dorado);
  color: #1a0f08;
  font-weight: 600;
}
.descargar-donador-grupo {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.5rem;
  flex-wrap: nowrap;
}
.btn-descargar-donador {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex: 1;
  padding: 0.55rem 0.5rem;
  background: var(--dorado);
  border: none;
  border-radius: var(--radio);
  color: #1a0f08;
  font-family: var(--fuente-cuerpo);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.btn-descargar-donador:hover {
  background: var(--dorado-claro);
  transform: scale(1.03);
}
.btn-descargar-donador.btn-descargar-epub {
  background: var(--teal-profundo);
  color: #fff8f0;
  border: 1px solid rgba(212, 169, 74, 0.35);
}
.btn-descargar-donador.btn-descargar-epub:hover {
  background: var(--teal-medio);
}

@media (max-width: 480px) {
  .btn-descargar-donador {
    font-size: 0.78rem;
    padding: 0.5rem 0.3rem;
    gap: 0.25rem;
  }
}

/* ════════════════════════════════════════════════════════
   MODAL: CÓDIGO DE DONADOR
════════════════════════════════════════════════════════ */
.modal-codigo-panel {
  max-width: 440px;
}
.codigo-descripcion {
  font-size: 0.95rem;
  color: var(--texto-suave);
  margin-bottom: 1.2rem;
  line-height: 1.6;
}
.codigo-input-wrapper {
  margin-bottom: 1rem;
}
.codigo-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--fondo-input);
  border: 1.5px solid var(--borde);
  border-radius: var(--radio);
  color: var(--texto);
  transition: border-color 0.2s;
}
.codigo-input:focus {
  outline: none;
  border-color: var(--dorado);
  box-shadow: 0 0 0 3px var(--dorado-glow);
}
.codigo-mensaje {
  padding: 0.6rem 0.9rem;
  border-radius: var(--radio);
  font-size: 0.88rem;
  margin-bottom: 0.8rem;
}
.codigo-mensaje.exito {
  background: rgba(34, 139, 34, 0.1);
  color: #228B22;
  border: 1px solid rgba(34, 139, 34, 0.3);
}
.codigo-mensaje.error {
  background: rgba(180, 40, 40, 0.1);
  color: var(--teal-medio);
  border: 1px solid rgba(180, 40, 40, 0.3);
}
.codigo-donacion-link {
  margin-top: 1rem;
  font-size: 0.83rem;
  color: var(--texto-suave);
  text-align: center;
}
.codigo-donacion-link a {
  color: var(--dorado);
  text-decoration: underline;
}

/* ════════════════════════════════════════════════════════
   LECTOR DE PDF EMBEBIDO (PDF.js)
════════════════════════════════════════════════════════ */
.lector-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--fondo-header);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Barra de controles superior */
.lector-barra-controles {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: rgba(8, 20, 17, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(184, 137, 42, 0.25);
  z-index: 9030;
  flex-shrink: 0;
}
.lector-titulo-texto {
  font-family: var(--fuente-titulo);
  font-size: 0.9rem;
  color: var(--dorado-claro);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.lector-controles {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.lector-paginas {
  font-family: var(--fuente-cuerpo);
  font-size: 0.9rem;
  color: var(--dorado-suave);
  padding: 0 0.4rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.lector-pag-input {
  width: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(184, 137, 42, 0.35);
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--fuente-cuerpo);
  font-size: 0.88rem;
  text-align: center;
  padding: 0.15rem 0.2rem;
  transition: border-color 0.2s, background-color 0.2s;
}
.lector-pag-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--dorado-claro);
}
.lector-pag-input::-webkit-inner-spin-button,
.lector-pag-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.lector-pag-input {
  -moz-appearance: textfield;
}
.lector-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(42, 123, 106, 0.12);
  border: 1px solid rgba(42, 123, 106, 0.25);
  border-radius: 6px;
  color: var(--teal-claro);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.lector-btn:hover {
  background: rgba(42, 123, 106, 0.28);
  transform: scale(1.08);
}
.lector-btn:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}
.lector-btn-donar {
  background: rgba(184, 137, 42, 0.15);
  border-color: var(--dorado);
  color: var(--dorado-claro);
}
.lector-btn-donar:hover {
  background: var(--dorado);
  color: #1a0f08;
}
.lector-btn-donar-epub {
  background: rgba(42, 123, 106, 0.25);
  border-color: var(--dorado);
  color: var(--teal-claro);
}
.lector-btn-donar-epub:hover {
  background: var(--teal-medio);
  color: #fff;
}
.lector-btn-descarga-formato {
  width: auto !important;
  min-width: 44px !important;
  height: 32px !important;
  padding: 0 0.55rem !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.lector-btn-descarga-formato .lector-btn-lbl {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em !important;
  line-height: 1 !important;
  font-family: var(--fuente-cuerpo) !important;
  display: inline-block !important;
}
.lector-btn-lbl {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1;
  font-family: var(--fuente-cuerpo);
}
.lector-btn-cerrar {
  background: rgba(122, 26, 46, 0.15);
  border-color: rgba(122, 26, 46, 0.3);
  color: var(--vino-claro);
}
.lector-btn-cerrar:hover {
  background: var(--vino);
  color: #fff;
}

/* Contenedor del canvas */
.lector-canvas-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 1rem;
  background: #0f1a17;
  position: relative;
  /* Bloquear selección de texto en el lector */
  user-select: none;
  -webkit-user-select: none;
}
#lectorCanvas {
  display: block;
  box-shadow: 0 4px 32px rgba(0,0,0,0.5);
  border-radius: 2px;
  max-width: 100%;
}

/* Spinner de carga */
.lector-cargando {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--dorado-suave);
  font-family: var(--fuente-cuerpo);
  font-size: 1rem;
}
.lector-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(42, 123, 106, 0.2);
  border-top-color: var(--teal-claro);
  border-radius: 50%;
  animation: lector-spin 0.8s linear infinite;
}
@keyframes lector-spin {
  to { transform: rotate(360deg); }
}

/* Panel de bloqueo (página 16+) */
.lector-bloqueo {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 17, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9020;
  padding: 1.5rem;
}
.lector-bloqueo-caja {
  position: relative;
  max-width: 440px;
  text-align: center;
  background: rgba(22, 36, 32, 0.98);
  border: 1px solid rgba(184, 137, 42, 0.35);
  border-radius: 12px;
  padding: 2.2rem 2rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.lector-bloqueo-cerrar {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--texto-suave);
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border-radius: 50%;
  width: 1.8rem;
  height: 1.8rem;
}
.lector-bloqueo-cerrar:hover {
  color: var(--dorado-claro);
  background: rgba(184, 137, 42, 0.15);
}
.lector-bloqueo-icono {
  font-size: 3rem;
  margin-bottom: 0.8rem;
}
.lector-bloqueo-titulo {
  font-family: var(--fuente-titulo);
  font-size: 1.3rem;
  color: var(--dorado-claro);
  margin-bottom: 0.8rem;
}
.lector-bloqueo-texto {
  font-family: var(--fuente-literaria);
  font-size: 1rem;
  color: #c8b8a0;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
.lector-bloqueo-opciones {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: center;
}
.btn-comprar-preview {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  background: var(--dorado);
  color: #1a0f08;
  font-family: var(--fuente-cuerpo);
  font-size: 1rem;
  font-weight: 700;
  border-radius: 30px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.btn-comprar-preview:hover {
  background: var(--dorado-claro);
  transform: scale(1.04);
}
.btn-codigo-preview {
  background: transparent;
  border: 1px solid rgba(184, 137, 42, 0.4);
  border-radius: 30px;
  padding: 0.55rem 1.4rem;
  color: var(--dorado-suave);
  font-family: var(--fuente-cuerpo);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-codigo-preview:hover {
  border-color: var(--dorado);
  background: rgba(184, 137, 42, 0.1);
}

.bloqueo-nota {
  font-family: var(--fuente-cuerpo);
  font-size: 0.8rem;
  color: rgba(200, 184, 160, 0.6);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ── Responsive: botones de hero en móvil ── */
@media (max-width: 480px) {
  .btn-codigo-donador span { display: none; }
  .btn-codigo-donador {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
  }
}

/* ── Adaptación móvil del lector (Alternativa A) ── */
@media (max-width: 600px) {
  .lector-titulo-texto { display: none; }
  .lector-barra-controles {
    padding: 0.35rem 0.5rem;
    overflow-x: hidden;
  }
  .lector-controles {
    width: 100%;
    gap: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }
  /* Alternativa A: Ocultar zoom en móvil (se usa zoom táctil de pellizco) */
  #lectorBtnZoomOut,
  #lectorBtnZoomIn {
    display: none !important;
  }
  .lector-btn {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }
  .lector-btn-lbl { display: none; }
  .lector-btn-descarga-formato {
    width: auto !important;
    min-width: 35px !important;
    height: 30px !important;
    padding: 0 0.35rem !important;
    justify-content: center !important;
    flex-shrink: 0;
  }
  .lector-btn-descarga-formato .lector-btn-lbl {
    display: inline-block !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
  }
  .lector-paginas {
    font-size: 0.78rem;
    padding: 0 0.15rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .lector-btn-cerrar {
    margin-left: auto;
  }
  .lector-canvas-container { padding: 0.5rem 0; }
  .lector-bloqueo-caja { padding: 1.5rem 1.2rem; }
  .lector-bloqueo-titulo { font-size: 1.1rem; }
}

/* ── Sección de destacados (Carrusel) ── */
.destacados-seccion {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 0 0.5rem;
}
.destacados-header-fila {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 2.5rem;
  margin-bottom: 1.2rem;
}
.destacados-header-fila .seccion-titulo-destacados {
  padding: 0;
  margin-bottom: 0;
}
.destacados-guia-scroll {
  font-family: var(--fuente-cuerpo);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--texto-suave);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: 0.2px;
}
.seccion-titulo-destacados {
  font-family: var(--fuente-titulo);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--teal-profundo);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 2.5rem;
}
.destacados-carrusel-contenedor {
  position: relative;
  width: 100%;
}
.destacados-galeria {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  scroll-behavior: smooth;
  gap: 1.5rem;
  padding: 0.5rem 2.5rem 1.5rem !important;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
.destacados-galeria::-webkit-scrollbar {
  display: none;
}
.destacados-galeria .tarjeta {
  position: relative;
  flex: 0 0 205px !important;
  scroll-snap-align: start;
}
.destacados-galeria .tarjeta-descripcion,
.destacados-galeria .badge-preview {
  display: none !important;
}
.destacado-rank-badge {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 6;
  font-family: var(--fuente-titulo);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 248, 240, 0.35);
  letter-spacing: 0.02em;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.2s ease;
}
.destacado-rank-badge.podio-oro {
  background: linear-gradient(135deg, #ffd700 0%, #d4a017 50%, #9e6f21 100%);
  color: #1a1202;
  border-color: #fff2a8;
  box-shadow: 0 4px 14px rgba(212, 160, 23, 0.55);
}
.destacado-rank-badge.podio-plata {
  background: linear-gradient(135deg, #ffffff 0%, #dcdce2 50%, #9a9aa4 100%);
  color: #1a1a24;
  border-color: #ffffff;
  box-shadow: 0 4px 14px rgba(160, 160, 175, 0.45);
}
.destacado-rank-badge.podio-bronce {
  background: linear-gradient(135deg, #f3a878 0%, #c46d3b 50%, #873f15 100%);
  color: #ffffff;
  border-color: #ffd8bf;
  box-shadow: 0 4px 14px rgba(196, 109, 59, 0.5);
}
.destacado-rank-badge.podio-resto {
  background: rgba(25, 18, 22, 0.82);
  color: #f0e9df;
  border-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}
.carrusel-btn {
  position: absolute;
  top: calc(50% - 20px);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--fondo-tarjeta);
  border: 1.5px solid var(--borde);
  color: var(--teal-profundo);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 12px var(--sombra);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.85;
}
.carrusel-btn:hover {
  opacity: 1;
  background: var(--teal-suave);
  color: var(--teal-profundo);
  border-color: var(--dorado);
  transform: scale(1.1);
}
.carrusel-btn:active {
  transform: scale(0.95);
}
.carrusel-btn-izq {
  left: 1rem;
}
.carrusel-btn-der {
  right: 1rem;
}
.carrusel-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50px;
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.3s;
}
.carrusel-fade-izq {
  left: 0;
  background: linear-gradient(to right, var(--fondo) 0%, transparent 100%);
}
.carrusel-fade-der {
  right: 0;
  background: linear-gradient(to left, var(--fondo) 0%, transparent 100%);
}

@media (max-width: 768px) {
  .destacados-galeria {
    padding: 0.5rem 1.2rem 1.25rem !important;
    gap: 0.75rem !important;
  }
  .destacados-galeria .tarjeta {
    flex: 0 0 calc((100vw - 3.15rem) / 2) !important;
    flex-direction: column !important;
    scroll-snap-align: start;
  }
  .destacados-galeria .tarjeta-portada {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 3/4 !important;
    object-fit: cover !important;
    border-radius: var(--radio) var(--radio) 0 0 !important;
    border-right: none !important;
    border-bottom: 1px solid var(--borde-suave) !important;
  }
  .destacados-galeria .tarjeta-info {
    padding: 0.85rem 0.85rem 0.45rem !important;
    gap: 0.22rem !important;
  }
  .destacados-galeria .tarjeta-titulo {
    font-size: 0.95rem !important;
  }
  .destacados-galeria .tarjeta-autor {
    font-size: 0.84rem !important;
  }
  .destacados-galeria .btn-ver {
    margin: 0.4rem 0.85rem 0.85rem !important;
    padding: 0.5rem !important;
    font-size: 0.82rem !important;
  }
  .destacados-galeria .tarjeta-acciones-fila {
    padding: 0 0.85rem 0.85rem !important;
  }
  .destacados-galeria .tarjeta-acciones-fila .btn-ver {
    margin: 0 !important;
    padding: 0.45rem 0.6rem !important;
  }
  .carrusel-btn {
    display: none;
  }
}
@media (max-width: 480px) {
  .destacados-galeria {
    padding: 0.5rem 1rem 1.2rem !important;
    gap: 0.65rem !important;
  }
  .destacados-galeria .tarjeta {
    flex: 0 0 calc((100vw - 2.65rem) / 2) !important;
    flex-direction: column !important;
    scroll-snap-align: start;
  }
  .destacados-galeria .tarjeta-portada {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 3/4 !important;
    object-fit: cover !important;
    border-radius: var(--radio) var(--radio) 0 0 !important;
    border-right: none !important;
    border-bottom: 1px solid var(--borde-suave) !important;
  }
  .destacados-galeria .tarjeta-info {
    padding: 0.75rem 0.75rem 0.35rem !important;
    gap: 0.18rem !important;
  }
  .destacados-galeria .tarjeta-titulo {
    font-size: 0.9rem !important;
  }
  .destacados-galeria .tarjeta-autor {
    font-size: 0.8rem !important;
  }
  .destacados-galeria .btn-ver {
    margin: 0.35rem 0.75rem 0.75rem !important;
    padding: 0.48rem !important;
    font-size: 0.78rem !important;
  }
  .destacados-galeria .tarjeta-acciones-fila {
    padding: 0 0.75rem 0.75rem !important;
  }
  .destacados-galeria .tarjeta-acciones-fila .btn-ver {
    margin: 0 !important;
    padding: 0.42rem 0.5rem !important;
  }
}
.destacados-fin-banner {
  position: relative;
  text-align: center;
  margin: 1.2rem 0 0.8rem;
  padding: 0 2.5rem;
}
.destacados-fin-banner::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 2.5rem;
  right: 2.5rem;
  height: 1px;
  background: var(--borde-suave);
  z-index: 1;
}

/* ── Cabecera del Catálogo Completo ── */
.catalogo-header-barra {
  max-width: 1400px;
  margin: 1.8rem auto 0.8rem;
  padding: 0 2.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--borde-suave);
}
.catalogo-barra-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.catalogo-titular-fila {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.catalogo-separador-punto {
  color: var(--texto-suave);
  font-weight: 300;
  font-size: 1.1rem;
}
.catalogo-barra-titulo {
  font-family: var(--fuente-titulo);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--teal-profundo);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}
.catalogo-barra-acciones {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.dropdown-menu-derecha {
  right: 0 !important;
  left: auto !important;
}
/* ── Estilos de Tipografía Literaria (Fase 2) ── */
.tarjeta-descripcion,
.detalle-descripcion,
.frase-literaria {
  font-family: var(--fuente-literaria) !important;
}

/* ── Estilos Premium del Recomendador IA (Fase 2) ── */

/* Botón Recomendar especial IA */
.modal-panel-ia #btnRecomendar {
  background: linear-gradient(135deg, var(--dorado) 0%, var(--teal-profundo) 100%) !important;
  border: 1px solid rgba(212, 169, 74, 0.4) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(201, 152, 46, 0.3) !important;
  transition: all 0.3s ease;
}

.modal-panel-ia #btnRecomendar:hover {
  background: linear-gradient(135deg, var(--dorado-claro) 0%, var(--teal-medio) 100%) !important;
  border-color: var(--dorado) !important;
  box-shadow: 0 6px 20px rgba(201, 152, 46, 0.45) !important;
  transform: translateY(-2px);
}

/* Animación de carga: Book Loader */
.book-loader {
  width: 44px;
  height: 30px;
  position: relative;
  margin: 1.5rem auto;
  perspective: 150px;
}

.book-loader::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--dorado);
  z-index: 10;
  box-shadow: 0 0 5px var(--dorado);
}

.book-page {
  position: absolute;
  left: 50%;
  top: 0;
  width: 50%;
  height: 100%;
  background: var(--fondo-tarjeta);
  border: 1.5px solid var(--teal-profundo);
  border-left: none;
  border-radius: 0 3px 3px 0;
  transform-origin: 0% 50%;
  animation: pageFlip 1.6s infinite ease-in-out;
}

.book-page:nth-child(1) {
  animation-delay: 0.2s;
}

.book-page:nth-child(2) {
  animation-delay: 0.4s;
}

.book-page:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes pageFlip {
  0% {
    transform: rotateY(0deg);
    z-index: 1;
  }
  50% {
    transform: rotateY(-180deg);
    z-index: 5;
  }
  100% {
    transform: rotateY(-180deg);
    z-index: 1;
  }
}

/* Destello IA en el botón del Hero */
.btn-ia-icono i,
.btn-ia-icono svg {
  animation: destelloIA 2.5s ease-in-out infinite;
}

@keyframes destelloIA {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 0 0 rgba(212, 169, 74, 0));
    opacity: 0.9;
  }
  50% {
    transform: scale(1.18) rotate(15deg);
    filter: drop-shadow(0 0 6px var(--dorado-claro));
    opacity: 1;
    color: var(--dorado-claro);
  }
}

/* ── Estilos de Animación, Transición y Accesibilidad (Fase 3) ── */

/* Efecto Shimmer Dorado en el botón de IA */
.btn-ia-trigger {
  position: relative;
  overflow: hidden;
}

.btn-ia-trigger::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 30%;
  height: 200%;
  background: linear-gradient(
    90deg, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(212, 169, 74, 0.4) 50%, 
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: shimmerIA 6s infinite ease-in-out;
}

@keyframes shimmerIA {
  0% {
    left: -60%;
  }
  30% {
    left: 140%;
  }
  100% {
    left: 140%;
  }
}

/* Transición suave para cambios de tema claro/oscuro */
body {
  transition: background-color 0.4s ease, color 0.3s ease;
}

.tarjeta, 
.modal-panel, 
.modal-panel-ia,
footer, 
input, 
.custom-dropdown, 
.custom-dropdown .dropdown-menu, 
.chip-epoca,
.tag-genero,
.btn-ver,
.btn-recomendar,
.btn-cancelar,
.btn-tema {
  transition: background-color 0.4s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.25s ease;
}

/* Accesibilidad: Contraste de texto en modo oscuro */
:root[data-theme="dark"] .tag-genero.activo,
:root[data-theme="dark"] .chip-epoca.activo,
:root[data-theme="dark"] .btn-pagina.activo {
  color: #0c2621 !important; /* Contraste óptimo (AAA) sobre fondo verde menta brillante */
}

/* ── SKELETON LOADING ── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--borde-suave) 0%,
    var(--fondo-tarjeta) 50%,
    var(--borde-suave) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-portada {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radio) var(--radio) 0 0;
}

.skeleton-badge {
  width: 70px;
  height: 18px;
  border-radius: 100px;
  margin-bottom: 0.5rem;
}

.skeleton-titulo {
  width: 90%;
  height: 16px;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.skeleton-autor {
  width: 60%;
  height: 14px;
  margin-top: 0.3rem;
  margin-bottom: 0.5rem;
}

.skeleton-btn {
  width: 100%;
  height: 36px;
  margin-top: auto;
  border-radius: var(--radio);
}

.skeleton-tarjeta {
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

/* ── BOTÓN VOLVER ARRIBA ── */
.btn-scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--teal-profundo);
  color: #fff8f0;
  border: 1.5px solid rgba(212, 169, 74, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--sombra-glow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  opacity: 0;
  transform: translateY(15px);
}

.btn-scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.btn-scroll-top:hover {
  background: var(--teal-medio);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(26, 92, 80, 0.45);
  border-color: var(--dorado-claro);
}

.btn-scroll-top:active {
  transform: scale(0.95);
}

/* ── SECCIÓN DE COLECCIONES CURADAS Y SAGAS ── */
.colecciones-seccion {
  padding: 1.5rem 0 0.5rem;
  max-width: var(--max-ancho);
  margin: 0 auto;
  width: 100%;
}
.colecciones-header-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0 2.5rem;
  margin-bottom: 1.1rem;
}
.seccion-titulo-colecciones {
  font-family: var(--fuente-titulo);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--teal-profundo);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0;
}

/* Pestañas Colecciones / Sagas */
.colecciones-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: 999px;
  padding: 0.25rem;
  box-shadow: 0 2px 8px var(--sombra);
}
.coleccion-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.95rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--texto-medio);
  font-family: var(--fuente-cuerpo);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
}
.coleccion-tab-btn:hover {
  color: var(--teal-profundo);
}
.coleccion-tab-btn.activo {
  background: var(--teal-profundo);
  color: #fff8f0;
  box-shadow: 0 2px 8px rgba(26, 92, 80, 0.28);
}
.coleccion-tab-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
  background: rgba(184, 137, 42, 0.18);
  color: var(--dorado);
}
.coleccion-tab-btn.activo .coleccion-tab-count {
  background: rgba(255, 248, 240, 0.2);
  color: #fff8f0;
}

.colecciones-carrusel-contenedor {
  position: relative;
  width: 100%;
}

/* Carrusel horizontal de packs y sagas */
.colecciones-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  gap: 1.35rem;
  padding: 0.5rem 2.5rem 1.5rem;
  margin-bottom: 0.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.colecciones-grid::-webkit-scrollbar {
  display: none;
}

/* Tarjeta de Pack / Saga — Edición de Coleccionista */
.pack-tarjeta {
  position: relative;
  flex: 0 0 290px;
  scroll-snap-align: start;
  background: linear-gradient(165deg, #182c26 0%, #101c18 55%, #0b1411 100%);
  border: 1px solid rgba(212, 163, 89, 0.28);
  border-top: 2.5px solid var(--dorado);
  border-radius: 14px;
  padding: 1.15rem 1.15rem 1.05rem;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  height: 280px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.28s ease, 
              box-shadow 0.28s ease;
  cursor: pointer;
  z-index: 1;
}

.pack-tarjeta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(14, 25, 22, 0.22) 0%, rgba(12, 21, 18, 0.62) 42%, rgba(9, 16, 14, 0.95) 86%);
  opacity: 0.94;
  transition: opacity 0.3s ease;
  z-index: 0;
  pointer-events: none;
}

.pack-tarjeta-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(14px) brightness(0.42) saturate(1.32);
  transform: scale(1.18);
  z-index: -1;
  transition: transform 0.5s ease, filter 0.5s ease;
}

.pack-tarjeta:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 163, 89, 0.55);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32), 0 3px 8px rgba(0, 0, 0, 0.18);
}

.pack-tarjeta:hover .pack-tarjeta-bg {
  transform: scale(1.24);
  filter: blur(12px) brightness(0.48) saturate(1.4);
}

.pack-tarjeta:hover::before {
  opacity: 0.96;
}

/* Abanico 3D de portadas con volumen editorial */
.pack-libros-stack {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 118px;
  margin-top: 1.35rem;
  margin-bottom: 0.55rem;
  position: relative;
  width: 100%;
  z-index: 2;
  order: 1;
  perspective: 700px;
}

.pack-libro-stack-item {
  width: 74px;
  height: 110px;
  position: relative;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.35s ease;
}

.pack-libro-stack-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px 5px 5px 2px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-left: 2.5px solid rgba(255, 255, 255, 0.38);
  box-shadow: -4px 6px 16px rgba(0, 0, 0, 0.65), 0 2px 5px rgba(0, 0, 0, 0.4);
}

.pack-libro-stack-item.portada-idx-0 {
  transform: translateX(12px) translateY(4px) rotate(-8deg) scale(0.96);
  z-index: 1;
}
.pack-libro-stack-item.portada-idx-1 {
  transform: translateY(-4px) scale(1.1);
  z-index: 3;
}
.pack-libro-stack-item.portada-idx-2 {
  transform: translateX(-12px) translateY(4px) rotate(8deg) scale(0.96);
  z-index: 2;
}

/* Efecto hover en el abanico 3D */
.pack-tarjeta:hover .pack-libro-stack-item.portada-idx-0 {
  transform: translateX(4px) translateY(-2px) rotate(-13deg) scale(1.02);
}
.pack-tarjeta:hover .pack-libro-stack-item.portada-idx-1 {
  transform: translateY(-9px) scale(1.16);
}
.pack-tarjeta:hover .pack-libro-stack-item.portada-idx-2 {
  transform: translateX(-4px) translateY(-2px) rotate(13deg) scale(1.02);
}

/* Insignia superior derecha — Sello de Colección */
.pack-insignia {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: linear-gradient(135deg, rgba(32, 25, 14, 0.9) 0%, rgba(16, 26, 23, 0.94) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 163, 89, 0.6);
  color: #ffd88a;
  font-family: var(--fuente-cuerpo);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  z-index: 4;
  letter-spacing: 0.025em;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.saga-autor-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--dorado-claro);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tag-sagas-btn {
  border-color: rgba(184, 137, 42, 0.45) !important;
  color: var(--dorado) !important;
  font-weight: 600 !important;
}
.tag-sagas-btn:hover {
  background: var(--dorado-glow) !important;
  border-color: var(--dorado) !important;
}
.tag-sagas-btn.activo {
  background: linear-gradient(135deg, #c99432 0%, #9e6f21 100%) !important;
  border-color: var(--dorado) !important;
  color: #fff8f0 !important;
}

.tarjeta-serie-badge {
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.tarjeta-serie-badge:hover {
  background: var(--dorado);
  color: #fff8f0;
}

/* Info del pack */
.pack-info {
  margin-top: auto;
  z-index: 2;
  color: #fff8f0;
  order: 3;
}

.pack-titulo {
  font-family: var(--fuente-titulo);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.45rem;
  color: #fff9f2;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pack-descripcion {
  font-family: var(--fuente-cuerpo);
  font-size: 0.8rem;
  line-height: 1.44;
  color: rgba(255, 248, 240, 0.86);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.btn-explorar-pack {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(212, 163, 89, 0.15) 0%, rgba(26, 92, 80, 0.85) 100%);
  border: 1px solid rgba(212, 163, 89, 0.45);
  color: #fff8f0;
  font-family: var(--fuente-cuerpo);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.36rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.24s ease;
  display: flex;
  align-items: center;
  gap: 0.32rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
  margin-top: 0.15rem;
}

.btn-explorar-pack:hover {
  background: linear-gradient(135deg, var(--dorado) 0%, #aa7a28 100%);
  border-color: var(--dorado);
  color: #0c1815;
  font-weight: 700;
  box-shadow: 0 5px 16px rgba(184, 137, 42, 0.4);
}

.pack-tarjeta:hover .btn-explorar-pack {
  transform: translateY(-1px);
}

/* Botón cerrar pack */
.catalogo-barra-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.btn-cerrar-pack {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(184, 137, 42, 0.15);
  border: 1px solid rgba(184, 137, 42, 0.4);
  color: var(--dorado-claro);
  font-family: var(--fuente-cuerpo);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cerrar-pack:hover {
  background: rgba(220, 53, 69, 0.2);
  border-color: rgba(220, 53, 69, 0.5);
  color: #ff8585;
}

/* Botón de alternancia de filtros en móvil (oculto en desktop) */
@media (min-width: 769px) {
  .btn-toggle-filtros-movil {
    display: none !important;
  }
}

/* Botón "Ver todos los géneros" en chips */
.tag-ver-todos {
  border-style: dashed !important;
  border-color: var(--dorado) !important;
  color: var(--dorado-claro) !important;
  background: transparent !important;
  opacity: 0.85;
  transition: all 0.2s;
}
.tag-ver-todos:hover {
  opacity: 1;
  background: var(--dorado-glow) !important;
}

/* Contenedor de géneros extra al expandir */
.tags-generos-extra {
  display: contents;
  gap: inherit;
}

/* Responsive */
@media (max-width: 768px) {
  .colecciones-header-fila {
    padding: 0 1.2rem !important;
    margin-bottom: 0.9rem !important;
    gap: 0.65rem;
  }
  .seccion-titulo-colecciones {
    font-size: 1.3rem !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
  }
  .destacados-header-fila {
    padding: 0 1.2rem !important;
    margin-bottom: 0.9rem !important;
  }
  .destacados-header-fila .seccion-titulo-destacados,
  .seccion-titulo-destacados {
    font-size: 1.25rem !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
    white-space: nowrap;
  }
  .coleccion-tab-btn {
    padding: 0.36rem 0.75rem;
    font-size: 0.78rem;
  }

  .catalogo-header-barra {
    padding: 0 1.2rem 0.4rem !important;
    margin: 1.2rem auto 1rem !important;
  }

  .catalogo-barra-titulo {
    font-size: 1.3rem !important;
  }
  .colecciones-grid {
    gap: 1rem;
    padding: 0.3rem 1.2rem 1.2rem 1.2rem;
  }
  .pack-tarjeta {
    flex: 0 0 255px;
    scroll-snap-align: start;
    min-height: 270px;
    height: 270px;
    padding: 0.95rem 0.95rem 0.85rem;
  }

  .pack-libros-stack {
    height: 108px;
    margin-top: 1.15rem;
    margin-bottom: 0.45rem;
  }

  .pack-libro-stack-item {
    width: 66px;
    height: 98px;
  }
  .catalogo-barra-info {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* ════════════════════════════════════════════════════════
   MODAL DE ADQUIRIR ACCESO (COMPRA)
   ════════════════════════════════════════════════════════ */
.modal-compra-panel {
  max-width: 520px;
  width: 90%;
}

.compra-descripcion {
  font-family: var(--fuente-cuerpo);
  font-size: 0.95rem;
  color: var(--texto-medio);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  text-align: center;
}

.beneficios-lista {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 2rem;
  background: rgba(42, 123, 106, 0.05);
  border: 1px solid rgba(42, 123, 106, 0.15);
  border-radius: var(--radio);
  padding: 1.5rem;
}

.beneficio-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.beneficio-icono {
  color: var(--dorado-claro);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.beneficio-icono svg,
.beneficio-icono i {
  width: 20px;
  height: 20px;
}

.beneficio-texto {
  font-family: var(--fuente-cuerpo);
  font-size: 0.92rem;
  color: var(--texto);
  line-height: 1.5;
}

.beneficio-texto strong {
  color: var(--dorado-claro);
  font-weight: 600;
}

.compra-email-grupo {
  margin-bottom: 1rem;
  width: 100%;
}

.compra-email-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--fuente-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--texto);
  margin-bottom: 0.45rem;
}

.compra-email-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.72rem 0.95rem;
  font-family: var(--fuente-cuerpo);
  font-size: 0.95rem;
  color: var(--texto);
  background: var(--fondo-input);
  border: 1.5px solid var(--borde);
  border-radius: var(--radio);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.compra-email-input:focus {
  border-color: var(--dorado);
  box-shadow: 0 0 0 3px rgba(212, 163, 89, 0.18);
}

.texto-mp-estado {
  font-family: var(--fuente-ui);
  font-size: 0.92rem;
  font-weight: 600;
  color: #007eb5;
  margin-left: 0.6rem;
}

.codigo-entregado-caja {
  text-align: center;
  padding: 0.5rem 0.2rem;
}

.codigo-entregado-icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(212, 163, 89, 0.16);
  color: var(--dorado-claro);
  margin-bottom: 0.75rem;
}

.codigo-entregado-subtitulo {
  font-family: var(--fuente-titulo);
  font-size: 1.25rem;
  color: var(--texto);
  margin: 0 0 0.5rem 0;
}

.codigo-entregado-texto {
  font-family: var(--fuente-cuerpo);
  font-size: 0.92rem;
  color: var(--texto-suave);
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

.codigo-entregado-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--fondo-input);
  border: 2px dashed var(--dorado);
  border-radius: var(--radio);
  padding: 0.9rem 1rem;
  margin: 0.8rem 0;
}

.codigo-entregado-valor {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--dorado-claro);
  user-select: all;
}

.btn-copiar-codigo {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--dorado);
  color: #121c19;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  font-family: var(--fuente-ui);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-copiar-codigo:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.codigo-entregado-nota {
  font-family: var(--fuente-cuerpo);
  font-size: 0.83rem;
  color: var(--texto-suave);
  margin: 0.5rem 0 0 0;
}

.compra-accion-caja {
  display: flex;
  justify-content: center;
  margin-bottom: 1.8rem;
  width: 100%;
}

.btn-mercadopago-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0.8rem 1.5rem;
  background: #ffffff; /* Fondo blanco para que destaque la imagen del logo */
  border: 1.5px solid #009ee3; /* Borde con el color azul característico de Mercado Pago */
  border-radius: var(--radio);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 15px rgba(0, 158, 227, 0.15);
}

.btn-mercadopago-checkout:hover {
  background: #f7f9fc;
  transform: scale(1.01);
  box-shadow: 0 6px 20px rgba(0, 158, 227, 0.30);
}

.img-mercadopago-logo {
  max-width: 100%;
  height: auto;
  max-height: 52px; /* Limitar altura máxima para mantener proporción estética */
  display: block;
}

.compra-pasos-donador {
  border-top: 1px dashed var(--borde);
  padding-top: 1.5rem;
}

.pasos-titulo {
  font-family: var(--fuente-titulo);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dorado-claro);
  text-align: center;
  margin-bottom: 1rem;
}

.pasos-lista {
  font-family: var(--fuente-cuerpo);
  font-size: 0.88rem;
  color: var(--texto-suave);
  line-height: 1.6;
  padding-left: 1.2rem;
  margin: 0;
}

.pasos-lista li {
  margin-bottom: 0.5rem;
}

.pasos-lista strong {
  color: var(--texto);
}



/* ════════════════════════════════════════════════════════
   LÍMITE DE USOS DEL RECOMENDADOR IA
   ════════════════════════════════════════════════════════ */

.ia-usos-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--fuente-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dorado-claro);
  background: rgba(var(--dorado-rgb, 212, 175, 55), 0.12);
  border: 1px solid rgba(var(--dorado-rgb, 212, 175, 55), 0.3);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  margin-top: 0.4rem;
}

.ia-badge-agotado {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.3);
}

.ia-usos-restantes {
  font-family: var(--fuente-ui);
  font-size: 0.82rem;
  color: var(--dorado-claro);
  text-align: center;
  margin: 0.5rem 0 0;
  padding: 0.4rem 0.8rem;
  background: rgba(var(--dorado-rgb, 212, 175, 55), 0.08);
  border-radius: 8px;
}

.ia-usos-agotados {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.08);
}

/* Modal de límite de IA */
.modal-panel-limite {
  max-width: 480px;
}

.limite-ia-body {
  text-align: center;
  gap: 1rem;
}

.limite-ia-icono {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.limite-ia-texto {
  font-family: var(--fuente-cuerpo);
  font-size: 0.95rem;
  color: var(--texto-suave);
  line-height: 1.6;
  margin: 0;
}

.limite-ia-texto strong {
  color: var(--texto);
}

.limite-ia-beneficios {
  background: rgba(var(--dorado-rgb, 212, 175, 55), 0.06);
  border: 1px solid rgba(var(--dorado-rgb, 212, 175, 55), 0.15);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-align: left;
  width: 100%;
}

.limite-ia-subtitulo {
  font-family: var(--fuente-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dorado-claro);
  margin: 0 0 0.75rem;
}

.limite-ia-lista {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.limite-ia-lista li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--fuente-ui);
  font-size: 0.85rem;
  color: var(--texto-suave);
}

.limite-ia-lista li [data-lucide] {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #4ade80;
}

.limite-ia-lista strong {
  color: var(--texto);
}

.limite-ia-comprar {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 0.5rem;
  width: 100%;
}

/* ════════════════════════════════════════════════════════
   SISTEMA DE MARCADORES EN EL LECTOR
   ════════════════════════════════════════════════════════ */

/* Botón de marcar página en la barra del lector */
.lector-btn-marcador {
  color: var(--dorado-claro) !important;
  position: relative;
}

.lector-btn-marcador.marcador-activo {
  background: rgba(var(--dorado-rgb, 212, 175, 55), 0.2) !important;
  color: #f5d000 !important;
}

.lector-btn-marcador.marcador-activo [data-lucide] {
  fill: currentColor;
}

/* Panel flotante de marcadores - Vercel trigger modification */
.lector-marcadores-panel {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: clamp(240px, 30vw, 320px);
  max-height: min(75vh, 480px);
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 20;
  animation: marcadoresFadeIn 0.2s ease;
}

@keyframes marcadoresFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.marcadores-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--borde);
  font-family: var(--fuente-ui);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dorado-claro);
  flex-shrink: 0;
}

.marcadores-cerrar-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--texto-suave);
  display: flex;
  align-items: center;
  padding: 0.2rem;
  border-radius: 4px;
  transition: color 0.15s;
}

.marcadores-cerrar-btn:hover {
  color: var(--texto);
}

.marcadores-cerrar-btn [data-lucide] {
  width: 15px;
  height: 15px;
}

.marcadores-vacio {
  font-family: var(--fuente-cuerpo);
  font-size: 0.82rem;
  color: var(--texto-suave);
  text-align: center;
  padding: 1.5rem 1rem;
  line-height: 1.6;
  margin: 0;
}

.marcadores-lista {
  overflow-y: auto;
  flex: 1;
  padding: 0.4rem 0;
}

.marcador-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.marcador-item:hover {
  background: var(--hover);
}

.marcador-item-actual {
  background: rgba(var(--dorado-rgb, 212, 175, 55), 0.08) !important;
}

.marcador-icono {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.marcador-pag {
  font-family: var(--fuente-ui);
  font-size: 0.82rem;
  color: var(--texto);
  flex: 1;
}

.marcador-ir-btn {
  background: none;
  border: 1px solid var(--dorado-claro);
  color: var(--dorado-claro);
  font-family: var(--fuente-ui);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.marcador-ir-btn:hover {
  background: var(--dorado-claro);
  color: var(--fondo);
}

.marcador-del-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--texto-suave);
  display: flex;
  align-items: center;
  padding: 0.2rem;
  border-radius: 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}

.marcador-del-btn:hover {
  color: #ff6b6b;
}

.marcador-del-btn [data-lucide] {
  width: 14px;
  height: 14px;
}

/* Responsive: en móvil, el panel ocupa más ancho */
@media (max-width: 600px) {
  .lector-marcadores-panel {
    width: calc(100vw - 1.5rem);
    right: 0.75rem;
    top: 0.5rem;
  }
}

/* ══════════════════════════════════════════════════════ */
/* MEJORAS DE BENCHMARK (UX / FUNCIONALIDADES)           */
/* ══════════════════════════════════════════════════════ */

/* ── 1. PAGINACIÓN EXTENDIDA Y SALTO RÁPIDO ── */
.btn-pagina-extremo {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 0.6rem;
  min-width: 3.2rem;
}

.paginacion-salto {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.6rem;
  padding: 0.25rem 0.6rem;
  background: var(--fondo-tarjeta);
  border: 1.5px solid var(--borde-suave);
  border-radius: var(--radio);
  font-family: var(--fuente-cuerpo);
  font-size: 0.82rem;
  color: var(--texto-suave);
}

.paginacion-salto-input {
  width: 3.2rem;
  height: 2.1rem;
  padding: 0 0.3rem;
  text-align: center;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: var(--fondo-input);
  color: var(--texto);
  font-family: var(--fuente-cuerpo);
  font-size: 0.88rem;
  outline: none;
}

.paginacion-salto-input:focus {
  border-color: var(--teal-profundo);
  box-shadow: 0 0 0 2px var(--teal-suave);
}

.paginacion-salto-total {
  font-size: 0.82rem;
  color: var(--texto-suave);
}

.btn-salto-pag {
  height: 2.1rem;
  padding: 0 0.7rem;
  background: var(--teal-profundo);
  color: #fff8f0;
  border: none;
  border-radius: var(--radio);
  font-family: var(--fuente-cuerpo);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn-salto-pag:hover {
  background: var(--teal-medio);
  transform: translateY(-1px);
}

/* ── 2. MÓDULO CONTINUAR LEYENDO (HOME) ── */
.continuar-leyendo-seccion {
  max-width: 1400px;
  margin: 1.5rem auto 2rem;
  padding: 0 1.5rem;
}

.continuar-leyendo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.continuar-tarjeta {
  display: flex;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde-suave);
  border-radius: var(--radio);
  padding: 0.9rem;
  gap: 1rem;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: 0 2px 8px var(--sombra);
}

.continuar-tarjeta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--sombra-media);
  border-color: var(--teal-claro);
}

.continuar-portada {
  width: 72px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 6px var(--sombra-media);
  flex-shrink: 0;
}

.continuar-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
}

.continuar-titulo {
  font-family: var(--fuente-titulo);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--texto);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 1.2rem;
}

.continuar-autor {
  font-size: 0.8rem;
  color: var(--texto-suave);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.continuar-progreso-barra {
  width: 100%;
  height: 5px;
  background: var(--borde-suave);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.45rem 0 0.25rem;
}

.continuar-progreso-fill {
  height: 100%;
  background: var(--dorado);
  border-radius: 3px;
  transition: width 0.3s ease-out;
}

.continuar-pag-txt {
  font-size: 0.76rem;
  color: var(--dorado);
  font-weight: 600;
}

.btn-continuar-accion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  padding: 0.35rem 0.8rem;
  background: var(--teal-profundo);
  color: #fff8f0;
  border: none;
  border-radius: var(--radio);
  font-family: var(--fuente-cuerpo);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.btn-continuar-accion:hover {
  background: var(--teal-medio);
  transform: translateY(-1px);
}

.continuar-descartar-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: none;
  border: none;
  color: var(--texto-suave);
  cursor: pointer;
  opacity: 0.5;
  padding: 0.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, color 0.2s;
}

.continuar-descartar-btn:hover {
  opacity: 1;
  color: var(--vino);
}

/* ── 3. ACCIONES Y DESCARGA RÁPIDA EN TARJETA ── */
.tarjeta-acciones-fila {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0 0.95rem 0.95rem;
  box-sizing: border-box;
}

.tarjeta-acciones-fila .btn-ver {
  flex: 1;
  margin: 0 !important;
  min-width: 0;
}

.tarjeta-descarga-rapida {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.btn-descarga-tarjeta {
  padding: 0.32rem 0.55rem;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--dorado-claro);
  background: var(--dorado-glow);
  color: var(--dorado-texto);
  font-family: var(--fuente-cuerpo);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radio);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-descarga-tarjeta:hover {
  background: var(--dorado);
  color: #1a0f08;
  border-color: var(--dorado);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(184, 137, 42, 0.3);
}

:root[data-theme="dark"] .btn-descarga-tarjeta {
  border-color: rgba(212, 169, 74, 0.5);
  color: var(--dorado-claro);
}

:root[data-theme="dark"] .btn-descarga-tarjeta:hover {
  background: var(--dorado);
  color: #1a0f08;
}

@media (max-width: 480px) {
  .tarjeta-acciones-fila {
    padding: 0 0.75rem 0.75rem !important;
    gap: 0.25rem !important;
  }

  .btn-descarga-tarjeta {
    padding: 0.25rem 0.42rem !important;
    font-size: 0.65rem !important;
    min-height: 28px !important;
  }
}

/* ── 4. ÍNDICE ALFABÉTICO A–Z ── */
.indice-az-seccion {
  max-width: 1400px;
  margin: 0.4rem auto 1rem;
  padding: 0 1.5rem;
}

.indice-az-contenedor {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde-suave);
  border-radius: var(--radio);
  padding: 0.35rem 0.8rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.indice-az-label {
  font-family: var(--fuente-cuerpo);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--texto-suave);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.indice-az-lista {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.btn-indice-letra {
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--texto-medio);
  font-family: var(--fuente-cuerpo);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-indice-letra:hover {
  background: var(--teal-suave);
  color: var(--teal-profundo);
  border-color: var(--teal-claro);
}

.btn-indice-letra.activo {
  background: var(--teal-profundo);
  color: #fff8f0;
  border-color: var(--teal-profundo);
}

/* ── 5. LIBROS RELACIONADOS EN MODAL DE DETALLE ── */
.relacionado-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--teal-suave);
  color: var(--teal-profundo);
  margin-top: 0.2rem;
  align-self: flex-start;
}

.relacionado-badge-saga {
  background: var(--dorado-glow);
  color: var(--dorado);
  border: 1px solid var(--dorado-claro);
}

/* ── 6. SAGAS Y SERIES ── */
.tarjeta-serie-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--dorado);
  background: var(--dorado-glow);
  border: 1px solid var(--dorado-claro);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  margin-top: 0.2rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detalle-serie-wrapper {
  margin: 0.3rem 0 0.5rem;
}

.btn-detalle-serie {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: var(--dorado-glow);
  border: 1px solid var(--dorado-claro);
  color: var(--dorado);
  border-radius: var(--radio);
  font-family: var(--fuente-cuerpo);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-detalle-serie:hover {
  background: var(--dorado);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(184, 137, 42, 0.25);
}

/* ── 7. TARJETA SOLICITAR LIBRO (WHATSAPP) ── */
.sin-resultados-acciones {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  width: 100%;
}

.sin-resultados-solicitar-card {
  max-width: 540px;
  width: 100%;
  margin: 0.8rem auto 0;
  padding: 1.2rem 1.4rem;
  background: var(--fondo-tarjeta);
  border: 1px solid var(--borde-suave);
  border-radius: var(--radio);
  display: flex;
  align-items: center;
  gap: 1.1rem;
  text-align: left;
  box-shadow: 0 4px 16px var(--sombra);
  transition: transform 0.2s, box-shadow 0.2s;
}

.sin-resultados-solicitar-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--sombra-media);
  border-color: var(--teal-claro);
}

.solicitar-card-icono {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--teal-suave);
  color: var(--teal-profundo);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.solicitar-card-info {
  flex: 1;
  min-width: 0;
}

.solicitar-card-titulo {
  font-family: var(--fuente-titulo);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--texto);
  margin-bottom: 0.25rem;
  line-height: 1.25;
}

.solicitar-card-subtitulo {
  font-size: 0.82rem;
  color: var(--texto-suave);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.btn-solicitar-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  background: #1b7454;
  color: #ffffff !important;
  border-radius: var(--radio);
  font-family: var(--fuente-cuerpo);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(27, 116, 84, 0.25);
}

.btn-solicitar-whatsapp:hover {
  background: #14583f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 116, 84, 0.35);
  color: #ffffff !important;
}

.footer-link-solicitar {
  color: var(--dorado) !important;
  font-weight: 600 !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.footer-link-solicitar:hover {
  color: var(--vino) !important;
}

@media (max-width: 600px) {
  .sin-resultados-solicitar-card {
    flex-direction: column;
    text-align: center;
    padding: 1.2rem;
  }
  .btn-solicitar-whatsapp {
    width: 100%;
  }
}

/* ── 8. METADATOS DE EXTENSIÓN Y PÁGINAS ── */
.tarjeta-meta-fila {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--texto-suave);
}

.tarjeta-paginas {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--texto-suave);
}

.tarjeta-idioma-en {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  background: #2b4c7e;
  color: #ffffff;
  letter-spacing: 0.03em;
}

.detalle-meta-fila {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.3rem 0 0.5rem;
}

.detalle-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--teal-suave);
  color: var(--teal-profundo);
}


/* ── ESTADOS DE LECTURA Y ESTANTERÍA LEYENDO ── */

.btn-leyendo-toggle:hover {
  border-color: var(--teal-medio);
  color: var(--teal-medio);
}

.btn-leyendo-toggle.activo {
  background: var(--teal-profundo);
  border-color: var(--teal-profundo);
  color: #fff8f0;
  font-weight: 600;
}

.continuar-leyendo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.continuar-leyendo-titulo-grupo {
  display: flex;
  flex-direction: column;
}

.continuar-ornamento {
  font-family: var(--fuente-cuerpo);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--dorado-texto);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-ver-todos-leyendo {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-family: var(--fuente-cuerpo);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal-medio);
  background: var(--teal-suave);
  border: 1px solid var(--borde-suave);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-ver-todos-leyendo:hover {
  background: var(--teal-profundo);
  color: #fff8f0;
  transform: translateX(2px);
}

.continuar-progreso-fill.leido {
  background: #2e7d32;
}

.continuar-pag-txt.leido {
  color: #2e7d32;
}

.btn-releer-accion {
  background: #2e7d32;
}

.btn-releer-accion:hover {
  background: #1b5e20;
}

/* ── Mini barra de progreso en tarjetas de catálogo y carrusel ── */
.tarjeta-progreso-mini {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.35rem;
}

.tarjeta-progreso-mini-barra {
  flex: 1;
  height: 4px;
  background: var(--borde-suave);
  border-radius: 2px;
  overflow: hidden;
}

.tarjeta-progreso-mini-fill {
  height: 100%;
  background: var(--dorado);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.tarjeta-progreso-mini-fill.leido {
  background: #2e7d32;
}

.tarjeta-progreso-mini-txt {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--dorado);
  white-space: nowrap;
}

.tarjeta-progreso-mini-txt.leido {
  color: #2e7d32;
}

.btn-leer-continuar {
  background: var(--dorado);
  color: #1a0f08;
  font-weight: 600;
}

.btn-leer-continuar:hover {
  background: #c98b2c;
  color: #ffffff;
}

/* ── Píldora de progreso en modal de detalle ── */
.detalle-meta-progreso {
  background: rgba(212, 163, 89, 0.18);
  color: var(--dorado);
  border: 1px solid rgba(212, 163, 89, 0.4);
}

/* ── ICONOS LUCIDE: UTILIDADES DE TAMAÑO Y ALINEACIÓN ── */
.icono-xs, svg.icono-xs {
  width: 12px;
  height: 12px;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

.icono-sm, svg.icono-sm {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

.icono-md, svg.icono-md {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

.icono-lg, svg.icono-lg {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

.icono-xl, svg.icono-xl {
  width: 38px;
  height: 38px;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

.modal-ornamento {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.modal-ornamento svg {
  width: 14px;
  height: 14px;
}

.lector-bloqueo-icono svg,
.limite-ia-icono svg {
  color: var(--dorado);
}

.autocompletar-item-sugerencia-header {
  padding: 0.5rem 0.9rem 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dorado);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid var(--borde-suave);
  background: rgba(184, 137, 42, 0.08);
}

/* ════════════════════════════════════════════════════════
   ATAJOS DE DESCUBRIMIENTO INMEDIATO (MODAL IA)
════════════════════════════════════════════════════════ */
.ia-atajos-contenedor {
  background: var(--fondo);
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ia-atajos-titulo {
  font-family: var(--fuente-cuerpo);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--dorado-texto);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ia-atajos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

@media (max-width: 580px) {
  .ia-atajos-grid {
    grid-template-columns: 1fr;
  }
}

.ia-atajo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: var(--fondo-tarjeta);
  border: 1.5px solid var(--borde);
  color: var(--texto);
  font-family: var(--fuente-cuerpo);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.ia-atajo-btn:hover {
  border-color: var(--teal-profundo);
  background: var(--teal-suave);
  color: var(--teal-profundo);
  transform: translateY(-1px);
}

.ia-atajos-divisor {
  display: flex;
  align-items: center;
  text-align: center;
  margin-top: 0.2rem;
  color: var(--texto-suave);
  font-size: 0.74rem;
  font-weight: 500;
}

.ia-atajos-divisor::before,
.ia-atajos-divisor::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--borde);
  opacity: 0.6;
}

.ia-atajos-divisor span {
  padding: 0 0.6rem;
}

/* ════════════════════════════════════════════════════════
   BARRA DE NAVEGACIÓN INFERIOR MÓVIL (PWA Bottom Bar)
════════════════════════════════════════════════════════ */
.bottom-nav-movil {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 68px !important;
  }

  .bottom-nav-movil {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: rgba(253, 250, 244, 0.95);
    border-top: 1px solid var(--borde);
    z-index: 95;
    align-items: center;
    justify-content: space-around;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
  }

  :root[data-theme="dark"] .bottom-nav-movil {
    background: rgba(14, 26, 23, 0.95);
    border-color: var(--borde);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.35);
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--texto-suave);
    font-family: var(--fuente-cuerpo);
    font-size: 0.68rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    gap: 3px;
    transition: color 0.18s, transform 0.15s;
    padding: 4px 0;
  }

  .bottom-nav-item i,
  .bottom-nav-item [data-lucide] {
    width: 20px;
    height: 20px;
    transition: transform 0.18s;
  }

  .bottom-nav-item:hover,
  .bottom-nav-item.activo {
    color: var(--teal-profundo);
    font-weight: 700;
  }

  :root[data-theme="dark"] .bottom-nav-item:hover,
  :root[data-theme="dark"] .bottom-nav-item.activo {
    color: var(--dorado-claro);
  }

  .bottom-nav-item.activo i,
  .bottom-nav-item.activo [data-lucide] {
    transform: scale(1.12);
  }

  .bnav-badge {
    position: absolute;
    top: 5px;
    right: 22%;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: var(--dorado);
    color: #1a0f08;
    font-size: 0.62rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1.5px solid var(--fondo);
  }
}

/* ════════════════════════════════════════════════════════
   BOTTOM SHEET: FILTROS MÓVILES AVANZADOS
════════════════════════════════════════════════════════ */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.bottom-sheet-overlay.abierto {
  visibility: visible;
  opacity: 1;
}

.bottom-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.bottom-sheet-panel {
  position: relative;
  width: 100%;
  max-height: 82vh;
  background: var(--fondo);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  z-index: 1;
}

.bottom-sheet-overlay.abierto .bottom-sheet-panel {
  transform: translateY(0);
}

.bottom-sheet-drag-handle {
  width: 38px;
  height: 4px;
  background: var(--borde);
  border-radius: 2px;
  margin: 0.6rem auto 0.2rem;
  flex-shrink: 0;
}

.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.2rem 0.8rem;
  border-bottom: 1px solid var(--borde);
  flex-shrink: 0;
}

.bottom-sheet-titulo-grupo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bottom-sheet-titulo {
  font-family: var(--fuente-titulo);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--teal-profundo);
  margin: 0;
}

:root[data-theme="dark"] .bottom-sheet-titulo {
  color: var(--dorado-claro);
}

.bottom-sheet-cerrar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--borde);
  background: var(--fondo-tarjeta);
  color: var(--texto-suave);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.bottom-sheet-cerrar:hover {
  color: var(--texto);
  background: var(--hover);
}

.bottom-sheet-body {
  padding: 1rem 1.2rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.sheet-seccion {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sheet-seccion-titulo {
  font-family: var(--fuente-cuerpo);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--texto-suave);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.sheet-autor-caja {
  position: relative;
  width: 100%;
}

.sheet-input-autor {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  border: 1.5px solid var(--borde);
  background: var(--fondo-tarjeta);
  color: var(--texto);
  font-family: var(--fuente-cuerpo);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.sheet-input-autor:focus {
  border-color: var(--teal-medio);
}

.sheet-autor-sugerencias {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
  max-height: 120px;
  overflow-y: auto;
}

.bottom-sheet-footer {
  display: flex;
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  border-top: 1px solid var(--borde);
  background: var(--fondo);
  flex-shrink: 0;
}

.btn-sheet-secundario {
  flex: 1;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--borde);
  background: var(--fondo-tarjeta);
  color: var(--texto);
  font-family: var(--fuente-cuerpo);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sheet-primario {
  flex: 2;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  border: none;
  background: var(--teal-profundo);
  color: #fff8f0;
  font-family: var(--fuente-cuerpo);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sheet-primario:hover {
  background: var(--teal-medio);
}

@media (min-width: 769px) {
  .bottom-sheet-overlay,
  .bottom-nav-movil {
    display: none !important;
  }
}

/* ════════════════════════════════════════════════════════
   MEJORAS DE CONVERSIÓN Y RECOMENDADOR DIRECTO (NOV 2026)
   ════════════════════════════════════════════════════════ */
/* Botón WhatsApp secundario en Hero */
.btn-hero-whatsapp {
  text-decoration: none;
  border-color: rgba(61, 178, 155, 0.45);
  background: rgba(27, 116, 84, 0.22);
  color: #f3eadc;
}

.btn-hero-whatsapp:hover {
  background: rgba(27, 116, 84, 0.42);
  border-color: var(--dorado-claro);
  color: #ffffff;
}

/* Bloque WhatsApp / Transferencia SPEI dentro del Modal Compra */
.compra-whatsapp-caja {
  margin-top: -0.6rem;
  margin-bottom: 1.5rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radio);
  background: rgba(27, 116, 84, 0.08);
  border: 1px solid rgba(27, 116, 84, 0.28);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.compra-whatsapp-texto {
  font-family: var(--fuente-cuerpo);
  font-size: 0.85rem;
  color: var(--texto-medio);
  margin: 0;
  line-height: 1.45;
}

.btn-whatsapp-compra {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.68rem 1rem;
  border-radius: var(--radio);
  background: #1b7454;
  color: #ffffff !important;
  font-family: var(--fuente-ui);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 3px 10px rgba(27, 116, 84, 0.24);
}

.btn-whatsapp-compra:hover {
  background: #14583f;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(27, 116, 84, 0.34);
}

/* Botón flotante discreto de WhatsApp (esquina inferior izquierda) */
.btn-whatsapp-flotante {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 94;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: #14583f;
  color: #fffaf2 !important;
  border: 1.5px solid rgba(212, 169, 74, 0.55);
  font-family: var(--fuente-ui);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(10, 32, 26, 0.32);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn-whatsapp-flotante:hover {
  background: #1b7454;
  transform: translateY(-2px);
  border-color: var(--dorado-claro);
  box-shadow: 0 6px 22px rgba(10, 32, 26, 0.42);
}

@media (max-width: 768px) {
  .btn-whatsapp-flotante {
    bottom: 4.35rem;
    left: 0.85rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.78rem;
  }
}

/* Modal IA: consulta directa arriba + chips de ejemplo + preguntas colapsables */
.ia-consulta-directa {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ia-ejemplos-fila {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ia-prompt-chip {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--borde);
  background: var(--fondo);
  color: var(--texto-medio);
  font-family: var(--fuente-cuerpo);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.ia-prompt-chip:hover {
  border-color: var(--teal-medio);
  background: var(--teal-suave);
  color: var(--teal-profundo);
}

.ia-guiado-details {
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: var(--fondo);
  padding: 0.7rem 0.9rem;
}

.ia-guiado-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--fuente-cuerpo);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--texto-medio);
}

.ia-guiado-summary::-webkit-details-marker {
  display: none;
}

.ia-guiado-details[open] .ia-guiado-summary {
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--borde-suave);
  color: var(--teal-profundo);
}

.ia-guiado-details[open] .ia-guiado-summary svg {
  transform: rotate(180deg);
}

.ia-guiado-contenido {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
