/* ==================================================================
   MENU HEADER -- dropdown Notifikasi dan Profil (pembeli & mitra)
   ==================================================================

   Dipakai header pembeli (widgets/location/index) dan header penjual
   (spl_owner/layouts/owner_header). Warna dan huruf mengikuti .tb di
   beranda usaha supaya header dan isi halaman terbaca satu aplikasi.

   PANEL DI-TELEPORT KE <body>. Header (.glass-header) memakai
   backdrop-filter, dan elemen position:fixed di dalam elemen ber-
   backdrop-filter terkunci ke kotak elemen itu, bukan ke layar -- bottom
   sheet di ponsel akan tergantung di bawah header alih-alih menempel di
   dasar layar. Di desktop posisinya dihitung dari tombol pemicu (lihat
   hmMenu di _menu_header_js).
   ================================================================== */

[x-cloak] { display: none !important; }

.hm,
.hm-lapis,
.hm-ikon {
    --hm-hijau: #0a7c3f;
    --hm-hijau-tua: #075f30;
    --hm-hijau-lembut: #e8f5ee;
    --hm-tinta: #0f172a;
    --hm-teks: #475569;
    --hm-abu: #64748b;
    --hm-abu-muda: #94a3b8;
    --hm-garis: #e8ecef;
    --hm-latar: #f8fafc;
    --hm-merah: #dc2626;
    --hm-merah-lembut: #fef2f2;
    --hm-jingga: #c2410c;
    --hm-jingga-lembut: #fff7ed;
    --hm-biru: #1d4ed8;
    --hm-biru-lembut: #eff6ff;

    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
}

.hm { position: relative; display: inline-flex; }

/* ---------- Tombol ikon header (keranjang, lonceng, menu) ----------

   Satu bentuk untuk semua tombol ikon di header. Sebelumnya hamburger
   kotak hijau 40px, keranjang transparan berikon 20px dengan lencana "0"
   yang selalu merah, dan lonceng transparan berikon 22px -- tiga tombol
   bersebelahan dengan tiga rupa. */

