/* * header_app.css
 * Estilos completos para el header tipo App SaaS
 */

:root {
    /* Paleta de Colores Profesional */
    --app-bg: #ffffff;
    --app-text: #334155;        /* Slate 700 */
    --app-text-light: #64748b;  /* Slate 500 */
    --app-primary: #2563eb;     /* Blue 600 */
    --app-primary-hover: #1d4ed8;
    --app-accent: #0f172a;      /* Slate 900 (Titulos, logos) */
    --app-border: #e2e8f0;      /* Slate 200 */
    --app-hover-bg: #f1f5f9;    /* Slate 100 */
    
    --app-header-height: 70px;
    --app-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Reset Básico para el Header */
.app-header * {
    box-sizing: border-box;
}

.app-header {
    background-color: var(--app-bg);
    height: var(--app-header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--app-shadow);
    border-bottom: 1px solid var(--app-border);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- LOGO AREA --- */
.app-logo-area {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 5px 0;
}

.app-logo {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
    margin-right: 20px;
}

.app-logo img {
    height: auto !important;
    max-height: 45px !important; /* Ajustado para un look más refinado */
    width: auto !important;
    object-fit: contain;
}

/* Botón Hamburguesa (Móvil) */
.app-mobile-toggle {
    display: none; /* Oculto en escritorio */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--app-text);
    cursor: pointer;
    padding: 0.5rem;
}

/* --- NAVEGACIÓN PRINCIPAL --- */
.app-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Espacio entre items */
    height: 100%;
}

.app-nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--app-text);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    height: 40px; /* Altura consistente para botones */
}

.app-nav-link:hover, .app-nav-item.active .app-nav-link {
    color: var(--app-primary);
    background-color: var(--app-hover-bg);
}

.app-nav-link i {
    font-size: 1.1rem;
    color: var(--app-text-light);
}

.app-nav-link:hover i, .app-nav-item.active .app-nav-link i {
    color: var(--app-primary);
}

.dropdown-arrow {
    font-size: 0.75rem !important;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.app-nav-item.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* --- ESTILO ESPECIAL PARA SOCIOS --- */
.socios-link {
    color: #475569 !important; /* Un gris oscuro elegante */
    font-weight: 600;
}
.socios-link:hover {
    color: var(--app-primary) !important;
    background-color: #eff6ff; /* Azul muy claro */
}
.socios-link i {
    color: #f59e0b !important; /* Icono dorado/ámbar para denotar exclusividad */
}

/* --- DROPDOWNS --- */
.app-dropdown {
    position: absolute;
    top: calc(100% - 5px); /* Justo debajo */
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1001;
    overflow: hidden;
}

.app-nav-item.active .app-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Mega Menú */
.mega-menu {
    width: 900px; /* Ancho fijo amplio */
    padding: 20px;
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.mega-menu-col h4 {
    color: var(--app-accent);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--app-hover-bg);
    padding-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mega-menu-item {
    display: block;
    color: var(--app-text-light);
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.15s;
    margin-bottom: 2px;
}

.mega-menu-item:hover {
    color: var(--app-primary);
    background-color: var(--app-hover-bg);
}

.badge-hot {
    background-color: #ef4444;
    color: white;
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
}

/* Dropdown Simple */
.simple-dropdown {
    width: 240px;
    padding: 8px 0;
    left: 0;
    transform: translateY(10px); /* Reset del translateX center */
}

.app-nav-item.active .simple-dropdown {
    transform: translateY(0);
}

/* Alineación derecha para menú de usuario */
.dropdown-right {
    left: auto;
    right: 0;
}

.dropdown-header {
    padding: 8px 16px;
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: var(--app-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background-color: var(--app-hover-bg);
    color: var(--app-primary);
}

.dropdown-item.danger:hover {
    background-color: #fef2f2;
    color: #ef4444;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--app-border);
    margin: 6px 0;
}

/* --- CTA BUTTON --- */
.app-cta-button {
    background-color: var(--app-primary);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 50px; /* Redondo */
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.app-cta-button:hover {
    background-color: var(--app-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(37, 99, 235, 0.3);
}

.app-cta-button:active {
    transform: translateY(0);
}

/* --- USER AREA --- */
.app-user-area {
    display: flex;
    align-items: center;
    gap: 15px;
    height: 100%;
}

/* WhatsApp Pulse */
.app-whatsapp-pulse {
    color: #25D366;
    font-size: 1.5rem;
    animation: pulse-green 2s infinite;
    text-decoration: none;
}

@keyframes pulse-green {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Tokens */
.app-tokens {
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #fffbeb;
    color: #b45309;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #fcd34d;
}

.app-tokens.zero {
    filter: grayscale(1);
    opacity: 0.7;
}

/* Avatar de Usuario */
.app-user-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.app-user-avatar {
    width: 38px;
    height: 38px;
    background-color: var(--app-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Botones Auth (Invitado) */
.app-auth-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-btn-login {
    color: var(--app-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 6px 12px;
}

.app-btn-login:hover {
    color: var(--app-primary);
}

.app-btn-register {
    background-color: var(--app-accent);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.app-btn-register:hover {
    opacity: 0.9;
}

/* --- RESPONSIVE / MOBILE --- */
@media (max-width: 1024px) {
    .app-mobile-toggle {
        display: block;
    }

    .app-nav {
        position: fixed;
        top: var(--app-header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background-color: white;
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        gap: 0;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        border-top: 1px solid var(--app-border);
    }

    .app-nav.active {
        transform: translateX(0);
    }

    .app-nav-item {
        height: auto;
        display: block;
        width: 100%;
        border-bottom: 1px solid var(--app-border);
    }

    .app-nav-link {
        width: 100%;
        justify-content: space-between;
        padding: 15px 10px;
        height: auto;
    }
    
    .app-cta-button {
        margin-top: 20px;
        justify-content: center;
        width: 100%;
    }

    /* Reset Dropdowns en Mobile */
    .app-dropdown, .mega-menu, .simple-dropdown {
        position: static;
        width: 100%;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        display: none; /* JS lo hará block */
        padding-left: 20px;
        background-color: #f8fafc;
    }

    .app-nav-item.active .app-dropdown {
        display: block;
    }

    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}