:root {
  --green: #3a7d44;
  --green-light: #e8f5e9;
  --green-dark: #2d6135;
  --navy: #1b2a4a;
  --navy-dark: #111d33;
  --brown: #6f4e37;
  --brown-light: #f5ede6;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e0e0e0;
  --bg: #fafaf8;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { overflow-x: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Prevent iOS Safari from zooming on input focus */
input, select, textarea { font-size: 16px; }

a { color: var(--green); text-decoration: none; }

/* ── Navbar ── */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1b2a4a;
  letter-spacing: -0.5px;
}
.navbar .logo span { color: #1b2a4a; }

#hours-modal-body > div:last-child { border-bottom: none !important; }

.back-btn {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  padding: 0.3rem 0;
}
.back-btn:hover { opacity: 0.7; }

.cart-btn {
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.45rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cart-btn:hover { background: var(--green-dark); }
.cart-count {
  background: var(--white);
  color: var(--green);
  border-radius: 50%;
  width: 20px; height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

/* ── Category filter ── */
.categories {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.cat-btn {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.cat-btn.active, .cat-btn:hover {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}

/* ── Menu grid ── */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
}

.menu-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.menu-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--green-light);
}
.menu-card .card-img-placeholder {
  width: 100%;
  height: 180px;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}
.card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.card-title { font-weight: 600; font-size: 1rem; }
.card-category { font-size: 0.78rem; color: var(--muted); margin: 0.15rem 0 0.4rem; }
.card-desc { font-size: 0.82rem; color: var(--muted); flex: 1; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.8rem; }
.card-price { font-weight: 700; color: var(--green); font-size: 1.05rem; }

.options-row { display: flex; gap: 0.5rem; margin: 0.6rem 0; }
.opt-label {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.82rem; cursor: pointer;
}
.opt-label input { accent-color: var(--green); }

.add-btn {
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.add-btn:hover { background: var(--green-dark); }

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

.cart-drawer {
  position: fixed;
  top: 0; right: -400px;
  width: min(400px, 100vw);
  height: 100vh;
  height: 100dvh;
  background: var(--white);
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  z-index: 201;
  display: flex; flex-direction: column;
  transition: right 0.25s ease;
}
.cart-drawer.open { right: 0; }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.cart-header h2 { font-size: 1.1rem; }
.close-btn { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); }

.cart-items { flex: 1; overflow-y: auto; padding: 0.5rem 0; }

.cart-item {
  display: flex; gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
/* Thumbnail */
.cart-item-img {
  width: 58px; height: 58px; border-radius: 8px;
  overflow: hidden; flex-shrink: 0;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }

/* Body */
.cart-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }

/* Top row: name + ✕ */
.cart-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.4rem; }
.cart-item-name { font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.cart-del-btn {
  background: #fde8e8; border: none; cursor: pointer;
  color: #c0392b; font-size: 0.78rem; font-weight: 700;
  line-height: 1; padding: 0.25rem 0.45rem;
  border-radius: 5px; flex-shrink: 0;
}
.cart-del-btn:active { background: #c0392b; color: var(--white); }

/* Meta: option badge + comments */
.cart-item-meta { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.cart-item-opt {
  font-size: 0.72rem; color: var(--muted); text-transform: capitalize;
  background: var(--bg); border-radius: 4px; padding: 0.1rem 0.4rem;
}

/* Bottom row: qty controls + price + edit */
.cart-item-bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.25rem;
}
.cart-item-right { display: flex; align-items: center; gap: 0.6rem; }
.cart-item-subtotal { font-weight: 700; font-size: 0.88rem; }
.cart-edit-link {
  font-size: 0.75rem; color: var(--white); background: var(--navy);
  border: none; cursor: pointer;
  padding: 0.25rem 0.6rem; border-radius: 5px; font-weight: 600;
}
.cart-edit-link:active { background: var(--navy-dark); }
.qty-controls { display: flex; align-items: center; gap: 0.4rem; }
.qty-btn {
  width: 36px; height: 36px;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--white); cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.qty-btn:hover { background: var(--green-light); }

.cart-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.cart-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1rem; margin-bottom: 0.8rem; }
.checkout-btn {
  width: 100%;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.checkout-btn:hover { background: var(--navy-dark); }
.checkout-btn:disabled { background: var(--muted); cursor: not-allowed; }

.empty-cart { text-align: center; color: var(--muted); padding: 2rem 0; }

/* ── Forms ── */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.9rem;
  background: var(--white);
  color: var(--text);
}
.form-group input:focus,
.form-group select:focus { outline: none; border-color: var(--green); }

/* ── Checkout page ── */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 760px) {
  .checkout-layout { grid-template-columns: 1fr; }
}

.card-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.card-box h2 { font-size: 1.1rem; margin-bottom: 1.2rem; }

.order-summary-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.order-summary-item:last-child { border: none; }
.summary-total {
  display: flex; justify-content: space-between;
  font-weight: 700; font-size: 1rem;
  margin-top: 0.75rem; padding-top: 0.75rem;
  border-top: 2px solid var(--text);
}

.place-order-btn {
  width: 100%;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1rem;
}
.place-order-btn:hover { background: var(--green-dark); }
.place-order-btn:disabled { background: var(--muted); cursor: not-allowed; }

/* ── Payment page ── */
.payment-card {
  max-width: 480px;
  margin: 3rem auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
}
.payment-card h1 { font-size: 1.4rem; color: var(--green); margin-bottom: 0.5rem; }
.payment-amount { font-size: 2rem; font-weight: 700; margin: 0.5rem 0 1.25rem; }
.paynow-qr {
  max-width: 220px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0 auto 0.5rem;
  display: block;
}
.qr-save-hint {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 1.25rem;
}
.paynow-qr-placeholder {
  width: 220px;
  height: 220px;
  background: var(--green-light);
  border: 2px dashed var(--green);
  border-radius: 8px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  font-size: 0.85rem;
}
.paid-btn {
  background: #25D366;
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
}
.paid-btn:hover { background: #128c55; }
.payment-note { font-size: 0.8rem; color: var(--muted); margin-top: 0.75rem; }

/* ── Admin panel ── */
.admin-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 56px;
}
.admin-nav .logo { font-weight: 700; color: var(--green); margin-right: 1rem; }
.tab-link {
  background: none; border: none;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
}
.tab-link.active { color: var(--green); border-bottom-color: var(--green); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Admin table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table th {
  text-align: left;
  padding: 0.6rem 0.8rem;
  background: var(--green-light);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--green-dark);
}
.data-table td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--bg); }
.data-table img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }

