/* ========== MENÚ DESPLEGABLE DE USUARIO (CLASES ÚNICAS) ========== */
.wd-user-dropdown {
    position: relative;
    display: inline-block;
}

.wd-user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.wd-user-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wd-user-name {
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wd-dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.wd-user-dropdown.active .wd-dropdown-arrow {
    transform: rotate(180deg);
}

.wd-user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
    overflow: hidden;
}

.wd-user-dropdown.active .wd-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wd-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.wd-menu-item i {
    width: 20px;
    font-size: 16px;
    color: #666;
    transition: color 0.2s ease;
}

.wd-menu-item:hover {
    background: #f8f9fa;
    color: #ff6b35;
}

.wd-menu-item:hover i {
    color: #ff6b35;
}

.wd-menu-divider {
    height: 1px;
    background: #e9ecef;
    margin: 6px 0;
}

.wd-logout-item {
    color: #dc3545;
}

.wd-logout-item i {
    color: #dc3545;
}

.wd-logout-item:hover {
    background: #fff5f5;
    color: #dc3545;
}

.wd-logout-item:hover i {
    color: #dc3545;
}

.wd-user-guest {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.1);
}

/* Flecha arriba del menú */
.wd-user-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

/* Animación */
@keyframes wdDropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wd-user-dropdown.active .wd-user-menu {
    animation: wdDropdownFadeIn 0.2s ease;
}

/* ========== VERSIÓN MÓVIL - POPUP NORMAL (NO BOTTOM SHEET) ========== */
@media (max-width: 768px) {
    .wd-user-name {
        max-width: 80px;
        font-size: 13px;
    }
    
    .wd-user-trigger {
        padding: 6px 10px;
        gap: 6px;
    }
    
    /* En móvil el menú sigue siendo un popup flotante, no ocupa toda la pantalla */
    .wd-user-menu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: auto;
        min-width: 180px;
        width: auto;
        border-radius: 12px;
        bottom: auto;
        transform: translateY(-10px);
    }
    
    .wd-user-dropdown.active .wd-user-menu {
        transform: translateY(0);
    }
    
    /* La flecha sigue visible en móvil */
    .wd-user-menu::before {
        display: block;
        right: 15px;
    }
    
    .wd-menu-item {
        padding: 12px 16px;
        justify-content: flex-start;
        font-size: 14px;
    }
    
    .wd-menu-item i {
        font-size: 16px;
    }
    
    .wd-dropdown-arrow {
        font-size: 10px;
    }
}

/* Para tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .wd-user-name {
        max-width: 100px;
    }
}

/* Ajuste para pantallas muy pequeñas */
@media (max-width: 480px) {
    .wd-user-menu {
        min-width: 160px;
        right: -10px;
    }
    
    .wd-user-menu::before {
        right: 18px;
    }
    
    .wd-user-name {
        max-width: 60px;
        font-size: 12px;
    }
    
    .wd-user-trigger {
        padding: 5px 8px;
        gap: 5px;
    }
}