/* ############################################ */
/* Reglas Generales Desktop*/
:root {
    --bg-primary:
}

body {
    height: 100%;
    width: 100%;
    scroll-behavior: smooth;

}

body #wspbtn {
    position: fixed;
    bottom: 6%;
    right: 3%;
    height: 3rem;
    width: 3rem;
    border-radius: 50%;
    z-index: 1500;
    object-fit: contain;
    padding: 0;
    /* Quita el espacio interno que trae el botón por defecto */
    border: none;
    /* Quita el borde gris de los botones */
    background: none;
    /* Quita el fondo gris de los botones */
    display: flex;
    /* Usamos flexbox para centrar lo que hay dentro */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    /* Asegura que nada se salga del círculo */
}

#wspbtn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(1px 2px 4px rgba(0, 0, 0, 0.5));
    /* REEMPLAZA box-shadow POR ESTO: */
}

main {
    width: 100dvw;
    background-color: #f5f7fa;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding-bottom: 1rem;

}

.section {
    padding: 0rem 0.5rem;
    width: 80%;
}

.section::after {
    content: '';
    display: block;
    width: 60%;
    height: 2px;
    background: linear-gradient(to right, transparent, #1E5AA8, transparent);
    margin: 2rem auto;
    opacity: 0.7;
}

/* ############################################ */
/* Estilos Header */
header {
    background-color: #1E5AA8;
    width: 100dvw;
    height: 20dvh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1dvh;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: height 0.3s ease;
}

header.header-scrolled {
    height: 15dvh;
}

.header-logo {
    max-height: 100%;
    max-width: 120px;
    transition: max-height 0.3s ease, max-width 0.3s ease;
}

header.header-scrolled .header-logo {
    max-height: 100%;
    max-width: 80px;
}

.header-nav {
    display: none;
}

.header-nav .nav {
    display: flex;
    gap: 0.5rem;
    flex-direction: row;
}

header.header-scrolled .header-nav .nav {
    gap: 0.3rem;
    font-size: 0.8rem;
}

.header-nav .nav-link {
    font-weight: bold;
    transition: color 0.3s;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
}

.header-nav .nav-link:hover {
    color: #ecf021 !important;
}

header img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ############################################ */
/* Carrusel contenido */

.hero-container {
    position: relative;
    width: 100%;
    height: 60vh;
    overflow: hidden;
    /* ajustable según tu diseño */
}

#carouselMain {
    height: 100%;
    width: 100%;
    max-width: 100%;
}

#carouselMain .carousel-inner {
    width: 100%;
    height: 100%;
}

#carouselMain .carousel-item {
    height: 100%;
}

#carouselMain .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1);
}

.hero-overlay {
    margin-bottom: 1.5rem;
    position: absolute;
    top: auto;
    bottom: 20%;
    left: 30%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    border-radius: 8px;
    max-width: calc(100vw - 2rem);
    box-sizing: border-box;
    width: 90%;
    overflow: hidden;
    word-wrap: break-word;
    word-break: break-word;

    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    p {
        font-size: 0.9rem;
    }

    button {
        background-color: #2E8B57;
        color: #F5F7FA;

        a {
            text-decoration: none;
            color: #F5F7FA;
        }

    }

    button:hover {
        background-color: #32aa66;
    }

    ;

}

/* ############################################ */
/* Seccion Quienes somos */
#quienesSomos {
    height: auto;


    #quienesSomosContainer {
        display: flex;
        flex-direction: row;
        align-items: center;
        width: 80%;
        max-width: 80%;
        max-height: 80%;
        margin: 0 auto;
        gap: 1rem;
        padding: 1rem;
        box-sizing: border-box;
    }

    #quienesSomosContainer img {
        width: 50%;
        height: auto;
        max-height: 100%;
        object-fit: contain;
        border-radius: 8px;
    }

    #quienesSomosContainer .quienesSomosdiv {
        width: 50%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        /* padding: 1rem; */
        box-sizing: border-box;
        overflow: hidden;
    }

    #quienesSomosContainer .quienesSomosdiv h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
        color: #1E5AA8;
        width: 100%;
    }

    #quienesSomosContainer .quienesSomosdiv p {
        font-size: 0.80rem;
        line-height: 1.8;
        width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ############################################ */
