:root {
  --primary: #C0392B;
  --primary-dark: #9c2e21;
  --bg: #F5F5F5;
  --text: #1A1A1A;
  --muted: #8a8a8a;
  --border: #ececec;
  --white: #ffffff;
  --radius: 18px;
  --radius-sm: 14px;
  --radius-pill: 100px;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
  --shadow-lift: 0 10px 28px rgba(0, 0, 0, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  justify-content: center;
}

#app-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
}

a { color: inherit; text-decoration: none; }

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

/* ── Splash ─────────────────────────────────────────────── */
#splash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 1;
  transition: opacity 0.5s ease;
  background: var(--white);
}
#splash.hide { opacity: 0; pointer-events: none; }

#splash-logo {
  width: 160px;
  position: relative;
  z-index: 1;
  animation: logo-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both,
             logo-dissolve 1.1s ease-in 1s forwards;
}
#splash-smoke {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

@keyframes logo-pop {
  0%   { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes logo-dissolve {
  0%   { opacity: 1; filter: blur(0px); }
  100% { opacity: 0; filter: blur(7px); }
}

/* ── Header ─────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 var(--border);
}
.topbar__logo { height: 40px; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  background: var(--bg);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  position: relative;
  transition: transform 0.15s ease;
}
.icon-btn:active { transform: scale(0.92); }
.cart-badge {
  position: absolute;
  top: -3px; right: -3px;
  background: var(--primary);
  color: white;
  font-size: 10px;
  min-width: 17px; height: 17px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--white);
}

/* ── Content area ───────────────────────────────────────── */
#view {
  flex: 1;
  padding: 16px;
  padding-bottom: 100px;
}

/* ── Greeting header (Home / Katalog) ──────────────────────*/
.greeting {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.greeting__avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px;
  flex-shrink: 0;
}
.greeting__hello { font-size: 15px; font-weight: 700; margin: 0; }
.greeting__sub { font-size: 12px; color: var(--muted); margin: 2px 0 0; }

/* ── Banner carousel ────────────────────────────────────── */
.banner-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 0;
  margin: 0 -16px 14px;
  padding: 0 0 2px;
}
.banner-carousel::-webkit-scrollbar { display: none; }
.banner-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  padding: 0 16px;
}
.banner-slide img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.banner-dots { display: flex; justify-content: center; gap: 6px; margin: -6px 0 16px; }
.banner-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: background 0.2s ease, width 0.2s ease; }
.banner-dots span.active { background: var(--primary); width: 16px; border-radius: 3px; }

/* ── Points card ────────────────────────────────────────── */
.points-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.points-card__pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-weight: 700; font-size: 14px;
}
.points-card__pill .icon { font-size: 16px; }
.points-card__arrow { color: var(--muted); font-size: 18px; }

/* ── WhatsApp help button ───────────────────────────────── */
.wa-help {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #25D366; color: white;
  padding: 14px; border-radius: var(--radius-pill);
  font-weight: 700; font-size: 14px;
  margin-top: 8px;
}

/* ── Home ───────────────────────────────────────────────── */
.home-hero { margin: 4px 0 22px; }
.home-hero h1 {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.home-hero h1 .hl {
  background: var(--primary);
  color: white;
  padding: 1px 10px;
  border-radius: 8px;
  display: inline-block;
}
.home-hero p { color: var(--muted); margin: 0; font-size: 13.5px; }

.order-type-grid { display: grid; gap: 14px; }
.order-type-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.order-type-card:active { transform: scale(0.98); box-shadow: var(--shadow); }
.order-type-card__icon {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.order-type-card__title { font-weight: 700; font-size: 16px; margin: 0 0 2px; }
.order-type-card__desc { color: var(--muted); font-size: 13px; margin: 0; }
.order-type-card__arrow { margin-left: auto; color: var(--muted); font-size: 18px; }

/* ── Bottom nav ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  background: var(--white);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lift);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  z-index: 20;
}
.bottom-nav__item {
  flex: 1;
  background: none;
  padding: 9px 6px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}
.bottom-nav__item.active { color: white; background: var(--primary); }
.bottom-nav__item .icon { font-size: 17px; line-height: 1; }
.bottom-nav__item span:last-child { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width 0.2s ease; }
.bottom-nav__item.active span:last-child { max-width: 80px; }

/* ── Outlet list ────────────────────────────────────────── */
.section-title { font-size: 17px; font-weight: 800; margin: 0 0 14px; letter-spacing: -0.01em; }
.outlet-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  border: none;
}
.outlet-card__name { font-weight: 700; font-size: 15px; margin: 0 0 4px; }
.outlet-card__addr { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.outlet-card__meta { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.badge { padding: 4px 10px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; }
.badge--open { background: #e6f6ea; color: #1e8e3e; }
.badge--closed { background: #fdeaea; color: var(--primary); }
.outlet-card__dist { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.outlet-card__dist b { color: var(--text); font-size: 16px; display: block; font-weight: 800; }

/* ── Search + tabs ──────────────────────────────────────── */
.search-bar-row { display: flex; gap: 8px; margin-bottom: 14px; }
.search-bar {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--white);
  box-shadow: var(--shadow);
  font-size: 14px;
}
.search-bar:focus { outline: 2px solid var(--primary); }
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--white);
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
}
.tab.active { background: var(--primary); color: white; }

/* ── Product grid ───────────────────────────────────────── */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.15s ease;
}
.product-card:active { transform: scale(0.97); }
.product-card__imgwrap { position: relative; }
.product-card__img {
  width: 100%; aspect-ratio: 1;
  background: #eee;
  display: flex; align-items: center; justify-content: center;
  color: #bbb; font-size: 28px;
  object-fit: cover;
}
.product-card__fav {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.92);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.product-card__fav.active { color: var(--primary); }
.product-card__cat {
  position: absolute; left: 8px; bottom: 8px;
  background: var(--text);
  color: white;
  font-size: 10px; font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: capitalize;
}
.product-card__body { padding: 11px 12px 13px; }
.product-card__name {
  font-size: 13px; font-weight: 600; margin: 0 0 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 34px;
}
.product-card__price { font-weight: 800; font-size: 14.5px; color: var(--primary); margin: 0; }
.product-card__stock { font-size: 11px; color: var(--muted); margin-top: 3px; }
.stock-badge--low { color: #d97706; }
.stock-badge--out { color: var(--primary); }

.empty-state { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; }

/* ── Bottom sheet ───────────────────────────────────────── */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: 100%; max-width: 480px;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 20px;
  max-height: 88vh;
  overflow-y: auto;
}
.sheet__handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--border);
  margin: 0 auto 16px;
}
.sheet__img { width: 100%; aspect-ratio: 1.3; object-fit: cover; border-radius: var(--radius); background: #eee; margin-bottom: 16px; }
.sheet__cat {
  display: inline-block; background: var(--bg); color: var(--muted);
  font-size: 11px; font-weight: 700; text-transform: capitalize;
  padding: 4px 10px; border-radius: var(--radius-pill); margin-bottom: 8px;
}
.sheet__title { font-size: 18px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.01em; }
.sheet__price { color: var(--primary); font-weight: 800; font-size: 18px; margin: 0 0 4px; }

.qty-stepper { display: flex; align-items: center; gap: 18px; justify-content: center; margin: 20px 0 8px; }
.qty-stepper button {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--text); color: white; font-size: 18px; font-weight: 600;
}
.qty-stepper span { min-width: 24px; text-align: center; font-size: 17px; font-weight: 700; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  width: 100%;
  padding: 15px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: white;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  transition: transform 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; }
