* {
    box-sizing: border-box;
}


.carousel-container {
    position: relative;
    overflow: hidden;
    max-height: 1000px;
    margin: 0;
    width: 800px;
}

.carousel-track {
    display: flex;
    overflow: visible;
    transition: transform 0.5s ease;
}

.carousel-slide {
    height: 100%; /* 80% del ancho del carrusel */
    width: auto;
    margin: 0 15px; /* espacio entre slides */
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.carousel-controls {
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
}

.carousel-btn {
    background: rgba(255, 255, 255, 0.7);
    border: none;
    font-size: 1rem;
    cursor: pointer;
}
.cuento-img {
    width: 400px;
    height: auto;
}


/******************************************************************************/
/*CARD-TRAMA*/
/******************************************************************************/

.card {
    font-weight: bold;
    padding: 1em;
    text-align: right;
    color: #181a1a;
    width: 195px;
    height: 287px;
    /*box-shadow:  4px 4px 8px #7166F988;*/
    /*border: 1px solid #ffffff;    */
    border-radius: 10px;
    background-size: cover;
    position: relative;
    transition-duration: 300ms;
    transition-property: transform, box-shadow;
    transition-timing-function: ease-out;
    transform: rotate3d(0);
}

/*lo referido a la trama (falta hacer la responsibidad)*/
.card-trama {
    width: 500px;
    height: 500px;
    text-align: left;
    color: white;
}


.trama-titulo {
    font-family: Geist, sans-serif;
    font-weight: 400;
    color: #ffffff;
    font-size: 1.3rem;
    outline: none;
    list-style: none;
    display: flex;
    align-items: center;
    cursor: pointer;
    text-transform: capitalize;
    text-align: left;
    margin:0;
}

.titulo-imagen {
    font-size: 1.6rem;
}
.trama-subtitle {
    font-size: 1rem;
    font-weight: 300;
    margin-left: 5px;
    text-align: left;
}

/* Ajusta los párrafos internos */
.trama-descripcion {
    scroll-snap-align: start;
    font-size: 0.8rem;
    padding: 5px;
    scroll-snap-align: center;
    position: relative;
    font-family: Geist, sans-serif;
    font-weight: 200;
    overflow: hidden;
    color: #e0e0e0;
    margin: 0;
    text-align: left;
}

.card-button {
    font-family: Geist, sans-serif;
    font-weight: 200;
    font-style: normal;
    display: inline-block;
    align-items: center;
    padding: 7px 10px;
    font-size: 1.2rem;
    text-align: center;
    text-decoration: none;
    color: #ffffff;
    border-radius: 7px;
    border: solid 1px #14204d; 
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background-color: #0B1635;
}

    .card-button:hover {
        background-color: #ffffff; 
        color: #000000;
    }
.card-trama-flip {
    perspective: 1200px;
    width: 340px; /* Igual que las tarjetas */
    height: 450px;
    margin: 20px;
    overflow: visible; /* Asegura que no recorte contenido interno */
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s ease-in-out;
    transform-style: preserve-3d;
    transform-origin: center;
}

.card-trama-flip:hover .card-inner, .card-trama-flip:focus-within .card-inner {
    transform: rotateY(-180deg) scale(1.07);
}

.card-trama-flip:focus-within .card-inner {
    transform: scale(1) rotateY(0);
}

.card-trama-flip:hover .card-front {
    z-index: 1;
    pointer-events: auto;
}

.card-trama-flip:hover .card-back {
    z-index: 2;
    pointer-events: auto;
}

.card-front, .card-back {
    border-radius: 10px;
    background-size: cover;
    position: absolute;
    width: 340px;
    height: 450px;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
    font-weight: bold;
    padding: 1.5em;
    text-align: left;
    flex-direction: column;
}


.card-front {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    pointer-events: auto;
    flex-direction: column; /* Organiza los elementos de arriba hacia abajo */
    justify-content: space-between; /* Coloca el título arriba y el botón abajo */
    height: 100%; /* Asegura que el contenedor tenga la altura completa */
    padding: 1.5rem;
}


.card-back {
    background-color: #05102C;
    background-image: radial-gradient( circle at 60% -20%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.25) 20%, rgba(0, 0, 0, 0.2) 45%, rgba(0, 0, 0, 0.3) 65%, rgba(0, 0, 0, 0.4) 85%, rgba(0, 0, 0, 0.5) 100% );
    background-blend-mode: soft-light;
    border: solid 1px #1a2a40; /*#14204d */
    cursor: pointer;
    transition: background 0.3s ease;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transform: rotateY(-180deg);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}
