/* ==========================================================================
   HUD.CSS — MOSHI APEX v5.4 (BACKUP-V5 RECONSTRUCTION)
   Fidelidad 1:1 con el diseño original perfecto.
   ========================================================================== */

:root {
    --c-bg: #05050d;
    --c-cyan: #00f3ff;
    --c-magenta: #ff00ff;
    --c-glass: rgba(0, 0, 0, 0.75);
    --c-border: rgba(0, 243, 255, 0.3);
    --font-main: 'Inter', sans-serif;
    --font-apex: 'Orbitron', sans-serif;
}

.site-header.moshi-apex-navigation {
    position: relative;
    top: 0;
    width: 100%;
    z-index: 10000;
    background: transparent;
}

/* === HUD BAR ARCHITECTURE === */
.moshi-hud-bar {
    position: relative;
    height: 100px; 
    background: #000;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 50px rgba(0,0,0,0.9);
    overflow: hidden;
}

.moshi-hud-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0px, transparent 1px, transparent 2px);
    pointer-events: none;
    z-index: 2;
}

.hud-main-container {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 60px;
    z-index: 10;
    position: relative;
}

.hud-unit { display: flex; align-items: center; }

/* 1. LOGO HUB (IZQUIERDA) */
.logo-hub { flex: 0 0 auto; margin-right: 30px; }
.avatar-frame-v30 {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    position: relative;
    background: #000 !important;
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.45) !important;
    z-index: 1;
    overflow: visible !important;
    display: block !important;
}

/* Anillo de Color Cónico (Clon Móvil) */
.avatar-frame-v30::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 3px; /* Igual que celular */
    border-radius: 50%;
    background: conic-gradient(from 0deg, #00f3ff, #ff00f7, #8b5cf6, #00f3ff) !important;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: cosmicSpin 4s linear infinite;
    z-index: 10; /* Por encima de la imagen */
}

/* Anillo Negro de Separación (Clon Móvil) */
.avatar-frame-v30::after {
    content: "";
    position: absolute;
    inset: 3px; /* Igual que celular */
    border: 1.5px solid #000 !important; /* Igual que celular */
    border-radius: 50%;
    z-index: 11; /* Máxima prioridad */
    pointer-events: none;
}

.avatar-frame-v30 img, 
.avatar-frame-v30 .custom-logo-link,
.avatar-frame-v30 .custom-logo-link img {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    /* translateZ(0) fuerza renderizado GPU nítido y evita el blur de subpíxeles */
    transform: translate(-50%, -50%) translateZ(0) !important;
    width: 74px !important; 
    height: 74px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 5 !important;
    
    /* Optimizaciones de nitidez */
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
    backface-visibility: hidden !important;
    -webkit-font-smoothing: subpixel-antialiased !important;
}

.avatar-frame-v30 .custom-logo-link {
    width: 100% !important;
    height: 100% !important;
}

/* 2 & 3. HUD PILLS (Social & Clock) */
.social-pod { 
    position: absolute;
    left: 24%; 
    transform: translateX(-50%);
}
.clock-pod { position: absolute; left: 50%; transform: translateX(-50%); }

