/* =====================================================
   GAMA Ingeniería — Animaciones
   Colores del proyecto: Azul #07189B | Naranja #F5430B
   ===================================================== */

/* ─────────────────────────────────────────────────────
   1. PAGE LOADER (pantalla de carga entre páginas)
   ───────────────────────────────────────────────────── */
#gama-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background-color: #07189B;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

#gama-loader.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Logo dentro del loader */
#gama-loader .loader-logo img {
    width: 160px;
    animation: loaderLogoPulse 1.4s ease-in-out infinite;
}

@keyframes loaderLogoPulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%       { transform: scale(1.07); opacity: 0.85; }
}

/* Barra de progreso animada */
#gama-loader .loader-bar-wrap {
    width: 180px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

#gama-loader .loader-bar {
    height: 100%;
    width: 0%;
    background-color: #F5430B;
    border-radius: 4px;
    animation: loaderBarFill 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes loaderBarFill {
    0%   { width: 0%; }
    60%  { width: 75%; }
    100% { width: 100%; }
}

/* Tres puntos animados debajo */
#gama-loader .loader-dots {
    display: flex;
    gap: 10px;
}

#gama-loader .loader-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #F5430B;
    animation: loaderDotBounce 0.9s ease-in-out infinite;
}

#gama-loader .loader-dots span:nth-child(2) { animation-delay: 0.18s; }
#gama-loader .loader-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes loaderDotBounce {
    0%, 80%, 100% { transform: translateY(0);    opacity: 0.5; }
    40%            { transform: translateY(-10px); opacity: 1;   }
}


/* ─────────────────────────────────────────────────────
   2. ANIMACIÓN DE ENTRADA A LA PÁGINA (fade + slide)
      Se aplica a #page-wrap, NO al body.
      El body con transform/animation rompe position:fixed.
   ───────────────────────────────────────────────────── */
#page-wrap {
    animation: pageEnter 0.5s ease forwards;
    /* El wrapper no debe crear stacking context propio
       una vez que la animación termina — usar will-change
       solo durante la animación y dejar que el browser lo libere */
}

@keyframes pageEnter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}


/* ─────────────────────────────────────────────────────
   3. REDES SOCIALES — Hover animado
      .socialshare (header) y .socialico (footer)
   ───────────────────────────────────────────────────── */

/* ── Header ─────────────────────── */
.socialshare ul li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.25s ease;
}

.socialshare ul li a img {
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.28s ease;
    display: block;
}

/* Base hover: rebote con escala */
.socialshare ul li a:hover img {
    transform: scale(1.28) translateY(-4px);
}

/* Facebook hover — sombra azul Facebook */
.socialshare ul li:nth-child(2) a:hover img {
    transform: scale(1.28) translateY(-4px);
    filter: drop-shadow(0 4px 8px rgba(24, 119, 242, 0.75)) !important;
}

/* Instagram hover — sombra degradado naranja/violeta */
.socialshare ul li:nth-child(3) a:hover img {
    transform: scale(1.28) translateY(-4px) rotate(8deg);
    filter: drop-shadow(0 4px 8px rgba(245, 67, 11, 0.7)) !important;
}

/* Botón "open-contact.png" — pulso continuo sutil + rebote al hover */
.socialshare ul li.justdesktop a img {
    transition: transform 0.28s ease;
    animation: contactPing 2.6s ease-in-out infinite;
}

.socialshare ul li.justdesktop a:hover img {
    animation: none;
    transform: scale(1.22) rotate(-5deg);
    filter: drop-shadow(0 0 8px rgba(245, 67, 11, 0.65)) !important;
}

@keyframes contactPing {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.09); }
}

/* ── Footer ─────────────────────── */
.socialico a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.25s ease;
}

.socialico a img {
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.28s ease;
    display: block;
}

/* Facebook footer hover */
.socialico a:first-child:hover img {
    transform: scale(1.3) translateY(-4px);
    filter: drop-shadow(0 4px 10px rgba(24, 119, 242, 0.8)) !important;
}

/* Instagram footer hover */
.socialico a:last-child:hover img {
    transform: scale(1.3) translateY(-4px) rotate(8deg);
    filter: drop-shadow(0 4px 10px rgba(245, 67, 11, 0.8)) !important;
}


/* ─────────────────────────────────────────────────────
   4. BOTÓN FLOTANTE WHATSAPP — animación de pulso
      (posición/tamaño definidos en style.css via #gama-wa-fab)
   ───────────────────────────────────────────────────── */

#gama-wa-fab {
    animation: waPulse 2.8s ease-in-out infinite;
    transition: transform 0.25s ease, filter 0.25s ease;
}

#gama-wa-fab:hover {
    animation: none;
    transform: scale(1.14);
    filter: drop-shadow(0 0 14px rgba(37, 211, 102, 0.8));
}

@keyframes waPulse {
    0%   { transform: scale(1);    box-shadow: 0 0 0 0    rgba(37, 211, 102, 0.65); }
    50%  { transform: scale(1.07); box-shadow: 0 0 0 14px rgba(37, 211, 102, 0);    }
    100% { transform: scale(1);    box-shadow: 0 0 0 0    rgba(37, 211, 102, 0);    }
}


/* ─────────────────────────────────────────────────────
   5. BOTÓN "COTIZA AHORA" — efecto de brillo al hover
   ───────────────────────────────────────────────────── */
.ctabtn a {
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.ctabtn a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.45) 50%,
        rgba(255,255,255,0) 100%
    );
    transform: skewX(-20deg);
    transition: left 0.5s ease;
    pointer-events: none;
}

.ctabtn a:hover::after {
    left: 130%;
}

.ctabtn a:hover {
    transform: translateY(-2px);
}

.ctabtn a:active {
    transform: translateY(0px);
}


/* ─────────────────────────────────────────────────────
   6. LINKS DE NAV — subrayado animado al hover
   ───────────────────────────────────────────────────── */
.navcenter ul li a {
    position: relative;
}

.navcenter ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0%;
    height: 2px;
    background-color: #F5430B;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.navcenter ul li a:hover::after,
.navcenter ul li a.active::after {
    width: 70%;
}