.btn--outline { background: var(--white); color: var(--primary); border: 1.5px solid var(--primary); box-shadow: none; }
.btn--secondary { background: var(--bg); color: var(--text); }

/* ── Cart ───────────────────────────────────────────────── */
.cart-item {
  display: flex; gap: 12px; align-items: center;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px; margin-bottom: 10px;
}
.cart-item__img { width: 54px; height: 54px; border-radius: 12px; background: #eee; object-fit: cover; flex-shrink: 0; }
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name { font-size: 13px; font-weight: 600; margin: 0 0 2px; }
.cart-item__price { font-size: 13px; color: var(--primary); font-weight: 700; margin: 0; }
.cart-item__stepper { display: flex; align-items: center; gap: 8px; }
.cart-item__stepper button {
  width: 28px; height: 28px; border-radius: 50%; background: var(--bg); font-size: 14px; font-weight: 600;
}

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

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  border: none; box-shadow: var(--shadow);
  font-size: 14px; font-family: var(--font); background: var(--white);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--primary); }
.field textarea { resize: vertical; min-height: 60px; }

.option-group { display: flex; gap: 8px; flex-wrap: wrap; }
.option-chip {
  padding: 10px 16px; border-radius: var(--radius-pill); border: none;
  background: var(--white); box-shadow: var(--shadow); font-size: 13px; font-weight: 600;
}
.option-chip.active { background: var(--primary); color: white; }

/* ── Order confirmation / tracker ───────────────────────── */
.order-header { text-align: center; padding: 12px 0 22px; }
.order-header__check {
  width: 66px; height: 66px; border-radius: 50%;
  background: #e6f6ea; color: #1e8e3e; font-size: 30px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.order-header__number { font-size: 21px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.01em; }

.tracker { display: flex; justify-content: space-between; margin: 26px 0; position: relative; }
.tracker::before {
  content: ""; position: absolute; top: 14px; left: 20px; right: 20px; height: 2px; background: var(--border);
}
.tracker__step { flex: 1; text-align: center; position: relative; z-index: 1; }
.tracker__dot {
  width: 28px; height: 28px; border-radius: 50%; background: var(--white); border: 2px solid var(--border);
  margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.tracker__step.done .tracker__dot { background: var(--primary); border-color: var(--primary); color: white; }
.tracker__label { font-size: 10px; color: var(--muted); }
.tracker__step.done .tracker__label { color: var(--text); font-weight: 700; }

.info-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.info-card__row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; }
.info-card__row span:first-child { color: var(--muted); }

/* ── Profile ────────────────────────────────────────────── */
.profile-header { text-align: center; padding: 20px 0; }
.profile-avatar {
  width: 76px; height: 76px; border-radius: 50%; background: var(--primary); color: white;
  font-size: 27px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.profile-header h2 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.profile-header p { margin: 0; color: var(--muted); font-size: 13px; }
.points-pill {
  display: inline-block; margin-top: 10px; background: var(--primary); color: white;
  padding: 6px 16px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700;
}

.order-list-item { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px; }
.order-list-item__top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.order-list-item__num { font-weight: 700; font-size: 13px; }
.order-list-item__date { font-size: 11px; color: var(--muted); }
.status-pill { padding: 4px 12px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; background: var(--bg); }

.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%);
  background: #1A1A1A; color: white; padding: 12px 20px; border-radius: 24px; font-size: 13px;
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
  max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; }

.center-msg { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ── Voucher ────────────────────────────────────────────── */
.voucher-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.voucher-card__icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(192,57,43,0.1); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.voucher-card__title { font-weight: 700; font-size: 14px; margin: 0 0 3px; }
.voucher-card__desc { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.voucher-card__code {
  display: inline-block; font-family: monospace; font-size: 11px; font-weight: 700;
  background: var(--bg); padding: 3px 8px; border-radius: 6px; letter-spacing: 0.03em;
}
