/* =====================================================
   GRUPO PROIMPSAC - Estilos principales
   ===================================================== */

:root {
    --azul-oscuro: #0a1a3c;
    --azul-oscuro-2: #0d2050;
    --azul-brillo: #3b6fd4;
    --azul-claro: #6fa8ff;
    --blanco: #ffffff;
    --gris-footer: #16161a;
    --texto-gris: #b8c2d9;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background: var(--azul-oscuro);
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { text-decoration: none; }

/* =====================================================
   HEADER
   ===================================================== */
.site-header {
    background: var(--blanco);
    width: 100%;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: relative;
    z-index: 50;
}

.site-header .logo-wrap img {
    height: 60px;
    width: auto;
}

.header-contact {
    display: flex;
    gap: 26px;
    align-items: center;
}

.header-contact .contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1c2a4a;
    font-size: 14px;
    font-weight: 500;
}

.header-contact .contact-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: none;
    stroke: #1959c9;
    stroke-width: 1.8;
}

.header-contact a.contact-item {
    color: #1c2a4a;
}

/* =====================================================
   SLIDER
   ===================================================== */
.slider-section {
    width: 100%;
    background: var(--azul-oscuro);
    line-height: 0;
}

.slider-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #061027;
}

/* Solo el slide activo participa del flujo normal (position: relative);
   los demás quedan absolutos y no afectan la altura. Como la imagen usa
   height:auto, el contenedor termina adoptando exactamente la altura
   real de la imagen activa: sin barras ni espacios en ningún dispositivo. */
.slider-viewport .slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    line-height: 0;
}

.slider-viewport .slide.active {
    opacity: 1;
    position: relative;
}

.slider-viewport img {
    display: block;
    width: 100%;
    height: auto;
}

/* =====================================================
   CUERPO - FONDO ANIMADO
   ===================================================== */
.main-body {
    position: relative;
    background: linear-gradient(160deg, var(--azul-oscuro) 0%, var(--azul-oscuro-2) 100%);
    padding: 70px 20px 90px;
    overflow: hidden;
}

.bg-icons {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-icons svg {
    position: absolute;
    stroke: var(--azul-claro);
    fill: none;
    stroke-width: 1.2;
    opacity: 0.09;
}

.bg-icon-1 { top: 8%;  left: 6%;  width: 110px; animation: floatA 22s ease-in-out infinite; }
.bg-icon-2 { top: 55%; left: 12%; width: 90px;  animation: floatB 26s ease-in-out infinite; }
.bg-icon-3 { top: 15%; right: 8%; width: 130px; animation: floatA 30s ease-in-out infinite reverse; }
.bg-icon-4 { bottom: 10%; right: 14%; width: 100px; animation: floatB 24s ease-in-out infinite; }
.bg-icon-5 { bottom: 20%; left: 45%; width: 80px; animation: floatA 28s ease-in-out infinite; }
.bg-icon-6 { top: 40%; right: 40%; width: 70px; animation: floatB 20s ease-in-out infinite reverse; }

@keyframes floatA {
    0%   { transform: translate(0,0) rotate(0deg); }
    50%  { transform: translate(20px,-25px) rotate(8deg); }
    100% { transform: translate(0,0) rotate(0deg); }
}
@keyframes floatB {
    0%   { transform: translate(0,0) rotate(0deg); }
    50%  { transform: translate(-18px,20px) rotate(-6deg); }
    100% { transform: translate(0,0) rotate(0deg); }
}

.body-description {
    position: relative;
    z-index: 1;
    color: var(--blanco);
    text-align: center;
    max-width: 900px;
    margin: 0 auto 60px;
    font-size: 18px;
    line-height: 1.7;
    font-weight: 300;
}

/* =====================================================
   CUADROS DE EMPRESAS - BORDE LUMINOSO ANIMADO
   ===================================================== */
.companies-grid {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.company-card {
    position: relative;
    width: 260px;
    height: 260px;
    border-radius: 18px;
    cursor: pointer;
}

/* SVG que traza el contorno del cuadro: un segmento de luz recorre el
   borde completo (incluyendo esquinas) sin que nada gire ni rote. */
.card-border-glow {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: visible;
}

.card-border-glow .glow-path {
    fill: none;
    stroke: var(--azul-claro);
    stroke-width: 5.5;
    stroke-linecap: round;
    stroke-dasharray: 16 84;
    stroke-dashoffset: 0;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 5px var(--azul-claro)) drop-shadow(0 0 12px rgba(111, 168, 255, 0.7));
    animation: travelBorder 3.2s linear infinite;
}

@keyframes travelBorder {
    to { stroke-dashoffset: -100; }
}

.company-card-inner {
    position: absolute;
    inset: 3px;
    z-index: 1;
    border-radius: 16px;
    background: #0c1f4a;
    overflow: hidden;
    transition: transform 0.25s ease, background 0.25s ease;
}

.company-card:hover .company-card-inner {
    transform: scale(1.03);
    background: #10265c;
}

.company-card-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.logo-pendiente {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #5679c9;
    font-size: 13px;
    text-align: center;
    width: 80%;
}

/* =====================================================
   POPUP DE EMPRESA
   ===================================================== */
.company-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 9, 26, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    overflow: hidden;
}

