/* =========================================================
   RASA MOBILE NAVIGATION FINAL V5
   Single-source mobile navigation.
   No legacy drawer/auth CSS dependency.
   ========================================================= */

.rasa-v5-menu-trigger,
.rasa-v5-backdrop,
.rasa-v5-drawer {
    display: none;
}

@media (max-width: 768px) {
    /*
     * Mobile header:
     * brand only + our single menu trigger.
     * Desktop remains untouched.
     */
    html body #siteHeader.site-header,
    html body header.site-header#siteHeader {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        z-index: 40 !important;
        overflow: visible !important;
    }

    html body #siteHeader .container,
    html body #siteHeader .nav-shell,
    html body #siteHeader > div {
        position: relative !important;
        overflow: visible !important;
    }

    html body #siteHeader nav.menu,
    html body #siteHeader .menu,
    html body #siteHeader .rasa-menu-more,
    html body #siteHeader .rasa-menu-more-panel,
    html body #siteHeader .nav-actions,
    html body #siteHeader .header-actions,
    html body #siteHeader .actions {
        display: none !important;
    }

    /*
     * Old organization mobile producers may still execute because
     * organization-menu.js is also used by desktop.
     * Their mobile output is hidden permanently.
     */
    html body .rasa-org-mobile-fallback,
    html body .rasa-org-mobile-fallback.is-needed,
    html body .rasa-org-mobile-block,
    html body [data-rasa-org-mobile-canonical] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    html body .rasa-header-close,
    html body .rasa-header-backdrop {
        display: none !important;
    }

    /*
     * Trigger is INSIDE the real header.
     * It therefore loads at the top and naturally scrolls away.
     */
    html body .rasa-v5-menu-trigger {
        appearance: none;
        -webkit-appearance: none;

        position: absolute !important;
        top: 50% !important;
        left: 14px !important;
        right: auto !important;
        transform: translateY(-50%) !important;

        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 7px;

        min-width: 64px;
        height: 42px;
        padding: 0 13px;

        border: 1px solid rgba(255,255,255,.52);
        border-radius: 999px;

        color: #fff;
        background:
            linear-gradient(
                135deg,
                #22c7ca 0%,
                #078e96 100%
            );

        box-shadow:
            0 9px 24px rgba(5,111,119,.20),
            inset 0 1px 0 rgba(255,255,255,.34);

        font-family: IRANSansX, Tahoma, sans-serif;
        font-size: 12px;
        font-weight: 900;
        line-height: 1;

        z-index: 90 !important;
        cursor: pointer;
    }

    html body .rasa-v5-menu-trigger-icon {
        font-size: 18px;
        line-height: 1;
    }

    /*
     * Drawer / backdrop.
     */
    html body .rasa-v5-backdrop {
        position: fixed !important;
        inset: 0 !important;
        z-index: 2147482000 !important;

        display: block !important;

        background: rgba(2,31,37,.42);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition:
            opacity .20s ease,
            visibility .20s ease;
    }

    html body .rasa-v5-drawer {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;

        width: min(88vw, 342px);
        max-width: 342px;

        z-index: 2147482100 !important;

        display: flex !important;
        flex-direction: column;

        direction: rtl;

        padding: 0;

        background:
            radial-gradient(
                circle at 15% 5%,
                rgba(31,199,202,.12),
                transparent 28%
            ),
            linear-gradient(
                180deg,
                #f4ffff 0%,
                #edfafa 100%
            );

        border-left: 1px solid rgba(7,93,101,.10);
        box-shadow: -18px 0 50px rgba(3,44,51,.18);

        transform: translateX(105%);
        visibility: hidden;
        pointer-events: none;

        transition:
            transform .24s ease,
            visibility .24s ease;

        font-family: IRANSansX, Tahoma, sans-serif;
        box-sizing: border-box;
        overflow: hidden;
    }

    html body.rasa-v5-mobile-nav-open
    .rasa-v5-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    html body.rasa-v5-mobile-nav-open
    .rasa-v5-drawer {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }

    html body.rasa-v5-mobile-nav-open {
        overflow: hidden !important;
        touch-action: none;
    }

    .rasa-v5-drawer-head {
        flex: 0 0 auto;

        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;

        padding: 18px 16px 14px;

        border-bottom: 1px solid rgba(7,85,92,.08);
    }

    .rasa-v5-drawer-title {
        min-width: 0;
    }

    .rasa-v5-drawer-title strong {
        display: block;

        color: #123f49;
        font-size: 14px;
        font-weight: 950;
        line-height: 1.6;
    }

    .rasa-v5-drawer-title span {
        display: block;

        margin-top: 2px;

        color: #739095;
        font-size: 10.5px;
        font-weight: 700;
        line-height: 1.7;
    }

    .rasa-v5-close {
        appearance: none;
        -webkit-appearance: none;

        flex: 0 0 38px;
        width: 38px;
        height: 38px;

        display: inline-flex;
        align-items: center;
        justify-content: center;

        border: 0;
        border-radius: 13px;

        color: #fff;
        background:
            linear-gradient(
                135deg,
                #1cc4c7,
                #078f96
            );

        font-size: 21px;
        line-height: 1;
        cursor: pointer;
    }

    /*
     * Main links remain SEPARATE and compact.
     */
    .rasa-v5-main-links {
        flex: 1 1 auto;

        display: grid;
        align-content: start;
        gap: 8px;

        min-height: 0;

        padding: 14px 14px 10px;

        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }

    .rasa-v5-main-link {
        width: 100%;
        min-height: 43px;

        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;

        padding: 9px 13px;

        border: 1px solid rgba(8,104,112,.07);
        border-radius: 14px;

        color: #183f49;
        background: rgba(255,255,255,.86);

        box-shadow: 0 5px 15px rgba(4,60,67,.035);

        font-size: 12px;
        font-weight: 850;
        line-height: 1.7;

        text-decoration: none;
        box-sizing: border-box;
    }

    .rasa-v5-main-link::after {
        content: "‹";

        flex: 0 0 auto;

        color: #16b8bc;
        font-size: 18px;
        font-weight: 950;
        line-height: 1;
    }

    .rasa-v5-main-link:active {
        background: #eaf9f8;
    }

    /*
     * Bottom controls are always at the bottom and never mixed
     * with normal website navigation.
     */
    .rasa-v5-bottom {
        flex: 0 0 auto;

        display: grid;
        gap: 8px;

        padding: 12px 14px 15px;

        border-top: 1px solid rgba(8,85,93,.09);
        background: rgba(240,252,251,.96);
    }

    .rasa-v5-bottom > a,
    .rasa-v5-bottom > button,
    .rasa-v5-bottom > form > button {
        appearance: none;
        -webkit-appearance: none;

        width: 100%;
        min-height: 44px;

        display: flex;
        align-items: center;
        justify-content: center;

        margin: 0;
        padding: 9px 13px;

        border-radius: 14px;

        font-family: IRANSansX, Tahoma, sans-serif;
        font-size: 13px;
        font-weight: 900;
        line-height: 1.7;

        text-align: center;
        text-decoration: none;

        box-sizing: border-box;
    }

    .rasa-v5-panel-action {
        border: 0;

        color: #fff;

        background:
            linear-gradient(
                135deg,
                #21c7ca 0%,
                #078f96 100%
            );

        box-shadow: 0 8px 18px rgba(7,143,150,.13);
    }

    .rasa-v5-account-action {
        border: 1px solid rgba(8,92,101,.09);

        color: #173f49;
        background: #fff;

        box-shadow: none;
        cursor: pointer;
    }

    .rasa-v5-logout-form {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .rasa-v5-logout-action {
        border: 1px solid rgba(184,69,69,.13);

        color: #ad4e4e;
        background: rgba(255,255,255,.96);

        box-shadow: none;
        cursor: pointer;
    }

    .rasa-v5-exit-hint {
        margin: 1px 0 0;

        color: #82989c;
        font-size: 9.5px;
        font-weight: 650;
        line-height: 1.7;
        text-align: center;
    }

    @media (prefers-reduced-motion: reduce) {
        html body .rasa-v5-backdrop,
        html body .rasa-v5-drawer {
            transition: none;
        }
    }
}

/* /RASA MOBILE NAVIGATION FINAL V5 */
