.flip-box {
    background-color: transparent;
    width: 100%;
    max-width: 780px;
    height: auto;
    min-height: 20rem;
    border: 1px solid #ecf0f1;
    perspective: 1000px; 
    border-radius: 24px;
    padding: 10px;
    margin: 0 auto;
}

.flip-box-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 20rem;
    aspect-ratio: 593 / 328; /* proporción real de la imagen, evita recortes y deformación */
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    border-radius: 20px;
}

.flip-box:hover .flip-box-inner {
    transform: rotateY(180deg);
}

.flip-box-front, .flip-box-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; 
    backface-visibility: hidden;
    border-radius: 20px;
}

.flip-box-front {
    background-color: #ecf0f1;
    color: #093b8b;
    border-radius: 20px;
    background-position: center;
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.flip-box-back {
    background-color: #ecf0f1;
    color: #093b8b;
    transform: rotateY(180deg);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

h2 {
    padding: 10px;
    margin-bottom: 10px;
}

p, h2 {
    color: #093b8b;
}

/* Móvil: la imagen conserva su proporción (sin estirarse) dentro de la caja */
@media (max-width: 767.98px) {
    .flip-box-inner {
        aspect-ratio: auto;
    }

    .flip-box-front {
        background-color: #ffffff;
        background-size: contain;
    }
}