.hm-ikon {
    position: relative;
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 13px;
    background: #f1f5f9;
    color: #334155;
    font-size: 22px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.hm-ikon:hover,
.hm-ikon[aria-expanded="true"] { background: var(--hm-hijau-lembut); color: var(--hm-hijau-tua); }
.hm-ikon:focus-visible { outline: 2px solid var(--hm-hijau); outline-offset: 2px; }
.hm-ikon > i { font-size: inherit; line-height: 1; }

/* Hamburger: bentuk dan ukuran yang sama, tetap hijau sebagai penanda menu
   utama. Diberi awalan header.glass-header supaya menang atas gaya sebaris
   di kedua header. */
header.glass-header .menu-btn {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 22px;
}

@media (max-width: 767px) {
    .hm-ikon,
    header.glass-header .menu-btn { width: 40px; height: 40px; font-size: 20px; }
}

/* ---------- Tombol pemicu ---------- */

.hm-pemicu {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    min-width: 42px;
    padding: 0 10px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: #334155;
    font: inherit;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.hm-pemicu:hover,
.hm-pemicu[aria-expanded="true"] { background: var(--hm-hijau-lembut); color: var(--hm-hijau-tua); }
.hm-pemicu:focus-visible { outline: 2px solid var(--hm-hijau); outline-offset: 2px; }

.hm-pemicu > i { font-size: 22px; line-height: 1; }

.hm-lencana[hidden] { display: none !important; }

.hm-lencana {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 2px solid #fff;
    background: var(--hm-merah);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

/* Profil: avatar + nama (nama disembunyikan di layar sempit). */
.hm-pemicu--profil { padding: 0 8px 0 4px; }

.hm-avatar {
    flex: none;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--hm-hijau);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .02em;
}

.hm-pemicu__teks {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    max-width: 150px;
    line-height: 1.2;
    text-align: left;
}

.hm-pemicu__nama {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 800;
    color: var(--hm-tinta);
}

.hm-pemicu__peran { font-size: 11px; font-weight: 700; color: var(--hm-hijau); }

.hm-pemicu__panah { font-size: 18px; color: var(--hm-abu-muda); transition: transform .15s; }
.hm-pemicu[aria-expanded="true"] .hm-pemicu__panah { transform: rotate(180deg); color: var(--hm-hijau); }

@media (max-width: 767px) {
    .hm-pemicu__teks, .hm-pemicu__panah { display: none; }
    .hm-pemicu--profil { padding: 0 4px; }
}

/* ---------- Lapisan & panel ---------- */

.hm-lapis { position: fixed; inset: 0; z-index: 10050; }

.hm-latar {
    position: absolute;
    inset: 0;
    background: transparent;
}

.hm-panel {
    position: fixed;
    display: flex;
    flex-direction: column;
    max-height: min(640px, calc(100vh - 100px));
    /* Tombol pemicu bisa cukup dekat ke kiri sehingga panel 400px
       melewati tepi kiri layar. */
    max-width: calc(100vw - 24px);
    border: 1px solid var(--hm-garis);
    border-radius: 20px;
    background: #fff;
    color: var(--hm-tinta);
    box-shadow: 0 24px 48px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .05);
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    animation: hm-muncul .14s ease-out;
}

.hm-panel--notif { width: 400px; }
.hm-panel--profil { width: 340px; }

@keyframes hm-muncul {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

.hm-pegangan { display: none; }

/* Ponsel: bottom sheet selebar layar, latar digelapkan. */
@media (max-width: 639px) {
    .hm-latar { background: rgba(15, 23, 42, .45); }

    .hm-panel {
        top: auto !important;
        right: 0 !important;
        left: 0;
        bottom: 0;
        width: auto;
        max-width: none;
        max-height: 85vh;
        border-radius: 22px 22px 0 0;
        border-bottom: 0;
        padding-bottom: env(safe-area-inset-bottom);
        animation-name: hm-naik;
        animation-duration: .2s;
    }

    .hm-pegangan {
        display: block;
        flex: none;
        width: 44px;
        height: 5px;
        margin: 10px auto 2px;
        border-radius: 999px;
        background: #cbd5e1;
    }

    html.hm-kunci, html.hm-kunci body { overflow: hidden; }
}

@keyframes hm-naik {
    from { transform: translateY(24px); opacity: .6; }
    to   { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .hm-panel { animation: none; }
}

/* ---------- Kepala panel ---------- */

.hm-kepala {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 12px;
}

.hm-kepala__judul { display: flex; align-items: center; gap: 8px; min-width: 0; }

.hm-kepala h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--hm-tinta);
}

.hm-pil {
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--hm-hijau);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.hm-teks-aksi {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    margin-right: -6px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--hm-hijau);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.hm-teks-aksi:hover { background: var(--hm-hijau-lembut); color: var(--hm-hijau-tua); }

/* ---------- Daftar notifikasi ---------- */

.hm-daftar {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: var(--hm-latar);
    border-top: 1px solid var(--hm-garis);
}

.hm-notif {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.hm-notif:hover { border-color: var(--hm-garis); }
.hm-notif:focus-visible { outline: 2px solid var(--hm-hijau); outline-offset: 1px; }

.hm-notif--dibaca { background: transparent; }
.hm-notif--dibaca .hm-notif__pesan { font-weight: 500; color: var(--hm-abu); }

.hm-notif__ikon {
    position: relative;
    flex: none;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 19px;
}

.hm-titik {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--hm-hijau);
}

.hm-notif__isi { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }

.hm-notif__baris {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.hm-chip {
    padding: 2px 8px;
    border-radius: 7px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hm-waktu { flex: none; font-size: 11.5px; color: var(--hm-abu-muda); }

.hm-notif__pesan {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--hm-tinta);
    overflow-wrap: anywhere;
}

.hm-notif__kaki {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

.hm-notif__nominal { font-size: 13.5px; font-weight: 800; color: var(--hm-hijau); }

.hm-notif__aksi {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    color: var(--hm-hijau);
}

/* Nada per jenis notifikasi -- ikon dan label memakai pasangan yang sama. */
.hm-nada--hijau { background: var(--hm-hijau-lembut); color: var(--hm-hijau); }
.hm-nada--biru  { background: var(--hm-biru-lembut);  color: var(--hm-biru); }
.hm-nada--merah { background: var(--hm-merah-lembut); color: var(--hm-merah); }
.hm-nada--jingga{ background: var(--hm-jingga-lembut);color: var(--hm-jingga); }
.hm-nada--abu   { background: #f1f5f9;                color: var(--hm-abu); }

.hm-kosong {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 32px 16px;
    text-align: center;
}

.hm-kosong i { font-size: 30px; color: var(--hm-abu-muda); margin-bottom: 6px; }
.hm-kosong strong { font-size: 14px; font-weight: 800; color: var(--hm-tinta); }
.hm-kosong span { font-size: 12.5px; color: var(--hm-abu); }

.hm-kaki {
    flex: none;
    display: flex;
    justify-content: center;
    padding: 12px;
    border-top: 1px solid var(--hm-garis);
    background: #fff;
}

.hm-kaki a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 800;
    color: var(--hm-hijau);
    text-decoration: none;
}

.hm-kaki a:hover { color: var(--hm-hijau-tua); }

/* ---------- Panel profil ---------- */

.hm-gulir { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

.hm-identitas {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(180deg, var(--hm-hijau-lembut), #fff);
}

.hm-identitas .hm-avatar { width: 52px; height: 52px; border-radius: 16px; font-size: 18px; }

.hm-identitas__teks { min-width: 0; }

.hm-identitas__nama {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 800;
    color: var(--hm-tinta);
}

.hm-identitas__ket {
    margin: 2px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    color: var(--hm-abu);
}

.hm-peran {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #006d37;
    font-size: 11px;
    font-weight: 700;
}

.hm-dompet {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    padding: 4px 12px 12px;
}

.hm-dompet__kartu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px;
    border: 1px solid var(--hm-garis);
    border-radius: 14px;
    background: var(--hm-latar);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s, background .15s;
}

.hm-dompet__kartu:hover { border-color: #cbd5e1; background: #fff; color: inherit; }

.hm-dompet__label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--hm-abu);
}

.hm-dompet__label i { font-size: 15px; color: var(--hm-hijau); }

.hm-dompet__nilai { font-size: 16px; font-weight: 800; letter-spacing: -.01em; color: var(--hm-tinta); }

.hm-dompet__aksi {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--hm-hijau);
}

.hm-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px;
    border-top: 1px solid var(--hm-garis);
}

.hm-menu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 13px;
    color: inherit;
    text-decoration: none;
    transition: background .15s;
}

.hm-menu__item:hover { background: var(--hm-latar); color: inherit; }
.hm-menu__item:focus-visible { outline: 2px solid var(--hm-hijau); outline-offset: -2px; }

.hm-menu__ikon {
    flex: none;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #f1f5f9;
    color: var(--hm-teks);
    font-size: 18px;
    transition: background .15s, color .15s;
}

.hm-menu__item:hover .hm-menu__ikon { background: var(--hm-hijau-lembut); color: var(--hm-hijau); }

.hm-menu__teks { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.hm-menu__judul { font-size: 13.5px; font-weight: 700; color: var(--hm-tinta); }
.hm-menu__ket { font-size: 12px; color: var(--hm-abu); }
.hm-menu__panah { flex: none; font-size: 18px; color: var(--hm-abu-muda); }

.hm-keluar {
    flex: none;
    padding: 8px;
    border-top: 1px solid var(--hm-garis);
    background: #fff;
}

.hm-keluar form { margin: 0; }

.hm-keluar button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--hm-merah);
    font: inherit;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
}

.hm-keluar button:hover { background: var(--hm-merah-lembut); }
.hm-keluar button i { font-size: 18px; }
