/* ==========================================================================
   ESTILOS GENERALES Y RESET
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    letter-spacing: -0.5px;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-white);
    color: var(--color-text);
    overflow-x: hidden;
    line-height: 1.6;
    /* Renderizado nítido de la tipografía */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

button, input, textarea {
    font-family: var(--font-primary);
    border: none;
    outline: none;
    background: none;
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg-light);
}
::-webkit-scrollbar-thumb {
    background: var(--color-primary-light);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* ==========================================================================
   ESTILOS DE CABECERA (HEADER)
   ========================================================================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(5, 12, 26, 0.45); /* Vidrio esmerilado continuo de fondo */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: var(--transition-smooth);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.main-header.scrolled {
    background-color: var(--color-glass-dark);
    height: 75px;
    box-shadow: var(--shadow-md);
}

.header-container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo Integrado Flotante */
.logo-container a {
    display: flex;
    align-items: center;
    padding: 4px 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.logo-img {
    height: 52px;
    width: auto;
    transition: var(--transition-smooth);
}

/* Modificaciones al hacer scroll */
.main-header.scrolled .logo-container a {
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
}

.main-header.scrolled .logo-img {
    height: 44px;
}

/* Hover interactivo del Logo */
.logo-container a:hover {
    transform: scale(1.05) rotate(-1deg);
    filter: drop-shadow(0 4px 15px rgba(255, 122, 0, 0.45));
}
@keyframes logo-pulse {
    0% {
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    50% {
        border-color: rgba(255, 122, 0, 0.25);
        box-shadow: 0 4px 25px rgba(255, 122, 0, 0.15);
    }
    100% {
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
}

/* Navegación Desktop */
.nav-menu ul {
    display: flex;
    gap: 16px;
    align-items: center;
}

.nav-menu a {
    color: var(--color-bg-white);
    font-weight: 600;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    display: block;
    overflow: hidden;
}

/* Si el Header no ha hecho scroll */
.main-header.scrolled .nav-menu a {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Hover de Glassmorphism */
.nav-menu a:hover {
    color: var(--color-accent) !important;
    background: rgba(255, 122, 0, 0.08);
    border-color: rgba(255, 122, 0, 0.4);
    box-shadow: 
        0 4px 15px rgba(255, 122, 0, 0.15),
        inset 0 0 10px rgba(255, 122, 0, 0.05);
    transform: translateY(-1.5px);
}

/* Botón activo (Página actual) */
.nav-menu a.active {
    color: var(--color-bg-white) !important;
    background: var(--color-accent-gradient);
    border-color: var(--color-accent);
    box-shadow: 
        0 6px 20px rgba(255, 122, 0, 0.35),
        inset 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Shimmer Effect en Hover */
.nav-menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: skewX(-25deg);
    pointer-events: none;
}

.nav-menu a:hover::before {
    left: 150%;
    transition: left 0.8s ease-in-out;
}

/* Header Derecha (WhatsApp y Redes) */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.phone-btn {
    background: var(--color-accent-gradient);
    color: var(--color-bg-white) !important;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-accent);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.phone-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 122, 0, 0.4);
}

.social-icons-header {
    display: flex;
    gap: 12px;
}

.social-icons-header a {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-bg-white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.social-icons-header a:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
}

/* Botón Hamburguesa */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 18px;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.hamburger span {
    width: 100%;
    height: 2.5px;
    background-color: var(--color-bg-white);
    border-radius: var(--radius-full);
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    transform-origin: center;
}

/* Animación a X en estado abierto */
.hamburger.open span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
    background-color: var(--color-accent);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background-color: var(--color-accent);
}

/* ==========================================================================
   MENÚ MÓVIL PANTALLA COMPLETA
   ========================================================================== */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -340px; /* Oculto inicialmente a la derecha */
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh; /* Altura real en navegadores móviles */
    background-color: rgba(5, 12, 26, 0.98) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 100px 30px 40px 30px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav.open {
    right: 0;
    /* Sombras y overlay virtual */
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5), 0 0 0 100vw rgba(5, 12, 26, 0.6);
}

.mobile-nav ul {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin-bottom: auto;
    width: 100%;
    counter-reset: menu-counter;
}

.mobile-nav ul li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    list-style: none;
}