.btn { padding: 0.35rem 0.8rem; border-radius: 6px; border: none; cursor: pointer; font-size: 0.82rem; font-weight: 600; }
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-dark); }
.btn-danger { background: #fde8e8; color: #c0392b; }
.btn-danger:hover { background: #c0392b; color: var(--white); }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.78rem; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: min(500px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.modal h3 { margin-bottom: 1.25rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.25rem; }

/* Order item picker (Create Order modal) */
.order-item-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.order-item-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.order-item-row:last-child { border-bottom: none; }
.oi-name { font-weight: 600; font-size: 0.88rem; }
.oi-price { font-size: 0.78rem; color: var(--muted); }
.oi-opts { display: flex; gap: 0.4rem; margin-top: 0.35rem; flex-wrap: wrap; }
.oi-opts .sheet-opt { padding: 0.25rem 0.55rem; font-size: 0.75rem; margin-bottom: 0; }
.oi-qty-ctrl { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.oi-qty-ctrl .qty-btn { width: 28px; height: 28px; font-size: 0.9rem; }
.oi-qty-ctrl span { min-width: 1.2rem; text-align: center; font-weight: 600; }

/* Interval rows (Pickup Hours tab) */
.day-label {
  width: 110px; font-weight: 600; font-size: 0.9rem;
  display: flex; align-items: center; gap: 0.5rem;
  padding-top: 0.35rem; flex-shrink: 0;
}
.intervals-wrap { display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.intervals-wrap.disabled { opacity: 0.35; pointer-events: none; }
.interval-row { display: flex; align-items: center; gap: 0.45rem; }
.interval-row input[type="time"] {
  padding: 0.3rem 0.5rem; border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.85rem;
}
.interval-sep { color: var(--muted); font-size: 0.85rem; }
.interval-del-btn {
  background: #fde8e8; border: none; cursor: pointer;
  color: #c0392b; font-size: 0.8rem; padding: 0.2rem 0.45rem;
  border-radius: 5px; line-height: 1;
}
.interval-del-btn:hover { background: #c0392b; color: var(--white); }
.interval-del-placeholder { width: 28px; display: inline-block; }
.interval-add-btn {
  align-self: flex-start; margin-top: 0.1rem;
  background: var(--green-light); color: var(--green);
  border: 1px solid var(--green); font-size: 0.78rem;
}

/* Store hours grid */
.hours-grid { display: flex; flex-direction: column; gap: 0.9rem; }
.hours-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.hours-row label.day { width: 100px; font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.hours-row .time-range { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; }
.hours-row input[type="time"] { padding: 0.3rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; }
.hours-row .time-range.disabled { opacity: 0.35; pointer-events: none; }

/* Drag-and-drop reordering */
.drag-handle {
  cursor: grab;
  color: #bbb;
  font-size: 1.1rem;
  padding: 0 0.5rem !important;
  user-select: none;
  text-align: center;
}
.drag-handle:active { cursor: grabbing; }
tr.row-dragging { opacity: 0.35; }
tr.row-drag-over td { background: var(--green-light); }
tr.row-drag-over td:first-child { border-left: 3px solid var(--green); }

/* Status badge */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-pending { background: #fff3cd; color: #856404; }
.badge-confirmed { background: #d1ecf1; color: #0c5460; }
.badge-completed { background: #d4edda; color: #155724; }
.badge-cancelled { background: #f8d7da; color: #721c24; }

/* Options checkboxes in admin */
.opts-check { display: flex; gap: 1rem; }
.opts-check label { display: flex; align-items: center; gap: 0.35rem; font-size: 0.88rem; cursor: pointer; }
.opts-check input { accent-color: var(--green); }

/* Availability toggle */
.toggle-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.88rem; }
.toggle-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--green); }

/* Toast */
.toast {
  position: fixed;
  top: 1rem; right: 1rem;
  transform: translateY(-120px);
  opacity: 0;
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  max-width: 180px;
  text-align: center;
  z-index: 999;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--white); color: var(--navy); }
.toast.error { background: #fde8e8; color: #c0392b; border-color: #c0392b; }

/* Misc */
.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem; }
.text-muted { color: var(--muted); font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.slot-info { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }
.pickup-away-note { font-size: 0.76rem; color: var(--muted); margin-top: 0.6rem; }
.pickup-away-note a { color: var(--muted); text-decoration: underline; }

/* ── Date Calendar Picker ── */
.date-calendar {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  user-select: none;
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--navy);
  color: var(--white);
  padding: 0.65rem 0.9rem;
}
.cal-month-title { font-weight: 700; font-size: 0.9rem; }
.cal-nav-btn {
  background: none; border: none;
  color: var(--white); font-size: 1.5rem; line-height: 1;
  padding: 0.05rem 0.4rem; border-radius: 6px; cursor: pointer;
}
.cal-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.2); }
.cal-nav-btn:disabled { opacity: 0.3; cursor: default; }
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #e8ecf3;
  border-bottom: 1px solid var(--border);
}
.cal-weekday {
  text-align: center;
  font-size: 0.65rem; font-weight: 700;
  color: var(--navy); padding: 0.4rem 0;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0.45rem 0.3rem;
  gap: 3px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 0.85rem;
  color: #ccc;
  cursor: default;
}
.cal-day.cal-available {
  color: var(--text); font-weight: 600; cursor: pointer;
  background: #e8ecf3;
}
.cal-day.cal-available:hover { background: var(--navy); color: var(--white); }
.cal-day.cal-today {
  border: 2px solid var(--navy);
  color: var(--navy); font-weight: 700;
}
.cal-day.cal-selected {
  background: var(--navy) !important;
  color: var(--white) !important;
  font-weight: 700; border: none;
}
.cal-empty-msg {
  padding: 1.1rem 1rem;
  text-align: center;
  color: var(--muted); font-size: 0.85rem; line-height: 1.6;
}

@media (max-width: 600px) {
  .container { padding: 1rem; }
  .menu-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .checkout-layout { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .menu-grid { grid-template-columns: 1fr; }
}

/* ── Store profile ── */
.store-profile { background: var(--white); }
.store-banner {
  width: 100%; height: 110px;
  background: #1b2a4a;
}
.store-info-wrap { text-align: center; padding: 0 1rem 1rem; }
.store-avatar {
  width: 78px; height: 78px;
  border-radius: 50%;
  border: 3px solid var(--white);
  background: var(--white);
  margin: -40px auto 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center;
}
.store-avatar img { width: 100%; height: 100%; object-fit: cover; }
.store-avatar-emoji { font-size: 2rem; }
.store-name { font-size: 1.4rem; font-weight: 700; margin: 0 0 0.35rem; }
.store-status-row {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--muted); font-size: 0.85rem; margin-bottom: 0.35rem;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #ccc; }
.status-dot.open  { background: #27ae60; }
.status-dot.closed { background: #e74c3c; }
.store-address { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.55rem; }
.store-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; padding-bottom: 0.25rem; }
.store-tag {
  font-size: 0.76rem; color: var(--green);
  padding: 0.2rem 0.65rem;
  border-radius: 20px; background: var(--green-light);
}

/* ── Category strip ── */
.cat-strip {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0.8rem;
  display: flex; gap: 0.65rem;
  overflow-x: auto;
  position: sticky; top: 0; z-index: 50;
}
.cat-strip::-webkit-scrollbar { display: none; }
.cat-pill {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  cursor: pointer; background: none;
  border: 2px solid transparent; border-radius: 10px;
  padding: 0.2rem 0.4rem; min-width: 54px;
}
.cat-pill.active { border-color: var(--green); }
.cat-pill-img {
  width: 42px; height: 42px; border-radius: 8px;
  object-fit: cover; display: block;
}
.cat-pill-all, .cat-pill-emoji {
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--green);
}
.cat-pill-label {
  font-size: 0.7rem; color: var(--text); white-space: nowrap;
  max-width: 58px; overflow: hidden; text-overflow: ellipsis;
}
.cat-pill.active .cat-pill-label { color: var(--green); font-weight: 600; }

/* ── Menu list ── */
#menu-list { padding: 0 0.75rem; }
.menu-section {
  background: var(--white);
  margin-bottom: 1rem;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0,0,0,0.08);
}
.menu-section-header {
  padding: 1rem 1rem 0.5rem;
  font-size: 1.05rem; font-weight: 700;
}
.menu-list-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
}
.menu-list-item:first-of-type { border-top: none; }
.menu-list-item:active { background: var(--bg); }
.menu-list-content { flex: 1; min-width: 0; }
.menu-list-name { font-weight: 700; font-size: 1rem; margin-bottom: 0.2rem; line-height: 1.3; }
.menu-list-desc {
  font-size: 0.84rem; color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.35rem;
  line-height: 1.4;
}
.menu-list-price { font-size: 1rem; font-weight: 700; color: var(--text); }
.menu-list-img {
  width: 90px; height: 90px; border-radius: 12px;
  flex-shrink: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; overflow: hidden;
}
.menu-list-img img { width: 100%; height: 100%; object-fit: cover; }

/* ── Floating cart button ── */
.float-cart-btn {
  position: fixed;
  bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
  left: 50%; transform: translateX(-50%);
  background: var(--navy); color: var(--white);
  border: none; border-radius: 30px;
  padding: 0.8rem 1.5rem;
  font-size: 0.95rem; font-weight: 700;
  cursor: pointer; z-index: 150;
  box-shadow: 0 4px 16px rgba(27,42,74,0.4);
  display: flex; align-items: center; justify-content: center;
  min-width: 200px;
  white-space: nowrap;
}
.float-cart-btn:hover { background: var(--navy-dark); }
.float-cart-count {
  background: var(--white); color: var(--green);
  border-radius: 50%; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  margin-left: 0.6rem;
}

/* ── Item bottom sheet ── */
.item-sheet-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 300;
}
.item-sheet-overlay.open { display: block; }
.item-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white); border-radius: 18px 18px 0 0;
  padding: 1.25rem 1.25rem calc(2rem + env(safe-area-inset-bottom, 0px));
  z-index: 301;
  transform: translateY(100%);
  transition: transform 0.28s ease;
  max-height: 80vh; overflow-y: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.item-sheet::-webkit-scrollbar { display: none; }
