/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER / NAV ===== */
.main-header {
    background: #1a1a2e;
    padding: 0; /* Eliminamos todo el padding */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 40px; /* Altura fija de 40px */
    display: flex;
    align-items: center; /* Centra verticalmente */
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    height: 40px; /* Misma altura que el header */
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
    height: 100%;
}

.logo img {
    height: 32px; /* Reducido para que quepa en 60px */
    width: auto;
    display: block;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
    height: 100%;
    align-items: center;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    padding: 4px 8px;
    font-size: 0.85rem;
    transition: color 0.3s;
    line-height: 1;
}

.nav-menu a:hover {
    color: #f0a500;
}

.nav-right {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-right select {
    padding: 4px 8px;
    border-radius: 3px;
    border: none;
    background: #2d2d44;
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    height: 30px;
}

/* ===== HERO ===== */
.hero-section {
    background: #000000;
background: linear-gradient(90deg, rgba(0, 0, 0, 1) 0%, rgba(0, 68, 135, 1) 15%, rgba(0, 68, 135, 1) 100%);
    color: #fff;
    padding: 5px 20px;
    margin: 0px;
}

.hero-content {
    max-width: 1200px;
    margin: 0 12px;
    display: flex;
    align-items: left;
    justify-content: left;
    gap: 12px;
}

.hero-content .logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.hero-content .logo img {
    width: 32px;
    height: 32px;
    display: block;
}

.hero-content h1 {
    font-size: 1.5rem;
    margin: 0;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content .logo img {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.2rem;
    }
    
    .hero-content .logo img {
        width: 24px;
        height: 24px;
    }
}
/* ===== (INDEX) ===== */
.section-notice {
    text-align: center;
    margin-bottom: 30px;
    color: #1a1a2e;
}
.section-title {
    text-align: center;
    color: #1a1a2e;
}
/* ===== LIBROS GRID (INDEX) ===== */

.libros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.ficha-card {
    background: #fff;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 0; /* Sin bordes redondeados */
}

.ficha-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* ===== CONTENEDOR DE LA IMAGEN ===== */
.img-holder {
    width: 100%;
    background: #efefef !important; /* Fondo gris claro con prioridad */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px; /* Altura mínima para evitar colapsos */
}

/* ===== IMAGEN DE LA FICHA ===== */
.ficha-portada {
    width: 224px !important; /* Ancho fijo con prioridad */
    height: auto !important; /* Altura automática con prioridad */
    max-width: 100% !important; /* Nunca más ancha que el contenedor */
    display: block;
    background: #ffffff;
    margin: 0 auto; /* Centrado horizontal */
    flex-shrink: 0; /* Evita que se encoja */
}

/* ===== CUERPO DE LA FICHA ===== */
.ficha-body {
    padding: 15px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    border-top: none; /* Sin borde superior */
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .libros-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .ficha-portada {
        width: 180px !important;
    }
}

@media (max-width: 480px) {
    .libros-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ficha-portada {
        width: 160px !important;
    }
}
/* ===== PORTADAS PARA PÁGINAS COMPLETAS ===== */
.portada-completa {
    width: 100%;
    max-width: 800px; /* Tamaño más grande para páginas de libro */
    height: auto;
    aspect-ratio: 307 / 480; /* Mantiene la proporción */
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: block;
    margin: 0 auto;
}

/* ===== CUERPO DE LA FICHA ===== */
.ficha-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ficha-titulo {
    font-size: 1.3rem;
    color: #1a1a2e;
    margin-bottom: 0px;
    padding-bottom:0px;
}
.ficha-etiqueta {
    font-size: 1rem;
    color: #000;
    font-weight: 500;
}
.ficha-subtitulo {
    font-size: 1rem;
    color: #000;
    margin-top: 0px;
    margin-bottom: 1rem;
    padding-top:0px;
}
.ficha-genero {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.ficha-abstract {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #444;
    flex: 1;
    margin-bottom: 15px;
    /* ===== ALTURA MÍNIMA PARA ESTABILIZAR ===== */
    min-height: 92px;
    overflow: hidden;
}

.ficha-idiomas {
    font-size: 0.85rem;
    border-top: 1px solid #eee;
    padding-top: 12px;
    margin-top: auto;
}

.ficha-idiomas a {
    color: #f0a500;
    text-decoration: none;
    margin: 0 3px;
}

.ficha-idiomas a:hover {
    text-decoration: underline;
    color: #d49100;
}

/* ===== FOOTER ===== */
.main-footer {
    background: #1a1a2e;
    color: #aaa;
    padding: 40px 20px 20px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.footer-section h4 {
    color: #fff;
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #f0a500;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 20px;
    font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-left {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .libros-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    /* Portadas de índices en móvil */
    .ficha-portada {
        height: 250px;
    }
    
    /* Portadas completas en móvil */
    .portada-completa {
        max-width: 100%;
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    /* Portadas de índices en móvil pequeño */
    .ficha-portada {
        height: 200px;
    }
    
    /* Portadas completas en móvil pequeño */
    .portada-completa {
        max-width: 100%;
        padding: 0 10px;
    }
}
