/* ========================================
   HEADER MÓVIL NUEVO - CODIGOAMIGO.COM
   Diseño moderno desde cero para móvil
   ======================================== */

/* Variables móviles */
:root {
    --mobile-bg: #000000;
    --mobile-text: #ffffff;
    --mobile-accent: #ff6b35;
    --mobile-border: #333333;
    --mobile-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    --mobile-radius: 8px;
    --mobile-transition: all 0.3s ease;
}

/* HEADER MÓVIL PRINCIPAL */
@media (max-width: 768px) {
    .header-modern.mobile-only {
        background: var(--mobile-bg);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        height: 50px;
        box-shadow: var(--mobile-shadow);
        display: flex;
        align-items: center;
        padding: 0 8px;
    }
    
    .header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: 50px;
        gap: 8px;
        padding: 0 8px;
    }
    
    /* LOGO MÓVIL */
    .logo-section {
        display: flex;
        align-items: center;
        text-decoration: none;
        color: var(--mobile-text);
        flex-shrink: 0;
    }
    
    .logo-text {
        font-size: 1.3rem;
        font-weight: 800;
        line-height: 1;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 2px;
    }
    
    .logo-codigo {
        color: var(--mobile-text);
    }
    
    .logo-amigo {
        color: var(--mobile-accent);
    }
    
    .logo-tagline {
        display: none; /* Oculto en móvil para compactación */
    }
    
    /* BÚSQUEDA MÓVIL */
    .search-header {
        flex: 1;
        max-width: 200px;
        margin: 0 10px;
    }
    
    .search-input-wrapper {
        position: relative;
        width: 100%;
    }
    
    .search-input-header {
        width: 100%;
        height: 32px;
        padding: 0 30px 0 25px;
        border: 1px solid var(--mobile-border);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.1);
        color: var(--mobile-text);
        font-size: 0.8rem;
        outline: none;
        transition: var(--mobile-transition);
    }
    
    .search-input-header:focus {
        border-color: var(--mobile-accent);
        background: rgba(255, 255, 255, 0.15);
    }
    
    .search-input-header::placeholder {
        color: #999;
        font-size: 0.75rem;
    }
    
    .search-icon {
        position: absolute;
        left: 8px;
        top: 50%;
        transform: translateY(-50%);
        color: #999;
        font-size: 0.8rem;
    }
    
    .search-btn {
        position: absolute;
        right: 4px;
        top: 50%;
        transform: translateY(-50%);
        width: 24px;
        height: 24px;
        background: var(--mobile-accent);
        border: none;
        border-radius: 50%;
        color: white;
        font-size: 0.7rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--mobile-transition);
    }
    
    .search-btn:hover {
        background: #e55a2b;
        transform: translateY(-50%) scale(1.1);
    }
    
    /* PERFIL DE USUARIO MÓVIL */
    .user-profile-mobile {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--mobile-accent);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 0.9rem;
        cursor: pointer;
        flex-shrink: 0;
        transition: var(--mobile-transition);
    }
    
    .user-profile-mobile:hover {
        background: #e55a2b;
        transform: scale(1.05);
    }
    
    .user-profile-mobile img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }
    
    /* BOTÓN DE MENÚ HAMBURGUESA */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 24px;
        height: 20px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
        transition: var(--mobile-transition);
    }
    
    .mobile-menu-toggle:hover {
        transform: scale(1.05);
    }
    
    .mobile-menu-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--mobile-text);
        border-radius: 2px;
        transition: var(--mobile-transition);
    }
    
    /* Animación del botón de hamburguesa */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
    
    /* MENÚ DESPLEGABLE MÓVIL */
    .mobile-menu {
        position: fixed;
        top: 50px;
        left: 0;
        width: 100%;
        height: calc(100vh - 50px);
        background: var(--mobile-bg);
        transform: translateX(100%);
        transition: var(--mobile-transition);
        z-index: 999;
        overflow-y: auto;
        padding: 20px;
    }
    
    .mobile-menu.show {
        transform: translateX(0);
    }
    
    .mobile-menu-content {
        padding-bottom: 2rem;
    }
    
    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        gap: 15px;
        margin-top: 20px;
    }
    
    .mobile-nav-link {
        color: var(--mobile-text);
        text-decoration: none;
        font-size: 1.1rem;
        padding: 15px 20px;
        border-radius: var(--mobile-radius);
        transition: var(--mobile-transition);
        display: block;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--mobile-border);
    }
    
    .mobile-nav-link:hover {
        background: rgba(255, 107, 53, 0.2);
        color: var(--mobile-accent);
        border-color: var(--mobile-accent);
    }
    
    /* Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        display: none;
    }
    
    .mobile-menu-overlay.show {
        display: block;
    }
    
    /* Ajustar margen del body */
    body {
        margin-top: 50px !important;
    }
    
    /* Ajustes para pantallas muy pequeñas */
    @media (max-width: 480px) {
        .header-modern.mobile-only {
            height: 45px;
            padding: 0 6px;
        }
        
        .header-container {
            height: 45px;
            gap: 6px;
            padding: 0 6px;
        }
        
        .logo-text {
            font-size: 1.1rem;
        }
        
        .search-header {
            max-width: 150px;
            margin: 0 5px;
        }
        
        .search-input-header {
            height: 28px;
            font-size: 0.75rem;
        }
        
        .user-profile-mobile {
            width: 28px;
            height: 28px;
        }
        
        .mobile-menu {
            top: 45px;
            height: calc(100vh - 45px);
        }
        
        body {
            margin-top: 45px !important;
        }
    }
    
    @media (max-width: 360px) {
        .header-modern.mobile-only {
            height: 40px;
            padding: 0 4px;
        }
        
        .header-container {
            height: 40px;
            gap: 4px;
            padding: 0 4px;
        }
        
        .logo-text {
            font-size: 1rem;
        }
        
        .search-header {
            max-width: 120px;
            margin: 0 3px;
        }
        
        .search-input-header {
            height: 26px;
            font-size: 0.7rem;
        }
        
        .user-profile-mobile {
            width: 26px;
            height: 26px;
        }
        
        .mobile-menu {
            top: 40px;
            height: calc(100vh - 40px);
        }
        
        body {
            margin-top: 40px !important;
        }
    }
}

/* OCULTAR HEADER DESKTOP EN MÓVIL */
@media (max-width: 768px) {
    .header-modern.desktop-only {
        display: none !important;
    }
}

/* MOSTRAR HEADER DESKTOP EN PANTALLAS GRANDES */
@media (min-width: 769px) {
    .header-modern.desktop-only {
        display: block !important;
    }
    
    .header-modern.mobile-only {
        display: none !important;
    }
    
    body {
        margin-top: 0 !important;
    }
}