/* Enlaces principales del menú */
.mobile-nav ul li a {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    color: var(--color-bg-white) !important;
    font-size: 1.25rem !important;
    font-weight: 600;
    padding: 20px 0 !important;
    border-radius: 0 !important;
    background: none !important;
    border: none !important;
    width: 100% !important;
    max-width: none !important;
    text-align: left !important;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

/* Numeración automática SOLO en enlaces principales */
.mobile-nav ul li a::before {
    counter-increment: menu-counter;
    content: "0" counter(menu-counter) ".";
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-right: 15px;
    font-family: 'Segoe UI', sans-serif;
    display: inline-block;
}

/* Flecha Chevron SOLO en enlaces principales */
.mobile-nav ul li a::after {
    content: '\f054'; /* FontAwesome Chevron-Right */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
    display: inline-block;
}

.mobile-nav.open ul li a {
    opacity: 1;
    transform: translateX(0);
}

/* Retardos progresivos (Staggered Animation) */
.mobile-nav ul li:nth-child(1) a { transition-delay: 0.1s; }
.mobile-nav ul li:nth-child(2) a { transition-delay: 0.18s; }
.mobile-nav ul li:nth-child(3) a { transition-delay: 0.26s; }
.mobile-nav ul li:nth-child(4) a { transition-delay: 0.34s; }

.mobile-nav ul li a:hover,
.mobile-nav ul li a.active {
    color: var(--color-accent) !important;
    box-shadow: none !important;
}

.mobile-nav ul li a:hover::after,
.mobile-nav ul li a.active::after {
    color: var(--color-accent);
    transform: translateX(4px);
}

/* Footer del Menú Móvil */
.mobile-nav-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 25px;
    width: 100%;
}

/* Botón WhatsApp responsivo de alta gama sin números ni chevrons */
.mobile-nav-footer .phone-btn {
    width: 100% !important;
    justify-content: center !important;
    background: var(--color-accent-gradient) !important;
    color: var(--color-bg-white) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    border-radius: var(--radius-full) !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: var(--shadow-accent) !important;
    transition: all 0.3s ease !important;
    border: none !important;
    text-align: center !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Asegurar exclusión de pseudo-elementos en el botón footer */
.mobile-nav-footer .phone-btn::before,
.mobile-nav-footer .phone-btn::after {
    display: none !important;
    content: none !important;
}

.mobile-nav-footer .phone-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 18px rgba(255, 122, 0, 0.35) !important;
}

.mobile-nav-footer .social-icons {
    display: flex;
    gap: 12px;
    margin-top: 5px;
    width: 100%;
    justify-content: center;
}

/* Redes sociales en círculos fluidos sin números ni chevrons */
.mobile-nav-footer .social-icons a {
    opacity: 1 !important;
    transform: none !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    font-size: 0.85rem !important;
    color: var(--color-bg-white) !important;
    transition: all 0.3s ease !important;
    padding: 0 !important;
    position: relative !important;
}

.mobile-nav-footer .social-icons a::before,
.mobile-nav-footer .social-icons a::after {
    display: none !important;
    content: none !important;
}

.mobile-nav-footer .social-icons a:hover {
    background: var(--color-accent) !important;
    border-color: var(--color-accent) !important;
    transform: translateY(-2px) !important;
    color: var(--color-bg-white) !important;
}

/* Hamburguesa Activa */
.hamburger.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ==========================================================================
   FOOTER PREMIUM
   ========================================================================== */
.main-footer {
    background-color: var(--color-dark);
    color: var(--color-text-light);
    border-top: 1px solid var(--border-glass);
    position: relative;
    z-index: 10;
}

.footer-top {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 80px 24px 40px 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1.5fr;
    gap: 40px;
}

.footer-column h3 {
    color: var(--color-bg-white);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--color-accent-gradient);
}