/* Seccion Areas */
#sectionAreas {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
    gap: 1rem;
    padding: 0 1rem;
}

#sectionAreas h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.container-Areas {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    background-color: #F5F7FA;
    padding: 1rem;
    gap: 1rem;
    width: 100%;
}

    .containerImg {
        width: 700px;
        max-width: 80%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

.containerImg .img-Areas {
    
    max-width: 90%;
    max-height: 90%;
    height: auto;
    display: block;
    object-fit: contain;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2);
    transform: scale(1);
}

.text-Areas {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    height: auto;
    padding: 2rem 5rem;
    background-color: #326fb462;
    border-radius: 10px;

    h4 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }

    p {
        font-size: 0.80rem;
        line-height: 1.5;
    }
}

/* ############################################ */
/* Seccion Ventajas */
#sectionVentajas {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0rem 1rem;
    width: 100%;
    gap: 3dvh;

    p {
        width: 90%;
        max-width: 90vw;
        font-size: 0.95rem;
        text-align: left;
        line-height: 1.6;
    }
}

/* ############################################ */
/* Seccion MVV */
#sectionMVV {
    padding: 2dvh 0;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 3dvh;
    margin-bottom: 5dvh;
}

#containerSpecialMVV {
    display: flex;
    justify-content: center;
    gap: 2dvh;
    /* align-items: stretch; */
    flex-wrap: nowrap;
    width: 100%;
}

.specialMVV {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    height: 100%;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.specialAreas p {
    flex-grow: 1;
    display: flex;
    align-items: center;
    height: auto;
    /* altura automática basada en contenido */
}

.specialAreas {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    height: auto;
    /* altura dinámica basada en el contenido */
    flex: 1;
    min-width: 0;
    overflow: visible;
    /* permitir que el contenido sea visible */
}

.card-container {
    perspective: 1000px;
    width: 260px;
    height: 260px;
    margin-bottom: 1rem;
}

.card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 1.5s;
}

.card-container:hover .card {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
}

.card-front {
    background-color: white;
    color: white;
}

.card-back {
    background-color: #1E5AA8;
    color: white;
    transform: rotateY(180deg);
    padding: 12px;
    overflow-y: auto;
    /* permitir que el contenido se desplace si excede */
    box-sizing: border-box;
}

.card-back p {
    font-size: 1rem;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0 5dvh;
}

.img-fit {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* box-shadow: 5px 5px 10px rgba(0,0,0,0.5); */

}

#img-ventaja {
    max-width: 40%;
}

/* ############################################ */
/* Footer */
footer {
    background-color: #326EB4;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

footer #Contactanos {
    width: 100%;
    padding: 1rem;
    text-align: center;
}

footer #contactForm {
    width: 100%;
    padding: 1rem;
}

footer #btnForm {
    background-color: #d6e4f0;
    width: 100%;
}

footer #btnForm:hover {
    background-color: #687968;
}

/* Reglas @media mobiles */

/* @media (min-width: 640px) {
    .section {
        padding: 0rem 0.2rem;
    }

    .section::after {
        width: 70%;
        margin: 2.5rem auto;
    }

    #sectionAreas h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .hero-overlay {
        bottom: 20%;
        left: 30%;
        transform: translateX(-50%);
        padding: 1.5rem;
        width: auto;
        max-width: calc(100vw - 3rem);

        h1 {
            font-size: 2rem;
            margin-bottom: 0.75rem;
        }

        p {
            font-size: 1rem;
        }
    }

    .img-Areas {
        max-width: 320px;
        box-shadow: 8px 8px 18px rgba(0, 0, 0, 0.25);
        transform: scale(1.1);
    }

    .text-Areas {
        max-width: 95%;
        padding: 1.5rem 1rem;

        h4 {
            font-size: 1.3rem;
            margin-bottom: 0.75rem;
        }

        p {
            font-size: 1rem;
        }
    }

    #sectionPresentation p {
        max-width: 80vw;
        font-size: 1rem;
    }

    #sectionVentajas {
        padding: 0rem 1.5rem;

        p {
            max-width: 85vw;
            font-size: 1rem;
        }
    }

    .card-container {
        width: 300px;
        height: 300px;
        margin-bottom: 1.5rem;
    }

    footer #btnForm {
        width: auto;
    }
} */

