:root {
    --rojo: rgb(233, 79, 55);
    /* principal */
    --gris: rgb(132, 134, 136);
    /* secundario */
    --negro: #000000;
    /* fuerte */
    --azul: rgb(40, 64, 89);
    /* elegante */
    --blanco: rgb(230, 231, 232);
    /* fondo */
    --azul2: #0f4c6b;
    /* base elegante */
    --azul-claro: #2f7fa3;
    /* estilo blueprint */
    --fondo: #eaf3f7;


}

* {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

html {
    scroll-behavior: smooth;
}

section {
    scroll-margin-top: 100px;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--blanco);

}

h2 {
    font-size: 38px;
    font-weight: 700;
}

/* ESPACIADO GLOBAL */
section {
    padding-top: 100px;
}


#loader {
    position: fixed;
    width: 100%;
    height: 100vh;
    background: var(--azul);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader-content img {
    width: 120px;
    animation: fadeIn 1.5s ease infinite alternate;
}

@keyframes fadeIn {
    from {
        opacity: 0.3;
    }

    to {
        opacity: 1;
    }
}


.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0%;
    background: var(--rojo);
    z-index: 2000;
}

/* HEADER */
.header {
    position: fixed;
    top: 0;
    width: 100%;

    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;

    background: rgba(15, 76, 107, 0.2);
    /* 👈 azul transparente */
    backdrop-filter: blur(6px);

    z-index: 1000;
}

.header.scrolled {
    background: rgba(40, 64, 89, 0.8);
    backdrop-filter: blur(15px);
}

.menu-toggle {
    display: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
}


/* LOGO */
.logo img {
    height: 130px;
}

/* NAV */
nav {
    display: flex;
    align-items: center;
    gap: 25px;
    /* 👈 mejor que margin */
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: 0.3s;
    color: var(--rojo);
}

/* EFECTO SUBRAYADO PRO */
nav a::after {
    content: "";
    width: 0;
    height: 2px;
    background: var(--rojo);
    position: absolute;
    left: 0;
    bottom: -6px;
    transition: 0.3s;
}

nav a:hover::after {
    width: 100%;
}




/* IMAGEN */
.hero {
    height: calc(100vh - 70px);
    background: linear-gradient(rgba(4, 30, 50, 0.75), rgba(4, 30, 50, 0.75)),
        url("imagenes/ENCABEZADO.jpg") center/cover no-repeat;

    display: flex;
    align-items: center;
    justify-content: center;
    /* 👈 centrado horizontal */
    text-align: center;
    color: white;
}

/* TEXTO */
.hero-texto {
    max-width: 700px;
}

.hero h2 {
    font-size: 55px;
    font-weight: 700;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    /* 🔥 contraste pro */
}

.hero p {
    font-size: 20px;
    margin: 20px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero button {
    background: var(--rojo);
    border: none;
    padding: 15px 25px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
}

.hero button:hover {
    transform: scale(1.05);
    background: #d63b1f;
}

/* ===== HERO CINEMATICO ===== */
.hero.cinematic {
    position: relative;
    height: 100dvh;

    background: url("imagenes/ENCABEZADO1.jpg") center/cover no-repeat;
    background-attachment: fixed;
    /* 🔥 parallax */

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    overflow: hidden;
}

/* CAPA OSCURA */
.hero-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(4, 30, 50, 0.8), rgba(4, 30, 50, 0.9));
    z-index: 1;
}

/* CONTENIDO ENCIMA */
.hero-logo,
.hero-texto {
    position: relative;
    z-index: 2;
}

/* LOGO ANIMADO */
.hero-logo img {
    max-width: 350px;
    opacity: 0;
    transform: scale(0.8);

    animation: logoCine 1.5s ease-out forwards;

    filter: brightness(0.8) saturate(2.2); /* 🔥 más oscuro */
}

/* TEXTO ANIMADO */
.hero-texto {
    opacity: 0;
    transform: translateY(40px);
    animation: textoCine 1.2s ease-out 0.8s forwards;
}

