/* ====================== SECCIÓN INTRO ====================== */
#catalogo-intro {
    position: relative;
    padding: 100px 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    color: white;
}

.catalogo-intro-container {
    max-width: 800px;
    margin: 0 auto;
}

#catalogo-intro h2 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 20px;
}

#catalogo-intro p {
    font-size: 20px;
    margin-bottom: 40px;
    line-height: 1.5;
}

.btn-catalogo {
    background-color: #cf0c57;
    color: white;
    font-size: 19px;
    font-weight: 600;
    padding: 18px 50px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-catalogo:hover {
    background-color: #b00a4a;
    transform: translateY(-4px);
}

/* ====================== MODAL ====================== */
.catalogo-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.catalogo-modal.show {
    opacity: 1;
}

.btn-cerrar {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: #222;
    cursor: pointer;
    z-index: 2100;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    transition: all 0.3s ease;
}

.btn-cerrar:hover {
    background: #cf0c57;
    color: white;
    transform: rotate(90deg) scale(1.1);
}

/* ====================== CONTENEDOR FLIPBOOK (PC) ====================== */
.catalogo-book {
    width: 90%;
    max-width: 850px; 
    
    /* Proporción de tus imágenes (Ancho x2 / Alto) */
    aspect-ratio: 800 / 600; 
    height: auto; 
    
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ====================== BOTONES LATERALES ====================== */
.nav-btn.lateral {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #2750A3; 
    color: white;
    border: 2px solid #ffffff; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    width: 55px;
    height: 85px;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.nav-btn.lateral:hover {
    background: #cf0c57;
    transform: translateY(-50%) scale(1.05);
}

.nav-btn.lateral.left {
    left: -60px;
    border-radius: 8px 0 0 8px;
}

.nav-btn.lateral.right {
    right: -60px;
    border-radius: 0 8px 8px 0;
}

.nav-btn.lateral:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.7);
    border-color: transparent;
}

/* ====================== MOTOR 3D Y HOJAS ====================== */
.flipbook {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    perspective: 1500px;
}

.flipbook .leaf {
    position: absolute;
    transform-style: preserve-3d;
    height: 100%;
    width: 50%;
    background-color: #fff;
    left: 50%;
    transition: transform 1s cubic-bezier(0.64, 0.04, 0.35, 1);
    transform: rotate3d(0,1,0,0deg);
    transform-origin: left center;
    border-radius: 0 10px 10px 0;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}

.flipbook .leaf .page {
    transform-style: preserve-3d;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    overflow: hidden;
    background-color: #fff; 
    padding: 2px; /* Reducido a 2px como solicitaste */
    box-sizing: border-box; 
}

.flipbook .leaf .page.front {
    transform: rotate3d(0,1,0,0deg) translate3d(0,0,0.1px);
    border-radius: 0 10px 10px 0;
    border-left: 1px solid #ddd;
}

.flipbook .leaf .page.back {
    transform: rotate3d(0,1,0,180deg) translate3d(0,0,0.1px);
    border-radius: 10px 0 0 10px;
    border-right: 1px solid #ddd;
}


/* ====================== IMÁGENES ====================== */
.service-img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    border-radius: 10px; /* Bordes redondeados más evidentes */
    display: block; 
    overflow: hidden; /* Asegura que la imagen respete el redondeo */
}

/* ====================== RESPONSIVE Y ROTACIÓN 90° ====================== */
@media (max-width: 900px) {
    .nav-btn.lateral.left { left: -20px; }
    .nav-btn.lateral.right { right: -20px; }
}

@media (max-width: 576px) {
    .catalogo-book {
        transform: rotate(90deg);
        /* Usamos calc para restar 140px. Esto le hace espacio a los botones afuera del libro sin que se salgan de la pantalla */
        width: calc(100vh - 140px);  
        max-width: none;
        max-height: 90vw; 
    }

    .nav-btn.lateral {
        width: 50px;
        height: 50px; /* Botones más compactos en celular */
        font-size: 24px;
    }
    
    .nav-btn.lateral.left {
        /* Al ser de -60px y el botón medir 50px, queda completamente fuera de la hoja con un margen de 10px */
        left: -60px;
        border-radius: 8px 8px 0 0;
    }
    
    .nav-btn.lateral.right {
        /* Igualmente, completamente fuera de la hoja */
        right: -60px;
        border-radius: 0 0 8px 8px;
    }
    
    .btn-cerrar {
        top: 15px;
        right: 15px;
        z-index: 2500;
    }
}