/* Area pembeli: tampilan ala aplikasi seluler, terpisah dari situs publik. */
:root {
    --navy: #03045e; --blue: #0077b6; --mist: #f6f7f9; --ink: #0a1a33; --muted: #3d4f66; --line: #e2e5e9;
    --ok: #14532d; --ok-bg: #e8f5ec; --bad: #b42318;
    --bar: 3.5rem; --tab: 3.75rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #dfe3e8; color: var(--ink); font: 400 1rem/1.5 "Google Sans", system-ui, sans-serif; }
.app { position: relative; max-width: 480px; min-height: 100dvh; margin: 0 auto; background: var(--mist); }
.app a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* bilah atas */
.ap-top { position: sticky; top: 0; z-index: 10; background: var(--navy); color: #fff; }
.ap-top-in { display: flex; align-items: center; gap: .5rem; height: var(--bar); padding: 0 .5rem 0 .25rem; }
.ap-top h1 { flex: 1; margin: 0; font-size: 1.125rem; font-weight: 600; }
.ap-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0 .5rem; border: 0; background: none; color: #fff; text-decoration: none; font-size: .875rem; font-weight: 600; gap: .25rem; }
.ap-icon i { font-size: 1.25rem; }
.ap-top form { margin: 0; }

/* isi */
.ap-main { padding: 1rem 1rem calc(var(--tab) + 1.5rem + env(safe-area-inset-bottom)); }
.ap-main.ap-has-bar { padding-bottom: calc(var(--tab) + 6.5rem + env(safe-area-inset-bottom)); }
.ap-flash { margin: 0 0 1rem; padding: .75rem 1rem; border-radius: 8px; background: var(--ok-bg); color: var(--ok); font-weight: 500; }
.ap-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.ap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.ap-label { margin: 0 0 .5rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ap-muted { color: var(--muted); font-size: .875rem; }
.ap-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.ap-row strong { font-variant-numeric: tabular-nums; }
.ap-price { color: var(--navy); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* tombol */
.ap-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3rem; padding: 0 1.25rem; border: 1px solid transparent; border-radius: 10px; background: var(--blue); color: #fff !important; font-weight: 600; text-decoration: none; cursor: pointer; }
.ap-btn:active { transform: scale(.98); }
.ap-btn-block { width: 100%; }
.ap-btn-line { background: #fff; color: var(--blue) !important; border-color: var(--blue); }
.ap-btn-danger { background: var(--bad); }
.ap-link-danger { min-height: 44px; padding: 0 .5rem; border: 0; background: none; color: var(--bad); font-weight: 600; }

/* status */
.ap-pill { display: inline-block; padding: .125rem .75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--mist); color: var(--navy); font-size: .8125rem; font-weight: 700; white-space: nowrap; }
.ap-dibayar { background: var(--ok-bg); color: var(--ok); border-color: #b7dfc3; }
.ap-batal, .ap-kedaluwarsa { color: var(--muted); }

/* jumlah */
.ap-qty { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; }
.ap-qty input { width: 5.5rem; min-height: 44px; padding: 0 .75rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-variant-numeric: tabular-nums; }
.ap-qty .ap-btn { min-height: 44px; }
.ap-act { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.ap-act form { margin: 0; }

/* bilah bayar menempel di atas tab */
.ap-pay { position: fixed; bottom: calc(var(--tab) + env(safe-area-inset-bottom)); left: 50%; z-index: 9; width: 100%; max-width: 480px; transform: translateX(-50%); display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem; background: #fff; border-top: 1px solid var(--line); }
.ap-pay form { display: contents; }
.ap-pay div { flex: 1; line-height: 1.25; }
.ap-pay div span { display: block; font-size: .8125rem; color: var(--muted); }
.ap-pay div strong { font-size: 1.125rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.ap-pay .ap-btn { flex: 0 0 auto; }

/* tab bawah */
.ap-tabs { position: fixed; bottom: 0; left: 50%; z-index: 10; width: 100%; max-width: 480px; transform: translateX(-50%); display: grid; grid-template-columns: repeat(3, 1fr); height: calc(var(--tab) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); }
.ap-tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .125rem; color: var(--muted); font-size: .75rem; font-weight: 600; text-decoration: none; }
.ap-tabs a i { font-size: 1.375rem; line-height: 1; }
.ap-tabs a[aria-current="page"] { color: var(--navy); }
.ap-tabs a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue); }
.ap-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .6875rem; line-height: 18px; text-align: center; }
.ap-badge:empty, .ap-badge[data-nol] { display: none; }

/* BRIVA */
.ap-va { margin: 0 0 .75rem; font-size: clamp(1.5rem, 7vw, 1.875rem); font-weight: 700; line-height: 1.2; letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--navy); overflow-wrap: anywhere; }
.ap-meta { margin: 1rem 0 0; }
.ap-meta div { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--line); }
.ap-meta dt { font-weight: 500; color: var(--muted); }
.ap-meta dd { margin: 0; font-weight: 700; text-align: right; }
.ap-steps { margin: 0; padding-left: 1.25rem; }
.ap-steps li { margin-bottom: .5rem; }
.ap-items { list-style: none; margin: 0; padding: 0; }
.ap-items li { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--line); }
.ap-items li div span { display: block; font-size: .875rem; color: var(--muted); }
.ap-stack { display: grid; gap: .75rem; }

/* kosong & masuk */
.ap-empty { padding: 3rem 1rem; text-align: center; }
.ap-empty h2 { margin: 0 0 .5rem; font-size: 1.25rem; color: var(--navy); }
.ap-empty p { margin: 0 0 1.25rem; color: var(--muted); }
.ap-hero { display: flex; flex-direction: column; justify-content: center; min-height: calc(100dvh - var(--bar)); padding: 2rem 1.5rem; }
.ap-hero img { width: 72px; height: auto; margin-bottom: 1.5rem; }
.ap-hero h2 { margin: 0 0 .5rem; font-size: 1.75rem; line-height: 1.2; color: var(--navy); }
.ap-hero p { margin: 0 0 2rem; color: var(--muted); }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 0 16px; background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 4px; font: 500 14px/20px Roboto, Arial, sans-serif; text-decoration: none; }
.btn-google svg { width: 18px; height: 18px; flex: none; }
.btn-google:active { background: #f8f9fa; }
.ap-pager { display: flex; justify-content: space-between; margin-top: 1rem; }

/* dialog */
.dlg { width: min(24rem, calc(100% - 2rem)); padding: 1.25rem; border: 0; border-radius: 16px; color: var(--ink); }
.dlg::backdrop { background: rgba(3, 4, 94, .5); }
.dlg h2 { margin: 0 0 .5rem; font-size: 1.25rem; color: var(--navy); }
.dlg p { margin: 0 0 1.25rem; color: var(--muted); }
.dlg-act { display: grid; gap: .5rem; }

@media (min-width: 481px) { .app { box-shadow: 0 0 0 1px var(--line); } }

/* kolom: bertumpuk di HP, dua kolom di layar lebar */
.ap-cols { display: grid; gap: .75rem; }

/* desktop: bilah atas penuh dengan menu di dalamnya, isi dua kolom di dalam wadah */
@media (min-width: 900px) {
    body, .app { background: var(--mist); }
    .app { max-width: none; box-shadow: none; }
    .ap-top-in { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
    .ap-top h1 { flex: 0 0 auto; margin-right: 1.5rem; font-size: 1.25rem; }
    .ap-main, .ap-main.ap-has-bar { max-width: 72rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
    .ap-tabs { position: static; transform: none; width: auto; max-width: none; height: auto; margin-left: auto; padding: 0; display: flex; gap: .25rem; background: none; border: 0; }
    .ap-tabs a { flex-direction: row; gap: .5rem; min-height: 2.75rem; padding: 0 1rem; border-radius: 10px; color: #cfdcff; font-size: .9375rem; }
    .ap-tabs a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
    .ap-tabs a i { font-size: 1.125rem; }
    .ap-tabs a[aria-current="page"] { background: rgba(255, 255, 255, .16); color: #fff; }
    .ap-tabs a[aria-current="page"]::before { display: none; }
    .ap-badge { position: static; }
    .ap-cols { grid-template-columns: minmax(0, 1fr) minmax(20rem, 26rem); gap: 1.5rem; align-items: start; }
    .ap-list { grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 1rem; }
    .ap-cols > .ap-list { grid-template-columns: 1fr; }
    .ap-pay { position: sticky; top: calc(var(--bar) + 1.5rem); left: auto; bottom: auto; transform: none; width: auto; max-width: none; flex-direction: column; align-items: stretch; gap: 1rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 12px; }
    .ap-pay .ap-btn { width: 100%; }
    .ap-hero { max-width: 30rem; margin: 0 auto; min-height: calc(100dvh - var(--bar)); }
    .ap-pager { max-width: 30rem; }
}

/* layar sangat lebar (4K ke atas, TV, monitor besar): skala seluruh antarmuka lewat rem */
@media (min-width: 1920px) { html { font-size: 112.5%; } }
@media (min-width: 2560px) { html { font-size: 137.5%; } }
@media (min-width: 3200px) { html { font-size: 175%; } }
@media (min-width: 3840px) { html { font-size: 225%; } }
