.acgh-header,
.acgh-header * {
    box-sizing: border-box;
}

.acgh-header {
    position: relative;
    z-index: 1000;
    width: 100%;
    padding: 14px 24px;
    border-bottom: 1px solid #eef3fa;
    background: #ffffff;
}

.acgh-header.acgh-is-sticky {
    position: sticky;
    top: 0;
    z-index: 99990;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/*
 * A backdrop-filter/transform/filter on an ancestor establishes a containing
 * block for position:fixed descendants in modern browsers. When the hamburger
 * lives inside the sticky Global Header, that can make the overlay/panel use the
 * header's ~80px box as their viewport (the short white panel seen in staging).
 *
 * The menu script already adds `alsarhan-menu-lock` to <html>/<body> while open,
 * so temporarily neutralize containing-block creators and explicitly size the
 * off-canvas surfaces to the visual viewport. Sticky/Fixed header behavior and
 * the blur effect return immediately after the menu closes.
 */
html.alsarhan-menu-lock .acgh-header.acgh-is-sticky {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    transform: none !important;
    perspective: none !important;
    contain: none !important;
    will-change: auto !important;
    overflow: visible !important;
}

html.alsarhan-menu-lock .acgh-header .alsarhan-menu-overlay {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
}

html.alsarhan-menu-lock .acgh-header .alsarhan-menu-panel {
    position: fixed !important;
    top: 0 !important;
    bottom: auto !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
}

.acgh-inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
    gap: 18px;
}

.acgh-brand {
    min-width: 0;
    flex: 0 1 auto;
}

.acgh-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    color: inherit;
    text-decoration: none;
}

.acgh-logo {
    display: inline-flex;
    flex: 0 0 auto;
}

.acgh-logo img {
    display: block;
    width: 54px;
    max-width: 100%;
    height: auto;
}

.acgh-brand-copy {
    display: inline-flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.acgh-brand-name {
    color: #1f2937;
    font-size: 17px;
    font-weight: 800;
    white-space: nowrap;
}

.acgh-brand-subtitle {
    margin-top: 3px;
    color: #7c8798;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.acgh-menu {
    flex: 0 0 auto;
}

.acgh-menu .alsarhan-hamburger-menu-widget,
.acgh-menu .alsarhan-menu-toggle {
    display: inline-flex !important;
}

.acgh-menu .alsarhan-menu-toggle {
    min-height: 42px;
    padding: 10px 15px;
    border-color: #e5eaf2;
    border-radius: 999px;
    box-shadow: 0 5px 18px rgba(15, 23, 42, .06);
}

.acgh-menu .alsarhan-menu-toggle:hover,
.acgh-menu .alsarhan-menu-toggle:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .1);
}

.acgh-actions {
    display: flex;
    flex: 0 0 auto;
    min-width: 1px;
    margin-inline-start: auto;
}

.acgh-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 12px 18px;
    border-radius: 9px;
    background: #1769e0;
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(23, 105, 224, .18);
    transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.acgh-cta:hover,
.acgh-cta:focus-visible {
    background: #1257bc;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 11px 24px rgba(23, 105, 224, .24);
}

.acgh-cta:focus-visible,
.acgh-brand-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.acgh-cta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.acgh-cta-icon svg,
.acgh-cta-icon i {
    width: 15px;
    height: 15px;
}

.acgh-header[dir="rtl"] .alsarhan-menu-side-right .alsarhan-menu-panel,
.acgh-header[dir="ltr"] .alsarhan-menu-side-left .alsarhan-menu-panel {
    text-align: start;
}

/*
 * Elementor editor compatibility:
 * sticky/high-z-index frontend headers can sit above Elementor's widget controls,
 * making the pencil/edit handle visible but not clickable. Inside edit mode we
 * intentionally disable sticky stacking and interactive links so Elementor owns
 * the click surface. Frontend behavior is unchanged.
 */
.elementor-editor-active .acgh-header,
.elementor-edit-mode .acgh-header {
    position: relative !important;
    top: auto !important;
    z-index: 0 !important;
}

.elementor-editor-active .acgh-header.acgh-is-sticky,
.elementor-edit-mode .acgh-header.acgh-is-sticky {
    position: relative !important;
    top: auto !important;
    z-index: 0 !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.elementor-editor-active .acgh-brand-link,
.elementor-editor-active .acgh-cta,
.elementor-edit-mode .acgh-brand-link,
.elementor-edit-mode .acgh-cta {
    pointer-events: none;
}

.elementor-editor-active .acgh-menu .alsarhan-menu-overlay,
.elementor-editor-active .acgh-menu .alsarhan-menu-panel,
.elementor-edit-mode .acgh-menu .alsarhan-menu-overlay,
.elementor-edit-mode .acgh-menu .alsarhan-menu-panel {
    z-index: 1;
}

@media (max-width: 1024px) {
    .acgh-inner {
        gap: 14px;
    }

    .acgh-brand-subtitle {
        font-size: 9px;
    }

    .acgh-menu .alsarhan-menu-toggle {
        display: inline-flex !important;
    }
}

@media (max-width: 767px) {
    .acgh-header {
        padding: 11px 15px;
    }

    .acgh-inner {
        flex-wrap: wrap;
        gap: 10px 12px;
    }

    .acgh-brand {
        flex: 0 1 auto;
    }

    .acgh-menu {
        flex: 0 0 auto;
    }

    .acgh-actions {
        flex: 1 0 100%;
        width: 100%;
        margin-inline-start: 0;
    }

    .acgh-actions-empty {
        display: none;
    }

    .acgh-cta {
        width: 100%;
        min-height: 40px;
    }

    .acgh-logo img {
        width: 46px;
    }

    .acgh-brand-name {
        font-size: 15px;
    }

    .acgh-brand-subtitle {
        font-size: 9px;
    }

    .acgh-menu .alsarhan-menu-toggle {
        display: inline-flex !important;
        min-width: 44px;
        min-height: 44px;
        padding: 10px 12px;
    }
}

@media (max-width: 420px) {
    .acgh-brand-copy {
        max-width: 135px;
    }

    .acgh-brand-name,
    .acgh-brand-subtitle {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .acgh-menu .alsarhan-menu-toggle-label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .acgh-header *,
    .acgh-header *::before,
    .acgh-header *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
