/**
 * LIBROS CON VIDA - CSS Personalizado
 * DEBE cargarse DESPUÉS de Bootstrap
 */

:root {
    --color-verde: #43A047;
    --color-verde-oscuro: #2E7D32;
    --color-oscuro: #1a1a2e;
    --color-gris: #6c757d;
    --color-gris-claro: #f8f9fa;
    --shadow-soft: 2px 3px 8px rgba(0,0,0,0.28);
    --shadow-medium: 0 6px 24px rgba(0,0,0,0.22);
    --shadow-strong: 0 12px 40px rgba(0,0,0,0.30);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

* { box-sizing: border-box; }

body {
    font-family: var(--fuente-cuerpo, 'Open Sans', sans-serif);
    color: var(--color-texto, #333333);
    background-color: var(--color-fondo, #FFFFFF);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--fuente-titulos, 'Montserrat', sans-serif);
    font-weight: 700;
}

a { color: var(--color-acento, #E63946); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-verde); }

/* ================================================
   BOTÓN HAMBURGUESA - SIEMPRE VISIBLE
   ================================================ */
.btn-hamburguesa {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 10000; /* Muy alto para estar siempre visible */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #FFB629;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.4);
    transition: all var(--transition-normal);
    cursor: pointer;
}
.btn-hamburguesa:hover { background-color: #e6a224; transform: scale(1.05); }
.btn-hamburguesa:focus { outline: none; box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 182, 41, 0.4); }

/* ================================================
   BOTÓN VOLVER FLOTANTE (páginas internas)
   ================================================ */
.btn-volver-flotante {
    position: fixed;
    top: 75px;
    left: 15px;
    z-index: 9998;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--color-acento, #E63946);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    animation: pulso-suave 2.5s ease-in-out infinite;
}
.btn-volver-flotante:hover {
    background-color: #c62828;
    transform: scale(1.05);
    animation: none;
}
.btn-volver-flotante:focus {
    outline: none;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(230, 57, 70, 0.4);
}

/* Animación de pulso suave */
@keyframes pulso-suave {
    0%, 100% {
        transform: scale(1);
        box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 4px 4px 18px rgba(230, 57, 70, 0.5);
    }
}

/* Responsive - Botón volver */
@media (max-width: 767.98px) {
    .btn-volver-flotante {
        top: 75px; /* Misma altura que botón búsqueda */
        left: 15px; /* Mismo margen que el derecho */
    }
}

/* ================================================
   BOTÓN BÚSQUEDA FLOTANTE
   ================================================ */
.busqueda-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 9997;
    pointer-events: none;
    transition: background 0.3s ease;
}
.busqueda-overlay.activo {
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.btn-busqueda-flotante {
    position: fixed;
    top: 75px; /* Debajo del hamburguesa (15px + 50px + 10px) */
    right: 15px;
    z-index: 9999; /* Alto para estar siempre visible */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
}

.btn-busqueda-circulo {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    background-color: #FFB629;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.4);
    transition: all var(--transition-normal);
    cursor: pointer;
}
.btn-busqueda-circulo:hover { background-color: #e6a224; transform: scale(1.05); }
.btn-busqueda-circulo:focus { outline: none; box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 182, 41, 0.4); }

.busqueda-flotante-form {
    display: flex;
    align-items: center;
    overflow: hidden;
    width: 0;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-right: 0;
}

.busqueda-flotante-input {
    width: 100%;
    height: 46px;
    padding: 10px 18px;
    border: 2px solid #FFB629;
    border-radius: 25px;
    font-size: 0.95rem;
    outline: none;
    background: #fff;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
}
.busqueda-flotante-input:focus {
    border-color: #e6a224;
    box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.25);
}
.busqueda-flotante-input::placeholder {
    color: #888;
    font-size: 0.85rem;
}

/* Estado expandido - ancho máximo según viewport */
.btn-busqueda-flotante.expandido .busqueda-flotante-form {
    width: calc(100vw - 95px); /* 100vw - margen izq(15) - espacio(10) - botón(50) - posición botón(15) - extra(5) */
    opacity: 1;
    margin-right: 10px;
}

/* Limitar ancho máximo en pantallas grandes */
@media (min-width: 576px) {
    .btn-busqueda-flotante.expandido .busqueda-flotante-form {
        width: calc(100vw - 95px);
        max-width: 500px;
    }
}

@media (min-width: 768px) {
    .btn-busqueda-flotante.expandido .busqueda-flotante-form {
        max-width: 550px;
    }
}

@media (min-width: 992px) {
    .btn-busqueda-flotante.expandido .busqueda-flotante-form {
        max-width: 600px;
    }
}

/* ================================================
   HEADER - SE OCULTA AL SCROLL
   ================================================ */
.header-main {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.header-main.header-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}
.header-content { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.header-logo { text-decoration: none; display: flex; align-items: center; }
.header-logo img { height: auto; max-height: 45px; }
.logo-text { font-family: var(--fuente-titulos); font-size: 1.5rem; font-weight: 700; color: var(--color-acento, #E63946); }

/* ================================================
   MENÚ OFFCANVAS
   ================================================ */
.menu-offcanvas { background-color: var(--color-oscuro); width: 300px !important; max-width: 85vw; }
.menu-offcanvas .offcanvas-header { border-bottom: 1px solid rgba(255,255,255,0.1); }
.menu-offcanvas .offcanvas-title { color: #fff; font-family: var(--fuente-titulos); font-weight: 600; }
.menu-offcanvas .offcanvas-body { padding-top: 20px; }
.menu-search .form-control { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; border-radius: 8px 0 0 8px; }
.menu-search .form-control::placeholder { color: rgba(255,255,255,0.5); }
.menu-search .form-control:focus { background: rgba(255,255,255,0.15); border-color: var(--color-verde); box-shadow: none; }
.menu-search .btn { border-radius: 0 8px 8px 0; }
.menu-nav .nav-link { color: rgba(255,255,255,0.85); padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.08); transition: all var(--transition-fast); font-size: 0.95rem; }
.menu-nav .nav-link:hover { color: var(--color-verde); padding-left: 8px; }
.menu-nav .nav-link i { width: 24px; text-align: center; }

/* Chips de géneros en el menú */
.generos-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 10px 15px 10px;
    max-height: 280px;
    overflow-y: auto;
}
.generos-chips-container::-webkit-scrollbar {
    width: 4px;
}
.generos-chips-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}
.generos-chips-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}
.genero-chip {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid rgba(255,255,255,0.15);
}
.genero-chip:hover {
    background: var(--color-verde);
    color: #fff;
    border-color: var(--color-verde);
    transform: translateY(-1px);
}

/* ================================================
   CONTENIDO PRINCIPAL
   ================================================ */
.main-content { 
    min-height: calc(100vh - 200px); 
}

/* Cuando NO hay hero, añadir espacio para el header */
.main-content.sin-hero {
    padding-top: 65px;
}

/* ================================================
   HERO SECTION - VIDEO DETRÁS DEL HEADER
   ================================================ */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: var(--color-oscuro);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 0;
    padding-top: 0;
}

.hero-media-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-video,
.hero-imagen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ====== MÓVIL (default): Solo video VERTICAL visible ====== */
.hero-video-vertical,
.hero-imagen-vertical {
    display: block;
    z-index: 2;
}

.hero-video-horizontal,
.hero-imagen-horizontal {
    display: none;
    z-index: 1;
}

/* ====== DESKTOP (768px+): Solo video HORIZONTAL visible ====== */
@media screen and (min-width: 768px) {
    .hero-video-vertical,
    .hero-imagen-vertical {
        display: none;
    }
    
    .hero-video-horizontal,
    .hero-imagen-horizontal {
        display: block;
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    pointer-events: none;
}
.hero-overlay > * { pointer-events: auto; }
.hero-texto-caja { box-sizing: border-box; }
.hero-texto-contenido { line-height: 1.5; }
.hero-boton { transition: all var(--transition-fast); }
.hero-boton:hover { filter: brightness(1.1); transform: scale(1.02); }
.hero-link-full { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 5; }

/* ================================================
   SECCIONES
   ================================================ */
.section-title { 
    font-size: 1.8rem; 
    margin-bottom: 0.5rem; 
    position: relative; 
    display: inline-block; 
}
.section-title::after { 
    content: ''; 
    position: absolute; 
    bottom: -8px; 
    left: 0; 
    width: 50px; 
    height: 3px; 
    background: var(--color-acento, #E63946); 
    border-radius: 2px; 
}

/* ================================================
   TARJETAS DE LIBRO
   ================================================ */

/* Centrar los libros en el grid cuando no llenan la fila */
.row.libros-grid {
    justify-content: center;
}

/* En pantallas muy grandes, aumentar el ancho máximo para fichas más grandes */
@media (min-width: 1400px) {
    .libros-container {
        max-width: 95%;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 1600px) {
    .libros-container {
        max-width: 92%;
    }
}

@media (min-width: 1900px) {
    .libros-container {
        max-width: 1850px;
    }
}

.libro-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all var(--transition-normal);
    height: 100%;
}
.libro-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-strong);
}
.libro-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.libro-link:hover { color: inherit; }

.libro-media {
    position: relative;
    aspect-ratio: 9 / 14;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    overflow: hidden;
}

.libro-video,
.libro-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video encima del poster - siempre visible */
.libro-video { z-index: 2; }
.libro-poster { z-index: 1; }

.libro-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
}

.btn-libro {
    padding: 8px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Botones más pequeños en notebook (4 columnas, 992px-1199px) */
@media (min-width: 992px) {
    .btn-libro {
        padding: 4px 7px;
        font-size: 0.55rem;
        border-radius: 5px;
    }
    .btn-libro i {
        font-size: 0.6rem;
    }
}

/* Botones más pequeños en desktop (6 columnas, 1200px+) */
@media (min-width: 1200px) {
    .btn-libro {
        padding: 5px 8px;
        font-size: 0.6rem;
    }
    .btn-libro i {
        font-size: 0.65rem;
    }
}

/* Botones aún más pequeños en pantallas muy grandes */
@media (min-width: 1400px) {
    .btn-libro {
        padding: 4px 7px;
        font-size: 0.55rem;
    }
}

.btn-escuchar { background: var(--color-verde); color: #fff; }
.btn-escuchar:hover { background: var(--color-verde-oscuro); }
.btn-escuchar.speaking { background: var(--color-acento, #E63946); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.btn-infografia { background: #FFB629; color: #fff; }
.btn-infografia:hover { background: #e6a020; color: #fff; transform: scale(1.05); }
.btn-radio { background: #E63946; color: #fff; }
.btn-radio:hover { background: #c0303b; transform: scale(1.05); }

/* Los tres botones ocupan el mismo ancho y tienen gap entre icono y texto */
.libro-overlay {
    gap: 6px;
}
.btn-libro {
    flex: 1;
    gap: 5px;
}
.btn-libro i {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.libro-info { padding: 16px; }
.libro-titulo {
    font-size: var(--ficha-titulo-tamano, 1.05rem);
    font-weight: 700;
    margin-bottom: 4px;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.libro-autor { 
    font-size: var(--ficha-autor-tamano, 0.9rem); 
    color: var(--color-gris); 
    margin-bottom: 10px; 
}
.libro-generos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.badge-genero { 
    background: var(--color-gris-claro); 
    color: #555; 
    padding: 4px 10px; 
    border-radius: 20px; 
    font-size: var(--ficha-generos-tamano, 0.7rem); 
    font-weight: 500; 
}
.libro-sinopsis {
    font-size: var(--ficha-sinopsis-tamano, 0.85rem);
    color: #666;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Textos más pequeños en notebook (4 columnas, 992px-1199px) */
@media (min-width: 992px) {
    .libro-info {
        padding: 14px;
    }
    .libro-titulo {
        font-size: 0.95rem;
        margin-bottom: 3px;
    }
    .libro-autor {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    .libro-generos {
        gap: 5px;
        margin-bottom: 8px;
    }
    .badge-genero {
        padding: 3px 8px;
        font-size: 0.65rem;
    }
    .libro-sinopsis {
        font-size: 0.8rem;
        line-height: 1.4;
    }
}

/* Textos más pequeños en desktop (6 columnas, 1200px+) */
@media (min-width: 1200px) {
    .libro-info {
        padding: 12px;
    }
    .libro-titulo {
        font-size: 0.9rem;
    }
    .libro-autor {
        font-size: 0.8rem;
    }
    .libro-generos {
        gap: 4px;
    }
    .badge-genero {
        padding: 3px 7px;
        font-size: 0.6rem;
    }
    .libro-sinopsis {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }
}

/* Textos aún más compactos en pantallas muy grandes */
@media (min-width: 1400px) {
    .libro-info {
        padding: 10px;
    }
    .libro-titulo {
        font-size: 0.85rem;
    }
    .libro-autor {
        font-size: 0.75rem;
    }
    .badge-genero {
        padding: 2px 6px;
        font-size: 0.55rem;
    }
    .libro-sinopsis {
        font-size: 0.7rem;
    }
}

/* ================================================
   NEWSLETTER
   ================================================ */
.newsletter-section {
    background: linear-gradient(135deg, var(--color-acento, #E63946) 0%, #c62828 100%);
    padding: 60px 20px;
    color: #fff;
}
.newsletter-section h2 { color: #fff; }
.newsletter-section .form-control { border: none; padding: 14px 18px; border-radius: 8px 0 0 8px; font-size: 1rem; }
.newsletter-section .btn { padding: 14px 28px; border-radius: 0 8px 8px 0; font-weight: 600; }
.newsletter-section .form-check-label { font-size: 0.85rem; }
.newsletter-section .form-check-label a { color: #fff; text-decoration: underline; }

/* Mensajes de respuesta del newsletter */
.newsletter-mensaje {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
}
.newsletter-exito {
    background-color: rgba(255, 255, 255, 0.95);
    color: #2E7D32;
}
.newsletter-error {
    background-color: rgba(255, 255, 255, 0.95);
    color: #c62828;
}

/* ================================================
   FOOTER
   ================================================ */
.footer-main { background: var(--color-oscuro); color: #fff; padding: 50px 0 30px; margin-top: 60px; }
.footer-logo { max-height: 50px; width: auto; }
.footer-logo-text { color: var(--color-acento, #E63946); font-family: var(--fuente-titulos); font-weight: 700; font-size: 1.3rem; }
.footer-descripcion { color: rgba(255,255,255,0.7); font-size: 0.95rem; line-height: 1.6; }
.footer-titulo { color: #fff; font-weight: 600; margin-bottom: 18px; font-size: 1rem; }
.footer-link { color: rgba(255,255,255,0.7); transition: color var(--transition-fast); display: inline-flex; align-items: center; }
.footer-link:hover { color: var(--color-acento); }
.footer-link-legal { color: rgba(255,255,255,0.5); font-size: 0.85rem; }
.footer-link-legal:hover { color: #fff; }
.footer-social { display: flex; flex-wrap: wrap; gap: 12px; }
.social-link { width: 45px; height: 45px; border-radius: 50%; background: rgba(255,255,255,0.1); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: all var(--transition-normal); }
.social-link:hover { background: var(--color-acento, #E63946); color: #fff; transform: translateY(-4px); }
.footer-divider { border-color: rgba(255,255,255,0.1); margin: 30px 0; }
.footer-copyright { text-align: center; color: rgba(255,255,255,0.5); font-size: 0.9rem; }

/* ================================================
   SELECTOR DE ORDEN
   ================================================ */
.selector-orden .dropdown-toggle { background: #fff; border: 1px solid #dee2e6; color: #333; padding: 8px 16px; border-radius: 8px; font-size: 0.9rem; }
.selector-orden .dropdown-toggle:hover { background: var(--color-gris-claro); border-color: var(--color-acento); }
.selector-orden .dropdown-menu { border-radius: 10px; box-shadow: var(--shadow-medium); border: none; padding: 8px; }
.selector-orden .dropdown-item { border-radius: 6px; padding: 10px 16px; font-size: 0.9rem; }
.selector-orden .dropdown-item:hover { background: var(--color-gris-claro); }
.selector-orden .dropdown-item.active { background: var(--color-acento); color: #fff; }

/* ================================================
   PAGINACIÓN
   ================================================ */
.pagination { gap: 5px; }
.pagination .page-link { border-radius: 8px; border: none; color: #333; padding: 10px 16px; font-weight: 500; background: var(--color-gris-claro); transition: all var(--transition-fast); }
.pagination .page-link:hover { background: var(--color-acento); color: #fff; }
.pagination .page-item.active .page-link { background: var(--color-acento); color: #fff; }
.pagination .page-item.disabled .page-link { background: transparent; color: #aaa; }

/* ================================================
   BLOQUES DE CONTENIDO
   ================================================ */
.bloque-contenido { margin: 20px 0; }
.bloque-contenido img { max-width: 100%; height: auto; }

/* ================================================
   RESPONSIVE - MÓVIL (1 columna)
   ================================================ */
@media screen and (max-width: 767.98px) {
    .hero-section { 
        min-height: 100vh; 
    }
    
    .hero-texto-caja { 
        max-width: 95% !important; 
        font-size: 0.9em; 
    }
    
    .section-title { 
        font-size: 1.4rem; 
    }
    
    .btn-libro { 
        padding: 10px 14px;
        font-size: 0.75rem;
    }
    
    .footer-social { 
        justify-content: center; 
    }
}

/* ================================================
   FRANJA DEGRADADA BAJO LOGO FLOTANTE
   ================================================ */
.franja-logo-flotante {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 80px;
    z-index: 997; /* Debajo del logo flotante (998) pero encima del contenido */
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.25) 50%,
        transparent 100%
    );
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.franja-logo-flotante.visible {
    opacity: 1;
    visibility: visible;
}

/* Ajuste de altura responsive */
@media (max-width: 768px) {
    .franja-logo-flotante {
        height: 70px; /* Más compacta en móvil */
    }
}

@media (min-width: 769px) {
    .franja-logo-flotante {
        height: 90px; /* Un poco más en desktop */
    }
}

/* ================================================
   LOGO FLOTANTE AL HACER SCROLL
   ================================================ */
.logo-flotante-scroll {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 998; /* Debajo del hamburguesa (999) y búsqueda (999) */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.logo-flotante-scroll.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.logo-flotante-scroll a {
    display: block;
    line-height: 0;
}

.logo-flotante-scroll img {
    display: block;
    width: auto;
}

/* Responsive - Logo flotante */
@media (max-width: 768px) {
    .logo-flotante-scroll {
        top: 15px;
        left: 15px;
    }
}

@media (min-width: 769px) {
    .logo-flotante-scroll {
        top: 25px;
        left: 25px;
    }
}

/* ================================================
   PÁGINA DETALLE DEL LIBRO
   ================================================ */

/* Infografía horizontal (solo desktop) */
.infografia-horizontal {
    margin-bottom: 2rem;
}

.infografia-horizontal img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 0;
}

/* Infografía vertical (móvil) */
.infografia-vertical img,
.poster-destacado img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Header del libro (título, autor, géneros) */
.libro-header {
    border-bottom: 2px solid rgba(0,0,0,0.08);
    padding-bottom: 1.5rem;
}

.libro-titulo-detalle {
    font-family: var(--fuente-titulos);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-texto);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.libro-autor-detalle {
    font-size: 1.25rem;
    color: var(--color-gris);
    margin-bottom: 0;
    font-weight: 500;
}

.libro-generos-detalle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge-genero-detalle {
    display: inline-block;
    padding: 6px 16px;
    background: var(--color-acento);
    color: #fff;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.badge-genero-detalle:hover {
    background: var(--color-verde);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.libro-meta-extra {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0;
}

.libro-meta-extra .meta-separador {
    color: #ccc;
}

/* Sinopsis */
.libro-sinopsis-seccion {
    background: var(--color-gris-claro);
    padding: 1.5rem;
    border-radius: 8px;
}

.sinopsis-titulo {
    font-family: var(--fuente-titulos);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-texto);
}

.libro-sinopsis-texto {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-texto);
}

.libro-sinopsis-texto p {
    margin-bottom: 1rem;
}

.libro-sinopsis-texto p:last-child {
    margin-bottom: 0;
}

/* Botón de audio */
.btn-audio-detalle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 16px;
    background: var(--color-verde);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(67, 160, 71, 0.3);
}

.btn-audio-detalle:hover {
    background: var(--color-verde-oscuro);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 160, 71, 0.4);
}

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

.btn-audio-detalle.playing {
    background: var(--color-acento);
    animation: pulse-audio 1.5s ease-in-out infinite;
}

@keyframes pulse-audio {
    0%, 100% { box-shadow: 0 2px 8px rgba(230, 57, 70, 0.3); }
    50% { box-shadow: 0 4px 16px rgba(230, 57, 70, 0.6); }
}

/* Video del libro */
.libro-video-detalle {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    background: #000;
}

.libro-video-desktop {
    position: sticky;
    top: 85px;
}

/* Compartir en RRSS */
.compartir-seccion,
.compartir-seccion-desktop {
    padding: 1.5rem;
    background: var(--color-gris-claro);
    border-radius: 8px;
}

.compartir-titulo {
    font-family: var(--fuente-titulos);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-texto);
    margin-bottom: 1rem;
}

.compartir-botones {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* Móvil: 3 botones por fila, centrados */
@media (max-width: 767.98px) {
    .compartir-seccion {
        text-align: center;
    }
    
    .compartir-botones {
        gap: 15px;
        max-width: 240px;
        margin: 0 auto;
    }
    
    .btn-compartir {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

.btn-compartir {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    font-size: 1.3rem;
    color: #fff;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-compartir:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.btn-compartir:active {
    transform: translateY(-1px);
}

.btn-whatsapp { background: #25D366; }
.btn-whatsapp:hover { background: #1EBE57; }

.btn-facebook { background: #1877F2; }
.btn-facebook:hover { background: #0D65D9; }

.btn-twitter { background: #000000; }
.btn-twitter:hover { background: #333333; }

.btn-instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.btn-instagram:hover { background: linear-gradient(45deg, #e08322 0%, #d5572b 25%, #cb1632 50%, #bb1255 75%, #ab0777 100%); }

.btn-email { background: var(--color-gris); }
.btn-email:hover { background: #5a6268; }

.btn-copiar { background: var(--color-verde); }
.btn-copiar:hover { background: var(--color-verde-oscuro); }

.btn-copiar.copiado {
    background: var(--color-acento);
    animation: pulse-copiar 0.6s ease;
}

@keyframes pulse-copiar {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Botones de compra */
.botones-compra-seccion {
    padding: 1.5rem;
    background: #fff;
    border: 2px solid var(--color-gris-claro);
    border-radius: 8px;
}

.botones-compra-titulo {
    font-family: var(--fuente-titulos);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-texto);
    margin-bottom: 1rem;
}

.botones-compra-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.boton-compra {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--color-acento);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.boton-compra:hover {
    background: var(--color-verde);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.boton-compra:active {
    transform: translateY(0);
}

.boton-compra .boton-icono {
    width: 24px;
    height: 24px;
}

.boton-compra .boton-icono-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Tamaños de botones */
.boton-compra-small {
    padding: 10px 18px;
    font-size: 0.875rem;
}

.boton-compra-small .boton-icono,
.boton-compra-small .boton-icono-img {
    width: 20px;
    height: 20px;
}

.boton-compra-medium {
    padding: 14px 24px;
    font-size: 1rem;
}

.boton-compra-large {
    padding: 18px 32px;
    font-size: 1.125rem;
}

.boton-compra-large .boton-icono,
.boton-compra-large .boton-icono-img {
    width: 28px;
    height: 28px;
}

/* Plantilla tienda (colores específicos) */
.boton-plantilla-tienda {
    background: #fff;
    color: #333;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    min-height: 50px;
}

.boton-plantilla-tienda:hover {
    background: var(--color-gris-claro);
    color: #333;
    border-color: var(--color-gris);
}

/* Logo de tienda (imagen) */
.boton-logo-tienda {
    max-width: 100%;
    max-height: 32px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.boton-compra-small .boton-logo-tienda {
    max-height: 26px;
}

.boton-compra-large .boton-logo-tienda {
    max-height: 38px;
}

/* Texto solo (cuando no hay logo) */
.boton-texto-solo {
    font-weight: 600;
    font-size: inherit;
}

/* Libros relacionados - Reutiliza estilos de libro-card */

/* Responsive - Detalle del libro */
@media (max-width: 991px) {
    .libro-titulo-detalle {
        font-size: 1.75rem;
    }
    
    .libro-autor-detalle {
        font-size: 1.1rem;
    }
}

@media (min-width: 992px) {
    .botones-compra-lista {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .boton-compra {
        flex: 1;
        min-width: 200px;
    }
    
    .compartir-seccion-desktop {
        padding: 2rem;
    }
    
    .compartir-botones {
        gap: 16px;
    }
    
    .btn-compartir {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }
}

/* Bloques de contenido personalizados */
.bloque-contenido {
    padding: 1rem;
    background: rgba(0,0,0,0.02);
    border-radius: 8px;
}

.bloque-contenido:empty {
    display: none;
}

.bloque-contenido > *:last-child {
    margin-bottom: 0;
}

/* ================================================
   MODAL COMPARTIR POR EMAIL
   ================================================ */

.modal-email-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-email-overlay.activo {
    display: flex;
}

.modal-email-container {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalEntrar 0.3s ease;
}

@keyframes modalEntrar {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-email-cerrar {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.modal-email-cerrar:hover {
    background: var(--color-acento);
    color: #fff;
}

.modal-email-header {
    text-align: center;
    padding: 30px 30px 20px;
    background: linear-gradient(135deg, var(--color-acento) 0%, #c62828 100%);
    color: #fff;
    border-radius: 16px 16px 0 0;
}

.modal-email-header i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.modal-email-header h3 {
    margin: 0 0 5px;
    font-size: 1.4rem;
    font-weight: 600;
}

.modal-email-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.modal-email-form {
    padding: 25px 30px 30px;
}

.modal-email-campo {
    margin-bottom: 18px;
}

.modal-email-campo label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #444;
}

.modal-email-campo label i {
    color: var(--color-acento);
    margin-right: 5px;
}

.modal-email-campo input,
.modal-email-campo textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.modal-email-campo input:focus,
.modal-email-campo textarea:focus {
    outline: none;
    border-color: var(--color-acento);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
}

.modal-email-campo textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-email-preview {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px 18px;
    margin-bottom: 20px;
}

.modal-email-preview p {
    margin: 0 0 10px;
    font-size: 0.85rem;
    color: #666;
}

.modal-email-preview ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.modal-email-preview li {
    font-size: 0.8rem;
    color: #555;
}

.modal-email-preview li i {
    color: var(--color-verde);
    margin-right: 5px;
    width: 14px;
}

.modal-email-enviar {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--color-acento) 0%, #c62828 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-email-enviar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.35);
}

.modal-email-enviar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.modal-email-enviar.enviando i {
    animation: rotar 1s linear infinite;
}

@keyframes rotar {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.modal-email-mensaje {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.modal-email-mensaje.exito {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.modal-email-mensaje.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive modal */
@media (max-width: 480px) {
    .modal-email-container {
        max-height: 95vh;
    }
    
    .modal-email-header {
        padding: 25px 20px 15px;
    }
    
    .modal-email-form {
        padding: 20px;
    }
    
    .modal-email-preview ul {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PÁGINAS LEGALES (Privacidad, Cookies, etc.)
   ============================================ */

.legal-content {
    line-height: 1.8;
    color: var(--color-texto);
}

.legal-content h2 {
    font-family: var(--fuente-titulos);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-texto);
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-acento);
}

.legal-content h3 {
    font-family: var(--fuente-titulos);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-texto);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.legal-content p {
    margin-bottom: 1rem;
    text-align: justify;
}

.legal-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.legal-content ul li {
    margin-bottom: 0.5rem;
}

.legal-content a {
    color: var(--color-acento);
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-content table {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.legal-content table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.legal-content table td,
.legal-content table th {
    padding: 0.75rem;
    vertical-align: top;
}

@media (max-width: 767.98px) {
    .legal-content h2 {
        font-size: 1.2rem;
    }
    
    .legal-content h3 {
        font-size: 1rem;
    }
    
    .legal-content p {
        text-align: left;
    }
    
    .legal-content table {
        font-size: 0.8rem;
    }
    
    .legal-content table td,
    .legal-content table th {
        padding: 0.5rem;
    }
}

/* ================================================
   NAVEGACIÓN POR GÉNEROS (badges en página género)
   ================================================ */
.generos-navegacion {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

.badge-genero {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    color: #333;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.badge-genero:hover {
    background: var(--color-acento, #E63946);
    color: #fff;
    border-color: var(--color-acento, #E63946);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

.badge-genero:hover .badge-count {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.badge-genero.active {
    background: var(--color-acento, #E63946);
    color: #fff;
    border-color: var(--color-acento, #E63946);
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.3);
}

.badge-genero.active .badge-count {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #e9ecef;
    color: #666;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ========================================
   ESTILOS PARA NEWSLETTER - TEXTO EN ROJO PARPADEANDO
   ======================================== */

.texto-parpadeo-newsletter {
    animation: parpadeo-newsletter 2s ease-in-out infinite;
    font-weight: 700 !important;
}

@keyframes parpadeo-newsletter {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Ajustes para el mensaje de newsletter */
.newsletter-exito {
    background-color: #d4edda !important;
    border: 2px solid #28a745 !important;
    border-radius: 8px;
    padding: 20px !important;
    margin-top: 15px;
}

.newsletter-error {
    background-color: #f8d7da !important;
    border: 2px solid #dc3545 !important;
    border-radius: 8px;
    padding: 15px !important;
    margin-top: 15px;
}

.newsletter-exito i.fa-check-circle {
    color: #28a745;
}

.newsletter-error i.fa-exclamation-circle {
    color: #dc3545;
}

/* ========================================
   SECCIÓN DESTACADOS - MEJORAS VISUALES
   ======================================== */

/* Fondo gris claro para toda la sección */
.seccion-destacados {
    background: #DBF5F9;
    border-bottom: 1px solid #e9ecef;
}

/* Header de destacados */
.header-destacados {
    text-align: center;
    margin-bottom: 30px;
}

.section-title-destacados {
    font-size: 3rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.section-title-destacados i {
    color: #f59e0b;
    font-size: 0rem;
    animation: pulse-star 2s ease-in-out infinite;
}

@keyframes pulse-star {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.subtitle-destacados {
    font-size: 1.1rem;
    color: #64748b;
    margin: 0;
    font-weight: 400;
}

/* Badge destacado - CINTA DIAGONAL ROJA (TAMAÑO CORRECTO) */
.badge-destacado {
    position: absolute;
    top: -5px;
    left: -12px;
    z-index: 10;
    width: 105px;
    height: 77px;
    overflow: hidden;
    pointer-events: none;
}

.badge-destacado::before {
    content: 'TOP';
    position: absolute;
    top: 15px;
    left: -25px;
    width: 119px;
    height: 22px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 22px;
    transform: rotate(-45deg);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.75);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Efecto hover */
.libro-card:hover .badge-destacado::before {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Tarjetas destacadas con sombra más pronunciada */
.seccion-destacados .libro-card {
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.28);
}

.seccion-destacados .libro-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.30);
    transform: translateY(-12px);
}

/* Responsive */
@media (max-width: 768px) {
    .section-title-destacados {
        font-size: 3rem;
    }
    
    .section-title-destacados i {
        font-size: 0rem;
    }
    
    .subtitle-destacados {
        font-size: 1rem;
    }
    
    /* Cinta en móvil - MÁS GRANDE */
    .badge-destacado {
        width: 125px;
        height: 105px; /* 95 */
    }
    
    .badge-destacado::before {
        top: 21px; /*19 */
        left: -35px;
        width: 145px;
        height: 30px;
        font-size: 14px;
        line-height: 30px;
        letter-spacing: 1px;
    }
}

/* ============================================
   BOTÓN RADIO en tarjetas de libro
   ============================================ */
.btn-radio {
    background: #E63946;
    color: #fff;
}
.btn-radio:hover {
    background: #c0303b;
    transform: scale(1.05);
}

/* ============================================
   REPRODUCTOR DE PODCAST - Página de detalle
   ============================================ */
.podcast-reproductor-seccion {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(230, 57, 70, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.podcast-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.podcast-icono {
    font-size: 1.6rem;
    color: #E63946;
    flex-shrink: 0;
}

.podcast-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.podcast-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #E63946;
    text-transform: uppercase;
}

.podcast-titulo {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.podcast-controles {
    display: flex;
    align-items: center;
    gap: 12px;
}

.podcast-btn-play {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #E63946;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(230, 57, 70, 0.4);
}

.podcast-btn-play:hover {
    background: #c0303b;
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(230, 57, 70, 0.5);
}

.podcast-btn-play:active {
    transform: scale(0.96);
}

.podcast-progreso-wrap {
    flex: 1;
}

.podcast-barra {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    margin-bottom: 6px;
    transition: height 0.15s;
}

.podcast-barra:hover {
    height: 7px;
}

.podcast-barra-fill {
    height: 100%;
    background: #E63946;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.podcast-tiempos {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
}

/* ============================================
   PODCAST - Zona Drag & Drop (admin)
   ============================================ */
.podcast-dropzone {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 35px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fafafa;
}

.podcast-dropzone:hover,
.podcast-dropzone-activa {
    border-color: var(--color-verde) !important;
    background: rgba(67, 160, 71, 0.05) !important;
}

/* El contenido decorativo NO recibe eventos de ratón ni drag.
   Así la zona div recibe TODOS los eventos sin interferencias. */
.podcast-dropzone-contenido {
    pointer-events: none;
}

.podcast-dropzone-icono {
    font-size: 2.5rem;
    color: #bbb;
    display: block;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.podcast-dropzone:hover .podcast-dropzone-icono,
.podcast-dropzone-activa .podcast-dropzone-icono {
    color: var(--color-verde);
}

.podcast-dropzone-texto {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    margin: 0 0 4px;
}

.podcast-dropzone-subtexto {
    font-size: 0.8rem;
    color: #aaa;
    margin: 0;
}

/* ============================================
   REPRODUCTOR PODCAST FLOTANTE
   ============================================ */

.podcast-flotante {
    position: fixed;
    bottom: 24px;
    left: 15px; /* Alineado con el botón volver */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Píldora expandida — cristal oscuro */
.podcast-flotante-expandido {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 15, 25, 0.70);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /*border: 1px solid rgba(230, 57, 70, 0.45);*/
    border-radius: 50px;
    padding: 10px 14px 10px 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.45);
    cursor: default;
    white-space: nowrap;
}

.podcast-flotante-micro {
    color: #FFFFFF;
    font-size: 1rem;
    animation: pulseMicro 2s infinite;
}

@keyframes pulseMicro {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

.podcast-flotante-texto {
    color: rgba(255,255,255,0.88);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Botón play dentro de la píldora */
.podcast-flotante-expandido .podcast-flotante-btn-play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #E63946;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}

.podcast-flotante-expandido .podcast-flotante-btn-play:hover {
    background: #c0303b;
    transform: scale(1.1);
}

/* ── Estado reproduciendo: píldora horizontal oscura ── */
.podcast-flotante-contraido {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 15, 25, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50px;
    padding: 8px 16px 8px 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.45);
    white-space: nowrap;
    min-width: 200px;
}

/* Botón pausa dentro de la píldora reproduciendo */
.podcast-flotante-contraido .podcast-flotante-btn-play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #E63946;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
    animation: pulseCircle 2s infinite;
}

.podcast-flotante-contraido .podcast-flotante-btn-play:hover {
    background: #c0303b;
    transform: scale(1.1);
    animation: none;
}

@keyframes pulseCircle {
    0%, 100% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.4); }
    50%       { box-shadow: 0 0 0 6px rgba(230, 57, 70, 0); }
}

/* Bloque derecho: barra + tiempo */
.podcast-progreso-bloque {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Barra de progreso */
.podcast-barra-contenedor {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.podcast-barra-progreso {
    height: 100%;
    width: 0%;
    background: #E63946;
    border-radius: 4px;
    transition: width 0.8s linear;
}

/* Tiempo restante */
.podcast-tiempo-restante {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.70);
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* Transición suave entre expandido y contraído */
.podcast-flotante-expandido {
    transition: opacity 0.25s ease;
}

/* Móvil: misma alineación */
@media (max-width: 767.98px) {
    .podcast-flotante {
        left: 15px;
        bottom: 20px;
    }
}


/* ====================================================================
   REDISEÑO FICHAS v11.6
   Grid: auto-fill minmax(280px,1fr) — sin tocar Bootstrap
   Fichas huérfanas: se estiran (comportamiento correcto con auto-fill)
   ==================================================================== */

@media (min-width: 992px) {
    .libros-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
        padding: 0 10px;
    }
    .libros-grid > [class*="col-"] {
        width: 100% !important;
        padding: 0 !important;
    }
}

.libro-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    position: relative;
    height: 100%;
}
.libro-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-strong); }

@media (min-width: 992px) {

    .lc-top {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 10px;
        padding: 10px;
    }

    .lc-video-wrap {
        flex: 0 0 55%;
        aspect-ratio: 784 / 1168;
        position: relative;
        overflow: hidden;
        border-radius: 8px;
        background: #1a1a2e;
    }
    .lc-video-wrap .libro-poster,
    .lc-video-wrap .libro-video {
        position: absolute;
        top: 0; left: 0;
        width: 100%; height: 100%;
        object-fit: cover;
    }
    .lc-video-wrap .libro-poster { z-index: 1; }
    .lc-video-wrap .libro-video  { z-index: 2; }
    .lc-video-wrap .badge-destacado { z-index: 3; }
    .lc-video-wrap .libro-overlay { display: none; }

    /* Infografía */
    .lc-infografia-wrap {
        flex: 1 1 0;
        overflow: hidden;
        border-radius: 8px;
        position: relative;
        display: block;
    }
    .lc-infografia-img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top center;
        filter: grayscale(100%) brightness(1) opacity(0.2);
        transition: filter 0.5s ease;
    }
    .lc-infografia-wrap:hover .lc-infografia-img {
        filter: grayscale(0%) brightness(1) opacity(1);
    }

    /* Lupa centrada sobre la infografía */
    .lc-infografia-wrap::after {
        content: '\f00e';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        position: absolute;
        top: 50%; left: 50%;
        transform: translate(-50%, -50%);
        font-size: 2rem;
        color: rgba(255,255,255,0.9);
        text-shadow: 0 2px 8px rgba(0,0,0,0.5);
        pointer-events: none;
        z-index: 6;
        transition: opacity 0.3s ease;
    }
    .lc-infografia-wrap:hover::after { opacity: 0; }

    /* Canvas ondas */
    .lc-infografia-wrap .ondas-canvas {
        position: absolute;
        top: 0; left: 0;
        width: 100%; height: 100%;
        pointer-events: none;
        border-radius: 8px;
        z-index: 5;
    }

    .lc-texto-derecha { display: none; }

    .lc-bottom { padding: 10px 12px; flex-shrink: 0; display: flex; flex-direction: column; flex: 1; }
    .lc-bottom-link { display: flex; flex-direction: column; flex: 1; text-decoration: none; color: inherit; }
    .lc-bottom-link:hover { color: inherit; }
    .lc-bottom-texto { margin-bottom: 8px; flex: 1; }
    .lc-bottom .libro-generos { display: none; }
    .lc-bottom-botones { display: flex; gap: 6px; margin-top: auto; }
    .lc-bottom-botones .btn-libro { flex: 1; gap: 4px; padding: 6px 8px; font-size: 0.65rem; }
}

@media (max-width: 991.98px) {
    .lc-top { display: block; }
    .lc-video-wrap {
        position: relative;
        width: 100%;
        aspect-ratio: 784 / 1168;
        overflow: hidden;
        background: #1a1a2e;
    }
    .lc-video-wrap .libro-poster,
    .lc-video-wrap .libro-video {
        position: absolute;
        top: 0; left: 0;
        width: 100%; height: 100%;
        object-fit: cover;
    }
    .lc-video-wrap .libro-poster { z-index: 1; }
    .lc-video-wrap .libro-video  { z-index: 2; }
    .lc-infografia-wrap { display: none; }
    .lc-texto-derecha   { display: none; }
    .lc-bottom { padding: 14px; }
    .lc-bottom-link { display: block; text-decoration: none; color: inherit; }
    .lc-bottom-link:hover { color: inherit; }
    .lc-bottom-botones { display: none; }
}


/* Enlace transparente sobre el vídeo — móvil y desktop */
.lc-video-enlace {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 3; /* por encima del poster/vídeo pero por debajo del overlay de botones (z-index:10+) */
    display: block;
}
@media (min-width: 992px) {
    /* En desktop el overlay de botones está oculto, el enlace cubre todo el vídeo */
    .lc-video-enlace {
        z-index: 3;
    }
}

/* ====================================================================
   EFECTO ZOOM-IN INFOGRAFÍA — Solo móvil (<992px)
   Ciclo: vídeo termina → infografía aparece con zoom → 3s → vuelve vídeo
   ==================================================================== */

/* En desktop la capa zoom-in es invisible y no interfiere */
@media (min-width: 992px) {
    .lc-zoom-info-wrap { display: none; }
}

/* En móvil: capa superpuesta sobre el vídeo, z-index por debajo del overlay de botones */
@media (max-width: 991.98px) {
    .lc-zoom-info-wrap {
        position: absolute;
        top: 0; left: 0;
        width: 100%; height: 100%;
        z-index: 4; /* encima del vídeo (z-index:2) y del enlace (z-index:3), debajo del overlay */
        overflow: hidden;
        /* Estado inicial: invisible, escala grande */
        opacity: 0;
        transform: scale(1.40);
        /* Sin transición en reposo — la aplica el JS */
        transition: none;
        pointer-events: none; /* no bloquea taps cuando está oculta */
    }
    .lc-zoom-info-img {
        display: block;
        width: 100%; height: 100%;
        object-fit: cover;
        object-position: top center;
    }
}

/* ================================================
   PÁGINA DETALLE — NUEVO LAYOUT DESKTOP (≥992px)
   Franja superior: vídeo izquierda + infografía derecha
   ================================================ */

@media (min-width: 992px) {

    /* Franja superior: el contenedor se expande a la altura del elemento más alto */
    .detalle-franja-superior {
        display: flex;
        align-items: stretch;
        width: 100%;
        gap: 12px;
        background: #e8e8e8;
    }

    /* Vídeo: ancho fijo, altura natural según su ratio */
    .detalle-franja-video {
        flex: 0 0 auto;
        width: 28%;
        background: transparent;
    }

    .detalle-franja-video .libro-video-detalle {
        width: 100%;
        height: auto;
        display: block;
    }

    /* Infografía: se estira para igualar la altura del vídeo */
    .detalle-franja-infografia {
        flex: 1;
        min-width: 0;
        cursor: zoom-in;
        position: relative;
        display: flex;
        align-items: flex-start;
    }

    /* Lupa sobre la infografía al hacer hover */
    /* Lupa sobre la infografía al hacer hover */
    .detalle-franja-lupa {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.7);
        width: 80px;
        height: 80px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.52);
        border: 2px solid rgba(255,255,255,0.6);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.25s ease, transform 0.25s ease;
        pointer-events: none;
        backdrop-filter: blur(2px);
    }

    .detalle-franja-lupa i {
        font-size: 1.9rem;
        color: #fff;
    }

    .detalle-franja-infografia:hover .detalle-franja-lupa {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }


    .detalle-franja-infografia-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top left;
        display: block;
        transition: filter 0.2s ease;
    }

    .detalle-franja-infografia:hover .detalle-franja-infografia-img {
        filter: brightness(0.88);
    }

    /* Vídeo: ancho fijo proporcional, altura natural sin recorte */
    .detalle-franja-video {
        flex: 0 0 auto;
        width: 28%;
        background: transparent;
    }

    .detalle-franja-video .libro-video-detalle {
        width: 100%;
        height: auto;
        display: block;
    }

    /* Modal lightbox para infografía ampliada */
    .detalle-infografia-modal {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 9999;
        background: rgba(0,0,0,0.88);
        align-items: center;
        justify-content: center;
        padding: 20px;
        cursor: zoom-out;
    }

    .detalle-infografia-modal.activo {
        display: flex;
    }

    .detalle-infografia-modal img {
        max-width: 95vw;
        max-height: 92vh;
        object-fit: contain;
        border-radius: 8px;
        box-shadow: 0 20px 60px rgba(0,0,0,0.6);
        cursor: default;
    }

    .detalle-infografia-modal-cerrar {
        position: fixed;
        top: 16px;
        right: 20px;
        background: rgba(255,255,255,0.15);
        border: none;
        color: #fff;
        font-size: 1.6rem;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s;
    }

    .detalle-infografia-modal-cerrar:hover {
        background: rgba(255,255,255,0.3);
    }

    /* Zona inferior: sinopsis (izquierda) + acciones (derecha) */
    .detalle-contenido-inferior {
        display: flex;
        gap: 3rem;
        align-items: flex-start;
    }

    .detalle-col-sinopsis {
        flex: 1;
    }

    .detalle-col-acciones {
        flex: 0 0 300px;
        min-width: 260px;
    }

}

/* Botón Podcast junto a Escuchar sinopsis */
.btn-podcast-sinopsis {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 16px;
    background: var(--color-acento, #E63946);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.3);
}

.btn-podcast-sinopsis:hover {
    background: #c1121f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.45);
}

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

/* Botón Podcast en estado pausar */
.btn-podcast-sinopsis.pausando {
    background: #c1121f;
    box-shadow: 0 2px 8px rgba(193, 18, 31, 0.45);
}


/* ============================================
   AUTOCOMPLETADO DEL BUSCADOR FLOTANTE
   ============================================ */

/* Caja desplegable de sugerencias */
.autocompletado-box {
    display: none;
    position: absolute;
    top: 56px; /* justo debajo del botón/input (altura del input 46px + margen) */
    right: 0;
    left: 0;
    background: #fff;
    border: 2px solid #FFB629;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 9999;
    overflow: hidden;
    max-height: 360px;
    overflow-y: auto;
}

.autocompletado-box.visible {
    display: block;
}

/* Cabecera de sección (Libros / Autores / Géneros) */
.autocompletado-seccion {
    padding: 6px 14px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #FFB629;
    background: #fffdf5;
    border-bottom: 1px solid #f0e8d0;
}

/* Fila de sugerencia */
.autocompletado-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    transition: background 0.15s ease;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
}

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

.autocompletado-item:hover,
.autocompletado-item.activo {
    background: #fff8e8;
    color: #333;
    text-decoration: none;
}

/* Icono de cada sugerencia */
.autocompletado-icono {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Color de icono según tipo */
.autocompletado-item--libro .autocompletado-icono   { color: #E63946; }
.autocompletado-item--autor .autocompletado-icono   { color: #4A90D9; }
.autocompletado-item--genero .autocompletado-icono  { color: #FFB629; }

/* Texto de la sugerencia */
.autocompletado-texto {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ════════════════════════════════════════════
   LIBRO DEL DÍA — Sección home
   Basado en la prueba de concepto aprobada
════════════════════════════════════════════ */

.ld-seccion {
    max-width: 100%;
    margin: 0;
}

.ld-wrap { width: 100%; }

/* Franja vídeo + infografía */
.ld-franja {
    display: flex;
    align-items: stretch;
    width: 100%;
    background: #000;
    overflow: visible;
}

/* Vídeo — mismo 28% que la ficha de detalle */
.ld-video {
    flex: 0 0 28%;
    background: #000;
    position: relative;
    overflow: hidden;
}
.ld-video video {
    width: 100%;
    height: auto;
    display: block;
}

/* Badge sobre el vídeo */
.ld-badge {
    position: absolute;
    top: 12px; left: 12px;
    z-index: 2;
    background: #E63946;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(230,57,70,0.5);
}

/* Infografía con Tilt 3D */
.ld-infografia {
    flex: 1;
    min-width: 0;
    cursor: none;
    position: relative;
    display: flex;
    align-items: flex-start;
    perspective: 1000px;
    overflow: visible;
    text-decoration: none;
}
.ld-infografia img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    display: block;
    transition: transform 300ms ease, box-shadow 300ms ease, filter 300ms ease;
    will-change: transform;
}

/* Lupa que sigue al ratón */
.ld-lupa {
    position: absolute;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(0,0,0,0.52);
    border: 2px solid rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(2px);
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    transition: opacity 0.2s ease;
    transform: translate(-50%, -50%);
}
.ld-lupa i {
    font-size: 1.9rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Ticker inferior */
.ld-ticker-wrap {
    width: 100%;
    background: #1e293b;
    overflow: hidden;
    height: 62px;
    display: flex;
    align-items: center;
}
.ld-ticker {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: ldTicker 35s linear infinite;
    transform: translateX(20vw);
}
.ld-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    padding: 0 60px;
}
.ld-ticker-titulo {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}
.ld-ticker-sep {
    color: #E63946;
    font-size: 18px;
}
.ld-ticker-autor {
    font-size: 18px;
    color: rgba(255,255,255,0.55);
    font-style: italic;
}
.ld-ticker-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #E63946;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 4px;
    text-decoration: none;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(230,57,70,0.4);
    transition: background 0.2s;
}
.ld-ticker-btn:hover { background: #c0303c; color: #fff; }

@keyframes ldTicker {
    0%   { transform: translateX(20vw); }
    100% { transform: translateX(-100%); }
}

/* Móvil: ocultar el libro del día */
@media (max-width: 767px) {
    .ld-seccion { display: none; }
}


/* Estilos de progreso podcast integrados arriba en sección podcast-flotante-contraido */





