/* ============================================
   TRANSICIONES PROFESIONALES DE PÁGINA
   EXORTH CONSULTORES
   ============================================ */

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

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

body {
    animation: pageFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   OVERLAY DE TRANSICIÓN PRINCIPAL
   Diseño: fade suave con navy corporativo
   Duración total: ~1.5s
   ============================================ */

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: #1B3A6B;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* Logo centrado en el overlay */
.transition-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.page-transition.logo-visible .transition-logo {
    opacity: 1;
}

.transition-logo-img {
    height: 175px;
    width: auto;
    max-width: 460px;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 2px 20px rgba(255, 255, 255, 0.3));
    opacity: 0.95;
}

@media (max-width: 768px) {
    .transition-logo-img {
        height: 90px;
        max-width: 260px;
    }
}

@media (max-width: 480px) {
    .transition-logo-img {
        height: 72px;
        max-width: 220px;
    }
}

/* Prevenir scroll durante la transición */
body.transition-active {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ============================================
   ANIMACIONES DE ENTRADA DE SECCIONES
   ============================================ */

section {
    animation: pageFadeIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

section:nth-child(1) { animation-delay: 0.05s; }
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.15s; }
section:nth-child(4) { animation-delay: 0.2s; }
section:nth-child(5) { animation-delay: 0.25s; }
section:nth-child(6) { animation-delay: 0.3s; }

.fade-in {
    animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ============================================
   RIPPLE EN ELEMENTOS INTERACTIVOS
   ============================================ */

a, button, .btn, .nav-link, .service-link {
    position: relative;
    overflow: hidden;
}

a::before, button::before, .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(27, 58, 107, 0.12);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

a:active::before, button:active::before, .btn:active::before {
    width: 300px;
    height: 300px;
}
