/* EBADI APP — Header UX update 07
 * Mobile: menu on the right, logo on the left, back action stays in page context.
 */
@media (max-width: 640px) {
    .site-header__inner {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 8px !important;
        direction: ltr !important;
        min-height: 58px !important;
        padding: 5px 10px !important;
    }

    .site-header .brand {
        grid-column: 1 !important;
        justify-self: start !important;
        direction: rtl !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .site-header .brand__logo {
        width: 38px !important;
        height: 38px !important;
        flex: 0 0 38px !important;
    }

    /* On phones the logo is the visual brand. Hiding the copy leaves enough room for actions. */
    .site-header .brand__copy {
        display: none !important;
    }

    .site-header .header-actions {
        grid-column: 3 !important;
        justify-self: end !important;
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
        direction: ltr !important;
        min-width: 0 !important;
    }

    .site-header .header-actions .header-icon[aria-label="اعلان‌ها"] {
        order: 10 !important;
    }

    .site-header .header-actions .call-button {
        order: 20 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .site-header .header-actions [data-ebadi-menu],
    .site-header .header-actions [data-profile-menu-toggle] {
        order: 30 !important;
        width: 36px !important;
        height: 36px !important;
        border: 1px solid #2f3337 !important;
        border-radius: 11px !important;
        background: #15181b !important;
        color: #f1f2f3 !important;
    }

    .site-header .header-actions [data-ebadi-menu] svg,
    .site-header .header-actions [data-profile-menu-toggle] svg {
        width: 22px !important;
        height: 22px !important;
    }

    /* Secondary-page back button: right side, beside the page title, below the global header. */
    .account-page-header,
    .profile-editor__header {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        direction: rtl !important;
    }

    .account-page-header > a[data-app-back],
    .profile-editor__header > a[data-profile-back] {
        position: static !important;
        flex: 0 0 40px !important;
        width: 40px !important;
        height: 40px !important;
        margin: 0 !important;
        border: 1px solid #30343a !important;
        border-radius: 12px !important;
        background: #15181b !important;
        color: #eef0f2 !important;
        box-shadow: none !important;
    }

    .account-page-header > a[data-app-back] svg,
    .profile-editor__header > a[data-profile-back] svg {
        width: 20px !important;
        height: 20px !important;
    }

    .account-page-header > div,
    .profile-editor__header > div {
        min-width: 0 !important;
        text-align: right !important;
    }

    /* Global drawer logout entry. */
    .profile-side-menu[data-ebadi-menu-panel] > .profile-side-menu__logout {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        min-height: 44px !important;
        margin-top: auto !important;
        border: 1px solid rgba(205, 72, 72, .32) !important;
        border-radius: 12px !important;
        background: rgba(130, 35, 35, .10) !important;
        color: #e28b8b !important;
        font-size: var(--eb-fs-label) !important;
        font-weight: 800 !important;
        text-decoration: none !important;
    }

    .profile-side-menu[data-ebadi-menu-panel] > .profile-side-menu__logout span {
        font-size: var(--eb-fs-subtitle) !important;
        line-height: 1 !important;
    }
}

html[data-theme="light"] .site-header .header-actions [data-ebadi-menu],
html[data-theme="light"] .site-header .header-actions [data-profile-menu-toggle],
html[data-theme="light"] .account-page-header > a[data-app-back],
html[data-theme="light"] .profile-editor__header > a[data-profile-back] {
    border-color: #d8dee3 !important;
    background: #fff !important;
    color: #424b53 !important;
}

/* Update 08 — the brand-colored dot on the hamburger was a static decorative
 * pseudo-element from the original .login-action styles. It is not tied to
 * unread notifications; real notification state is shown on the bell badge. */
.site-header .login-action::after,
.site-header [data-ebadi-menu]::after {
    content: none !important;
    display: none !important;
}