.footer-logo {
    height: 65px;
    width: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.footer-column p {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 16px;
    color: var(--color-text-light);
}

.footer-column ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-column ul a {
    font-size: 0.95rem;
    transition: var(--transition-fast);
    display: inline-block;
}

.footer-column ul a:hover {
    color: var(--color-accent);
    transform: translateX(4px);
}

.footer-column .contact-info-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.95rem;
    margin-bottom: 14px;
}

.footer-column .contact-info-list i {
    color: var(--color-accent);
    font-size: 1.1rem;
    margin-top: 3px;
}

.social-icons-footer {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.social-icons-footer a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-bg-white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

.social-icons-footer a:hover {
    background: var(--color-accent);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 122, 0, 0.3);
}

.footer-bottom {
    background-color: #030812;
    padding: 30px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.footer-legal-links {
    display: flex;
    gap: 16px;
}

.footer-legal-links a:hover {
    color: var(--color-accent);
}

/* ==========================================================================
   WHATSAPP FLOTANTE PREMIUM
   ========================================================================== */
.wa-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.wa-card {
    background-color: var(--color-bg-white);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: -15px;
    padding-right: 25px;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.wa-card-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: var(--color-bg-white);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 0.8rem;
}

.wa-card-info strong {
    display: block;
    color: var(--color-primary);
    font-size: 0.85rem;
    line-height: 1.2;
}

.wa-card-info p {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    line-height: 1.2;
}

.wa-circle {
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: var(--color-bg-white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.35);
    position: relative;
    transition: var(--transition-smooth);
}

.wa-circle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #25d366;
    border-radius: 50%;
    z-index: -1;
    animation: wa-pulse 2s infinite;
}

.wa-notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #ff3b30;
    color: var(--color-bg-white);
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--color-bg-white);
    box-shadow: var(--shadow-sm);
}

.wa-float-btn:hover .wa-card {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.wa-float-btn:hover .wa-circle {
    transform: scale(1.08) rotate(10deg);
}

@keyframes wa-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* ==========================================================================
   BANNER LEGAL DE PRIVACIDAD
   ========================================================================== */
.banner-legal {
    position: fixed;
    bottom: -150px;
    left: 0;
    width: 100%;
    background-color: var(--color-dark-card);
    border-top: 1px solid var(--border-glass);
    color: var(--color-text-light);
    z-index: 998;
    padding: 20px 24px;
    transition: var(--transition-smooth);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.25);
}

.banner-legal.mostrar {
    bottom: 0;
}

.banner-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.banner-content p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.banner-content a {
    color: var(--color-accent);
    text-decoration: underline;
}

.btn-banner {
    background: var(--color-accent-gradient);
    color: var(--color-bg-white);
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.btn-banner:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
}

/* ==========================================================================
   ANIMACIONES DE DESPLAZAMIENTO (SCROLL REVEAL ELÁSTICO)
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(50px) scale(0.94);
    transition: var(--transition-elastic);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px) scale(0.96);
    transition: var(--transition-elastic);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px) scale(0.96);
    transition: var(--transition-elastic);
}

.reveal.active,
.reveal-left.active,
.reveal-right.active {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* ==========================================================================
   TRANSICIÓN DE PÁGINA ARQUITECTÓNICA (SLIDING BLUEPRINT PANELS)
   ========================================================================== */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
    background: radial-gradient(circle, var(--color-primary-light) 0%, var(--color-dark) 100%);
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.transition-panel {
    display: none; /* Desactivar los divs de persianas anteriores */
}

/* Cuadrícula de papel técnico */
.transition-grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s ease;
    background-image: 
        linear-gradient(rgba(255, 122, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 122, 0, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center center;
}

/* Resplandor radial */
.transition-grid-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 122, 0, 0.12) 0%, transparent 70%);
    opacity: 0;
    z-index: 2;
    transition: opacity 0.5s ease;
}

/* Logo Oficial QYM en Carga */
.transition-logo-box {
    position: relative;
    z-index: 3;
    opacity: 0;
    transform: scale(0.3) rotate(-35deg);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 0 35px rgba(255, 122, 0, 0.5));
    display: flex;
    justify-content: center;
    align-items: center;
}

