/* =========================================
   1. VARIABLES Y RESET
========================================= */
:root {
    --blanco: #ffffff;
    --oscuro: #212121;
    --azulPrimario: #1A4B8F;
    --azulSecundario: #0D1B2A;
    --rojoPrimario: #D72638;
    --rojoSecundario: #921420;
    --gris: #757575;
    --GrisClaro: #CDCDCD;
    --fuentePrincipal: "Montserrat", sans-serif;
}

html {
    font-size: 62.5%; /* 1rem = 10px */
    box-sizing: border-box;
    scroll-snap-type: y mandatory;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    font-family: var(--fuentePrincipal);
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--oscuro);
    background-color: var(--blanco);
    margin: 0;
}

h1, h2, h3 {
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

img {
    max-width: 100%;
    display: block;
}

/* =========================================
   2. UTILIDADES Y LAYOUT
========================================= */
.contenedor {
    max-width: 120rem;
    margin: 0 auto;
    padding: 0 2rem;
}

.alinear-derecha {
    display: flex;
    justify-content: flex-end;
}

.fondo-claro {
    background-color: #f9f9f9;
}

/* =========================================
   3. BOTONES
========================================= */
.btn {
    display: inline-block;
    padding: 1.2rem 3rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1.6rem;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primario {
    background-color: var(--rojoPrimario);
    color: var(--blanco);
}

.btn-primario:hover {
    background-color: var(--rojoSecundario);
}

.btn-cotizar {
    background-color: var(--rojoPrimario);
    color: var(--blanco);
    padding: 1.2rem 4rem;
    border-radius: 3rem;
    margin-top: 2rem;
}

.btn-cotizar:hover {
    background-color: var(--rojoSecundario);
}

.btn-full {
    width: 100%;
    display: block;
}

/* =========================================
   4. ENCABEZADO (HEADER)
========================================= */
.encabezado-principal {
    background-color: var(--azulPrimario);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 0.2rem 0.5rem rgba(0,0,0,0.1);
}

.contenedor-navegacion {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 6rem;
}

.navegacion-principal ul {
    display: flex;
    gap: 1rem; 
    align-items: center; 
}

.navegacion-principal a {
    color: var(--blanco);
    font-size: 1.6rem;
    font-weight: 500;
    padding: 0.8rem 2.5rem; 
    border-radius: 5rem; 
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.navegacion-principal a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--blanco);
    transform: translateY(-2px);
}

/* =========================================
   5. PORTADAS (HERO)
========================================= */
.portada {
    background-image: url('../img/BannerIndex.jpg');
    background-size: cover;
    background-position: center;
    height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.portada-interna {
    background-size: cover;
    background-position: center;
    height: 45vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 4rem;
}

.capa-portada {
    background: rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contenido-portada {
    text-align: center;
    color: var(--blanco);
    max-width: 100%;
    padding: 0 2rem;
}

.contenido-portada h1 {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    white-space: nowrap;
    max-width: 120rem;
    margin-left: auto;
    margin-right: auto;
}

.contenido-portada p {
    font-size: 1.7rem;
    margin-bottom: 3rem;
    font-weight: 300;
}

/* =========================================
   6. SECCIÓN SERVICIOS (GRID)
========================================= */
.servicios {
    padding: 10rem 2rem; 
    background-color: var(--blanco);
}

.titulo-seccion {
    font-size: 3.2rem;
    text-align: center;
    margin-bottom: 7rem;
    color: var(--oscuro);
}

.grid-servicios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
    gap: 3rem;
}

.tarjeta-servicio {
    background-color: #EAEAEA;
    padding: 4rem 2rem;
    border-radius: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 35rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.05);
}

.tarjeta-servicio:hover {
    transform: translateY(-0.5rem);
}

.tarjeta-servicio .icono {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 10rem;
    width: 100%;
}

.tarjeta-servicio .icono img {
    height: 8rem;
    width: auto;
    object-fit: contain;
}

.tarjeta-servicio .icono-servicio {
    width: 100%;
    height: 18rem;
    margin-bottom: 2rem;
    overflow: hidden;
    border-radius: 0.5rem;
}

.tarjeta-servicio .icono-servicio img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tarjeta-servicio:hover .icono-servicio img {
    transform: scale(1.1);
}

.tarjeta-servicio h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--oscuro);
    font-weight: 600;
    max-width: 22rem;
    min-height: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tarjeta-servicio .btn {
    width: 100%;
    display: block;
    padding: 1.2rem 0;
}

/* =========================================
   7. SECCIÓN DIVIDIDA (ZIG-ZAG)
========================================= */
.seccion-dividida {
    padding: 6rem 2rem; 
    background-color: var(--blanco);
}

.contenedor-dividido {
    display: flex;
    align-items: center;
    gap: 6rem;
}

.texto-dividido {
    flex: 1;
}

.texto-dividido h2 {
    color: var(--azulPrimario);
    font-size: 2.8rem;
    margin-bottom: 2rem;
    position: relative;
}

.texto-dividido h2::after {
    content: '';
    display: block;
    width: 6rem;
    height: 0.4rem;
    background-color: var(--rojoPrimario);
    margin-top: 1rem;
    border-radius: 2px;
}

.texto-dividido p {
    font-size: 1.6rem;
    color: var(--oscuro);
    text-align: justify;
    font-weight: 400;
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.imagen-dividida {
    flex: 1;
}

.imagen-dividida img {
    width: 100%;
    height: auto;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0,0,0,0.1);
}

.inverso {
    flex-direction: row-reverse;
}

/* =========================================
   8. SOBRE NOSOTROS
========================================= */
.sobre-nosotros {
    padding: 2rem;
}

.sobre-nosotros .titulo-seccion {
    margin-bottom: 6rem;
}