.card-inner,
.card-front,
.card-back {
    width: 340px;
    height: 450px;
}

/******************************************************************************/
/*CARD-BOOK*/
/******************************************************************************/

@media (max-width: 768px) {
    .card-trama {
        width: 90%;
        height: auto;
    }
}

.card-trama-flip,
.card-inner {
    overflow: visible;
}


.titulo-con-boton {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.card-copy-button {
    background-color: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}



/*modal*/
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* fondo semitransparente */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* asegúrate de que esté por encima de todo */
}

/* Contenido del modal (ventana blanca) */
.modal-content {
    background-color: #14203B;
    border-radius: 25px 25px 70px 70px;
    box-shadow: 2px 12px 25px rgba(162, 82, 129, 0.8);
    border: solid 1px #1a2a40;
    font-family: Geist, sans-serif;
    color: white;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    text-align: center;
    animation: fadeInUp 0.6s ease-out forwards; /* <<--- aquí */
    opacity: 0;
}

.modal-title {
    margin-top: 0px;
    margin-bottom: 50px;
}

.cuento-edition-title {
    color: yellow;
    margin: 0px;
    margin-bottom: 0px;
    text-align: center;
    font-weight: 400;
    font-size: 2.5rem;
}
/* Animación opcional */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content > * {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.modal-title {
    animation-delay: 0.2s;
}

.estilo-selector {
    animation-delay: 0.3s;
}

#btn-modal-siguiente {
    animation-delay: 0.4s;
}

.modal-close {
    animation-delay: 0.5s;
}

/* Botón cerrar */
.modal-close {
    margin-top: 1.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    color: red;
    cursor: pointer;
    transition: transform 0.2s ease, outline 0.2s ease;
}

    .modal-close:hover,
    .modal-close:focus {
        transform: scale(1.05) !important;
        box-shadow: none !important;
    }

/* Select y botón */
.modal-select {
    width: 100%;
    margin-top: 1rem;
    padding: 0.5rem;
    font-size: 1rem;
}

.modal-button {
    margin-top: 1.5rem;
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    background-color: #4578A3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}


/*estilo de selección*/
.estilo-selector {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    margin: 1rem;
}

.estilo-btn {
    flex: 1;
    height: 210px;
    background-size: cover;
    background-position: center;
    border: 1px solid transparent;
    color: #ffffff;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.9), 0 0 15px rgba(0, 0, 0, 0.6);
    filter: grayscale(100%);
    transition: 0.3s ease;
    cursor: pointer;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

    .estilo-btn.seleccionado {
        filter: grayscale(0%);
        border: 1px solid #FFD700;
        box-shadow: 0 0 15px #FFD700;
        text-shadow: 4px 4px 20px rgba(162, 82, 129, 0.9), 0 0 25px rgba(162, 82, 129, 0.6);
    }



.formato-tapa-dura-btn {
    height: 170px;
    width: 170px;
    background-size: cover;
    background-position: center;
    border: 1px solid transparent;
    filter: grayscale(100%);
    transition: 0.3s ease;
    cursor: pointer;
    border-radius: 0px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

.formato-tapa-blanda-btn {
    height: 170px;
    width: 115px;
    background-size: cover;
    background-position: center;
    border: 1px solid transparent;
    filter: grayscale(100%);
    transition: 0.3s ease;
    cursor: pointer;
    border-radius: 0px;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

    .formato-btn.seleccionado {
        filter: grayscale(0%);
        border: 1px solid #00BFFF;
        box-shadow: 0 0 15px #00BFFF;
    }


.cuento-edition-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left:100px;
}