.item-sheet.open { transform: translateY(0); }
#sheet-img-wrap {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.sheet-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sheet-item-name { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.3rem; }
.sheet-item-desc { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }
.sheet-options { display: flex; gap: 0.75rem; margin-bottom: 1.25rem; }
.sheet-opt {
  flex: 1; padding: 0.65rem;
  border: 2px solid var(--border); border-radius: 10px;
  text-align: center; cursor: pointer; font-size: 0.9rem;
  background: none; transition: all 0.1s;
}
.sheet-opt.selected { border-color: var(--green); background: var(--green-light); color: var(--green); font-weight: 600; }
.sheet-opt:disabled { opacity: 0.7; cursor: default; }
.sheet-add-btn {
  width: 100%; background: var(--navy); color: var(--white);
  border: none; border-radius: 12px; padding: 0.9rem 1rem;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
}
.sheet-add-btn:hover { background: var(--navy-dark); }

/* Sheet qty row */
.sheet-qty-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.sheet-qty-label { font-weight: 600; font-size: 0.9rem; }
.sheet-qty-ctrl  { display: flex; align-items: center; gap: 0.9rem; }
.sheet-qty-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--white);
  cursor: pointer; font-size: 1.1rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.sheet-qty-btn:active { background: var(--green-light); border-color: var(--green); }