.contenedor-sobre-nosotros {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 5rem;
    align-items: center;
    max-width: 100rem;
    margin: 0 auto;
}

.imagen-nosotros img {
    width: 100%;
    height: auto;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0,0,0,0.15);
    object-fit: cover;
    max-height: 40rem;
}

.lista-caracteristicas li {
    font-size: 1.6rem;
    margin-bottom: 3rem;
    padding-left: 2.5rem;
    position: relative;
    color: var(--oscuro);
    line-height: 1.6;
}

.lista-caracteristicas li strong {
    color: var(--azulPrimario);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.lista-caracteristicas li::before {
    content: "•";
    color: var(--rojoPrimario);
    position: absolute;
    left: 0;
    top: -0.5rem;
    font-size: 3rem;
    line-height: 1;
}

/* =========================================
   9. CONTACTO (CORPORATIVO)
========================================= */
.seccion-contacto {
    padding: 8rem 2rem; 
    background-color: var(--blanco);
}

.grid-contacto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
    gap: 4rem;
    align-items: flex-start;
}

.tarjeta-contacto {
    background-color: #EAEAEA; 
    padding: 4rem 3rem;
    border-radius: 1.5rem;
    text-align: center;
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%; 
}

.tarjeta-contacto:hover {
    transform: translateY(-0.5rem); 
}

.icono-contacto {
    height: 8rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icono-contacto img {
    height: 6rem;
    width: auto;
    object-fit: contain;
}

.tarjeta-contacto h3 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: var(--oscuro);
    font-weight: 700;
}

.texto-contacto {
    font-size: 1.6rem;
    color: var(--oscuro);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.email-destacado {
    font-weight: 700;
    color: var(--azulPrimario);
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    word-break: break-all;
}

.acciones-contacto {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* =========================================
   10. PIE DE PÁGINA (FOOTER)
========================================= */
.pie-pagina-principal {
    background-color: var(--azulPrimario);
    color: var(--blanco);
    text-align: center;
    padding: 0.5rem;
    font-size: 1.4rem;
}

.pie-pagina-principal p {
    margin-bottom: 1rem;
    opacity: 0.9;
}

/* =========================================
   11. MEDIA QUERIES (RESPONSIVE)
========================================= */
@media (min-width: 992px) {
    .grid-servicios {
        grid-template-columns: repeat(3, 1fr);
        gap: 5rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 50%;
    }

    /* --- NAVEGACIÓN --- */
    .contenedor-navegacion {
        flex-direction: column;
        gap: 1rem;
        padding-bottom: 1rem;
    }

    .navegacion-principal ul {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        padding: 1rem 2rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .navegacion-principal a {
        font-size: 1.3rem;
        padding: 0.6rem 1.5rem;
        white-space: nowrap;
        border: 2px solid transparent;
    }

    /* --- PORTADAS --- */
    .contenido-portada h1 {
        white-space: normal;
        font-size: 3.2rem;
        line-height: 1.3;
    }

    .portada-interna {
        height: 35vh;
    }

    .grid-servicios,
    .grid-contacto {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contenedor-dividido {
        flex-direction: column;
        gap: 2rem;
    }

    .imagen-dividida, 
    .texto-dividido {
        display: contents;
    }

    .texto-dividido h2 {
        order: 1;
        text-align: left; 
        margin-bottom: 1rem;
    }
    
    .texto-dividido h2::after {
        margin: 1rem 0 0 0; 
    }

    .imagen-dividida img {
        order: 2;
        width: 100%;
        max-width: 45rem; 
        margin: 0 auto;
    }

    .texto-dividido p {
        order: 3;
        margin-top: 1rem;
        text-align: left; 
    }

    .alinear-derecha {
        order: 4;
        width: 100%;
        justify-content: center;
    }

    /* --- SOBRE NOSOTROS --- */
    .contenedor-sobre-nosotros {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .imagen-nosotros {
        display: flex;
        justify-content: center;
    }

    .imagen-nosotros img {
        width: 70%;
        max-width: 30rem;
    }

    .lista-caracteristicas li {
        text-align: left;
        padding-left: 2rem;
        margin-bottom: 2rem;
    }

    /* --- ESPACIADOS --- */
    .servicios, 
    .sobre-nosotros, 
    .seccion-dividida,
    .seccion-contacto {
        padding: 4rem 2rem; 
    }
    
    .pie-pagina-principal {
        padding: 3rem 2rem;
    }
    
    .tarjeta-contacto {
        padding: 3rem 2rem;
    }
}

/* ==============================
   12. ANIMACIONES PREMIUM
================================= */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contenido-portada h1 {
    animation: fadeUp 1s ease-out forwards;
}

.contenido-portada p {
    animation: fadeUp 1s ease-out 0.3s forwards;
    opacity: 0;
}

.btn-primario, 
.btn-cotizar,
.tarjeta-servicio a {
    position: relative;
    overflow: hidden;
}

.btn-primario::after, 
.btn-cotizar::after,
.tarjeta-servicio a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    transition: left 0.6s ease;
}

.btn-primario:hover::after, 
.btn-cotizar:hover::after,
.tarjeta-servicio a:hover::after {
    left: 150%;
}

.icono img, 
.icono-contacto img {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tarjeta-servicio:hover .icono img,
.tarjeta-contacto:hover .icono-contacto img {
    transform: translateY(-1rem) scale(1.05);
}

.tarjeta-servicio,
.tarjeta-contacto {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.tarjeta-servicio:hover,
.tarjeta-contacto:hover {
    box-shadow: 0 1.5rem 3rem rgba(0,0,0,0.1);
}

.tarjeta-servicio > a:not(.btn):hover {
    background-color: var(--rojoSecundario);
}