.pill-container {
    background: rgba(10, 10, 20, 0.9);
    position: relative;
    border-radius: 40px;
    padding: 8px 25px;
    display: flex;
    align-items: center;
    gap: 18px;
    backdrop-filter: blur(20px);
    border: 2px solid transparent;
    background-image: linear-gradient(#000, #000), linear-gradient(90deg, var(--c-cyan), var(--c-magenta));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 5px 20px rgba(0,0,0,0.6);
}

.pill-container a { display: flex; transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.pill-container a svg { width: 22px; height: 22px; }

.link-fb { color: #1877F2 !important; filter: drop-shadow(0 0 8px #1877F2); }
.link-ig { color: #fff !important; background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); -webkit-background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 0 5px #dc2743); }
.link-tk { filter: drop-shadow(0 0 8px #00f3ff) drop-shadow(2px 0 0 #ff0055) drop-shadow(-2px 0 0 #00f3ff); }
.link-wa { color: #25D366 !important; filter: drop-shadow(0 0 8px #25D366); }

.clock-pod .pill-container { padding: 10px 55px; }
.clock-display { 
    display: flex; 
    align-items: center; 
    gap: 25px;
    font-family: var(--font-apex); 
    font-weight: 700; 
}
.c-val { font-size: 15px; text-shadow: 0 0 10px var(--c-cyan); color: #fff; }
.c-label { font-size: 11px; color: var(--c-cyan); opacity: 0.8; letter-spacing: 1.5px; font-weight: 800; }
.c-dot { 
    width: 6px; 
    height: 6px; 
    background: var(--c-magenta); 
    border-radius: 50%; 
    box-shadow: 0 0 10px var(--c-magenta);
    animation: breathingDot 2.5s ease-in-out infinite;
}

@keyframes breathingDot {
    0%, 100% { transform: scale(0.8); opacity: 0.4; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 20px var(--c-magenta); }
}

/* 4. NAVIGATION MATRIX */
.nav-matrix { flex: 0 0 auto; margin-left: auto; }
.matrix-menu ul { list-style: none; display: flex; gap: 35px; }
.matrix-menu a {
    position: relative; 
    font-family: var(--font-apex);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    text-transform: uppercase;
    text-decoration: none !important;
    transition: 0.4s;
    opacity: 0.9;
    padding-bottom: 8px;
}

.matrix-menu a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, var(--c-cyan), var(--c-magenta));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.65, 0.05, 0.36, 1);
    box-shadow: 0 0 10px var(--c-cyan);
}

.matrix-menu a:hover { color: var(--c-cyan); opacity: 1; }
.matrix-menu a:hover::after { transform: scaleX(1); transform-origin: left; }

/* FX Visuales */
.moshi-nebula-fx { 
    position: absolute; 
    inset: 0; 
    background: 
    radial-gradient(circle at 10% 50%, rgba(0, 180, 255, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 50%, rgba(188, 24, 136, 0.12) 0%, transparent 45%); 
    opacity: 1; 
    z-index: 1;
}
.moshi-energy-sweep { 
    position: absolute; 
    bottom: 0; left: 0; width: 100%; height: 2px; 
    background: linear-gradient(90deg, var(--c-cyan), var(--c-magenta), var(--c-cyan));
    background-size: 200% 100%;
    animation: accHeaderSweep 4s linear infinite;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
    opacity: 0.9;
}

@keyframes accHeaderSweep {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* === RESPONSIVE MOBILE === */
@media (max-width: 921px) {
    .site-header.moshi-apex-navigation {
        position: relative !important;
        background: #000 !important;
    }
    .moshi-hud-bar {
        height: 80px;
        overflow: visible; 
        display: flex;
        flex-direction: column;
    }

    .hud-main-container {
        padding: 0;
        height: 100%;
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .logo-hub { display: none !important; }

    .clock-pod {
        display: flex !important;
        position: relative !important;
        left: 0 !important;
        transform: none !important;
        margin: 0 !important;
    }
    .clock-pod .pill-container {
        padding: 8px 35px !important;
        transform: scale(0.9) !important;
    }

    .social-pod {
        display: flex !important;
        position: absolute !important;
        top: 95px; 
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin: 0 !important;
        z-index: 10;
    }

    .social-pod .pill-container {
        padding: 10px 25px;
        background: rgba(10, 10, 20, 0.9);
        gap: 20px;
        transform: scale(0.85);
        border: 2px solid transparent;
        background-image: linear-gradient(#000, #000), linear-gradient(90deg, var(--c-cyan), var(--c-magenta));
        background-origin: border-box;
        background-clip: padding-box, border-box;
    }

    .nav-matrix { display: none !important; }
}

/* === CYBER-CART FLOAT TRIGGER === */
#moshi-cart-float-trigger,
.moshi-cart-float-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    background: #000 !important;
    border: 2px solid var(--c-cyan) !important;
    border-radius: 50%;
    color: var(--c-cyan) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3), inset 0 0 10px rgba(0, 243, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
    overflow: visible;
}

#moshi-cart-float-trigger:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--c-cyan) !important;
    color: #000 !important;
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.6);
}

.moshi-cart-float-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moshi-cart-float-icon svg {
    width: 100%;
    height: 100%;
}

.moshi-cart-float-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--c-magenta);
    color: #fff;
    font-family: var(--font-apex);
    font-size: 12px;
    font-weight: 800;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 0 15px var(--c-magenta);
    animation: cartBadgePulse 2s infinite;
}

@keyframes cartBadgePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.9; }
}

/* === FIX GLOBAL: ESPACIO DE SEGURIDAD PARA BARRA INFERIOR === */
@media (max-width: 921px) {
    body.moshi-apex-os {
        padding-bottom: 90px !important; /* Espacio para que la barra no tape el contenido */
    }
    
    /* Demolición de márgenes de Astra en todo el sitio */
    .moshi-apex-os .site-content,
    .moshi-apex-os #primary,
    .moshi-apex-os #main {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }
}

/* Ocultar Social Pod en páginas que no sean Home solo en celulares, manteniéndolo siempre visible en PC */
@media (max-width: 921px) {
    body:not(.home) .social-pod {
        display: none !important;
    }
    /* Pero forzamos que el contenedor del HUD mantenga su integridad visual */
    body:not(.home) .moshi-hud-bar {
        margin-bottom: 0;
    }
}
