/* ==========================================================
   WARUNG MAKAN - STYLE UTAMA
   ========================================================== */

:root {
  --color-primary: #ff6b35;
  --color-primary-dark: #e65a2b;
  --color-primary-light: #ffe8dd;
  --color-secondary: #2ec4b6;
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #6b6b6b;
  --color-border: #e8e8e8;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.12);
  --transition: all 0.2s ease;
  --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
  --color-bg: #121212;
  --color-surface: #1e1e1e;
  --color-text: #f2f2f2;
  --color-text-muted: #a3a3a3;
  --color-border: #2e2e2e;
  --color-primary-light: #3a2419;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
  padding-bottom: 70px;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------------- LOADING SCREEN ---------------- */
#loading-screen {
  position: fixed; inset: 0; background: var(--color-bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; flex-direction: column; gap: 16px;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-spinner {
  width: 48px; height: 48px; border: 4px solid var(--color-primary-light);
  border-top-color: var(--color-primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- HEADER ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; max-width: 1200px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; }
.brand img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}
.status-pill.buka { background: #dcfce7; color: #15803d; }
.status-pill.tutup { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .status-pill.buka { background: #14532d; color: #86efac; }
[data-theme="dark"] .status-pill.tutup { background: #7f1d1d; color: #fca5a5; }

.header-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-bg); transition: var(--transition);
}
.icon-btn:hover { background: var(--color-primary-light); }
.cart-badge {
  position: absolute; top: -4px; right: -4px; background: var(--color-primary);
  color: white; font-size: 0.65rem; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

nav.main-nav {
  display: flex; gap: 4px; padding: 0 20px 12px; max-width: 1200px; margin: 0 auto;
  overflow-x: auto; scrollbar-width: none;
}
nav.main-nav::-webkit-scrollbar { display: none; }
nav.main-nav a {
  padding: 8px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 500;
  color: var(--color-text-muted); white-space: nowrap; transition: var(--transition);
}
nav.main-nav a:hover, nav.main-nav a.active { background: var(--color-primary); color: white; }

/* ---------------- BOTTOM NAV (mobile) ---------------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  display: flex; justify-content: space-around; padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 0.65rem; color: var(--color-text-muted); position: relative; padding: 4px 10px;
}
.bottom-nav a.active { color: var(--color-primary); }
.bottom-nav svg { width: 22px; height: 22px; }

/* ---------------- HERO / BANNER ---------------- */
.banner-slider {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  margin: 16px 20px; box-shadow: var(--shadow-md); aspect-ratio: 16/7;
  background: var(--color-primary-light);
}
.banner-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s ease;
}
.banner-slide.active { opacity: 1; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-dots {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.banner-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.6); transition: var(--transition);
}
.banner-dots span.active { background: white; width: 20px; border-radius: 4px; }

/* ---------------- SECTION ---------------- */
.section { padding: 24px 20px; }
.section-title {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.section-title h2 { font-size: 1.15rem; font-weight: 700; }
.section-title a.see-all { font-size: 0.8rem; color: var(--color-primary); font-weight: 600; }

/* ---------------- KATEGORI ---------------- */
.kategori-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.kategori-scroll::-webkit-scrollbar { display: none; }
.kategori-item {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 18px; background: var(--color-surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); min-width: 84px; transition: var(--transition);
}
.kategori-item:hover, .kategori-item.active { background: var(--color-primary); color: white; transform: translateY(-2px); }
.kategori-item .icon-circle {
  width: 40px; height: 40px; border-radius: 50%; background: var(--color-primary-light);
  display: flex; align-items: center; justify-content: center;
}
.kategori-item span { font-size: 0.75rem; font-weight: 600; text-align: center; }

/* ---------------- PRODUK GRID ---------------- */
.produk-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
@media (min-width: 640px) { .produk-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .produk-grid { grid-template-columns: repeat(4, 1fr); } }

.produk-card {
  background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: var(--transition); position: relative;
}
.produk-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.produk-card .foto-wrap { position: relative; aspect-ratio: 1/1; background: var(--color-primary-light); overflow: hidden; }
.produk-card .foto-wrap img { width: 100%; height: 100%; object-fit: cover; }
.produk-badges { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; }
.badge {
  font-size: 0.62rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; color: white;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.badge.best { background: #f59e0b; }
.badge.baru { background: #2ec4b6; }
.badge.diskon { background: var(--color-danger); }
.badge.habis { background: #6b6b6b; }
.produk-info { padding: 10px 12px 12px; }
.produk-info h3 { font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.harga-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.harga-sekarang { font-weight: 700; color: var(--color-primary); font-size: 0.9rem; }
.harga-coret { font-size: 0.72rem; color: var(--color-text-muted); text-decoration: line-through; }
.produk-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.68rem; color: var(--color-text-muted); }
.btn-add-cart {
  position: absolute; bottom: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-primary); color: white; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); transition: var(--transition);
}
.btn-add-cart:hover { background: var(--color-primary-dark); transform: scale(1.1); }
.btn-add-cart:disabled { background: #9ca3af; cursor: not-allowed; }

/* ---------------- PROMO CARD ---------------- */
.promo-scroll { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.promo-scroll::-webkit-scrollbar { display: none; }
.promo-card {
  flex: 0 0 auto; width: 260px; border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm); background: var(--color-surface);
}
.promo-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.promo-card .promo-body { padding: 10px 12px; }
.promo-card h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 4px; }
.promo-card p { font-size: 0.75rem; color: var(--color-text-muted); }

/* ---------------- INFO CARD (jam, alamat, wa) ---------------- */
.info-cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .info-cards { grid-template-columns: repeat(3, 1fr); } }
.info-card {
  background: var(--color-surface); border-radius: var(--radius-md); padding: 16px;
  box-shadow: var(--shadow-sm); display: flex; gap: 12px; align-items: flex-start;
}
.info-card .icon-circle {
  width: 40px; height: 40px; border-radius: 50%; background: var(--color-primary-light);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--color-primary);
}
.info-card h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 4px; }
.info-card p { font-size: 0.78rem; color: var(--color-text-muted); }

/* ---------------- FOOTER ---------------- */
footer.site-footer {
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  padding: 32px 20px 90px; margin-top: 32px;
}
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 24px; max-width: 1200px; margin: 0 auto; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 8px; }
.footer-col h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 10px; }
.footer-col p, .footer-col a { font-size: 0.8rem; color: var(--color-text-muted); display: block; margin-bottom: 6px; }
.social-links { display: flex; gap: 10px; margin-top: 10px; }
.social-links a {
  width: 34px; height: 34px; border-radius: 50%; background: var(--color-bg);
  display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.social-links a:hover { background: var(--color-primary); color: white; }
.footer-bottom { text-align: center; font-size: 0.72rem; color: var(--color-text-muted); margin-top: 24px; }

/* ---------------- BUTTONS ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.88rem;
  transition: var(--transition); text-align: center;
}
.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-primary:disabled { background: #d1d5db; cursor: not-allowed; }
.btn-outline { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text); }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.78rem; }
.btn-danger { background: var(--color-danger); color: white; }

/* ---------------- FORM ---------------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--color-text); font-size: 0.88rem; transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--color-primary); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.72rem; color: var(--color-text-muted); margin-top: 4px; }
.form-error { font-size: 0.72rem; color: var(--color-danger); margin-top: 4px; }

/* ---------------- TOAST ---------------- */
#toast-container {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 9998;
  display: flex; flex-direction: column; gap: 8px; width: min(90vw, 380px);
}
.toast {
  background: var(--color-text); color: var(--color-bg); padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 500; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px; animation: toast-in 0.3s ease;
}
.toast.success { background: #16a34a; color: white; }
.toast.error { background: #dc2626; color: white; }
.toast.info { background: #2563eb; color: white; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------- MODAL ---------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9997;
  display: flex; align-items: flex-end; justify-content: center; opacity: 0; visibility: hidden;
  transition: var(--transition);
}
.modal-overlay.show { opacity: 1; visibility: visible; }
@media (min-width: 640px) { .modal-overlay { align-items: center; } }
.modal-box {
  background: var(--color-surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto; padding: 24px;
  transform: translateY(30px); transition: var(--transition);
}
.modal-overlay.show .modal-box { transform: translateY(0); }
@media (min-width: 640px) { .modal-box { border-radius: var(--radius-lg); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; background: var(--color-bg); display: flex; align-items: center; justify-content: center; }

/* ---------------- CART ITEM ---------------- */
.cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.cart-item img { width: 68px; height: 68px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.cart-item-body { flex: 1; }
.cart-item-body h4 { font-size: 0.86rem; font-weight: 600; margin-bottom: 4px; }
.qty-control { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.qty-control button {
  width: 26px; height: 26px; border-radius: 50%; background: var(--color-bg);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.qty-control span { font-weight: 600; min-width: 18px; text-align: center; }
.cart-item-remove { color: var(--color-danger); font-size: 0.75rem; font-weight: 600; margin-top: 6px; }

.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 0.85rem; }
.summary-row.total { font-weight: 700; font-size: 1rem; border-top: 1px solid var(--color-border); padding-top: 12px; margin-top: 8px; }

/* ---------------- EMPTY STATE ---------------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--color-text-muted); }
.empty-state svg { width: 64px; height: 64px; margin: 0 auto 16px; opacity: 0.4; }

/* ---------------- SKELETON LOADING ---------------- */
.skeleton { background: linear-gradient(90deg, var(--color-border) 25%, var(--color-bg) 50%, var(--color-border) 75%); background-size: 200% 100%; animation: skeleton-anim 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton-anim { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------------- STEPPER (checkout / status) ---------------- */
.stepper { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 14px; position: relative; padding-bottom: 24px; }
.step:last-child { padding-bottom: 0; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%; background: var(--color-border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; z-index: 1;
  color: var(--color-text-muted);
}
.step.done .step-dot { background: var(--color-success); color: white; }
.step.current .step-dot { background: var(--color-primary); color: white; }
.step::before {
  content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--color-border);
}
.step:last-child::before { display: none; }
.step.done::before { background: var(--color-success); }
.step-body h4 { font-size: 0.85rem; font-weight: 700; }
.step-body p { font-size: 0.72rem; color: var(--color-text-muted); }

/* ---------------- MAP ---------------- */
#map, #map-detail { width: 100%; height: 280px; border-radius: var(--radius-md); overflow: hidden; }

/* ---------------- UTILITIES ---------------- */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.text-muted { color: var(--color-text-muted); }
.fw-bold { font-weight: 700; }
.sticky-bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--color-surface);
  border-top: 1px solid var(--color-border); padding: 14px 20px max(14px, env(safe-area-inset-bottom));
  z-index: 90; box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}

@media (min-width: 900px) { .bottom-nav { display: none; } body { padding-bottom: 0; } }
