/*
|--------------------------------------------------------------------------
| RentalAjay - Mobile Header Actions V2
|--------------------------------------------------------------------------
| Customer : [Profil] [Keranjang] [Chat]
| Seller   : [Profil] [Chat]
| Tombol berada DI DALAM header, bukan floating di atas konten.
*/

.admin-mobile-header-actions {
    display: none;
}

@media (max-width: 780px) {
    /* --------------------------------------------------------------
       Customer header
       -------------------------------------------------------------- */
    body.customer-body .customer-header .nav-wrap {
        flex-wrap: nowrap !important;
        align-items: center !important;
    }

    body.customer-body .customer-header .brand {
        min-width: 0;
        flex: 1 1 auto;
    }

    body.customer-body .customer-mobile-header-actions {
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 7px;
        flex: 0 0 auto;
        margin: 0 !important;
    }

    body.customer-body .customer-mobile-profile-shortcut,
    body.customer-body .customer-mobile-header-button {
        position: relative;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px;
        flex: 0 0 36px !important;
        display: grid !important;
        place-items: center;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid rgba(255, 255, 255, .34) !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, .13) !important;
        color: #fff !important;
        box-shadow: none !important;
        text-decoration: none !important;
    }

    body.customer-body .customer-mobile-profile-shortcut {
        border-radius: 50% !important;
        background: rgba(255, 255, 255, .18) !important;
        font-size: .72rem;
        font-weight: 900;
    }

    body.customer-body .customer-mobile-header-cart {
        background: rgba(9, 33, 82, .28) !important;
    }

    body.customer-body .customer-mobile-header-chat {
        background: rgba(255, 255, 255, .20) !important;
    }

    body.customer-body .customer-mobile-header-button svg {
        width: 19px !important;
        height: 19px !important;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    body.customer-body .customer-header-action-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        min-width: 18px;
        height: 18px;
        display: grid;
        place-items: center;
        padding: 0 4px;
        border: 2px solid #4a57ed;
        border-radius: 999px;
        background: #ef4444;
        color: #fff;
        font-size: .55rem;
        font-weight: 900;
        line-height: 1;
    }

    body.customer-body .customer-header-action-badge.is-cart {
        background: #f59e0b;
    }

    /* --------------------------------------------------------------
       Seller/Admin header
       -------------------------------------------------------------- */
    body.admin-body .admin-topbar {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    body.admin-body .admin-topbar-left {
        min-width: 0;
        flex: 1 1 auto;
    }

    body.admin-body .admin-topbar-left > div {
        min-width: 0;
    }

    body.admin-body .admin-topbar h1 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.admin-body .admin-topbar-user {
        display: none !important;
    }

    body.admin-body .admin-mobile-header-actions {
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 7px;
        flex: 0 0 auto;
        margin-left: auto;
    }

    body.admin-body .admin-mobile-header-button {
        position: relative;
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        display: grid;
        place-items: center;
        overflow: visible;
        padding: 0;
        border: 1px solid var(--border, #d9e2ef);
        border-radius: 12px;
        background: var(--surface, #fff);
        color: var(--primary, #315ffd);
        text-decoration: none;
        box-shadow: 0 4px 12px rgba(26, 47, 92, .08);
    }

    body.admin-body .admin-mobile-profile-button {
        overflow: hidden;
        border-radius: 50%;
        background: linear-gradient(135deg, #315ffd, #7049ec);
        color: #fff;
        font-size: .72rem;
        font-weight: 900;
    }

    body.admin-body .admin-mobile-profile-button img,
    body.admin-body .admin-mobile-profile-button span {
        width: 100%;
        height: 100%;
    }

    body.admin-body .admin-mobile-profile-button span {
        display: grid;
        place-items: center;
    }

    body.admin-body .admin-mobile-profile-button img {
        display: block;
        object-fit: cover;
        object-position: center;
        border-radius: inherit;
    }

    body.admin-body .admin-mobile-profile-button span {
        place-items: center;
    }

    body.admin-body .admin-mobile-chat-button svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    body.admin-body .admin-header-action-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        min-width: 18px;
        height: 18px;
        display: grid;
        place-items: center;
        padding: 0 4px;
        border: 2px solid var(--surface, #fff);
        border-radius: 999px;
        background: #ef4444;
        color: #fff;
        font-size: .55rem;
        font-weight: 900;
        line-height: 1;
    }
}

html[data-theme="dark"] body.admin-body .admin-mobile-header-button {
    border-color: #344660;
    background: #16243a;
    color: #a9c0ff;
}

html[data-theme="dark"] body.admin-body .admin-header-action-badge {
    border-color: #16243a;
}

@media (max-width: 390px) {
    body.customer-body .customer-mobile-header-actions,
    body.admin-body .admin-mobile-header-actions {
        gap: 5px;
    }

    body.customer-body .customer-mobile-profile-shortcut,
    body.customer-body .customer-mobile-header-button,
    body.admin-body .admin-mobile-header-button {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px;
        flex-basis: 34px !important;
    }
}
