/* Contenedor principal: Rejilla adaptativa */
.biblioteca-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

/* Estructura de cada tarjeta de libro */
.libro-tarjeta {
    display: flex;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    height: 180px; /* Altura fija para que todas las tarjetas cuadren perfectamente */
}

/* Bloque izquierdo: La Portada */
.libro-portada-wrapper {
    flex: 0 0 120px; /* Ancho fijo para la imagen de portada */
    background: #f7fafc;
}
.libro-portada-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ajusta la imagen sin deformarla */
    display: block;
}

/* Bloque derecho: Textos */
.libro-datos-wrapper {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tipografías y control de desborde */
.libro-titulo {
    font-size: 16px;
    margin: 0 0 4px 0;
    line-height: 1.2;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Corta el título con puntos si es larguísimo */
}
.libro-titulo a {
    color: #2d3748;
    text-decoration: none;
}
.libro-titulo a:hover {
    color: #3182ce;
}

.libro-autor {
    font-size: 13px;
    color: #718096;
    margin: 0 0 8px 0;
}
.libro-autor a {
    color: #718096;
    text-decoration: none;
}

.libro-sinopsis {
    font-size: 12px;
    color: #4a5568;
    line-height: 1.4;
    margin: 0;
}

/* Estilo para el botón inferior "Ver mas" */
.btn-biblioteca-vermas {
    display: inline-block;
    padding: 10px 24px;
    background-color: #3182ce;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s ease;
}
.btn-biblioteca-vermas:hover {
    background-color: #2b6cb0;
}

/* Contenedor general de filtros */
.biblioteca-filtros-container {
    margin-bottom: 30px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* El formulario de filtros superiores */
.biblioteca-form-busqueda {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

/* Campos de entrada individuales */
.input-busqueda-texto {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 14px;
}

.select-filtro-biblioteca {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    min-width: 160px;
}

/* Botones */
.btn-filtrar-biblioteca {
    padding: 8px 20px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.btn-filtrar-biblioteca:hover {
    background-color: #005177;
}

.btn-limpiar-biblioteca {
    padding: 8px 15px;
    background-color: #64748b;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}
.btn-limpiar-biblioteca:hover {
    background-color: #475569;
}

/* Maquetación del Abecedario (Estilo Lectulandia) */
.biblioteca-abecedario {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.letra-enlace {
    display: inline-block;
    padding: 4px 8px;
    color: #0284c7 !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: 3px;
    transition: background 0.1s ease;
}

.letra-enlace:hover {
    background: #e0f2fe;
}

/* Estado activo cuando el usuario está dentro de esa letra */
.letra-activa {
    background: #0284c7;
    color: #fff !important;
}

.no-resultados-biblioteca {
    padding: 20px;
    background: #fff5f5;
    color: #c53030;
    border-radius: 4px;
    border: 1px solid #fed7d7;
    text-align: center;
}


/* Paginación de la biblioteca */
.biblioteca-paginacion .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #0284c7 !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
}

.biblioteca-paginacion .page-numbers:hover {
    background: #e0f2fe;
}

/* Página activa actual */
.biblioteca-paginacion .page-numbers.current {
    background: #0284c7;
    color: #fff !important;
    border-color: #0284c7;
}