/* ============================================================
   LORONG KOPI — tampilan pelanggan (mobile-first)
   ============================================================ */
:root {
  --bg:           #f6f7f9;
  --surface:      #ffffff;
  --border:       rgba(11, 11, 11, 0.08);
  --ink:          #0b0b0b;
  --ink-2:        #52514e;
  --ink-muted:    #898781;
  --primary:      #2a78d6;
  --primary-soft: #e8f1fc;
  --primary-dark: #1c5cab;
  --radius:       16px;
  --nav-h:        62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14.5px;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1010;
}
.site-header .inner {
  display: flex; align-items: center; gap: 12px;
  height: 60px;
}
.logo-toko {
  width: 38px; height: 38px; border-radius: 11px; object-fit: cover; flex-shrink: 0;
}
.logo-ikon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
.nama-toko { font-weight: 800; font-size: 16px; line-height: 1.15; }
.jam-toko { font-size: 11.5px; color: var(--ink-muted); font-weight: 500; }

.nav-desktop { display: none; margin-left: auto; gap: 4px; }
.nav-desktop a {
  padding: 9px 16px; border-radius: 10px;
  font-weight: 600; color: var(--ink-2); font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
.nav-desktop a:hover { background: var(--bg); color: var(--ink); }
.nav-desktop a.aktif { background: var(--primary-soft); color: var(--primary-dark); }

/* Tombol keluar/masuk cepat di header */
.btn-keluar {
  margin-left: auto; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 10px;
  border: 1.5px solid #f0c9c9; background: #fdeeee; color: #b3403f;
  font-weight: 700; font-size: 13px;
}
.btn-keluar:active { transform: scale(.96); }
.btn-keluar i { font-size: 16px; }
.btn-masuk { border-color: rgba(42,120,214,.35); background: var(--primary-soft); color: var(--primary-dark); }
.nav-desktop ~ .btn-keluar { margin-left: 12px; }
@media (max-width: 480px) { .btn-keluar-teks { display: none; } .btn-keluar { padding: 9px 11px; } }

/* ---------- Bottom nav (mobile) ---------- */
.nav-bawah {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1020;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-bawah a {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-muted); font-size: 11px; font-weight: 600;
  position: relative;
}
.nav-bawah a i { font-size: 20px; }
.nav-bawah a.aktif { color: var(--primary); }
.badge-keranjang {
  position: absolute; top: 7px; left: calc(50% + 6px);
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: #d03b3b; color: #fff;
  font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Banner & info toko ---------- */
.banner-toko {
  border-radius: var(--radius);
  overflow: hidden; margin-top: 14px;
  position: relative;
  background: linear-gradient(120deg, var(--primary-dark), var(--primary));
  color: #fff;
}
.banner-toko img { width: 100%; height: 150px; object-fit: cover; display: block; }
.banner-isi { padding: 20px 18px; }
.banner-isi h1 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.banner-isi p { margin: 0; font-size: 13px; opacity: .9; }

/* ---------- Pencarian & kategori ---------- */
.cari-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px; margin: 14px 0 10px;
}
.cari-box i { color: var(--ink-muted); }
.cari-box input {
  border: 0; outline: 0; flex: 1; font: inherit; background: none; min-width: 0;
}
.chip-baris {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px;
  scrollbar-width: none;
}
.chip-baris::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.chip.aktif { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Grid menu ---------- */
.judul-bagian { font-size: 16px; font-weight: 800; margin: 14px 0 10px; }
.grid-menu {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.kartu-menu {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.kartu-menu .foto {
  aspect-ratio: 4 / 3; width: 100%; object-fit: cover; display: block;
  background: var(--bg);
}
.kartu-menu .foto-kosong {
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-size: 34px;
}
.kartu-menu .isi { padding: 10px 12px 12px; flex: 1; display: flex; flex-direction: column; }
.kartu-menu .nama { font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.kartu-menu .ket { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kartu-menu .bawah {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 10px;
}
.kartu-menu .harga { font-weight: 800; font-size: 14px; color: var(--primary-dark); }
.btn-tambah {
  width: 34px; height: 34px; border-radius: 10px; border: 0;
  background: var(--primary); color: #fff; font-size: 17px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .1s, background .15s;
}
.btn-tambah:active { transform: scale(.92); }
.btn-tambah:hover { background: var(--primary-dark); }

/* ---------- Kartu umum ---------- */
.kartu {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.kartu + .kartu { margin-top: 12px; }

/* ---------- Keranjang ---------- */
.item-keranjang {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.item-keranjang:last-child { border-bottom: 0; }
.item-keranjang .thumb {
  width: 58px; height: 58px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.stepper {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.stepper button {
  width: 30px; height: 30px; border: 0; background: var(--surface);
  font-size: 15px; color: var(--primary); cursor: pointer; font-weight: 700;
}
.stepper button:hover { background: var(--primary-soft); }
.stepper .qty { min-width: 26px; text-align: center; font-weight: 700; font-size: 13.5px; }

.bar-total {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 12px 16px; z-index: 1015;
}
.bar-total .inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}

/* ---------- Tombol ---------- */
.btn-utama {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: #fff; border: 0;
  padding: 12px 22px; border-radius: 12px;
  font: inherit; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.btn-utama:hover { background: var(--primary-dark); color: #fff; }
.btn-utama:disabled { opacity: .5; cursor: default; }
.btn-garis {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface); color: var(--primary);
  border: 1.5px solid var(--primary);
  padding: 11px 20px; border-radius: 12px;
  font: inherit; font-weight: 700; cursor: pointer;
}
.btn-garis:hover { background: var(--primary-soft); color: var(--primary-dark); }
.btn-blok { width: 100%; }

/* ---------- Form ---------- */
.form-grup { margin-bottom: 14px; }
.form-grup label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.input {
  width: 100%; padding: 11px 14px;
  border: 1px solid rgba(11,11,11,.14); border-radius: 11px;
  font: inherit; background: var(--surface);
}
.input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(42,120,214,.15); }
textarea.input { resize: vertical; }

.pilih-metode { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pilih-metode label {
  border: 1.5px solid var(--border); border-radius: 12px;
  padding: 14px; text-align: center; cursor: pointer;
  font-weight: 700; display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.pilih-metode label small { font-weight: 500; color: var(--ink-muted); }
.pilih-metode input { display: none; }
.pilih-metode input:checked + label,
.pilih-metode label:has(input:checked) {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark);
}

/* ---------- Badge status (samakan dgn admin) ---------- */
.badge-status {
  display: inline-flex; align-items: center;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-menunggu { background: #fdf3dd; color: #9a6a00; }
.badge-diproses { background: #e8f1fc; color: #1c5cab; }
.badge-siap     { background: #edeafb; color: #4a3aa7; }
.badge-selesai  { background: #e5f5ef; color: #0e7a55; }
.badge-batal    { background: #fdeeee; color: #b3403f; }

/* ---------- Toast ---------- */
.toast-lk {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(20px);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px);
  background: var(--ink); color: #fff;
  padding: 11px 20px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 1030; white-space: nowrap;
}
.toast-lk.tampil { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Halaman auth ---------- */
.auth-wrap { max-width: 420px; margin: 28px auto 0; padding: 0 16px; }
.auth-kartu {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 30px 26px;
}

/* ---------- Kosong ---------- */
.kosong {
  text-align: center; padding: 56px 20px; color: var(--ink-muted);
}
.kosong i { font-size: 44px; display: block; margin-bottom: 12px; color: var(--primary); opacity: .6; }

/* ---------- Alert ---------- */
.pesan-info {
  border-radius: 12px; padding: 12px 16px; font-size: 13.5px; font-weight: 500;
  margin: 14px 0;
}
.pesan-sukses { background: #e5f5ef; color: #0e7a55; }
.pesan-gagal  { background: #fdeeee; color: #b3403f; }

/* ============================================================
   Desktop / laptop (≥ 992px)
   ============================================================ */
@media (min-width: 992px) {
  body { padding-bottom: 40px; font-size: 15px; }
  .nav-bawah { display: none; }
  .nav-desktop { display: flex; }
  .site-header .inner { height: 68px; }
  .banner-toko img { height: 240px; }
  .banner-isi h1 { font-size: 26px; }
  .grid-menu { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .kartu-menu .nama { font-size: 14.5px; }
  .bar-total { bottom: 0; }
  .bar-total .inner { padding: 0 16px; }
  .toast-lk { bottom: 90px; }
}
@media (min-width: 768px) and (max-width: 991.98px) {
  .grid-menu { grid-template-columns: repeat(3, 1fr); }
  .banner-toko img { height: 200px; }
}

/* ============================================================
   Sheet opsi pesanan (ala Kopi Kenangan)
   ============================================================ */
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 1040;
}
.sheet-overlay.buka { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
  transform: translateY(105%); transition: transform .25s ease;
  box-shadow: 0 -12px 40px rgba(0,0,0,.18);
}
.sheet.buka { transform: translateY(0); }
.sheet-garis {
  width: 42px; height: 4.5px; border-radius: 3px;
  background: var(--border); margin: 4px auto 12px;
}
.sheet-atas { display: flex; gap: 13px; align-items: center; margin-bottom: 6px; }
.sheet-foto {
  width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex-shrink: 0;
}
.sheet-foto-kosong {
  background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 26px;
}
.sheet-tutup {
  margin-left: auto; width: 34px; height: 34px; flex-shrink: 0;
  border: 0; border-radius: 50%; background: var(--bg); color: var(--ink-2);
  font-size: 14px; cursor: pointer;
}
.opsi-grup { margin-top: 14px; }
.opsi-judul { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.opsi-pil { display: flex; flex-wrap: wrap; gap: 8px; }
.opsi-pil label { cursor: pointer; }
.opsi-pil input { display: none; }
.opsi-pil span {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 15px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  transition: all .12s;
}
.opsi-pil span small { font-weight: 500; color: var(--ink-muted); font-size: 11px; }
.opsi-pil input:checked + span {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark);
}
.opsi-pil input:checked + span small { color: var(--primary-dark); }

@media (min-width: 992px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: 440px; border-radius: 22px;
    transform: translate(-50%, -46%); opacity: 0; pointer-events: none;
    transition: opacity .18s, transform .18s;
  }
  .sheet.buka { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
  .sheet-garis { display: none; }
}

/* ---------- Sapaan user ---------- */
.salam-user {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 16px;
}
.salam-emoji { font-size: 26px; }
.salam-teks { font-size: 15px; font-weight: 600; }
.salam-teks b { font-weight: 800; }
.salam-sub { font-size: 12.5px; color: var(--ink-muted); }