/* Logos flotantes de fondo cuando el popup está abierto: sutiles, en un
   solo tono claro, se mueven lentamente por distintas zonas de la pantalla */
.modal-bg-logos {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.modal-bg-logo {
    position: absolute;
    filter: brightness(0) invert(1);
    opacity: 0.18;
}

.mbl-1 { width: 130px; top: 8%;    left: 6%;   animation: floatModalA 14s ease-in-out infinite; }
.mbl-2 { width: 90px;  top: 65%;   left: 12%;  animation: floatModalB 16s ease-in-out infinite; }
.mbl-3 { width: 150px; top: 15%;   right: 8%;  animation: floatModalA 18s ease-in-out infinite reverse; }
.mbl-4 { width: 100px; bottom: 10%; right: 14%; animation: floatModalB 13s ease-in-out infinite; }

@keyframes floatModalA {
    0%   { transform: translate(0,0) rotate(0deg); }
    50%  { transform: translate(30px,-35px) rotate(10deg); }
    100% { transform: translate(0,0) rotate(0deg); }
}
@keyframes floatModalB {
    0%   { transform: translate(0,0) rotate(0deg); }
    50%  { transform: translate(-25px,30px) rotate(-8deg); }
    100% { transform: translate(0,0) rotate(0deg); }
}

.company-modal-overlay.open {
    display: flex;
}

.company-modal {
    background: var(--blanco);
    border-radius: 16px;
    max-width: 440px;
    width: 100%;
    padding: 36px 30px 30px;
    position: relative;
    z-index: 1;
    text-align: center;
    animation: modalPop 0.25s ease;
}

@keyframes modalPop {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.company-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #eef1f8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.company-modal-close svg {
    width: 16px;
    height: 16px;
    stroke: #333;
    stroke-width: 2;
}

.company-modal .modal-logo {
    max-width: 280px;
    max-height: 170px;
    width: 100%;
    object-fit: contain;
    margin: 0 auto 20px;
}

.company-modal .modal-desc {
    color: #384258;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 22px;
}

.modal-socials {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.modal-socials a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eef1f8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.modal-socials a:hover {
    background: var(--azul-brillo);
}

.modal-socials a:hover svg {
    fill: #fff;
}

.modal-socials svg {
    width: 20px;
    height: 20px;
    fill: #1c2a4a;
}

.btn-visitar {
    display: inline-block;
    background: var(--azul-brillo);
    color: #fff;
    font-weight: 600;
    padding: 13px 34px;
    border-radius: 30px;
    font-size: 15px;
    transition: background 0.2s ease;
}

.btn-visitar:hover {
    background: #2c56a8;
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
    background: var(--gris-footer);
    color: #9aa0ad;
    text-align: center;
    padding: 16px 20px;
    font-size: 13px;
    letter-spacing: 0.3px;
}

/* =====================================================
   RESPONSIVE - MÓVIL
   ===================================================== */
@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        gap: 10px;
        padding: 16px 16px;
    }

    .site-header .logo-wrap {
        margin: 0 auto;
    }

    .site-header .logo-wrap img {
        height: 50px;
    }

    .header-contact {
        flex-direction: column;
        gap: 6px;
        width: 100%;
        align-items: center;
    }

    .header-contact .contact-item {
        font-size: 12.5px;
        text-align: center;
    }

    .body-description {
        font-size: 15.5px;
    }

    .companies-grid {
        gap: 26px;
    }

    .company-card {
        width: 100%;
        max-width: 300px;
        height: 220px;
    }
}
