
    .contenedor-lectura {
        padding: 20px;
        max-width: 1000px;
        margin: 0 auto;
    }

    .barra-regreso {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 30px;
        padding-bottom: 15px;
        border-bottom: 2px solid #ddd;
    }

    .btn-regreso {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background-color: #007bff;
        color: white;
        border-radius: 50%;
        text-decoration: none;
        font-size: 18px;
        transition: background-color 0.3s;
    }

    .btn-regreso:hover {
        background-color: #0056b3;
    }

    .titulo-libro {
        font-size: 24px;
        font-weight: bold;
        color: #333;
    }

    .info-libro {
        display: flex;
        gap: 30px;
        margin-bottom: 30px;
        padding: 20px;
        background-color: #f9f9f9;
        border-radius: 8px;
    }

    .portada-lectura {
        width: 150px;
        height: 200px;
        object-fit: cover;
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .detalles-libro {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .detalles-libro h2 {
        margin: 0 0 15px 0;
        color: #333;
    }

    .detalles-libro p {
        margin: 8px 0;
        color: #666;
        font-size: 16px;
    }

    .visor-pdf,
    .visor-audio {
        margin: 30px 0;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .visor-pdf iframe {
        width: 100%;
        height: 600px;
        border: none;
    }

    .visor-audio {
        padding: 20px;
        background-color: #f9f9f9;
    }

    .visor-audio h3 {
        margin-top: 0;
        margin-bottom: 20px;
        color: #333;
        font-size: 18px;
    }

    .visor-audio iframe {
        width: 100%;
        border-radius: 8px;
    }

    /* Controles superpuestos para el reproductor de audio */
    .audio-frame-container {
        position: relative;
    }


    .audio-control {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 56px;
        height: 56px;
        background: rgba(0,0,0,0.6);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        text-decoration: none;
        font-size: 22px;
        z-index: 10;
        transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease, box-shadow 0.12s ease;
        box-shadow: 0 4px 10px rgba(0,0,0,0.25);
        border: 2px solid rgba(255,255,255,0.08);
    }

    .audio-control-left { left: 12px; }
    .audio-control-right { right: 12px; }

    /* Hover: invertir a fondo blanco y texto negro. Active: fondo negro y texto blanco */
    .audio-control:hover,
    .audio-control:focus {
        background: #ffffff;
        color: #000000;
        transform: translateY(-50%) scale(1.06);
        box-shadow: 0 6px 14px rgba(0,0,0,0.2);
    }

    .audio-control:active {
        background: #000000;
        color: #ffffff;
        transform: translateY(-50%) scale(0.98);
    }

    .audio-center-text {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: 12px;
        z-index: 10;
        display: flex;
        gap: 12px;
        align-items: center;
        background: rgba(255,255,255,0.95);
        padding: 10px 16px;
        border-radius: 22px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.12);
        font-weight: 700;
        font-size: 15px;
    }

    .audio-number { color: #111; }
    .audio-custom-text { color: #444; font-size: 14px; }

    .botones-lectura {
        display: flex;
        gap: 15px;
        justify-content: center;
        margin-top: 30px;
        flex-wrap: wrap;
    }

    .btn {
        padding: 10px 20px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 16px;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        transition: all 0.3s;
    }

    .btn-descargar {
        background-color: #28a745;
        color: white;
    }

    .btn-descargar:hover {
        background-color: #218838;
    }

    .btn-escuchar {
        background-color: #9333ea;
        color: white;
    }

    .btn-escuchar:hover {
        background-color: #6f2dc7;
    }

    .btn-escuchar.activo {
        box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.25);
    }

    .audio-opciones {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 15px;
        justify-content: center;
    }

    .audio-playlist-label {
        display: inline-flex;
        align-items: center;
        font-weight: 600;
        color: #333;
        margin-right: 10px;
    }

    .btn-volver {
        background-color: #6c757d;
        color: white;
    }

    .btn-volver:hover {
        background-color: #5a6268;
    }

    @media (max-width: 768px) {
        .info-libro {
            flex-direction: column;
            align-items: center;
        }

        .portada-lectura {
            width: 120px;
            height: 160px;
        }

        .visor-pdf iframe {
            height: 400px;
        }

        .barra-regreso {
            flex-wrap: wrap;
        }

        .titulo-libro {
            font-size: 18px;
        }
    }

/* ========== FILTRO DE GÉNEROS ========== */

.filtro-generos {
    position: relative;
    margin: 30px 0;
    padding: 0 20px;
}

.btn-generos {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-generos:hover {
    background-color: #0056b3;
}

.dropdown-generos {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background-color: white;
    border: 2px solid #007bff;
    border-radius: 8px;
    min-width: 260px;
    max-width: 480px;
    max-height: 420px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.dropdown-generos.hidden {
    display: none;
}

.genero-item {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid #f5f7fb;
    text-decoration: none;
    color: #213547;
    transition: background-color 0.12s ease;
    cursor: pointer;
}

.genero-item:last-child {
    border-bottom: none;
}

.genero-item:hover {
    background-color: #f6fbff;
}

.genero-item.activo {
    background-color: #e9f4ff;
    border-left: 4px solid #007bff;
    padding-left: 10px;
}

.genero-nombre {
    display: block;
    font-weight: 700;
    color: #0b2a43;
}

.genero-desc {
    display: block;
    font-size: 13px;
    color: #667788;
    margin-top: 4px;
}

.genero-seleccionado {
    background-color: #e7f3ff;
    border-left: 4px solid #007bff;
    padding: 12px 20px;
    margin: 20px 0;
    border-radius: 4px;
    color: #0056b3;
    font-size: 14px;
}

.genero-seleccionado span {
    font-weight: bold;
    color: #003d82;
}
.filtro-generos {
    margin: 20px 0;
    text-align: center;
}

.filtro-generos select {
    padding: 8px 12px;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.filtro-generos option {
    color: black;
}