/* TITULO */
.hero h2 {
    font-size: 55px;
    letter-spacing: 1px;
    text-shadow: 0 5px 20px rgba(0, 0, 0, 0.7);
}

/* BOTON */
.hero button {
    margin-top: 20px;
}

/* ===== ANIMACIONES ===== */
@keyframes logoCine {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes textoCine {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nosotros {
    padding: 80px 40px;
    background: var(--fondo);
}

.nosotros-grid {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nosotros .texto {
    flex: 1;
    text-align: justify;
}

.nosotros .imagen {
    flex: 1;
}

.nosotros img {
    width: 100%;
    border-radius: 10px;
}

.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal.delay {
    transition-delay: 0.2s;
}

.representacion {
    margin-top: 40px;
    padding: 30px;
    background: white;
    border-left: 5px solid var(--rojo);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* CONTENIDO EN FILA */
.rep-contenido {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* IMAGEN */
.rep-img img {
    width: 1200px;
    height: 120px;
    object-fit: contain;
}

/* TEXTO */
.rep-texto h3 {
    color: var(--azul);
    margin-bottom: 10px;
    text-align: justify;
}

.rep-texto p {
    margin: 6px 0;
    color: #333;
    text-align: justify;
}




.experiencia {
    padding: 80px 40px;
    background: var(--fondo);
    text-align: center;
}

.experiencia h2 {
    color: var(--azul);
    margin-bottom: 40px;
}

/* GRID */
.exp-grid {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

/* TARJETAS */
.exp-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    width: 320px;
    text-align: left;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: 0.3s;
    border-top: 5px solid var(--rojo);
}

.timeline {
    padding: 80px 40px;
    background: var(--fondo);
}

.timeline h2 {
    text-align: center;
    color: var(--azul);
    margin-bottom: 50px;
}

/* LINEA CENTRAL */
.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: auto;
}

.timeline-container::before {
    content: "";
    position: absolute;
    width: 4px;
    background: var(--azul);
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* ITEM */
.timeline-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 50px;
    position: relative;
}

.impacto {
    position: relative;
    overflow: hidden;
    padding: 80px 40px;
    text-align: center;
    color: white;
}



/* CAPA DE FONDO */
.impacto::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;

    background: linear-gradient(rgba(4, 30, 50, 0.75), rgba(4, 30, 50, 0.75)),
        url("imagenes/PLANOSCODELCO.jpg") center/cover no-repeat;

    z-index: 0;
    transform: translateY(0);
}

/* CONTENIDO ENCIMA */
.impacto * {
    position: relative;
    z-index: 1;
}

.impacto h2 {
    color: var(--rojo);
}

.contador {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px 30px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.numero {
    font-size: 40px;
    font-weight: bold;
}



/* CONTENIDO */
.timeline-content {
    width: 45%;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    text-align: justify;
}

.timeline-content h3 {
    color: var(--azul);
}

.timeline-content span {
    font-size: 14px;
    color: var(--gris);
}

/* IMAGEN */
.timeline-img {
    width: 45%;
}

.timeline-img img {
    width: 100%;
    border-radius: 10px;
}

/* ALTERNAR LADOS */
.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}


.reveal-left {
    opacity: 0;
    transform: translateX(-80px);
    transition: 0.8s;
}

.reveal-right {
    opacity: 0;
    transform: translateX(80px);
    transition: 0.8s;
}

.reveal-left.active,
.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.servicios {
    padding: 80px 40px;
    background: var(--fondo);
    text-align: center;
}

.servicios h2 {
    margin-bottom: 40px;
    color: var(--azul);
}

/* GRID */
.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* CARD */
.card {
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.4s;
    background: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* IMAGEN */
.card-img {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

/* OVERLAY */
.overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    font-weight: bold;
}

/* CONTENIDO */
.card-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
    transition: all 0.4s ease;
}

/* ACTIVO */
.card.active .card-content {
    max-height: 150px;
    padding: 15px 20px;
}

/* HOVER */
.card:hover img {
    transform: scale(1.1);
}

.card:hover {
    transform: translateY(-10px);
}


.procesos {
    padding: 80px 40px;
    text-align: center;
    background: var(--fondo);
}

.procesos h2 {
    margin-bottom: 40px;
    color: var(--azul);
}

.galeria-seccion {
    padding: 80px 20px;
    text-align: center;
    background: var(--fondo);
}

/* TARJETA */
.galeria-card {
    background: linear-gradient(135deg, var(--azul), var(--azul2));
    color: white;
    padding: 40px;
    border-radius: 15px;
    cursor: pointer;
    max-width: 600px;
    margin: auto;
    transition: 0.4s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.galeria-card:hover {
    transform: translateY(-10px) scale(1.02);
}

/* TEXTO */
.galeria-card h2 {
    margin-bottom: 10px;
}

.galeria-card span {
    display: block;
    margin-top: 15px;
    font-size: 14px;
    opacity: 0.8;
}

/* GALERÍA OCULTA */
.galeria-contenido {
    max-height: 0;
    overflow: hidden;
    transition: all 0.6s ease;
}

/* CUANDO SE ABRE */
.galeria-contenido.activa {
    max-height: 2000px;
    /* suficiente para muchas fotos */
    margin-top: 40px;
}

/* GRID */
.grid-galeria {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* IMÁGENES */
.grid-galeria img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
    transition: 0.3s;
}

.grid-galeria img:hover {
    transform: scale(1.05);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .grid-galeria {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-galeria {
        grid-template-columns: 1fr;
    }
}


.modal-img {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
}

/* IMAGEN */
.modal-img img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    max-width: 90%;
    max-height: 85%;
    border-radius: 10px;
    transition: 0.3s ease;
}

/* CUANDO SE ABRE */
.modal-img.active img {
    transform: translate(-50%, -50%) scale(1);
}

/* BOTÓN CERRAR */
#cerrar-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

@media (max-width: 768px) {

    .galeria-card {
        padding: 25px;
    }

    .galeria-card span {
        font-size: 16px;
        font-weight: bold;
    }

    .galeria-contenido.activa {
        max-height: 80vh;
        /* 🔥 mejor que 2000px */
        overflow-y: auto;
    }

}


.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: #25D366;
    color: white;
    font-size: 28px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    z-index: 3000;

    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);

    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* HOVER */
.whatsapp-float:hover {
    transform: scale(1.1);
}

.footer {
    background: var(--azul);
    color: white;
    text-align: center;
    padding: 30px;
}

.contacto {
    padding: 80px 40px;
    background: var(--blanco);
}

.contacto-container {
    display: flex;
    gap: 50px;
    flex-wrap: wrap;
}

/* FORM */
.formulario {
    flex: 1;
}

.formulario h2 {
    margin-bottom: 20px;
}

.formulario label {
    display: block;
    margin-top: 15px;
    font-size: 12px;
    letter-spacing: 1px;
}

.formulario input,
.formulario textarea {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background: #eee;
    margin-top: 5px;
}

.formulario textarea {
    height: 120px;
}

.formulario button {
    margin-top: 20px;
    background: #0c1020;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
}

/* INFO */
.info {
    flex: 1;
}

.info h3 {
    margin-bottom: 15px;
}

.info p {
    margin: 8px 0;
}



.formulario button {
    margin-top: 20px;
    background: #25D366;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.formulario button:hover {
    background: #1ebe5d;
    transform: scale(1.05);
}



/* RESPONSIVE */
@media (max-width: 1024px) {
    .galeria-procesos {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .galeria-procesos {
        column-count: 1;
    }
}

/* ===== RESPONSIVE LIMPIO ===== */

/* NOSOTROS */
@media (max-width: 768px) {
    .nosotros-grid {
        flex-direction: column;
    }
}

/* ===== SERVICIOS (USAMOS GRID SIEMPRE) ===== */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}


/* TARJETAS */
.card {
    min-width: 250px;
    /* 🔥 ancho fijo */
    flex: 0 0 auto;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.cards::-webkit-scrollbar {
    height: 8px;
}

.cards::-webkit-scrollbar-thumb {
    background: var(--rojo);
    border-radius: 10px;
}

/* ===== GALERIA ===== */
.galeria {
    display: flex;
    gap: 15px;
    padding: 40px;
}

.galeria img {
    width: 100%;
    border-radius: 10px;
    transition: 0.3s;
}

.galeria img:hover {
    transform: scale(1.05);
}

/* ===== ANIMACIONES ===== */
.reveal {
    opacity: 0;
    transform: translateY(80px) scale(0.9);
    transition: all 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ===== TABLET ===== */
@media (max-width: 1024px) {

    .hero h2 {
        font-size: 40px;
        text-align: center;
    }

    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .galeria {
        flex-wrap: wrap;
    }

    .galeria img {
        width: 48%;
    }
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {

    /* HEADER */
    @media (max-width: 768px) {

        .header {
            flex-direction: row;
            /* 🔥 IMPORTANTE */
            justify-content: space-between;
            align-items: center;
            padding: 10px 20px;
        }

    }

    .header {
        flex-direction: row;
        /* 🔥 IMPORTANTE */
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
    }

    /* NAV */
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        /* oculto */
        width: 70%;
        height: 100vh;
        background: rgba(15, 76, 107, 0.98);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.3s ease;
        z-index: 999;
    }

    nav.active {
        right: 0;
        /* aparece */
    }

    nav a {
        padding: 20px;
        font-size: 18px;
        width: 100%;
        text-align: center;
    }


    .menu-toggle {
        display: block;
    }

    /* HERO */
    .hero {
        height: auto;
        padding: 60px 20px;
        text-align: center;
    }

    .hero h2 {
        font-size: 30px;
    }

    .hero button {
        padding: 12px 20px;
        font-size: 14px;
    }

    /* SERVICIOS */
    .cards {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    /* GALERIA */
    .galeria {
        flex-direction: column;
        padding: 20px;
    }

    .galeria img {
        width: 100%;
    }

    /* REPRESENTACION */
    .rep-contenido {
        flex-direction: column;
        text-align: center;
    }

    .rep-img img {
        width: 100px;
        height: 100px;
    }

    /* CONTACTO */
    .contacto-container {
        flex-direction: column;
    }
}

/* ===== EXTRA MOBILE PEQUEÑO ===== */
@media (max-width: 480px) {



    .hero h2 {
        font-size: 35px;
    }

    .hero p {
        font-size: 20px;
    }

    section {
        padding: 60px 20px;
    }

    .whatsapp-float {
        width: 55px;
        height: 55px;
        font-size: 24px;
        bottom: 15px;
        right: 15px;
    }
}

/* ===== IMÁGENES ===== */
img {
    max-width: 100%;
    height: auto;
}

/* 📱 TIMELINE MOBILE PRO */
@media (max-width: 768px) {

    /* QUITAR LÍNEA CENTRAL */
    .timeline-container::before {
        left: 10px;
    }

    /* ITEM EN COLUMNA */
    .timeline-item {
        flex-direction: column !important;
        align-items: flex-start;
        padding-left: 25px;
    }

    /* IMAGEN */
    .timeline-img {
        width: 100%;
        margin-bottom: 10px;
    }

    .timeline-img img {
        width: 100%;
        height: 200px;
        object-fit: cover;
        border-radius: 10px;
    }

    /* CONTENIDO */
    .timeline-content {
        width: 100%;
    }

}

@media (max-width: 768px) {

    .timeline-item {
        background: white;
        border-radius: 10px;
        padding: 15px;
        margin-bottom: 20px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

}

/* TABLET */
@media (max-width: 1024px) {
    .carrusel {
        height: 400px;
    }
}

/* MOBILE */
@media (max-width: 768px) {
    .carrusel {
        height: 300px;
    }

    .slide h3 {
        font-size: 16px;
        padding: 8px 15px;
    }

    .prev,
    .next {
        font-size: 18px;
        padding: 8px 10px;
    }
}

/* MOBILE PEQUEÑO */
@media (max-width: 480px) {
    .carrusel {
        height: 250px;
    }

    .slide h3 {
        font-size: 14px;
    }
}