@media (min-width: 768px) {
    header {
        height: 20dvh;
        padding: 1dvh 2rem;
    }

    header.header-scrolled {
        height: 15dvh;
    }

    .header-nav {
        display: block;
    }

    .header-logo {
        max-width: 200px;
    }

    header.header-scrolled .header-logo {
        max-width: 150px;
    }

    .header-nav .nav {
        gap: 1rem;
        flex-direction: row;
    }

    header.header-scrolled .header-nav .nav {
        gap: 0.5rem;
        font-size: 0.9rem;
    }

    .header-nav .nav-link {
        font-size: 1rem;
        padding: 0.5rem 1rem;


    }

    main {
        gap: 3rem;
        height: auto;
        padding-bottom: 2rem;
    }

    #sectionAreas {
        width: 95%;
        gap: 1rem;
        padding: 0.5rem;
    }

    .container-Areas {
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        padding: 0.5rem;
        gap: 1rem;
    }

    footer {
        flex-direction: row;
        align-items: center;
    }

    footer #Contactanos {
        width: 25%;
        padding: 2rem 1rem 2rem 3rem;
        text-align: left;
    }

    footer #contactForm {
        width: 75%;
        padding: 2rem 3rem;
    }
}

/* icono WhatsApp fijo en esquina inferior */
/* #wspIcon {
    position: fixed;
    bottom: 10px;
    right: 10px;
    border-radius: 100%;
    z-index: 1000;
    width:15dvh;
    height:15dvh;
} */

@media (min-width: 1024px) {
    main {
        gap: 5dvh;
        height: 80%;
    }

    .section {
        padding: 0dvh 0;
    }

    .section::after {
        width: 80%;
        margin: 3rem auto;
    }

    #sectionAreas {
        width: 80%;
        gap: 4rem;
        padding: 0rem 3rem;
    }

    .hero-overlay {
        bottom: 20%;
        left: 30%;
        transform: translateX(-50%);
        padding: 2rem;
        width: auto;
        max-width: 600px;

        h1 {
            font-size: 2.5rem;
            margin-bottom: 1rem;
        }

        p {
            font-size: 1.2rem;
        }

    }

    .container-Areas {
        padding: 2rem;
        gap: 3.5rem;
    }

    .img-Areas {
        max-width: 400px;
        box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3);
        transform: scale(1.2);
    }

    .text-Areas {
        max-width: 70%;
        padding: 2rem 1rem;

        h4 {
            font-size: 1.5rem;
        }

        p {
            font-size: 1rem;
        }

    }

    #sectionPresentation p {
        width: 70dvh;
        max-width: none;
    }

    #sectionVentajas {
        padding-bottom: 5dvh;
        width: 90%;

        p {
            width: 90dvh;
            max-width: none;
        }
    }

    .card-container {
        width: 400px;
        height: 300px;
        margin-bottom: 2rem;
    }
}

@media (max-width: 1254px) {
    .hero-overlay {
        top: auto;
        bottom: 20%;
        /* lo fijás cerca del borde inferior */
        left: 30%;
        transform: translateX(-50%);
        /* solo centrado horizontal */
        max-width: calc(100vw - 2rem);
        padding: 1rem;

        h1 {
            font-size: 1.8rem;
        }

        p {
            font-size: 1rem;
        }
    }

    .img-Areas {
        max-width: 30%;
        height: auto;
        border-radius: 10px;
        object-fit: contain;
        object-position: center;
        box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3);
        transform: scale(1.2);
        /* margin:10%; */
        /* Zoom in to make center icons more readable */
    }
}

/* ============================================================
   ESTILOS EXCLUSIVOS PARA MÓVILES (Pantallas menores a 768px)
   ============================================================ */
