/* ================================
   AIBD USER DROPDOWN (FINAL CLEAN)
   Source of truth: shortcode aibd_user_dropdown
================================ */

/* ===== Container ===== */
.aibd-header-user {
    position: relative;
}

/* ===== Button (avatar) ===== */
.aibd-user-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.aibd-user-btn img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* ===== Dropdown Menu ===== */
.aibd-user-menu {
    position: absolute;
    top: 44px;
    right: 0;
    min-width: 160px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    display: none;
    z-index: 9999;
}

/* show when open */
.aibd-header-user.open .aibd-user-menu {
    display: block;
}

/* ===== Menu links ===== */
.aibd-user-menu a {
    display: block;
    padding: 12px 16px;
    font-size: 14px;
    color: #111;
    text-decoration: none;
}

.aibd-user-menu a:hover {
    background: #f3f6fa;
}

/* logout */
.aibd-user-menu a.logout {
    color: #d32f2f;
}

/* ===== Mobile safety ===== */
@media (max-width: 768px) {
    .aibd-user-menu {
        right: 0;
        left: auto;
    }
}

/* ================================
   ASTRA CONFLICT KILLER
================================ */

/* Hide Astra default account / login UI */
.ast-header-account,
.ast-header-account-wrap,
.ast-header-profile,
header .ast-header-widget-area,
header .wp-block-loginout,
header .menu-item-account,
header .menu-item-login {
    display: none !important;
}

/* Astra header overflow fix */
.ast-primary-header-bar,
.ast-builder-grid-row {
    overflow: visible !important;
}

/* Strong Astra header-builder override: force the shortcode dropdown to be
   fixed, vertical and visible when open. This uses very specific selectors
   and !important to beat Astra's dynamic CSS. */
.ast-header-html .ast-builder-html-element .aibd-user-inline .user-dropdown,
.ast-header-html-1 .ast-builder-html-element .aibd-user-inline .user-dropdown,
.ast-header-html-2 .ast-builder-html-element .aibd-user-inline .user-dropdown {
    position: fixed !important;
    top: 56px !important;
    right: 24px !important;
    left: auto !important;
    width: 200px !important;
    display: none !important;
    flex-direction: column !important;
    z-index: 200000 !important;
    pointer-events: auto !important;
}

.ast-header-html .ast-builder-html-element .aibd-user-inline.open .user-dropdown,
.ast-header-html-1 .ast-builder-html-element .aibd-user-inline.open .user-dropdown,
.ast-header-html-2 .ast-builder-html-element .aibd-user-inline.open .user-dropdown {
    display: flex !important;
}

/* Ensure the trigger is interactive and not collapsed by header flex rules */
.ast-header-html .ast-builder-html-element .aibd-user-inline .user-trigger {
    display: inline-flex !important;
    align-items: center !important;
    cursor: pointer !important;
}
