/* ======================================
   BIBLIOTECA VIRTUAL — Búsqueda y detalle
   Paleta: #621333, #81A6AD, #eee5d0, #d4c19c, #b2b1b1
   ====================================== */

.bib-page {
    background-image: url("../images/bg-biblioteca.svg");
    background-size: cover;
    background-position: center;
    min-height: 60vh;
}

/* --- Búsqueda --- */
.bib-search-hero {
    padding: 2.5rem 0 2rem;
}

.bib-search-hero h2 {
    font-weight: 700;
    color: #621333;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.bib-search-hero .bib-search-subtitle {
    color: #b2b1b1;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.bib-search-form {
    max-width: 640px;
    margin: 0 auto;
}

.bib-search-input-group {
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 4px 24px rgba(98, 19, 51, 0.12);
    border: 2px solid #eee5d0;
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.bib-search-input-group:focus-within {
    border-color: #d4c19c;
    box-shadow: 0 6px 28px rgba(98, 19, 51, 0.18);
}

.bib-search-input-group .form-control {
    border: none;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    background: transparent;
}

.bib-search-input-group .form-control:focus {
    box-shadow: none;
}

.bib-search-input-group .btn {
    border-radius: 0 50px 50px 0;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    border: none;
    margin: 4px;
    margin-left: 0;
}

/* Botón flotante filtros */
.bib-filters-toggle {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 1060;
    border-radius: 50px;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(98, 19, 51, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #621333 !important;
    border-color: #621333 !important;
    color: #fff !important;
}

.bib-filters-toggle:hover,
.bib-filters-toggle:focus {
    background-color: #7a1a42 !important;
    border-color: #7a1a42 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* Overlay */
.bib-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(98, 19, 51, 0.35);
    z-index: 1045;
    backdrop-filter: blur(2px);
}

.bib-overlay.is-visible {
    display: block;
}

/* Panel filtros */
.bib-filter-panel {
    position: fixed;
    top: 0;
    left: -360px;
    width: 360px;
    max-width: 92vw;
    height: 100%;
    background: linear-gradient(180deg, #fff 0%, #f8f9fa 100%);
    border-right: 3px solid #eee5d0;
    z-index: 1050;
    transition: left 0.3s ease-in-out;
    padding: 1.5rem 1.25rem 2rem;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
}

.bib-filter-panel.is-open {
    left: 0;
}

.bib-filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px dotted #d4c19c;
}

.bib-filter-panel-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #621333;
}

.bib-filter-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bib-filter-group {
    border: 1px solid #eee5d0;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    background-color: #fff;
}

.bib-filter-group legend {
    font-weight: 700;
    color: #621333;
    font-size: 0.9rem;
    margin-bottom: 0.65rem;
    padding: 0;
    float: none;
    width: auto;
}

.bib-filter-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0;
    margin: 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: #495057;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.bib-filter-option:hover {
    background: #e0d0d6;
}

.bib-filter-option input[type="checkbox"] {
    accent-color: #621333;
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
}

.bib-filter-apply {
    width: 100%;
    border-radius: 50px;
    font-weight: 600;
    padding: 0.65rem;
    margin-top: 0.5rem;
}

/* Resultados */
.bib-results {
    padding: 1rem 0 3rem;
}

.bib-results-count {
    color: #b2b1b1;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.bib-book-card {
    border: 2px dotted #d4c19c;
    border-radius: 14px;
    overflow: hidden;
    height: 100%;
    background: #fff;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.bib-book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(98, 19, 51, 0.12);
}

.bib-book-card-cover {
    position: relative;
    overflow: hidden;
    background: #e0d0d6;
    aspect-ratio: 3 / 4;
}

.bib-book-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.bib-book-card:hover .bib-book-card-cover img {
    transform: scale(1.03);
}

.bib-book-card-body {
    padding: 1.15rem 1.25rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bib-book-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #621333;
    margin-bottom: 0.5rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bib-book-card-desc {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bib-book-meta {
    font-size: 0.8rem;
    color: #b2b1b1;
    margin-bottom: 0.35rem;
}

.bib-book-meta strong {
    color: #621333;
    font-weight: 600;
}

.bib-book-card .btn {
    border-radius: 50px;
    font-weight: 600;
    margin-top: auto;
    align-self: flex-start;
}

.bib-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    border: 2px dotted #d4c19c;
    max-width: 480px;
    margin: 2rem auto;
}

.bib-empty-state i {
    font-size: 2.5rem;
    color: #81A6AD;
    margin-bottom: 1rem;
}

.bib-empty-state p {
    color: #6c757d;
    margin: 0;
}

/* --- Detalle libro --- */
.bib-detail-section {
    padding: 3rem 0 4rem;
}

.bib-detail-card {
    background: #fff;
    border-radius: 20px;
    border: 2px dotted #d4c19c;
    box-shadow: 0 8px 40px rgba(98, 19, 51, 0.1);
    overflow: hidden;
}

.bib-detail-cover-wrap {
    background: linear-gradient(145deg, #e0d0d6 0%, #f8f9fa 100%);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

.bib-detail-cover {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(98, 19, 51, 0.2);
    object-fit: cover;
    aspect-ratio: 3 / 4;
}

.bib-detail-content {
    padding: 2rem 2.25rem 2.5rem;
}

.bib-detail-title {
    font-weight: 700;
    color: #621333;
    font-size: 1.75rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.bib-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.bib-detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    background: #e0d0d6;
    color: #621333;
}

.bib-detail-badge.bib-badge-teal {
    background: rgba(129, 166, 173, 0.25);
    color: #4a6a72;
}

.bib-detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
}

.bib-detail-meta-item {
    font-size: 0.9rem;
}

.bib-detail-meta-item .bib-meta-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #b2b1b1;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.bib-detail-meta-item .bib-meta-value {
    color: #343a40;
    font-weight: 500;
}

.bib-detail-description {
    border-top: 2px dotted #eee5d0;
    padding-top: 1.25rem;
    margin-bottom: 1.5rem;
}

.bib-detail-description h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #621333;
    font-weight: 700;
    margin-bottom: 0.65rem;
}

.bib-detail-description p {
    color: #495057;
    line-height: 1.65;
    margin: 0;
    text-align: justify;
}

.bib-detail-actions .btn {
    border-radius: 50px;
    font-weight: 600;
    padding: 0.65rem 1.75rem;
}

.bib-not-found {
    text-align: center;
    padding: 4rem 1.5rem;
}

.bib-not-found i {
    font-size: 3rem;
    color: #81A6AD;
    margin-bottom: 1rem;
}

@media (max-width: 767.98px) {
    .bib-detail-cover-wrap {
        padding: 1.5rem;
    }

    .bib-detail-content {
        padding: 1.5rem 1.25rem 2rem;
    }

    .bib-detail-title {
        font-size: 1.4rem;
    }

    .bib-filters-toggle {
        bottom: 1rem;
        left: 1rem;
    }
}