@media (max-width: 767px) {

    /* 1. Ajuste del Header */
    header {
        /* height: auto !important; */
        height: 12dvh;
        min-height: 70px;
        padding: 10px 15px;
    }

    header.header-scrolled {
        height: 10dvh !important;
    }

    .header-logo {
        height: 45px !important;
        width: auto !important;
    }

    .header-nav {
        display: block;
    }

    .header-nav .nav-link {
        font-weight: bold;
        transition: color 0.3s;
        font-size: 0.5rem;
        padding: 0.25rem 0.5rem;
    }

    .header-nav .nav-link:hover {
        color: #ecf021 !important;
    }

    /* 2. Secciones Principales: De horizontal a vertical */
    /* #quienesSomosContainer {
        flex-direction: row !important;
        width: 100% !important;
        gap: 10px;
        margin: 0 10px !important;
    }

    #quienesSomosContainer img{
         width:40% !important;
        max-width: 40% !important;  
    }
    
    #quienesSomosContainer{
    width:100% !important;
        max-width: 100% !important;
    }
    
    .quienesSomosdiv {
        width:100% !important;
        max-width: 100% !important;
    }

    #quienesSomosContainer .quienesSomosdiv h2 {
        font-size: 1.2rem !important;
        text-align: center;
    }
    #quienesSomosContainer .quienesSomosdiv p{
        font-size: 0.6rem !important;
        text-align: center;
    } */

    /* Hero / Carrusel */
    .hero-container {
        height: 50vh;
        /* Un poco más bajo en móvil para ver contenido abajo */
    }

    .hero-overlay {
        left: 50% !important;
        transform: translateX(-50%) !important;
        bottom: 5% !important;
        width: 90% !important;
        padding: 15px !important;
    }

    .hero-overlay h1 {
        font-size: 1.3rem !important;
    }

    .hero-overlay p {
        font-size: 0.85rem !important;
    }

    /* Seccion quienes somos */
    #quienesSomosContainer {
        display: flex !important;
        flex-direction: row !important;
        /* Mantiene la fila */
        align-items: flex-start !important;
        /* Alinea al tope */
        width: 100% !important;
        max-width: 100% !important;
        gap: 12px;
        /* Espacio entre imagen y texto */
        margin: 0 !important;
        padding: 10px !important;
    }

    #quienesSomosContainer img {
        width: 35% !important;
        /* Imagen más pequeña para dar aire al texto */
        max-width: 35% !important;
        height: auto !important;
        object-fit: cover;
        border-radius: 4px;
    }

    #quienesSomosContainer .quienesSomosdiv {
        width: 65% !important;
        /* El texto ocupa el resto */
        max-width: 65% !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    #quienesSomosContainer .quienesSomosdiv h2 {
        font-size: 1rem !important;
        /* Título más pequeño para que no rompa */
        text-align: left !important;
        /* Alineado a la izquierda */
        margin-bottom: 5px !important;
    }

    #quienesSomosContainer .quienesSomosdiv p {
        font-size: 0.65rem !important;
        /* Tamaño legible pero compacto */
        text-align: left !important;
        /* Alineado a la izquierda */
        line-height: 1.4 !important;
        /* Menos espacio entre líneas para que no sea eterno */
        margin: 0 !important;
    }

    /* 4. Áreas y Servicios */
    .container-Areas {
        display: flex;
        flex-direction: row !important;
        align-items: stretch !important;
        padding: 15px 5px !important;
        /* Padding reducido para ganar ancho */
        gap: 10px !important;
    }

    .containerImg {
        width: 30%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .containerImg .img-Areas {
        max-width: 90%;
        /* Evita que la imagen se desborde */
        max-height: 90%;
        height: auto;
        /* Mantiene la proporción dentro del div */
        display: block;
        object-fit: contain;
        /* max-width: 120px !important; */
        transform: scale(1) !important;
        /* Quitamos el zoom para que no tape el texto */
        margin: 0 !important;
        box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.1) !important;
    }

    /* El texto ocupa el 70% restante */
    .text-Areas {
        width: 70% !important;
        max-width: 70% !important;
        padding: 0 5px !important;
        /* ¡IMPORTANTE! Eliminamos el 5rem que causaba el estiramiento */
        text-align: left !important;
    background-color: #326fb462;
    border-radius: 10px;
    }

    .text-Areas h4 {
        font-size: 0.85rem !important;
        /* Título compacto */
        margin-bottom: 4px !important;
        line-height: 1.2;
    }

    .text-Areas p {
        font-size: 0.65rem !important;
        /* Tamaño similar al de Quienes Somos */
        line-height: 1.3 !important;
        text-align: left !important;
    }

    /* 5. Misión, Visión y Valores (MVV) */

    #sectionMVV {
        width: 100%;
        padding: 2rem 0;
    }

    /* 2. Configuramos el grid para el salto de línea */
    #containerSpecialMVV {
        display: flex;
        flex-wrap: wrap;       /* Permite que los elementos bajen de fila */
        justify-content: center; /* Centra la tarjeta que quede sola abajo */
        gap: 15px;             /* Espacio entre tarjetas */
        width: 100%;
        margin: 0 auto;
    }

    /* 3. Definimos el ancho de cada bloque */
    .specialMVV {
        /* Calculamos el 50% menos el gap para que entren 2 por fila */
        flex: 0 0 calc(50% - 10px); 
        max-width: calc(50% - 10px);
        display: flex;
        justify-content: center;
        padding: 0 !important; /* Quitamos paddings de Bootstrap que estorben */
    }

    /* 4. Ajustamos el tamaño de las tarjetas para que entren bien de a dos */
    /* Bajamos un poco el tamaño (de 260px a ~165px según el dispositivo) */
    .card-container {
        width: 165px; 
        height: 165px;
        perspective: 1000px;
        margin-bottom: 10px;
    }

    /* 5. Ajuste del texto interno (Importante: menos espacio) */
    .card-back p {
        font-size: 0.75rem !important; /* Texto más pequeño porque la tarjeta encogió */
        line-height: 1.2;
        padding: 0 10px !important;    /* Reducimos el padding lateral drásticamente */
    }

    /* 6. Mantenemos el efecto de giro */
    .card-container:active .card,
    .card-container:hover .card {
        transform: rotateY(180deg);
    }

    /* #containerSpecialMVV {
        flex-direction: column !important;
        align-items: center !important;
        gap: 25px;
    }

    .card-container {
        width: 280px !important;
        height: 280px !important;
    } */

    /* 6. Textos de párrafos generales */
    
    /* #sectionVentajas p {
        width: 90% !important;
        max-width: 90% !important;
        text-align: left;
        font-size: 0.95rem !important;
    } */

   
    #sectionVentajas {
        display: block !important; /* Cambiamos de flex a block para que el float funcione */
        padding: 1.5rem 1rem !important;
    }

    .clearfix {
        display: block !important; /* Aseguramos que el contenedor permita el flujo */
    }

    #img-ventaja {
        /* CLAVE: Forzamos el float a la derecha en móvil */
        float: right !important; 
        
        /* Ajustamos el ancho para que el texto tenga espacio suficiente al lado */
        width: 45% !important; 
        max-width: 150px !important; 
        
        /* Márgenes para que el texto no toque la imagen */
        margin-left: 15px !important;
        margin-bottom: 10px !important;
        margin-top: 5px !important;
        
        height: auto !important;
        border-radius: 8px;
    }

    #sectionVentajas h2 {
        font-size: 1.3rem !important;
        margin-bottom: 1rem !important;
        text-align: left !important; /* Mejor alineado a la izquierda si el texto rodea */
    }

    #sectionVentajas p {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 0.85rem !important; /* Un poco más pequeño para que quepan más palabras */
        line-height: 1.4 !important;
        text-align: justify !important; /* Justificar ayuda a que el rodeado se vea limpio */
        display: inline; /* Ayuda a que el flujo sea continuo */
    }


    /* 7. Footer */
    footer {
        flex-direction: column !important;
    }

    footer #Contactanos,
    footer #contactForm {
        width: 100% !important;
        padding: 20px !important;
        text-align: center;
    }
}

/* ############################################## */
/* @Media para quienes somos */
@media (max-width: 808px) {
    #quienesSomosContainer img {
        width: 35% !important;
        /* Imagen más pequeña para dar aire al texto */
        max-width: 35% !important;
        height: auto !important;
        object-fit: cover;
        border-radius: 4px;
    }

    #quienesSomosContainer .quienesSomosdiv {
        width: 65% !important;
        /* El texto ocupa el resto */
        max-width: 65% !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    #quienesSomosContainer .quienesSomosdiv h2 {
        font-size: 1rem !important;
        /* Título más pequeño para que no rompa */
        text-align: left !important;
        /* Alineado a la izquierda */
        margin-bottom: 5px !important;
    }

    #quienesSomosContainer .quienesSomosdiv p {
        font-size: 0.65rem !important;
        /* Tamaño legible pero compacto */
        text-align: left !important;
        /* Alineado a la izquierda */
        line-height: 1.4 !important;
        /* Menos espacio entre líneas para que no sea eterno */
        margin: 0 !important;
    }
}