:root {
  --red: #e2231a;
  --red-dark: #b81c14;
  --yellow: #ffc72c;
  --dark: #2b2222;
  --gray-bg: #f6f4f1;
  --card: #ffffff;
  --border: #e8e2da;
  --text: #2b2222;
  --text-light: #7a7069;
  --success: #2e9e4f;
  --warn: #d98a12;
  --danger: #c62828;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(43,34,34,0.08);
  /* BIKASS logo green, sampled from the printed logo/menu artwork */
  --brand-green: #368246;
  --brand-green-dark: #285f34;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--gray-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html { scroll-behavior: smooth; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

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

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--brand-green);
  color: #fff;
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  white-space: nowrap;
}
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
}
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.topbar-actions .pill { background: rgba(255,255,255,0.12); }
.topbar-actions .pill:hover { background: rgba(255,255,255,0.2); }

.pill {
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  background: var(--red);
  transition: background 0.15s, transform 0.1s;
}
.pill:hover { background: var(--red-dark); }
.pill:active { transform: scale(0.97); }
.pill.ghost { background: transparent; border: 1px solid rgba(255,255,255,0.4); }
.pill.ghost:hover { background: rgba(255,255,255,0.1); }
.pill.small { padding: 6px 12px; font-size: 13px; }
.pill.yellow { background: var(--yellow); color: var(--dark); }
.pill.yellow:hover { background: #f0b400; }
.pill.outline-dark { background: transparent; border: 1px solid var(--border); color: var(--text); }
.pill.outline-dark:hover { background: #f0ece5; }
.pill[disabled] { opacity: 0.5; cursor: not-allowed; }

.cart-btn { position: relative; }
.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--yellow);
  color: var(--dark);
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---------- Hero banner (menu heading, with burger + Coca-Cola) ---------- */
.hero-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(135deg, var(--brand-green), var(--brand-green-dark));
  border-radius: var(--radius);
  padding: 22px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-text { flex: 1; min-width: 150px; text-align: center; }
.hero-text h1 { margin: 0 0 4px; color: #fff; font-size: 26px; }
.hero-tagline { margin: 0 0 4px; font-size: 14px; color: #fff; opacity: 0.95; }
.hero-welcome { margin: 0; font-size: 13px; color: #fff; opacity: 0.85; }
.hero-side-img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.35));
  flex-shrink: 0;
}
@media (max-width: 560px) {
  .hero-banner { flex-wrap: wrap; padding: 18px 14px; }
  .hero-side-img { width: 64px; height: 64px; }
  .hero-text h1 { font-size: 22px; }
}

/* ---------- Layout sections ---------- */
.page { padding: 24px 0 80px; }
.section-title {
  font-size: 22px;
  font-weight: 800;
  margin: 28px 0 14px;
}
.section-title:first-child { margin-top: 0; }

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 0 4px;
  position: sticky;
  top: 57px;
  background: var(--gray-bg);
  z-index: 40;
}
.category-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  color: var(--text);
}
.tab-btn.active { background: var(--red); border-color: var(--red); color: #fff; }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.item-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border);
}
.item-emoji { font-size: 40px; line-height: 1; }
.item-photo {
  width: 100%;
  height: 100px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: var(--gray-bg);
}
.item-name { font-weight: 700; font-size: 16px; }
.item-desc { color: var(--text-light); font-size: 13px; min-height: 34px; }
.item-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.item-price { font-weight: 800; font-size: 16px; }
.unavailable-tag { font-size: 12px; color: var(--danger); font-weight: 700; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-bg);
  border-radius: 999px;
  padding: 4px;
}
.qty-control button {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--dark);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
}
.qty-control span { min-width: 16px; text-align: center; font-weight: 700; }

