:root {
  --timber: #79553d;
  --timber-dark: #5c3f2c;
  --timber-soft: #a98569;
  --sand: #e8dccf;
  --cream: #f6f1ec;
  --ink: #2b211b;
  --muted: #8f8179;
  --radius: 14px;
  --nav: 68px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Poppins", "Avenir Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--cream);
  color: var(--ink);
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--timber); outline-offset: 2px; }
[hidden] { display: none !important; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.shell { position: relative; display: flex; flex-direction: column; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; background: #fff; }
.app { flex: 1; overflow-y: auto; padding: 20px 20px 24px; scrollbar-width: none; }
.app::-webkit-scrollbar { display: none; }
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
h1 { font-size: 1.6rem; color: var(--timber); letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; }

.search { display: flex; align-items: center; gap: 10px; background: var(--cream); border-radius: 999px; padding: 11px 16px; color: var(--muted); }
.search svg { width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: .9rem; color: var(--ink); }
.search:focus-within { box-shadow: 0 0 0 2px var(--timber-soft); }

/* banner */
.slider { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-top: 20px; border-radius: var(--radius); scrollbar-width: none; }
.slider::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; height: 160px; display: grid; grid-template-columns: minmax(0, 1fr) 140px; align-items: center; gap: 12px; padding: 20px; background: var(--timber); color: #fff; }
.slide:nth-child(2) { background: var(--timber-dark); }
.slide:nth-child(3) { background: var(--timber-soft); }
.slide strong { display: block; font-size: 1.35rem; line-height: 1.2; }
.slide p { font-size: .8rem; opacity: .85; margin-top: 8px; }
.slide .ph { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--sand); }
.dots { display: flex; justify-content: center; gap: 4px; margin-top: 8px; }
.dots button { width: 20px; height: 20px; display: grid; place-items: center; }
.dots button::after { content: ""; width: 7px; height: 7px; border-radius: 99px; background: var(--sand); transition: width .2s; }
.dots button[aria-current="true"]::after { width: 16px; background: var(--timber); }

/* produk */
section { margin-top: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.more { font-size: .8rem; color: var(--timber); padding: 6px 0; text-decoration: none; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.card { border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: 0 4px 16px rgba(92, 63, 44, .10); }
.card .ph { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sand); }
.card-body { padding: 10px 12px 12px; }
.card h3 { font-size: .85rem; line-height: 1.3; }
.card p { font-size: .72rem; color: var(--muted); margin-top: 3px; }
.card { display: flex; flex-direction: column; }
.card-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.media { position: relative; }
.card { position: relative; }
.card-link { color: inherit; text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 2px solid var(--timber); outline-offset: -2px; }
a.slide { text-decoration: none; }
.badge { position: absolute; top: 8px; left: 8px; background: var(--timber); color: #fff; font-size: .66rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.type { font-size: .62rem; color: var(--timber); background: var(--cream); border-radius: 99px; padding: 2px 8px; margin-bottom: 6px; }
.card .prices { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; margin-top: auto; padding-top: 8px; }
.prices del { font-size: .7rem; }
.prices strong { font-size: .9rem; color: var(--timber); }
.three .card-body { padding: 8px; }
.three .card h3 { font-size: .74rem; }
.three .desc, .three .type { display: none; }
.three .badge { top: 5px; left: 5px; font-size: .58rem; padding: 1px 6px; }
.empty { text-align: center; color: var(--muted); font-size: .9rem; padding: 32px 0; }

/* navigasi bawah */
nav { flex: none; height: calc(var(--nav) + env(safe-area-inset-bottom)); display: flex; justify-content: space-around; align-items: center; background: #fff; box-shadow: 0 -4px 20px rgba(92, 63, 44, .10); padding-bottom: env(safe-area-inset-bottom); }
nav button, nav a { width: 56px; height: 44px; display: grid; place-items: center; color: var(--sand); }
nav button svg, nav a svg { stroke: var(--timber-soft); }
nav [aria-current="page"] svg { stroke: var(--timber); fill: var(--sand); }

.toast { position: absolute; bottom: calc(var(--nav) + 16px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .8rem; padding: 9px 16px; border-radius: 999px; white-space: nowrap; }

/* tablet ke atas: bingkai kecil di tengah dengan jarak atas dan bawah */
@media (min-width: 768px) {
  body { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 40px 0; }
  .shell { width: 480px; height: calc(100vh - 80px); height: calc(100dvh - 80px); max-height: 920px; border-radius: 28px; box-shadow: 0 20px 60px rgba(92, 63, 44, .18); }
  .app { padding-inline: 28px; }
  .slide { height: 180px; grid-template-columns: minmax(0, 1fr) 180px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* halaman produk */
.page-header { justify-content: flex-start; gap: 8px; }
.page-header h1 { font-size: 1.35rem; }
.back { display: grid; place-items: center; width: 36px; height: 36px; margin-left: -8px; color: var(--timber); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 4px; scrollbar-width: none; }
.chips button { flex: none; font-size: .8rem; padding: 7px 14px; border-radius: 99px; background: var(--cream); color: var(--timber); }
.chips button[aria-pressed="true"] { background: var(--timber); color: #fff; }
.count { font-size: .75rem; color: var(--muted); margin: 8px 0 12px; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.pagination button { min-width: 36px; height: 36px; border-radius: 10px; background: var(--cream); color: var(--timber); font-size: .85rem; }
.pagination button[aria-pressed="true"] { background: var(--timber); color: #fff; }
.pagination button:disabled { opacity: .4; cursor: default; }

/* special bundle: selebar grid */
.card.bundle { grid-column: 1 / -1; border: 2px solid var(--timber); }
.card.bundle h3 { font-size: 1rem; }
.card.bundle .prices strong { font-size: 1.15rem; }
.three .card.bundle .desc, .three .card.bundle .type { display: block; }
.special { margin: 14px 0 4px; }
.special h2 { margin-bottom: 12px; }

/* ---------- animasi ringan, mati kalau pengguna memilih "kurangi gerakan" ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* konten muncul bertahap saat halaman dibuka */
  .app > * { animation: rise .45s ease-out backwards; }
  .app > :nth-child(2) { animation-delay: .06s; }
  .app > :nth-child(3) { animation-delay: .12s; }
  .app > :nth-child(4) { animation-delay: .18s; }
  .app > :nth-child(n+5) { animation-delay: .24s; }

  .card { transition: transform .2s ease, box-shadow .2s ease; }
  .card:active { transform: scale(.97); }
  .card .ph { transition: transform .35s ease; }
  .media { overflow: hidden; }

  .chips button, .pagination button, .more, .back, nav a, nav button, header button { transition: background-color .2s, color .2s, transform .15s; }
  .chips button:active, .pagination button:not(:disabled):active, nav a:active, nav button:active, header button:active { transform: scale(.92); }

  nav [aria-current="page"] svg { animation: pop .4s ease-out; }
  .toast { animation: toast-in .25s ease-out; }
  /* denyut pelan pada label harga spesial */
  .card.bundle .badge { animation: pulse 2.4s ease-in-out infinite; }

  @media (hover: hover) {
    .card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(92, 63, 44, .18); }
    .card:hover .ph { transform: scale(1.04); }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes pop { 50% { transform: scale(1.18); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes pulse { 50% { transform: scale(1.07); } }
