/* ═══════════════════════════════════════
   JagoanMakan — Public Customer Pages
   Mobile-first, modern food ordering UI
   ═══════════════════════════════════════ */

/* ─── Base ─── */
.public-page {
  background: #fafafa;
  padding-bottom: 100px; /* space for cart bar */
}

/* ─── Public Header ─── */
.public-header {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(231,76,60,0.3);
}

.public-header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.public-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.public-logo .logo-icon {
  font-size: 32px;
}

.public-logo h1 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.branch-tag {
  display: inline-block;
  font-size: 11px;
  background: rgba(255,255,255,0.2);
  padding: 1px 8px;
  border-radius: 8px;
  margin-top: 2px;
}

.public-nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

/* ─── Branch Bar ─── */
.branch-bar {
  max-width: 800px;
  margin: 0 auto;
  padding: 8px 16px;
  background: white;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  position: sticky;
  top: 56px;
  z-index: 99;
}

.branch-select {
  flex: 1;
  border: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.branch-select:focus { outline: none; }

/* ─── Main Content Area ─── */
.public-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 12px 16px;
}

/* ─── Hero ─── */
.order-hero {
  text-align: center;
  padding: 24px 16px 16px;
  margin-bottom: 8px;
}

.order-hero h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.order-hero p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ─── Menu Grid ─── */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

@media (min-width: 480px) {
  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.menu-item-card {
  background: white;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  transition: all 0.2s;
  overflow: hidden;
}

.menu-item-card:active {
  transform: scale(0.98);
}

.menu-item-name {
  font-size: 15px;
  font-weight: 600;
}

.menu-item-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.menu-item-stock {
  font-size: 11px;
  color: var(--text-muted);
}

.menu-item-stock.low {
  color: var(--warning);
  font-weight: 600;
}

.menu-item-stock.out {
  color: var(--primary);
  font-weight: 700;
}

.menu-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.btn-menu-add,
.btn-menu-remove {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  background: white;
}

.btn-menu-add {
  color: var(--success);
  border-color: var(--success);
}

.btn-menu-add:hover {
  background: var(--success);
  color: white;
}

.btn-menu-add.added {
  background: var(--success);
  color: white;
}

.btn-menu-remove {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-menu-remove:hover {
  background: var(--primary);
  color: white;
}

.menu-item-qty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  user-select: none;
}

.qty-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.qty-btn.minus:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.qty-btn.plus:hover {
  border-color: var(--success);
  color: var(--success);
}

/* ─── Cart Bottom Bar ─── */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  padding: 12px 16px;
  z-index: 200;
  display: none;
}

.cart-bar.visible {
  display: block;
}

.cart-bar-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-info {
  display: flex;
  flex-direction: column;
}

.cart-count {
  font-size: 14px;
  font-weight: 600;
}

.cart-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.btn-order-now {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-order-now:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231,76,60,0.3);
}

/* ─── Checkout Modal ─── */
.checkout-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  align-items: flex-end;
  justify-content: center;
}

.checkout-overlay.open {
  display: flex;
}

.checkout-sheet {
  background: white;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  animation: sheetUp 0.3s ease;
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.checkout-sheet h2 {
  font-size: 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-items {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 14px;
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-form .form-group {
  margin-bottom: 0;
}

.checkout-form label {
  font-size: 13px;
  font-weight: 600;
}

.form-row-group {
  display: flex;
  gap: 10px;
}

.form-row-group .form-group {
  flex: 1;
}

.btn-checkout-submit {
  background: var(--success);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-checkout-submit:hover {
  background: #219a52;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(39,174,96,0.3);
}

.btn-checkout-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── Confirmation Page ─── */
.confirm-page {
  text-align: center;
  padding: 40px 16px;
}

.confirm-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.confirm-page h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.confirm-page .order-id {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.confirm-ref {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.confirm-details {
  background: white;
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.confirm-details h3 {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-muted);
}

.confirm-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 3px 0;
}

.confirm-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  color: var(--primary);
}

.pay-button-wrap {
  margin: 20px 0;
}

.btn-pay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-pay:hover {
  background: #219a52;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(39,174,96,0.3);
}

.btn-back-menu {
  display: inline-block;
  margin-top: 12px;
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

/* ─── Status Check Page ─── */
.status-page {
  padding: 24px 0;
}

.status-page h2 {
  text-align: center;
  margin-bottom: 4px;
}

.status-page .subtext {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

.status-search {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

.status-search label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}

.status-search .form-control {
  margin-bottom: 10px;
}

.btn-search {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}

.btn-search:hover {
  background: var(--primary-dark);
}

/* ─── Order Status Cards ─── */
.order-status-card {
  background: white;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 10px;
}

.order-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.order-status-header .order-number {
  font-size: 16px;
  font-weight: 700;
}

.order-status-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
}

.badge-pending { background: #fff3cd; color: #856404; }
.badge-paid { background: #d4edda; color: #155724; }
.badge-processing { background: #cce5ff; color: #004085; }
.badge-done { background: #d4edda; color: #155724; }
.badge-cancelled { background: #f8d7da; color: #721c24; }

.order-status-items {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}

.order-status-total {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.order-status-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Empty State ─── */
.order-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
}

.order-empty .icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.order-empty h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

/* ─── Menu Item Images (Web Order) ─── */
.menu-item-img-wrap {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: #f5f5f5;
  cursor: pointer;
  flex-shrink: 0;
}
.menu-item-img-wrap.menu-item-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #ccc;
}
.menu-item-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  transition: transform .3s;
  display: block;
}
.menu-item-img-wrap:hover .menu-item-img {
  transform: scale(1.05);
}
.menu-item-card .menu-item-name,
.menu-item-card .menu-item-price,
.menu-item-card .menu-item-stock,
.menu-item-card .menu-item-actions {
  padding: 10px 14px 2px;
}
/* spacing for the actions */
.menu-item-card .menu-item-actions {
  padding-bottom: 12px;
}

/* ─── Menu Image Lightbox ─── */
.menu-lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.menu-lightbox-overlay.open {
  display: flex;
}
