:root{
    --rojo:#ff0000;
    --azul:#0000ff;
    --amarillo:#ffff00;
    --gris:#f4f4f4;

    /* Variables reales usadas */
    --primary: var(--rojo);
    --accent: var(--azul);
    --shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* RESET BÁSICO */
*{
    box-sizing:border-box;
    margin:0;
    padding:0;
}

body{
    font-family:'Segoe UI',Tahoma,sans-serif;
    background:var(--rojo);
}

/* CONTENEDOR */
.wrapper{
    max-width:950px;
    width:100%;
    background:#fff;
    margin:0 auto;
    box-shadow:0 0 30px rgba(0,0,0,.7);
}

/* HEADER */
header{
    background:var(--rojo);
}

.topbar{
    display:flex;
    align-items:center;
    gap:10px;
    padding:8px;
    flex-wrap:wrap;
}

.menu-toggle{
    margin-left:auto;
    background:none;
    border:none;
    color:var(--amarillo);
    font-size:28px;
    cursor:pointer;
}

/* MENÚ HAMBURGUESA */
.menu-hamburguesa{
    position:fixed;
    top:0;
    right:0;
    width:280px;
    height:100%;
    background:#fff;
    transform:translateX(100%);
    transition:transform .3s ease;
    z-index:1000;
    overflow-y:auto;
}

.menu-hamburguesa.activo{
    transform:translateX(0);
}

.menu-hamburguesa a{
    display:block;
    padding:10px;
    color:#d32f2f;
    font-weight:600;
    border-bottom:1px solid #eee;
    text-decoration:none;
}

.submenu{
    display:none;
    background:#fafafa;
}

.menu-item.activo .submenu{
    display:block;
}

/* OVERLAY */
.overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.4);
    display:none;
    z-index:900;
}

.overlay.activo{
    display:block;
}

/* BANNER */
.banner img{
    width:100%;
    max-height:300px;
    object-fit:cover;
}

/* MAIN */
main{
    padding:20px;
}

h2,h3{
    color:#b30000;
}

/* BUSCADOR Y FILTROS */
.search-section{
    margin:30px 0;
    display:flex;
    flex-direction:column;
    gap:20px;
    align-items:center;
}

#searchInput{
    width:100%;
    max-width:500px;
    padding:12px 20px;
    border-radius:25px;
    border:2px solid #ddd;
    outline:none;
    transition:.3s;
}

#searchInput:focus{
    border-color:var(--accent);
}

.filter-controls{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    justify-content:center;
}

.btn-filter{
    padding:8px 15px;
    border-radius:20px;
    border:1px solid var(--primary);
    background:#fff;
    cursor:pointer;
    transition:.3s;
    font-weight:600;
}

.btn-filter.active,
.btn-filter:hover{
    background:var(--primary);
    color:#fff;
}

/* GRID DE LIBROS */
.descargas{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(160px,1fr));
    gap:20px;
}

.libro-card{
    background:#fff;
    border-radius:10px;
    overflow:hidden;
    box-shadow:var(--shadow);
    transition:.3s;
    display:flex;
    flex-direction:column;
}

.libro-card:hover{
    transform:translateY(-5px);
}

.libro-card img:not(.icon-club){
    width:100%;
    height:250px;
    object-fit:cover;
}

.card-info{
    padding:15px;
    text-align:center;
    flex-grow:1;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    align-items:center;
}

.card-info p{
    font-size:.9rem;
    font-weight:bold;
    color:var(--primary);
    margin-bottom:10px;
}

.icon-club{
    width:20px;
    height:auto;
}

/* FOOTER */
footer{
    text-align:center;
    background:#eee;
    padding:15px;
}

.redes img{
    width:30px;
    margin:0 5px;
}

/* RESPONSIVE */
@media(max-width:768px){
    .libro-card img:not(.icon-club){
        height:200px;
    }
}

@media(max-width:480px){
    .libro-card img:not(.icon-club){
        height:180px;
    }
}

/* GENERALES */
img{
    max-width:100%;
    height:auto;
}

iframe{
    max-width:100%;
}
