/* ================================================================
 * APOTEKAPP — tampilan pelanggan (mobile-first, tema hijau daun)
 * ================================================================ */
:root {
  --hijau: #2E7D32;
  --hijau-tua: #1B5E20;
  --hijau-muda: #E8F5E9;
  --hijau-terang: #66BB6A;
  --daun: #A5D6A7;
  --tinta: #1F2A24;
  --abu: #66736B;
  --garis: #E1EAE3;
  --latar: #F4F8F5;
  --putih: #fff;
  --merah: #D84343;
  --kuning: #F5A623;
  --radius: 16px;
  --bayang: 0 6px 24px rgba(27, 94, 32, .08);
  --nav-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--latar); color: var(--tinta); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; padding-bottom: calc(var(--nav-h) + 12px);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 14px; }
.sr { position: absolute; left: -9999px; }

/* ---------- header ---------- */
.hdr { position: sticky; top: 0; z-index: 40; background: var(--hijau); color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.12); }
.hdr .wrap { display: flex; align-items: center; gap: 10px; height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -.2px; white-space: nowrap; }
.logo .ikon { width: 34px; height: 34px; border-radius: 10px; background: #fff; color: var(--hijau); display: grid; place-items: center; font-size: 22px; font-weight: 900; }
.logo small { display: block; font-weight: 500; font-size: 11px; opacity: .85; margin-top: -2px; }
.cari { flex: 1; display: flex; align-items: center; background: rgba(255,255,255,.16); border-radius: 12px; padding: 0 12px; height: 40px; min-width: 0; }
.cari input { flex: 1; border: 0; background: transparent; color: #fff; outline: 0; min-width: 0; }
.cari input::placeholder { color: rgba(255,255,255,.75); }
.hdr-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center; }
.hdr-btn svg { width: 22px; height: 22px; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--kuning); color: #1F2A24; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.tgl-bar { background: var(--hijau-tua); color: #d9f0da; font-size: 12px; }
.tgl-bar .wrap { height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tgl-bar b { color: #fff; font-weight: 700; }
@media (max-width: 640px) { .logo span.teks { display: none; } .tgl-bar .jam { display: none; } }

/* ---------- hero ---------- */
.hero { margin: 14px 0; border-radius: 22px; background: linear-gradient(135deg, var(--hijau-tua), var(--hijau) 55%, #43A047); color: #fff; padding: 22px 20px; position: relative; overflow: hidden; box-shadow: var(--bayang); }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero::before { content: ""; position: absolute; right: 30px; bottom: -70px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.06); }
.hero h1 { font-size: 22px; font-weight: 800; letter-spacing: -.3px; position: relative; }
.hero p { margin: 6px 0 0; opacity: .92; font-size: 13.5px; position: relative; max-width: 520px; }
.hero .chips { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; position: relative; }
.hero .chips span { background: rgba(255,255,255,.18); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 600; }
@media (min-width: 720px) { .hero { padding: 34px 32px; } .hero h1 { font-size: 30px; } }

/* ---------- kategori chips ---------- */
.kat-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.kat-scroll::-webkit-scrollbar { display: none; }
.kat { flex: 0 0 auto; border: 1.5px solid var(--garis); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--abu); display: flex; gap: 6px; align-items: center; }
.kat.aktif { background: var(--hijau); border-color: var(--hijau); color: #fff; }

.judul-bagian { display: flex; align-items: baseline; justify-content: space-between; margin: 10px 0 10px; }
.judul-bagian h2 { font-size: 16px; font-weight: 800; }
.judul-bagian a { font-size: 13px; color: var(--hijau); font-weight: 700; }

/* ---------- grid produk ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(5, 1fr); } }
.kartu { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--garis); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; position: relative; }
.kartu:active { transform: scale(.98); }
@media (hover:hover) { .kartu:hover { box-shadow: var(--bayang); transform: translateY(-2px); } }
.kartu .gbr { aspect-ratio: 1; background: var(--hijau-muda); display: grid; place-items: center; overflow: hidden; }
.kartu .gbr img { width: 100%; height: 100%; object-fit: cover; }
.kartu .gbr .tanpa { font-size: 40px; opacity: .55; }
.kartu .isi { padding: 10px 10px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.kartu .nama { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.kartu .harga { font-weight: 800; color: var(--hijau-tua); font-size: 15px; }
.kartu .harga s { color: var(--abu); font-weight: 500; font-size: 11px; margin-left: 5px; }
.kartu .meta { font-size: 11px; color: var(--abu); }
.kartu .tambah { margin-top: auto; border: 0; background: var(--hijau); color: #fff; border-radius: 10px; padding: 8px; font-weight: 700; font-size: 13px; }
.kartu .tambah:disabled { background: #cfd8d1; }
.tag { position: absolute; top: 8px; left: 8px; background: var(--kuning); color: #1F2A24; font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 6px; z-index: 1; }
.tag.resep { background: #E3F2FD; color: #1565C0; }
.tag.habis { background: #444; color: #fff; }
.qty { display: flex; align-items: center; justify-content: space-between; border: 1.5px solid var(--hijau); border-radius: 10px; overflow: hidden; margin-top: auto; }
.qty button { border: 0; background: var(--hijau-muda); color: var(--hijau-tua); width: 34px; height: 32px; font-weight: 800; font-size: 16px; }
.qty b { font-size: 14px; }

/* ---------- panel / kotak ---------- */
.panel { background: #fff; border: 1px solid var(--garis); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.panel h3 { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.kosong { text-align: center; padding: 50px 16px; color: var(--abu); }
.kosong .ik { font-size: 52px; margin-bottom: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 700; background: var(--hijau); color: #fff; width: 100%; font-size: 15px; }
.btn.putih { background: #fff; color: var(--hijau-tua); border: 1.5px solid var(--hijau); }
.btn.abu { background: var(--hijau-muda); color: var(--hijau-tua); }
.btn.wa { background: #25D366; }
.btn.kecil { width: auto; padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.baris-tombol { display: flex; gap: 8px; }
.baris-tombol .btn { flex: 1; }

label.f { display: block; font-size: 12.5px; font-weight: 700; color: var(--abu); margin: 10px 0 5px; }
.in { width: 100%; border: 1.5px solid var(--garis); border-radius: 12px; padding: 11px 13px; background: #fff; outline: 0; }
.in:focus { border-color: var(--hijau); box-shadow: 0 0 0 3px rgba(46,125,50,.12); }
textarea.in { min-height: 76px; resize: vertical; }
.pilih { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pilih label { border: 1.5px solid var(--garis); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; background: #fff; }
.pilih label.aktif { border-color: var(--hijau); background: var(--hijau-muda); }
.pilih input { accent-color: var(--hijau); }
.metode { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 640px) { .metode { grid-template-columns: 1fr 1fr; } }
.metode label { border: 1.5px solid var(--garis); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; gap: 10px; align-items: center; background: #fff; }
.metode label.aktif { border-color: var(--hijau); background: var(--hijau-muda); }
.metode .lg { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; font-size: 12px; color: #fff; flex: 0 0 auto; }
.metode small { display: block; color: var(--abu); font-size: 11.5px; }
.lg.qris { background: #1a1a1a; } .lg.bank { background: #1E5AA8; } .lg.ewallet { background: #0A84FF; } .lg.cod { background: #6D4C41; }
.lg.bca { background: #005EB8; } .lg.mandiri { background: #003D79; } .lg.bri { background: #00529C; } .lg.bni { background: #F15A22; }
.lg.dana { background: #108EE9; } .lg.gopay { background: #00AED6; } .lg.ovo { background: #4C2A86; } .lg.shopeepay { background: #EE4D2D; }

.item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--garis); }
.item:last-child { border-bottom: 0; }
.item .th { width: 58px; height: 58px; border-radius: 12px; background: var(--hijau-muda); overflow: hidden; flex: 0 0 auto; display: grid; place-items: center; }
.item .th img { width: 100%; height: 100%; object-fit: cover; }
.item .nm { font-weight: 600; font-size: 13.5px; }
.item .hg { color: var(--hijau-tua); font-weight: 800; font-size: 13px; }
.item .kanan { margin-left: auto; text-align: right; }
.item .qty { margin: 0; width: 100px; }
.hapus { border: 0; background: none; color: var(--merah); font-size: 12px; font-weight: 700; padding: 2px 0; }
.ringkas { font-size: 14px; }
.ringkas div { display: flex; justify-content: space-between; padding: 4px 0; }
.ringkas .total { border-top: 1px dashed var(--garis); margin-top: 6px; padding-top: 8px; font-weight: 800; font-size: 17px; color: var(--hijau-tua); }
.stiky-bawah { position: fixed; left: 0; right: 0; bottom: var(--nav-h); z-index: 30; background: #fff; border-top: 1px solid var(--garis); padding: 10px 14px; box-shadow: 0 -6px 20px rgba(0,0,0,.06); }
.stiky-bawah .wrap { display: flex; align-items: center; gap: 12px; }
.stiky-bawah .btn { flex: 1; }
@media (min-width: 900px) { .stiky-bawah { bottom: 0; } }
.dua { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .dua { grid-template-columns: 1.6fr 1fr; align-items: start; } .dua .lengket { position: sticky; top: 100px; } }

/* status pesanan */
.status-pil { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.st-baru { background: #FFF3E0; color: #E65100; }
.st-dibayar { background: #E3F2FD; color: #1565C0; }
.st-diproses { background: #EDE7F6; color: #512DA8; }
.st-dikirim { background: #E0F7FA; color: #00838F; }
.st-selesai { background: var(--hijau-muda); color: var(--hijau-tua); }
.st-batal { background: #FFEBEE; color: #C62828; }
.langkah { display: flex; justify-content: space-between; margin: 12px 0 4px; }
.langkah div { flex: 1; text-align: center; font-size: 10.5px; color: var(--abu); position: relative; }
.langkah div::before { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--garis); margin: 0 auto 4px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--garis); }
.langkah div.ok { color: var(--hijau-tua); font-weight: 700; }
.langkah div.ok::before { background: var(--hijau); box-shadow: 0 0 0 1px var(--hijau); }
.langkah div:not(:last-child)::after { content: ""; position: absolute; top: 7px; left: 50%; right: -50%; height: 2px; background: var(--garis); z-index: -1; }
.langkah div.ok:not(:last-child)::after { background: var(--daun); }
.kotak-bayar { background: var(--hijau-muda); border-radius: 12px; padding: 12px; margin-top: 8px; }
.kotak-bayar .no { font-size: 20px; font-weight: 900; letter-spacing: .5px; color: var(--hijau-tua); }
.kotak-bayar img { width: 220px; max-width: 100%; margin: 8px auto; border-radius: 12px; background: #fff; padding: 8px; }
.salin { border: 0; background: #fff; color: var(--hijau-tua); border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 700; margin-left: 8px; }
.pratinjau { width: 100%; max-height: 300px; object-fit: contain; border-radius: 12px; background: var(--hijau-muda); margin-top: 8px; }
.info-kuning { background: #FFF8E1; border: 1px solid #FFE082; color: #6D4C00; border-radius: 12px; padding: 10px 12px; font-size: 13px; margin: 8px 0; }
.info-biru { background: #E3F2FD; border: 1px solid #90CAF9; color: #0D47A1; border-radius: 12px; padding: 10px 12px; font-size: 13px; margin: 8px 0; }

/* detail produk */
.detail { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 760px) { .detail { grid-template-columns: 1fr 1.2fr; } }
.detail .gbr { border-radius: var(--radius); overflow: hidden; background: var(--hijau-muda); aspect-ratio: 1; display: grid; place-items: center; }
.detail .gbr img { width: 100%; height: 100%; object-fit: cover; }
.detail h1 { font-size: 20px; font-weight: 800; }
.detail .harga { font-size: 24px; font-weight: 900; color: var(--hijau-tua); margin: 8px 0; }
.detail .desk { white-space: pre-wrap; color: #3d4a42; font-size: 14px; }
.kembali { display: inline-flex; gap: 6px; align-items: center; color: var(--hijau); font-weight: 700; font-size: 13px; margin: 12px 0 8px; }

/* ---------- bottom nav ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav-h); background: #fff; border-top: 1px solid var(--garis); display: flex; z-index: 45; padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--abu); position: relative; }
.nav a svg { width: 24px; height: 24px; }
.nav a.aktif { color: var(--hijau); }
.nav a .badge { top: 8px; right: calc(50% - 22px); }
@media (min-width: 900px) { .nav { display: none; } body { padding-bottom: 30px; } }
.footer { text-align: center; color: var(--abu); font-size: 12px; padding: 24px 0 8px; }
.wa-float { position: fixed; right: 14px; bottom: calc(var(--nav-h) + 14px); width: 52px; height: 52px; border-radius: 50%; background: #25D366; color: #fff; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(37,211,102,.4); z-index: 35; }
.wa-float svg { width: 28px; height: 28px; }
@media (min-width: 900px) { .wa-float { bottom: 24px; } }

/* ---------- toast & modal ---------- */
#toast-wrap { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { background: #263238; color: #fff; padding: 11px 14px; border-radius: 12px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: masuk .25s ease; }
.toast.sukses { background: var(--hijau); } .toast.gagal { background: var(--merah); }
@keyframes masuk { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.modal-bg { position: fixed; inset: 0; background: rgba(15,30,20,.55); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 18px 16px 24px; max-height: 92vh; overflow: auto; animation: naik .25s ease; }
@media (min-width: 640px) { .modal-bg { align-items: center; } .modal { border-radius: 22px; } }
@keyframes naik { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 17px; font-weight: 800; margin-bottom: 10px; }
.skeleton { background: linear-gradient(90deg, #eef3ef 25%, #f6f9f6 50%, #eef3ef 75%); background-size: 200% 100%; animation: shim 1.2s infinite; border-radius: var(--radius); height: 220px; }
@keyframes shim { to { background-position: -200% 0; } }
.tabel-r { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabel-r td { padding: 8px 4px; border-bottom: 1px solid var(--garis); vertical-align: top; }
.muted { color: var(--abu); font-size: 12.5px; }
