@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,600&display=swap');

:root {
  --white: #ffffff;
  --cream: #fbfaf6;
  --ink: #241c15;
  --ink-soft: #6b6157;
  --line: #efe9df;

  --primary: #ff6a3d;      /* oranye ceria - makanan */
  --primary-dark: #e5502a;
  --primary-light: #ffe7dc;

  --accent: #2fbf9f;       /* teal segar */
  --accent-light: #dff7f1;

  --yellow: #ffc23c;       /* badge diskon */
  --yellow-dark: #e8a600;

  --danger: #ef4444;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --shadow-soft: 0 8px 24px rgba(36, 28, 21, 0.06);
  --shadow-pop: 0 14px 34px rgba(255, 106, 61, 0.22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font-family: inherit; }

img { max-width: 100%; display: block; }

/* ---------- decorative blobs ---------- */
.blob-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob-bg span {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.5;
}
.blob-bg span:nth-child(1) { width: 260px; height: 260px; background: var(--primary-light); top: -80px; right: -60px; }
.blob-bg span:nth-child(2) { width: 180px; height: 180px; background: var(--accent-light); bottom: 10%; left: -70px; }
.blob-bg span:nth-child(3) { width: 120px; height: 120px; background: #fff2cf; top: 40%; right: 4%; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 250, 246, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 18px 20px 14px;
}
.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-pop);
  transform: rotate(-6deg);
}
.brand h1 {
  font-size: 19px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}
.brand p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 500;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 16px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line);
  background: var(--white);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.cat-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
  transform: translateY(-1px);
}

/* ---------- content ---------- */
.content {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 140px;
}
.section-title {
  font-size: 15px;
  font-weight: 800;
  margin: 26px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title:first-child { margin-top: 4px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 560px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

.product-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}
.product-card.out {
  opacity: 0.5;
  cursor: not-allowed;
}
.product-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 2px;
}
.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--yellow);
  color: #6b4c00;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 4px 10px rgba(255, 194, 60, 0.4);
}
.stock-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--danger);
  color: white;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}
.product-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}
.product-desc {
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.35;
  min-height: 15px;
}
.price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.price-now {
  font-weight: 800;
  font-size: 15px;
  color: var(--primary-dark);
}
.price-old {
  font-size: 11.5px;
  color: var(--ink-soft);
  text-decoration: line-through;
}
.stock-note {
  font-size: 10.5px;
  color: var(--accent);
  font-weight: 700;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}
.empty-state .emoji { font-size: 42px; margin-bottom: 10px; }

/* ---------- floating cart button ---------- */
.cart-fab {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  border: none;
  padding: 15px 26px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 30px rgba(36,28,21,0.28);
  cursor: pointer;
  z-index: 40;
  transition: transform .15s ease;
}
.cart-fab:active { transform: translateX(-50%) scale(0.97); }
.cart-fab .badge {
  background: var(--primary);
  color: white;
  border-radius: var(--radius-pill);
  font-size: 12px;
  padding: 2px 8px;
  font-weight: 800;
}
.cart-fab.hidden { display: none; }

/* ---------- modal / sheet ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(36, 28, 21, 0.45);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.overlay.open { opacity: 1; pointer-events: all; }
@media (min-width: 560px) {
  .overlay { align-items: center; }
}

.sheet {
  background: var(--white);
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 26px 26px 0 0;
  padding: 22px 22px 26px;
  transform: translateY(30px);
  transition: transform .25s ease;
}
.overlay.open .sheet { transform: translateY(0); }
@media (min-width: 560px) {
  .sheet { border-radius: 26px; }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  margin: 0 auto 16px;
}
.sheet-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.sheet-header .product-icon { width: 48px; height: 48px; font-size: 24px; margin: 0; }
.sheet-header h3 { margin: 0; font-size: 17px; font-weight: 800; }
.sheet-header .sub { font-size: 13px; color: var(--ink-soft); }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.field input, .field textarea, .field select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease;
  background: var(--cream);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary);
}
.field textarea { resize: none; min-height: 64px; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 14px;
}
.qty-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line);
  background: var(--white);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:active { transform: scale(0.94); }
.qty-value { font-size: 17px; font-weight: 800; min-width: 24px; text-align: center; }

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  transition: transform .12s ease;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.btn-secondary {
  width: 100%;
  background: var(--cream);
  color: var(--ink);
  border: 1.5px solid var(--line);
  padding: 13px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* ---------- cart list ---------- */
.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item:last-child { border-bottom: none; }
.cart-item .info { flex: 1; }
.cart-item .name { font-weight: 700; font-size: 13.5px; }
.cart-item .meta { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
.cart-item .price { font-weight: 800; font-size: 13.5px; color: var(--primary-dark); margin-top: 4px; }
.cart-item .remove {
  border: none;
  background: none;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
}
.summary-row.total {
  font-weight: 800;
  font-size: 16.5px;
  padding-top: 12px;
  margin-top: 6px;
  border-top: 1.5px dashed var(--line);
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  margin-bottom: 10px;
}
.payment-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.payment-option .icon { font-size: 22px; }
.payment-option .label { font-weight: 700; font-size: 14px; }
.payment-option .desc { font-size: 11.5px; color: var(--ink-soft); }

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--ink);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 700;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.success-screen {
  text-align: center;
  padding: 20px 10px 10px;
}
.success-screen .emoji {
  font-size: 56px;
  margin-bottom: 10px;
}
.success-screen h3 { margin: 0 0 6px; font-size: 19px; font-weight: 800; }
.success-screen p { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 20px; }