/* ---------- Cards / panels ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  border: 1px solid var(--border);
}

.auth-wrap {
  max-width: 420px;
  margin: 40px auto;
}
.auth-wrap h1 { text-align: center; margin-bottom: 4px; }
.auth-wrap p.sub { text-align: center; color: var(--text-light); margin-top: 0; margin-bottom: 20px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-light); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--red); outline-offset: 1px; }

.form-actions { margin-top: 18px; }
.form-actions .pill { width: 100%; text-align: center; padding: 12px; font-size: 15px; }

.switch-link { text-align: center; margin-top: 14px; font-size: 14px; color: var(--text-light); }
.switch-link a { color: var(--red); font-weight: 700; cursor: pointer; }

.demo-hint {
  background: #fff8e6;
  border: 1px solid #ffe6a3;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #7a5b00;
  margin-bottom: 16px;
}

.error-box {
  background: #fdecea;
  border: 1px solid #f5c6c3;
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.success-box {
  background: #eaf7ee;
  border: 1px solid #bfe6ca;
  color: var(--success);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ---------- Cart drawer ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
  display: none;
}
.overlay.open { display: block; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 100%;
  max-width: 420px;
  background: #fff;
  z-index: 100;
  box-shadow: -8px 0 30px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-header h2 { margin: 0; font-size: 18px; }
.drawer-close { background: none; border: none; font-size: 22px; color: var(--text-light); }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 18px; }
.drawer-footer { padding: 16px 18px; border-top: 1px solid var(--border); }

.cart-line { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-line-emoji { font-size: 28px; }
.cart-line-info { flex: 1; }
.cart-line-name { font-weight: 700; font-size: 14px; }
.cart-line-price { font-size: 13px; color: var(--text-light); }
.cart-line-remove { background: none; border: none; color: var(--danger); font-size: 13px; font-weight: 600; }

.cart-total-row { display: flex; justify-content: space-between; font-weight: 800; font-size: 17px; margin-bottom: 14px; }
.empty-state { text-align: center; color: var(--text-light); padding: 40px 10px; }
.empty-state .big-emoji { font-size: 44px; margin-bottom: 10px; }

/* ---------- Orders ---------- */
.order-card { margin-bottom: 16px; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.order-id { font-weight: 800; }
.order-date { font-size: 12.5px; color: var(--text-light); }
.status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-placed { background: #fff3d6; color: #8a6100; }
.status-preparing { background: #fde3cd; color: #a04f00; }
.status-out_for_delivery { background: #dbeafe; color: #1e50a2; }
.status-delivered { background: #e0f5e5; color: var(--success); }
.status-cancelled { background: #fdecea; color: var(--danger); }

.progress-track {
  display: flex;
  margin: 16px 0 6px;
}
.progress-step { flex: 1; text-align: center; position: relative; }
.progress-step .dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--border);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 6px;
  font-size: 13px;
  font-weight: 800;
}
.progress-step.done .dot { background: var(--success); }
.progress-step.current .dot { background: var(--red); }
.progress-step .label { font-size: 11px; color: var(--text-light); }
.progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 13px; left: 50%;
  width: 100%; height: 3px;
  background: var(--border);
  z-index: -1;
}
.progress-step.done:not(:last-child)::after { background: var(--success); }

.order-items-list { margin: 12px 0; font-size: 14px; }
.order-items-list div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--text-light); }

.order-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- Feedback ---------- */
.star-picker { display: flex; gap: 6px; font-size: 28px; margin-bottom: 6px; }
.star-picker span { cursor: pointer; color: var(--border); transition: color 0.1s; }
.star-picker span.filled { color: var(--yellow); }

.feedback-card { margin-bottom: 12px; }
.feedback-stars { color: var(--yellow); letter-spacing: 2px; }
.feedback-meta { font-size: 12.5px; color: var(--text-light); margin-top: 2px; }
.feedback-comment { margin-top: 8px; font-size: 14px; }
.admin-reply {
  margin-top: 10px;
  background: var(--gray-bg);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.admin-reply b { color: var(--red); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  max-width: 440px;
  width: 100%;
  padding: 22px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h2 { margin-top: 0; }

/* ---------- Tabs (generic) ---------- */
.tabbar {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tabbar button {
  background: none;
  border: none;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-light);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}
.tabbar button.active { color: var(--red); border-bottom-color: var(--red); }

/* ---------- Admin ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.stat-card .value { font-size: 26px; font-weight: 800; }
.stat-card .label { font-size: 12.5px; color: var(--text-light); margin-top: 2px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-light); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.table-wrap { overflow-x: auto; }

.status-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}

.menu-admin-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.menu-admin-row .item-emoji { font-size: 28px; }
.menu-admin-row .grow { flex: 1; }
.menu-admin-row .name { font-weight: 700; }
.menu-admin-row .meta { font-size: 12.5px; color: var(--text-light); }
.row-actions { display: flex; gap: 8px; }
.row-actions button { font-size: 12.5px; padding: 6px 10px; }

.filters-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) {
  .two-col { grid-template-columns: 1fr; }
}

.footer-note {
  text-align: center;
  color: var(--text-light);
  font-size: 12.5px;
  padding: 30px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.footer-logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.footer-food-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 0 16px 26px;
  font-size: 12.5px;
  color: var(--text-light);
}
.footer-link {
  color: var(--text-light);
  text-decoration: none;
}
.footer-link:hover { color: var(--brand-green); text-decoration: underline; }
.footer-sep { opacity: 0.5; }
.footer-quick-service {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #25d366;
  font-weight: 700;
}
.footer-quick-service:hover { color: #1ebe5a; text-decoration: underline; }
.footer-quick-service svg { flex-shrink: 0; }
.footer-complaints a { color: var(--text-light); text-decoration: underline; }
.footer-complaints a:hover { color: var(--brand-green); }

.badge-role {
  font-size: 11px;
  background: var(--yellow);
  color: var(--dark);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 800;
}

.loading { text-align: center; padding: 40px; color: var(--text-light); }

/* ---------- Checkout: payment options ---------- */
.payment-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.payment-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.payment-option input { width: auto; margin: 0; }
.payment-option:has(input:checked) { border-color: var(--red); background: #fff5f4; }
.payment-detail-box {
  background: var(--gray-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text-light);
  margin-bottom: 14px;
}

/* ---------- Floating contact widget (WhatsApp + call, per branch) ---------- */
.contact-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.contact-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  font-size: 24px;
  transition: transform 0.15s;
  border: none;
  background: #25d366;
  color: #fff;
}
.contact-btn:hover { transform: scale(1.08); }
.contact-btn:active { transform: scale(0.96); }
.contact-icon { line-height: 1; display: flex; }
.contact-icon svg, .contact-mini-btn svg { display: block; }

.contact-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  min-width: 230px;
}
.contact-widget.open .contact-panel { display: flex; }
.contact-branch { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.contact-branch-name { font-size: 13px; font-weight: 700; color: var(--text); }
.contact-branch-actions { display: flex; gap: 6px; }
.contact-mini-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}
.contact-mini-btn.whatsapp { background: #25d366; }
.contact-mini-btn.call { background: var(--red); }

@media (max-width: 480px) {
  .contact-widget { right: 12px; bottom: 12px; }
  .contact-btn { width: 46px; height: 46px; font-size: 20px; }
  .contact-panel { min-width: 200px; }
}

/* ---------- Floating, draggable cart button ---------- */
.cart-fab {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 150;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--brand-green);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: box-shadow 0.15s;
}
.cart-fab:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.3); }
.cart-fab.dragging { cursor: grabbing; box-shadow: 0 10px 26px rgba(0,0,0,0.38); }
.cart-fab-icon { line-height: 1; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.cart-fab-icon svg { display: block; }
.cart-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--yellow);
  color: var(--dark);
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  pointer-events: none;
}
@keyframes cart-fab-bounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.28); }
  55% { transform: scale(0.9); }
  75% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.cart-fab.bounce { animation: cart-fab-bounce 0.5s ease; }
@media (max-width: 480px) {
  .cart-fab { left: 12px; bottom: 12px; width: 50px; height: 50px; font-size: 22px; }
}
