/* Optimización de renderizado con GPU */
.book-container {
    perspective: 2500px;
    will-change: auto;
}

.book-spread {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 1400px;
    height: 850px;
    background: #fdfaf0;
    border-radius: 5px 20px 20px 5px;
    /* Sombras optimizadas (menos capas) */
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.2),
        2px 0 5px rgba(0, 0, 0, 0.5),
        0 30px 50px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    /* Aceleración por hardware */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Spine simplificado */
.book-spread::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 80px;
    transform: translateX(-50%) translateZ(0);
    background: linear-gradient(to right,
            transparent 0%,
            rgba(0, 0, 0, 0.2) 45%,
            rgba(0, 0, 0, 0.6) 50%,
            rgba(0, 0, 0, 0.2) 55%,
            transparent 100%);
    z-index: 20;
    pointer-events: none;
}

.page {
    flex: 1;
    padding: 50px 45px;
    position: relative;
    background-color: #fdfaf0;
    overflow: hidden;
    z-index: 5;
    /* Aceleración por hardware */
    transform: translateZ(0);
}

.page-left {
    border-radius: 5px 0 0 5px;
    background: linear-gradient(to left, #e8e4d8 0%, #fdfaf0 8%);
    box-shadow: inset -20px 0 30px -15px rgba(0, 0, 0, 0.15);
}

.page-right {
    border-radius: 0 20px 20px 0;
    background: linear-gradient(to right, #e8e4d8 0%, #fdfaf0 8%);
    box-shadow: inset 20px 0 30px -15px rgba(0, 0, 0, 0.15);
}

.ornament {
    text-align: center;
    color: #8b7d6b;
    font-size: 28px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: #2d2d2d;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    margin-top: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-icon {
    font-size: 1.1rem;
    color: #8b7d6b;
}

.chapter-item {
    font-family: 'Crimson Pro', serif;
    color: #4a4a4a;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
    line-height: 1.4;
}

.chapter-item span:first-child {
    flex: 1;
    padding-right: 8px;
}

.chapter-item span:last-child {
    font-weight: 600;
    white-space: nowrap;
}

.close-btn {
    /* Transición optimizada */
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
    font-family: 'Playfair Display', serif;
    border: 1px solid #8b7d6b;
    background: rgba(139, 125, 107, 0.05);
    color: #5a5a5a;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    /* Aceleración por hardware */
    will-change: transform;
}

.close-btn:hover {
    background: #4a4a4a;
    color: #fdfaf0;
    border-color: #4a4a4a;
    transform: translateY(-2px);
}

/* Modal optimizado */
.modal-backdrop.show {
    opacity: 0.95;
    background-color: #050505;
}

.modal-content-libro {
    box-shadow: none !important;
    background: transparent !important;
    border: none !important;
}

/* Transición del modal más rápida */
.modal.fade .modal-dialog {
    transition: transform 0.2s ease-out;
}

.modal.show .modal-dialog {
    transform: none;
}

/* Reducir animaciones para usuarios que lo prefieren */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.title-libro::after {
    background: none !important;
}

.footer-libro {
    background-color: transparent !important;
}

.footer-libro::before {
    background: none !important;
}