/* Tampilan pembeli (halaman menu & cek pesanan). Warna dari mockup 3 Nov. */
:root {
  --krem: #fbf5ec; --kertas: #fffdf9; --cokelat: #4a2c1d; --cokelat2: #7a4f36;
  --karamel: #c8742f; --karamel-tua: #a95c1f; --karamel-muda: #f6e3cf; --garis: #ecdccb; --hijau: #1f9d55; --abu: #8a7768; --merah: #b42318;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --huruf: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--huruf); background: var(--krem); color: var(--cokelat); font-size: 16px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); margin: 0; }
a { color: var(--cokelat2); }
.wadah { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* Kepala */
.kepala { background: var(--cokelat); color: #fff6ea; padding: 18px 0 14px; }
.kepala .atas { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kepala h1 { font-size: 26px; letter-spacing: .2px; line-height: 1.15; }
.kepala .sub { font-size: 14px; opacity: .85; margin-top: 4px; }
.buka { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: rgba(255,255,255,.12); padding: 5px 11px; border-radius: 99px; margin-top: 10px; }
.buka i { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; flex: none; }
.buka.tutup i { background: #fca5a5; }
.tombol-wa-kecil { flex: none; display: inline-flex; align-items: center; gap: 6px; background: var(--hijau); color: #fff; font-size: 14px; font-weight: 700; padding: 10px 14px; border-radius: 12px; text-decoration: none; min-height: 44px; }
.tombol-wa-kecil svg { width: 18px; height: 18px; }

.pita { padding: 10px 0; font-size: 14px; }
.pita.contoh { background: #fff3c4; color: #6b4e00; }
.pita.libur { background: #fde2e1; color: var(--merah); font-weight: 600; }

/* Tab kategori */
.tab { position: sticky; top: 0; z-index: 5; background: var(--kertas); border-bottom: 1px solid var(--garis); }
.tab .wadah { display: flex; gap: 8px; padding-top: 12px; padding-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.tab .wadah::-webkit-scrollbar { display: none; }
.tab button { flex: none; font-size: 15px; padding: 8px 15px; border-radius: 99px; border: 1px solid var(--garis); background: #fff; min-height: 40px; white-space: nowrap; }
.tab button[aria-pressed="true"] { background: var(--karamel); color: #fff; border-color: var(--karamel); font-weight: 700; }

/* Menu */
main.menu { padding-top: 14px; padding-bottom: 120px; }
.judul-seksi { font-size: 19px; margin: 10px 0 12px; }
.kisi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (min-width: 640px) { .kisi { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 900px) { .kisi { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kartu { background: var(--kertas); border: 1px solid var(--garis); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.kartu .foto { aspect-ratio: 4 / 3; display: grid; place-items: center; font-size: 54px; position: relative; background: var(--karamel-muda); }
.kartu .foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lencana { position: absolute; top: 8px; left: 8px; z-index: 1; font-size: 12px; font-weight: 700; background: #fff; color: var(--karamel-tua); padding: 3px 9px; border-radius: 99px; }
.lencana.habis { color: var(--merah); }
.kartu .t { padding: 10px 10px 12px; display: flex; flex-direction: column; flex: 1; }
.kartu h3 { font-family: var(--huruf); font-size: 15px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.kartu .ket { font-size: 13px; color: var(--abu); margin-top: 2px; overflow-wrap: anywhere; }
.kartu .harga { font-weight: 700; color: var(--cokelat2); margin-top: auto; padding-top: 6px; font-size: 16px; }
.kartu.redup .foto, .kartu.redup h3, .kartu.redup .harga { opacity: .55; }
.tambah { width: 100%; margin-top: 8px; background: var(--karamel-muda); color: var(--cokelat); font-weight: 700; font-size: 15px; border: 0; padding: 10px; border-radius: 10px; min-height: 44px; }
.tambah:disabled { cursor: default; opacity: .7; }
.jml { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; background: var(--karamel); color: #fff; border-radius: 10px; font-weight: 700; min-height: 44px; }
.jml button { border: 0; background: none; color: #fff; font-size: 22px; width: 46px; min-height: 44px; line-height: 1; }
.jml button:disabled { opacity: .4; }
.kosong { text-align: center; color: var(--abu); padding: 40px 10px; }

/* Kaki */
.kaki { border-top: 1px solid var(--garis); background: var(--kertas); padding: 22px 0 120px; font-size: 14px; color: var(--cokelat2); }
.kaki h2 { font-size: 18px; margin-bottom: 8px; color: var(--cokelat); }
.kaki p { margin: 4px 0; }
.cek-form { display: flex; gap: 8px; margin-top: 10px; max-width: 420px; }
.cek-form input { flex: 1; min-width: 0; text-transform: uppercase; }

/* Bilah keranjang */
.bilah { position: fixed; left: 12px; right: 12px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 10; max-width: 560px; margin: 0 auto; background: var(--cokelat); color: #fff; border-radius: 16px; padding: 12px 12px 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; box-shadow: 0 6px 18px rgba(60,30,10,.35); }
.bilah small { display: block; font-size: 13px; opacity: .8; }
.bilah strong { font-size: 18px; }
.bilah button { background: var(--karamel); color: #fff; border: 0; padding: 11px 16px; border-radius: 12px; font-weight: 700; font-size: 15px; min-height: 46px; }

/* Lembar penuh (isi pesanan, pesanan tercatat) */
.lembar { position: fixed; inset: 0; z-index: 20; background: var(--krem); display: flex; flex-direction: column; }
@media (min-width: 640px) { .lembar { background: rgba(40,20,10,.45); align-items: center; justify-content: center; padding: 24px; } .lembar .panel { max-width: 560px; height: min(100%, 900px); border-radius: 20px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.3); } }
.lembar .panel { background: var(--krem); width: 100%; height: 100%; display: flex; flex-direction: column; }
.lembar-kepala { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--kertas); border-bottom: 1px solid var(--garis); flex: none; }
.lembar-kepala h2 { font-size: 20px; }
.kembali { border: 0; background: none; font-size: 24px; width: 44px; height: 44px; border-radius: 10px; }
.gulir { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.kaki-lembar { flex: none; padding: 10px 16px max(12px, env(safe-area-inset-bottom)); background: var(--kertas); border-top: 1px solid var(--garis); }
.kotak { background: var(--kertas); border: 1px solid var(--garis); border-radius: 14px; padding: 12px 14px; }
.kotak h4 { margin: 0 0 8px; font-size: 13px; color: var(--abu); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.baris { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; font-size: 15px; padding: 4px 0; }
.baris > span:first-child { overflow-wrap: anywhere; }
.baris > span:last-child { flex: none; }
.baris.total { font-weight: 700; border-top: 1px dashed var(--garis); margin-top: 6px; padding-top: 8px; font-size: 16px; }
.item-kr { padding: 8px 0; border-bottom: 1px solid var(--garis); }
.item-kr:last-of-type { border-bottom: 0; }
.item-kr .atas { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.item-kr .nm { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.item-kr .hg { font-size: 14px; color: var(--abu); }
.jml-kecil { display: flex; align-items: center; border: 1px solid var(--garis); border-radius: 10px; background: #fff; flex: none; }
.jml-kecil button { border: 0; background: none; width: 40px; height: 40px; font-size: 20px; color: var(--karamel-tua); }
.jml-kecil b { min-width: 22px; text-align: center; }
.pilih { display: flex; gap: 8px; }
.pilih label { flex: 1; position: relative; }
.pilih input { position: absolute; opacity: 0; pointer-events: none; }
.pilih span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 46px; font-size: 15px; padding: 8px 6px; border: 1.5px solid var(--garis); border-radius: 10px; background: #fff; cursor: pointer; }
.pilih input:checked + span { border-color: var(--karamel); background: var(--karamel-muda); font-weight: 700; }
.pilih input:focus-visible + span { outline: 2px solid var(--karamel); outline-offset: 2px; }
.isian, .lembar input:not([type=radio]), .lembar select, .lembar textarea, .cek-form input { display: block; width: 100%; border: 1px solid var(--garis); border-radius: 10px; padding: 11px 12px; font-size: 16px; background: #fff; margin-top: 8px; min-height: 46px; }
.lembar textarea { min-height: 70px; resize: vertical; }
.lembar input:focus, .lembar select:focus, .lembar textarea:focus, .cek-form input:focus { outline: 2px solid var(--karamel); outline-offset: 0; border-color: var(--karamel); }
.label-isian { display: block; font-size: 14px; font-weight: 600; margin-top: 10px; }
.label-isian:first-of-type { margin-top: 0; }
.dua { display: flex; gap: 8px; }
.dua > * { flex: 1; min-width: 0; }
.catat { font-size: 13px; color: var(--abu); margin-top: 6px; }
.galat { background: #fde2e1; color: var(--merah); border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.tombol-utama { width: 100%; background: var(--karamel); color: #fff; border: 0; font-weight: 700; padding: 15px; border-radius: 14px; font-size: 17px; min-height: 52px; box-shadow: 0 6px 18px rgba(200,116,47,.35); }
.tombol-utama:disabled { opacity: .6; }
.tombol-wa { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; background: var(--hijau); color: #fff; font-weight: 700; padding: 15px; border-radius: 14px; font-size: 17px; text-decoration: none; min-height: 52px; }
.tombol-kedua { width: 100%; background: none; border: 1px solid var(--garis); padding: 12px; border-radius: 12px; font-weight: 600; min-height: 46px; color: var(--cokelat2); }

/* Pesanan tercatat & cek status */
.centang { width: 64px; height: 64px; border-radius: 50%; background: #dcfce7; color: var(--hijau); font-size: 34px; display: grid; place-items: center; margin: 6px auto 0; }
.judul-tengah { text-align: center; font-size: 23px; }
.kode { text-align: center; font-size: 14px; color: var(--abu); }
.kode b { display: block; font-size: 28px; color: var(--cokelat); letter-spacing: 2px; margin-top: 2px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.langkah { background: #fff7e6; border: 1px solid #f3d9a8; border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.rek { display: flex; gap: 12px; align-items: center; }
.rek img { width: 120px; height: 120px; object-fit: contain; border: 1px solid var(--garis); border-radius: 8px; background: #fff; flex: none; cursor: zoom-in; }
.salin { border: 0; background: var(--karamel-muda); color: var(--karamel-tua); font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 8px; margin-left: 4px; min-height: 30px; }
.langkah-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.langkah-status li { display: flex; gap: 12px; align-items: center; padding: 8px 0; color: var(--abu); }
.langkah-status li i { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--garis); display: grid; place-items: center; font-style: normal; font-size: 14px; flex: none; background: #fff; }
.langkah-status li.lewat { color: var(--cokelat); }
.langkah-status li.lewat i { background: var(--hijau); border-color: var(--hijau); color: #fff; }
.langkah-status li.kini { color: var(--cokelat); font-weight: 700; }
.langkah-status li.kini i { border-color: var(--karamel); background: var(--karamel-muda); }
.chip { display: inline-block; font-size: 13px; font-weight: 700; border-radius: 99px; padding: 2px 10px; }
.chip.belum { background: #fde2e1; color: var(--merah); }
.chip.dp { background: #fff3c4; color: #6b4e00; }
.chip.lunas { background: #dcfce7; color: var(--hijau); }
.chip.batal { background: #eee; color: #555; }

/* Pemberitahuan kecil */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 40; background: var(--cokelat); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.25); max-width: calc(100% - 32px); }
/* Kabar dari toko (web jalur utama, WA cadangan) */
.kabari { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #eef4ff; border: 1px solid #c7d7fe; border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.kabari > span { flex: 1 1 200px; }
.kabari.aktif { background: #e8f7ee; border-color: #b7e4c7; }
.tombol-kabari { flex: 1 1 100%; min-height: 48px; border: 0; border-radius: 12px; background: #2563eb; color: #fff; font-weight: 700; font-size: 16px; }
.tombol-kabari:disabled { opacity: .6; }
.pesan-toko { background: #fff7e6; border: 1px solid #f3d9a8; border-radius: 14px; padding: 12px 14px; }
.pesan-toko h4 { margin: 0 0 4px; font-size: 13px; color: #8a4a14; text-transform: uppercase; letter-spacing: .4px; }
.pesan-toko p { margin: 0; font-size: 16px; white-space: pre-line; overflow-wrap: anywhere; }
.riwayat { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.riwayat li { font-size: 14px; border-left: 3px solid var(--karamel-muda); padding-left: 10px; overflow-wrap: anywhere; }
.riwayat small { display: block; color: var(--abu); font-size: 12px; }
.cadangan { text-align: center; font-size: 14px; color: var(--abu); }
.cadangan a { color: var(--hijau); font-weight: 700; }
.kredit { margin: 18px 0 0 !important; padding-top: 12px; border-top: 1px dashed var(--garis); text-align: center; font-size: 12px; color: var(--abu); }
.kredit a { color: var(--cokelat2); font-weight: 700; text-decoration: none; }
/* Tombol WhatsApp melayang (cadangan) */
.wa-melayang { position: fixed; right: 16px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 11; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.28); text-decoration: none; transition: bottom .2s ease; }
.wa-melayang svg { width: 32px; height: 32px; }
.wa-melayang:active { transform: scale(.94); }
/* Naik di atas bilah keranjang; sembunyi saat lembar pesanan/selesai terbuka (tak menutupi tombol Kirim). */
body:has(#bilah:not([hidden])) .wa-melayang { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 84px) !important; }
body:has(.lembar:not([hidden])) .wa-melayang { display: none !important; }
/* Chat per pesanan */
.chat .obrolan { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; margin-bottom: 10px; padding: 2px; }
.chat .bbl { max-width: 85%; padding: 8px 11px; border-radius: 14px; font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.chat .bbl small { display: block; font-size: 11px; color: var(--abu); margin-top: 2px; }
.chat .bbl.pembeli { justify-self: end; background: #dbeafe; border-bottom-right-radius: 4px; }
.chat .bbl.toko { justify-self: start; background: var(--karamel-muda); border-bottom-left-radius: 4px; }
.kirim-chat { display: flex; gap: 8px; }
.kirim-chat textarea { flex: 1; min-width: 0; min-height: 46px; padding: 11px 12px; border: 1px solid var(--garis); border-radius: 12px; font: inherit; font-size: 16px; resize: none; background: #fff; color: var(--cokelat); }
.kirim-chat button { flex: none; border: 0; border-radius: 12px; background: var(--karamel); color: #fff; font-weight: 700; padding: 0 16px; min-height: 46px; }
.kirim-chat button:disabled { opacity: .6; }
/* Kartu tautan di kaki halaman (WhatsApp / Facebook / Peta) */
.sosial { display: grid; gap: 10px; margin: 14px 0 6px; }
@media (min-width: 640px) { .sosial { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.sos { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 16px; background: #fff; border: 1px solid var(--garis); text-decoration: none; color: var(--cokelat); box-shadow: 0 2px 8px rgba(74,44,29,.06); transition: transform .15s ease, box-shadow .15s ease; }
.sos:active { transform: scale(.98); }
@media (hover: hover) { .sos:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(74,44,29,.12); } }
.sos .ik { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.sos.wa .ik { background: #25d366; } .sos.fb .ik { background: #1877f2; } .sos.peta .ik { background: #ea4335; }
.sos > span:nth-child(2) { flex: 1; min-width: 0; }
.sos b { display: block; font-size: 15px; }
.sos small { display: block; font-size: 13px; color: var(--abu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sos .panah { flex: none; font-size: 24px; color: var(--abu); line-height: 1; }
/* Kaki halaman cokelat seperti kepala */
.kaki { background: var(--cokelat); color: #f3e2cf; border-top: 0; }
.kaki h2 { color: #fff6ea; }
.kaki a { color: #fcd9b0; }
.kaki .catat { color: #d9bfa6; }
.kaki .catat a { color: #fcd9b0; font-weight: 700; }
.kaki .sos { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); color: #fff6ea; box-shadow: none; }
.kaki .sos small, .kaki .sos .panah { color: #d9bfa6; }
@media (hover: hover) { .kaki .sos:hover { background: rgba(255,255,255,.12); box-shadow: 0 8px 18px rgba(0,0,0,.25); } }
.kaki .cek-form input { background: #fff; border-color: transparent; }
.kaki .cek-form .salin { background: var(--karamel); color: #fff; }
.kaki .kredit { border-top-color: rgba(255,255,255,.18); color: #d9bfa6; }
.kaki .kredit a { color: #fcd9b0; }
.bilah { border: 1px solid rgba(255,246,234,.22); }
/* Jarak bawah kaki: kecil saat keranjang kosong, lega saat bilah keranjang tampil (supaya tak tertutup). */
.kaki { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
body:has(#bilah:not([hidden])) .kaki { padding-bottom: 104px; }
main.menu { padding-bottom: 32px; }