.transition-logo-box img {
    width: 170px;
    height: auto;
    object-fit: contain;
}

/* Radar circular en el logo */
.transition-logo-box::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 122, 0, 0.15);
    z-index: -1;
    opacity: 0;
}

body.is-transitioning .transition-logo-box::before {
    animation: transition-ripple-effect 1.8s infinite ease-out 0.6s;
}

@keyframes transition-ripple-effect {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.3);
        opacity: 0;
    }
}

/* --- ESTADO: BARRIDO DE ENTRADA AL NAVEGAR --- */
body.is-transitioning .page-transition-overlay {
    pointer-events: auto;
    clip-path: circle(150% at 50% 50%);
}

body.is-transitioning .transition-grid-bg {
    opacity: 1;
    transition-delay: 0.3s;
}

body.is-transitioning .transition-grid-bg::after {
    opacity: 1;
    animation: transition-scan-glow 1.5s infinite alternate ease-in-out;
}

body.is-transitioning .transition-logo-box {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition-delay: 0.2s;
}

/* --- ESTADO: BARRIDO DE SALIDA AL CARGAR PÁGINA --- */
body.page-loaded .page-transition-overlay {
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

body.page-loaded .transition-logo-box {
    opacity: 0;
    transform: scale(0.3) rotate(35deg);
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

body.page-loaded .transition-grid-bg {
    opacity: 0;
    transition-delay: 0s;
}

/* Zoom y desenfoque del contenido para el Portal 3D */
.main-header, main, section, footer, .subpage-hero, .split-section {
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.8s ease, filter 0.8s ease;
}

body.is-transitioning .main-header,
body.is-transitioning main,
body.is-transitioning section,
body.is-transitioning footer,
body.is-transitioning .subpage-hero,
body.is-transitioning .split-section {
    transform: scale(0.94);
    opacity: 0.3;
    filter: blur(4px);
}

body.page-loaded .main-header,
body.page-loaded main,
body.page-loaded section,
body.page-loaded footer,
body.page-loaded .subpage-hero,
body.page-loaded .split-section {
    transform: scale(1);
    opacity: 1;
    filter: blur(0px);
}

@keyframes transition-scan-glow {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1.3); opacity: 1; }
}



/* ==========================================================================
   SOPORTE RESPONSIVE (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1024px) {
    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    /* En tablet el menú de escritorio ya no cabe: usar hamburguesa */
    .nav-menu {
        display: none;
    }

    .hamburger {
        display: flex;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: var(--header-height-mobile);
    }

    .social-icons-header {
        display: none;
    }
    
    .main-header {
        background-color: var(--color-glass-dark);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border-glass);
    }
    
    /* Adaptar el logo en móviles */
    .logo-container a {
        padding: 0 !important;
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45)) !important;
    }
    
    .logo-img {
        height: 38px !important;
    }
    
    .main-header.scrolled .logo-img {
        height: 38px !important;
    }
    
    /* Ajustar espaciado superior en celulares para que no solape */
    .mobile-nav {
        padding-top: 85px !important;
    }
    
    .footer-top {
        grid-template-columns: 1fr;
        padding: 60px 20px 30px 20px;
        gap: 30px;
    }
    
    .footer-bottom {
        padding: 20px;
    }
    
    .footer-bottom-container {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .banner-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .wa-float-btn {
        bottom: 20px;
        right: 20px;
    }
    
    .wa-circle {
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
    }
    
    .wa-card {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 16px;
    }

    /* Botón de WhatsApp del header solo con ícono para no desbordar */
    .header-right {
        gap: 14px;
    }

    .header-right .phone-btn {
        font-size: 0;
        gap: 0;
        padding: 10px 13px;
    }

    .header-right .phone-btn i {
        font-size: 1.15rem;
    }

    .footer-top {
        padding: 50px 16px 24px 16px;
    }

    .banner-legal {
        padding: 16px;
    }

    .banner-content p {
        font-size: 0.82rem;
    }
}
