/* F91F1D4B — Mobile public navigation repair.
   Desktop remains untouched. YBX V2 stays the base theme. */

.ybx-f91f1d4b-mobile-toggle,
.ybx-f91f1d4b-mobile-drawer,
.ybx-f91f1d4b-mobile-overlay {
    display: none;
}

@media (max-width: 900px) {
    /* Header structure: brand stays on the RIGHT in Arabic; menu button is fixed to the LEFT. */
    .ybx-public-header {
        position: relative !important;
        z-index: 210 !important;
    }

    .ybx-public-header .ybx-public-header-in {
        position: relative !important;
        min-height: 64px !important;
        padding-left: 62px !important;
        padding-right: 14px !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 10px !important;
    }

    html[dir="ltr"] .ybx-public-header .ybx-public-header-in {
        padding-left: 14px !important;
        padding-right: 62px !important;
    }

    /* Keep only the brand in the visible mobile header.
       Desktop navigation/auth remains intact above 900px. */
    .ybx-public-header .ybx-public-nav,
    .ybx-public-header .ybx-public-actions,
    .ybx-public-header .ybx-header-actions,
    .ybx-public-header nav:not(.ybx-f91f1d4b-mobile-nav) {
        display: none !important;
    }

    /* Old/legacy hamburger controls are suppressed; F91F1D4B owns mobile navigation. */
    .ybx-public-header button:not(.ybx-f91f1d4b-mobile-toggle) {
        display: none !important;
    }

    .ybx-public-header .ybx-brand,
    .ybx-public-header .ybx-public-brand,
    .ybx-public-header-in > a:first-child {
        margin: 0 !important;
        max-width: calc(100% - 54px) !important;
        min-width: 0 !important;
        flex: 0 1 auto !important;
    }

    html[dir="rtl"] .ybx-public-header .ybx-brand,
    html[dir="rtl"] .ybx-public-header .ybx-public-brand,
    html[dir="rtl"] .ybx-public-header-in > a:first-child {
        margin-right: 0 !important;
        margin-left: auto !important;
    }

    html[dir="ltr"] .ybx-public-header .ybx-brand,
    html[dir="ltr"] .ybx-public-header .ybx-public-brand,
    html[dir="ltr"] .ybx-public-header-in > a:first-child {
        margin-left: 0 !important;
        margin-right: auto !important;
    }

    .ybx-f91f1d4b-mobile-toggle {
        display: inline-flex !important;
        position: absolute !important;
        left: 12px !important;
        right: auto !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 42px !important;
        height: 42px !important;
        align-items: center !important;
        justify-content: center !important;
        border: 1px solid rgba(125, 162, 203, .28) !important;
        border-radius: 12px !important;
        background: rgba(19, 34, 53, .92) !important;
        color: #f3f7fb !important;
        box-shadow: 0 7px 22px rgba(3, 10, 20, .16) !important;
        cursor: pointer !important;
        z-index: 250 !important;
        font: inherit !important;
        padding: 0 !important;
        -webkit-tap-highlight-color: transparent;
    }

    html[dir="ltr"] .ybx-f91f1d4b-mobile-toggle {
        right: 12px !important;
        left: auto !important;
    }

    .ybx-f91f1d4b-mobile-toggle svg {
        width: 22px;
        height: 22px;
        pointer-events: none;
    }

    .ybx-f91f1d4b-mobile-toggle:focus-visible {
        outline: 3px solid rgba(60, 174, 255, .4) !important;
        outline-offset: 2px !important;
    }

    /* Overlay */
    .ybx-f91f1d4b-mobile-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(3, 9, 18, .52);
        backdrop-filter: blur(3px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .2s ease, visibility .2s ease;
        z-index: 980;
    }

    /* Drawer opens from the LEFT for Arabic as requested. */
    .ybx-f91f1d4b-mobile-drawer {
        display: flex;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: auto;
        width: min(88vw, 360px);
        background:
            linear-gradient(180deg, rgba(18, 34, 52, .99), rgba(12, 25, 40, .995));
        border-right: 1px solid rgba(142, 173, 207, .19);
        box-shadow: 20px 0 55px rgba(2, 8, 16, .28);
        transform: translateX(-105%);
        transition: transform .24s ease;
        z-index: 990;
        flex-direction: column;
        padding: max(16px, env(safe-area-inset-top)) 14px
                 max(18px, env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
        color: #eef5fb;
        text-align: right;
        direction: rtl;
    }

    html[dir="ltr"] .ybx-f91f1d4b-mobile-drawer {
        left: auto;
        right: 0;
        transform: translateX(105%);
        border-right: 0;
        border-left: 1px solid rgba(142, 173, 207, .19);
        text-align: left;
        direction: ltr;
    }

    body.ybx-f91f1d4b-mobile-open {
        overflow: hidden !important;
        touch-action: none;
    }

    body.ybx-f91f1d4b-mobile-open .ybx-f91f1d4b-mobile-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.ybx-f91f1d4b-mobile-open .ybx-f91f1d4b-mobile-drawer {
        transform: translateX(0);
    }

    .ybx-f91f1d4b-mobile-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 2px 2px 14px;
        margin-bottom: 8px;
        border-bottom: 1px solid rgba(142, 173, 207, .15);
    }

    .ybx-f91f1d4b-mobile-drawer-title {
        min-width: 0;
    }

    .ybx-f91f1d4b-mobile-drawer-title strong {
        display: block;
        color: #f6f9fc;
        font-size: 1rem;
        line-height: 1.3;
    }

    .ybx-f91f1d4b-mobile-drawer-title small {
        display: block;
        color: #91a7ba;
        font-size: .74rem;
        margin-top: 3px;
    }

    .ybx-f91f1d4b-mobile-close {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(142, 173, 207, .22);
        border-radius: 11px;
        background: rgba(255,255,255,.04);
        color: #f6f9fc;
        font-size: 1.55rem;
        line-height: 1;
        cursor: pointer;
    }

    .ybx-f91f1d4b-mobile-nav {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 6px !important;
        width: 100% !important;
        padding: 6px 0 !important;
        margin: 0 !important;
    }

    .ybx-f91f1d4b-mobile-nav a {
        display: flex !important;
        align-items: center;
        min-height: 46px;
        width: 100%;
        padding: 10px 12px !important;
        border-radius: 11px !important;
        border: 1px solid transparent !important;
        background: transparent !important;
        color: #dce8f2 !important;
        text-decoration: none !important;
        font-size: .94rem !important;
        font-weight: 700 !important;
        line-height: 1.35 !important;
        text-align: inherit !important;
        direction: inherit !important;
        box-shadow: none !important;
    }

    .ybx-f91f1d4b-mobile-nav a:hover,
    .ybx-f91f1d4b-mobile-nav a:focus-visible,
    .ybx-f91f1d4b-mobile-nav a[aria-current="page"] {
        background: rgba(74, 151, 218, .10) !important;
        border-color: rgba(94, 164, 225, .18) !important;
        color: #ffffff !important;
    }

    .ybx-f91f1d4b-mobile-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: auto;
        padding-top: 16px;
        border-top: 1px solid rgba(142, 173, 207, .15);
    }

    .ybx-f91f1d4b-mobile-actions a {
        min-height: 43px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 11px;
        padding: 9px 10px;
        text-decoration: none;
        font-weight: 800;
        font-size: .84rem;
    }

    .ybx-f91f1d4b-mobile-actions .primary {
        background: linear-gradient(135deg, #2b79b8, #245f91);
        color: #fff;
    }

    .ybx-f91f1d4b-mobile-actions .secondary {
        border: 1px solid rgba(142, 173, 207, .24);
        background: rgba(255,255,255,.035);
        color: #e5eef6;
    }

    /* Drawer must never make ticker or page content shift horizontally. */
    html,
    body {
        max-width: 100%;
        overflow-x: clip;
    }
}

@media (max-width: 390px) {
    .ybx-public-header .ybx-public-header-in {
        min-height: 60px !important;
        padding-left: 58px !important;
        padding-right: 10px !important;
    }

    .ybx-f91f1d4b-mobile-toggle {
        left: 9px !important;
        width: 40px !important;
        height: 40px !important;
    }

    html[dir="ltr"] .ybx-f91f1d4b-mobile-toggle {
        right: 9px !important;
        left: auto !important;
    }

    .ybx-f91f1d4b-mobile-drawer {
        width: min(91vw, 345px);
    }
}
