/* ============================================================
   UBM ELITE HEADER (Isolated Component)
   [Updated: 2026-02-19 T14:48]
   ============================================================ */

.ubm-elite-header {
    position: sticky;
    top: 0;
    z-index: 100 !important;
    width: 100%;
    height: 90px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ubm-elite-header.scrolled {
    height: 72px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.ubm-header-container {
    width: 100%;
    max-width: 1400px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    /* Logo | Nav | CTA */
    align-items: center;
    gap: 2rem;
}

/* 1. Brand Identity */
.ubm-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 2;
    justify-self: start;
}

.ubm-brand img {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: height 0.4s ease;
}

.ubm-elite-header.scrolled .ubm-brand img {
    height: 42px;
}

/* 2. Navigation Core */
.ubm-nav-core {
    justify-self: center;
    height: 100%;
    display: flex;
    align-items: center;
}

.ubm-nav-list {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    /* Space between groups */
    list-style: none;
    margin: 0;
    padding: 0;
}

.ubm-nav-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.03);
    padding: 4px;
    border-radius: 99px;
    gap: 2px;
}

.ubm-nav-group .ubm-nav-link {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.ubm-nav-group .ubm-nav-link:hover,
.ubm-nav-group .ubm-nav-link.active {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    color: var(--color-blue);
}

/* Premium Contact Button */
.ubm-nav-group .ubm-nav-link.nav-contact-premium {
    background: var(--color-blue);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    padding: 8px 20px;
}

.ubm-nav-group .ubm-nav-link.nav-contact-premium:hover {
    background: var(--color-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    color: #fff;
}

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

.ubm-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: var(--color-text-secondary);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: 99px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ubm-nav-link:hover,
.ubm-nav-link.active {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.04);
}

.ubm-nav-link i {
    font-size: 10px;
    opacity: 0.5;
    margin-top: 2px;
    transition: transform 0.3s ease;
}

.ubm-nav-item:hover .ubm-nav-link i {
    transform: rotate(180deg);
}

/* 3. Dropdown Engine (Absolute Isolation) */
.ubm-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 280px;
    padding: 8px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
    z-index: 1000;
}

/* Hover Bridge (Prevents closing when moving cursor) */
.ubm-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -30px;
    left: -10%;
    width: 120%;
    height: 40px;
    background: transparent;
    display: block;
}

/* Reveal Logic */
.ubm-nav-item:hover .ubm-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.ubm-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.ubm-menu-item:hover {
    background: var(--color-bg-alt);
}

.menu-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-blue-subtle);
    color: var(--color-blue);
    border-radius: 8px;
    font-size: 14px;
    flex-shrink: 0;
}

.menu-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu-title {
    color: var(--color-text);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}

.menu-desc {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    line-height: 1.3;
}

/* 4. Action Area */
.ubm-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.ubm-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 28px;
    height: 48px;
    background: var(--color-blue);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: 99px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease;
}

.ubm-cta:hover {
    background: var(--color-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    color: #fff;
}

/* Mobile Overrides (Simple) */
.ubm-mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text);
    cursor: pointer;
}

@media (max-width: 1100px) {
    .ubm-header-container {
        padding: 0 15px;
        height: 70px;
        gap: 1rem;
        grid-template-columns: auto 1fr auto;
    }

    .ubm-elite-header.scrolled {
        height: 64px;
    }

    .ubm-brand img {
        height: 36px;
    }

    /* Mobile Nav Drawer */
    .ubm-nav-core {
        display: none;
        /* Hidden by default */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        padding: 1rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        height: auto;
        overflow-y: auto;
        max-height: 80vh;
    }

    .ubm-nav-core.mobile-active {
        display: block !important;
        animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .ubm-nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    /* Reset Groups on Mobile */
    .ubm-nav-group {
        flex-direction: column;
        align-items: stretch;
        background: transparent;
        padding: 0;
        gap: 0.5rem;
        border-radius: 0;
    }

    .ubm-nav-item {
        width: 100%;
        display: block;
        height: auto;
    }

    .ubm-nav-link {
        width: 100%;
        justify-content: space-between;
        padding: 14px 16px;
        border-radius: 12px;
        background: transparent;
        font-size: 1rem;
        /* Restore font size */
    }

    .ubm-nav-link:hover,
    .ubm-nav-link.active {
        background: var(--color-bg-alt);
        box-shadow: none;
        color: var(--color-text);
    }

    /* Mobile Dropdown Reset */
    .ubm-dropdown-menu {
        position: static;
        width: 100%;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        padding: 0 0 0 1rem;
        display: none;
        /* Managed by JS slideToggle */
        transition: none;
        background: transparent;
        pointer-events: auto;
    }

    .ubm-nav-item:hover .ubm-dropdown-menu {
        /* Disable hover reveal on mobile */
        transform: none;
    }

    .ubm-menu-item {
        padding: 10px;
        background: transparent;
    }

    .menu-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Mobile Actions */
    .ubm-actions {
        gap: 0.75rem;
    }

    .ubm-cta {
        padding: 0 16px;
        height: 40px;
        font-size: 0.85rem;
    }

    .ubm-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--color-bg-alt);
        border-radius: 50%;
        border: none;
        font-size: 1.25rem;
        color: var(--color-text);
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .ubm-mobile-toggle:hover,
    .ubm-mobile-toggle.active {
        background: var(--color-blue-subtle);
        color: var(--color-blue);
    }
}

/* ============================================================
   ROBUST SEARCH OVERLAY
   ============================================================ */
.ubm-search-toggle {
    background: var(--color-bg-alt);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ubm-search-toggle:hover {
    background: var(--color-blue-subtle);
    color: var(--color-blue);
    transform: scale(1.05);
}

.ubm-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ubm-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-close {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: var(--color-bg-alt);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-secondary);
    font-size: 1.5rem;
    transition: all 0.2s ease;
}

.search-overlay-close:hover {
    background: #f1f1f1;
    color: var(--color-text);
    transform: rotate(90deg);
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    border-bottom: 2px solid var(--color-blue);
    padding: 10px 0;
}

.search-input-wrapper input {
    width: 100%;
    background: none;
    border: none;
    font-size: 2.5rem;
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--color-text);
    padding-right: 60px;
}

.search-input-wrapper input:focus {
    outline: none;
}

.search-submit {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-blue);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.search-submit:hover {
    transform: translateY(-50%) translateX(5px);
}

.suggestion-tag {
    padding: 8px 20px;
    background: var(--color-bg-alt);
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: 99px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.suggestion-tag:hover {
    background: var(--color-blue);
    color: #fff;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .search-input-wrapper input {
        font-size: 1.5rem;
    }
    .search-overlay-close {
        top: 20px;
        right: 20px;
    }
}