html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-image: url("../img/fondo2.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-family: Arial, sans-serif;
}

/* HEADER */
.header {
    position: relative;
    text-align: center;
    padding: 0px;
}

.header h1 {
    font-size: 40px;
    color: #000;
    font-weight: bold;
}

/* BUSCADOR */
.search-box {
    position: absolute;
    right: 60px;
    top: 70px;
}

.search-box input {
    width: 250px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* CATÁLOGO */
.catalogo {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-top: 60px;
    padding: 20px;
    justify-items: center;
}

/* TARJETAS */
.libro-card {
    width: 200px;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.libro-card:hover {
    transform: translateY(-5px);
}

.libro-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.libro-card h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 10px;
}

/* BOTONES */
.botones-grupo {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn {
    border: none;
    padding: 10px;
    color: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: filter 0.2s;
}

.btn-leer { background-color: #2563eb; }
.btn-escuchar { background-color: #9333ea; }
.btn-descargar { background-color: #059669; }

.btn:hover {
    filter: brightness(1.2);
}

/* VISOR PDF Y AUDIO */
.visor {
    margin: 30px auto;
    width: 80%;
    text-align: center;
}

#visorPDF {
    width: 100%;
    height: 500px;
    border: 2px solid #ccc;
    border-radius: 10px;
    margin-bottom: 15px;
    background: white;
}

#audioPlayer {
    width: 100%;
}

/* PAGINACIÓN */
.paginacion {
    text-align: center;
    margin: 20px;
}

.pagina-btn {
    background: #2563eb;
    color: white;
    padding: 8px 12px;
    margin: 5px;
    text-decoration: none;
    border-radius: 5px;
}

.pagina-btn:hover {
    background: #1d4ed8;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1200px) {
    .catalogo {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .catalogo {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .catalogo {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .catalogo {
        grid-template-columns: 1fr;
    }
}