#sheet-qty-display { font-size: 1rem; font-weight: 700; min-width: 22px; text-align: center; }


.cart-del-btn:active { background: #fde8e8; border-color: #c0392b; color: #c0392b; }

/* ── Mobile layout ── */
@media (max-width: 600px) {
  /* Float button: full-width bar at the bottom */
  .float-cart-btn {
    left: 0.75rem; right: 0.75rem;
    width: auto; transform: none;
    border-radius: 14px;
  }

  /* Clear space so last menu item isn't hidden under the float button */
  #menu-list { padding-bottom: 90px; }

  /* Cart drawer: full width */
  .cart-drawer { width: 100vw; right: -100vw; }
  .cart-drawer.open { right: 0; }


  .menu-list-img { width: 80px; height: 80px; }
  #menu-list { padding: 0 0.5rem 100px; }

  /* Checkout: stack columns, summary before pay button */
  .checkout-layout { grid-template-columns: 1fr; }
  .card-box { padding: 1rem; }

  /* Give form inputs more tap-friendly height */
  .form-group input,
  .form-group select { padding: 0.7rem 0.8rem; }

  /* Admin modal: full width, pinned to bottom */
  .modal { width: 100vw; max-height: 90vh; border-radius: 16px 16px 0 0; }
  .modal-overlay.open { align-items: flex-end; }

  /* Hours modal: centred, not pinned to bottom */
  #hours-modal.open { align-items: center; }
  #hours-modal .modal { width: calc(100vw - 2rem); border-radius: var(--radius); }

  /* Shrink admin table font */
  .data-table { font-size: 0.8rem; }
  .data-table td, .data-table th { padding: 0.5rem; }

  /* Store profile adjustments */
  .store-banner { height: 90px; }
  .store-name { font-size: 1.25rem; }
}

@media (max-width: 380px) {
  .cat-pill { min-width: 46px; }
  .cat-pill-img { width: 36px; height: 36px; }
  .menu-list-img { width: 72px; height: 72px; }
}

@media (min-width: 601px) {
  .item-sheet {
    left: 50%;
    right: auto;
    width: 460px;
    border-radius: 18px;
    bottom: 2rem;
    transform: translateX(-50%) translateY(calc(100% + 2rem));
    box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  }
  .item-sheet.open {
    transform: translateX(-50%) translateY(0);
  }
}
