:root {
  --navy-1: #1d4287;
  --navy-2: #0a2559;
  --navy-3: #04122f;
  --steel: #2e5d7d;
  --steel-hover: #3a7096;
  --orange: #d93a00;
  --text: #ffffff;
  --muted: #9fb4d8;
  --line: rgba(255, 255, 255, .14);
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--navy-3);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid #8fd3ff; outline-offset: 3px; border-radius: 6px; }

.app {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(120% 85% at 50% 0%, var(--navy-1) 0%, var(--navy-2) 52%, var(--navy-3) 100%);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------- Header ---------- */
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1.6rem clamp(1rem, 4vw, 3.2rem) .6rem;
  position: relative;
  z-index: 5;
}
.logo { display: inline-flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.02rem; justify-self: start; }

.cats { display: flex; gap: clamp(1rem, 3.6vw, 3.2rem); }
.cats button {
  position: relative;
  background: none; border: 0; padding: .55rem .2rem;
  font-size: .68rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255, 255, 255, .86);
  transition: color .2s;
}
.cats button::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 2.6rem; aspect-ratio: 1; border-radius: 50%;
  background: rgba(150, 190, 255, .24);
  translate: -50% -50%; scale: 0; transition: scale .25s;
  z-index: -1;
}
.cats button[aria-pressed="true"]::before { scale: 1; }
.cats button:hover { color: #fff; }

.actions { display: flex; gap: .4rem; justify-self: end; }
.icon-btn {
  position: relative; display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: none; border: 0;
  transition: background .2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.icon-btn svg, .quick svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.badge {
  position: absolute; top: .1rem; right: .05rem;
  min-width: 1.1rem; height: 1.1rem; padding: 0 .28rem;
  display: grid; place-items: center;
  border-radius: 999px; background: var(--orange);
  font-size: .64rem; font-weight: 700;
}
.badge.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.45); } }
.menu-btn { display: none; }

/* ---------- Stage ---------- */
.stage {
  --d: clamp(190px, 25vw, 340px);
  --disc: var(--orange);
  position: relative;
  flex: 1;
  min-height: clamp(300px, 50vh, 560px);
  touch-action: pan-y;
}
.ring {
  position: absolute; left: 50%; top: 50%;
  width: min(66vw, 640px); aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .06);
  background: radial-gradient(circle, rgba(255, 255, 255, .06), transparent 66%);
}
.disc {
  position: absolute; left: 50%; top: 50%;
  width: var(--d); aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--disc);
  transition: background .45s;
}
.hero {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--d) * 1.38);
  translate: -50% -50%;
  pointer-events: none;
}
.hero svg, .side svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 18px 14px rgba(0, 0, 0, .38)); }

.side {
  position: absolute; top: 50%;
  translate: 0 -50%;
  width: clamp(130px, 22vw, 330px);
  padding: 0; background: none; border: 0;
  opacity: .95;
  transition: scale .25s, opacity .25s;
}
.side-prev { left: clamp(0px, 3vw, 60px); }
.side-next { right: clamp(0px, 3vw, 60px); }
.side:hover { scale: 1.05; opacity: 1; }
.side svg { filter: drop-shadow(0 14px 10px rgba(0, 0, 0, .35)); }

.quick {
  position: absolute; top: 3%; right: 5%;
  width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--steel); border: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .25);
  transition: background .2s, scale .2s;
}
.quick:hover { background: var(--steel-hover); scale: 1.08; }
.quick:active { scale: .94; }

.dots { position: absolute; left: 4%; top: 6%; width: 3.2rem; height: 3.2rem; }
.dot {
  position: absolute; width: 1.15rem; height: 1.15rem; padding: 0;
  border-radius: 50%; border: 0; background: var(--c);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .0);
  transition: scale .2s, box-shadow .2s;
}
.dot:nth-child(1) { left: 0; top: 1.2rem; }
.dot:nth-child(2) { left: 1rem; top: .45rem; }
.dot:nth-child(3) { left: 2rem; top: 0; }
.dot::after { content: ""; position: absolute; inset: -.6rem; } /* area sentuh lebih besar */
.dot.on { scale: 1.3; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }

.empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 1rem; text-align: center; padding: 1rem; z-index: 2;
}
.ghost { background: none; border: 1px solid var(--line); border-radius: 999px; padding: .6rem 1.4rem; font-size: .85rem; }
.ghost:hover { background: rgba(255, 255, 255, .08); }

/* animasi ganti produk (hanya respons klik/geser) */
.stage.go-next .hero, .stage.go-next .side-next { animation: inNext .45s cubic-bezier(.2, .8, .2, 1); }
.stage.go-prev .hero, .stage.go-prev .side-prev { animation: inPrev .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes inNext { from { transform: translateX(34vw) scale(.8); opacity: .2; } }
@keyframes inPrev { from { transform: translateX(-34vw) scale(.8); opacity: .2; } }

/* ---------- Info produk ---------- */
.info {
  display: grid; justify-items: center; gap: .45rem;
  padding: 0 1rem 1.4rem; text-align: center;
  position: relative; z-index: 3;
}
.brand { font-size: .95rem; font-weight: 500; }
.name { font-size: clamp(1.35rem, 2.6vw, 1.8rem); font-weight: 700; letter-spacing: .01em; }
.price { color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; }
.qty { display: flex; align-items: center; gap: 1.1rem; font-size: .9rem; margin: .1rem 0 .5rem; }
.qty button {
  width: 2rem; height: 2rem; border-radius: 50%;
  background: none; border: 1px solid transparent; font-size: 1.25rem; line-height: 1;
}
.qty button:hover { border-color: var(--line); }
.qty button:disabled { opacity: .3; cursor: not-allowed; }
.qty output { min-width: 4.5rem; font-variant-numeric: tabular-nums; }

.buy {
  background: var(--steel); border: 0; border-radius: 999px;
  padding: .85rem 2.8rem;
  font-size: .68rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  transition: background .2s, scale .15s;
}
.buy:hover { background: var(--steel-hover); }
.buy:active { scale: .97; }
.buy:disabled { opacity: .5; cursor: wait; }
.buy.wide { width: 100%; }

/* ---------- Filter ikan ---------- */
.fish {
  position: absolute; left: clamp(1rem, 6vw, 5.5rem); bottom: 2.4rem;
  display: flex; gap: 1.6rem; z-index: 4;
}
.fish button {
  display: grid; justify-items: center; gap: .55rem;
  background: none; border: 0; padding: .2rem;
  opacity: .4; transition: opacity .2s, translate .2s;
}
.fish button:hover { opacity: .8; }
.fish button[aria-pressed="true"] { opacity: 1; translate: 0 -3px; }
.fish svg { width: 2.6rem; fill: none; stroke: #fff; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.fish svg circle { fill: #fff; stroke: none; }
.fish span { font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- Keranjang ---------- */
.scrim { position: fixed; inset: 0; background: rgba(2, 8, 24, .6); z-index: 20; opacity: 0; transition: opacity .25s; }
.scrim.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 21;
  width: min(100%, 26rem);
  display: flex; flex-direction: column;
  background: #0a2252; border-left: 1px solid var(--line);
  translate: 100% 0; transition: translate .3s cubic-bezier(.2, .8, .2, 1);
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
}
.drawer.open { translate: 0 0; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1rem 1rem 1.4rem; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.1rem; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: .6rem 1.4rem; }
.drawer-foot { padding: 1rem 1.4rem 1.4rem; border-top: 1px solid var(--line); display: grid; gap: .9rem; }
.total { display: flex; justify-content: space-between; align-items: baseline; }
.total strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }

.line { display: grid; grid-template-columns: 5.2rem 1fr auto; gap: .9rem; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.line .thumb { background: rgba(255, 255, 255, .05); border-radius: 12px; padding: .4rem; }
.line .thumb svg { width: 100%; display: block; }
.line h3 { font-size: .92rem; font-weight: 600; }
.line small { color: var(--muted); display: block; margin-top: .1rem; font-variant-numeric: tabular-nums; }
.line .step { display: flex; align-items: center; gap: .3rem; margin-top: .5rem; font-size: .85rem; }
.line .step button { width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 1px solid var(--line); background: none; line-height: 1; }
.line .step button:hover { background: rgba(255, 255, 255, .1); }
.line .step span { min-width: 1.4rem; text-align: center; }
.line .del { background: none; border: 0; color: var(--muted); font-size: .78rem; text-decoration: underline; }
.line .del:hover { color: #fff; }

.cart-empty, .done { display: grid; place-items: center; text-align: center; gap: .6rem; min-height: 14rem; color: var(--muted); }
.done h3 { color: #fff; font-size: 1.15rem; }
.done strong { color: #fff; letter-spacing: .06em; }

.toast {
  position: fixed; left: 50%; bottom: calc(1.4rem + env(safe-area-inset-bottom)); z-index: 30;
  translate: -50% 140%;
  background: #f4f8ff; color: #0a2252; font-size: .88rem; font-weight: 500;
  padding: .7rem 1.2rem; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transition: translate .3s cubic-bezier(.2, .8, .2, 1);
  max-width: calc(100% - 2rem); text-align: center;
}
.toast.show { translate: -50% 0; }

/* ---------- Responsif ---------- */
@media (max-width: 960px) {
  .fish { position: static; justify-content: center; padding: 0 1rem 1.6rem; gap: 2rem; }
}

@media (max-width: 820px) {
  .top { grid-template-columns: 1fr auto; padding-top: 1.1rem; }
  .menu-btn { display: grid; }
  .cats {
    grid-column: 1 / -1; grid-row: 2;
    justify-content: center; flex-wrap: wrap; gap: .4rem 1.4rem;
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height .3s, opacity .3s;
  }
  body.menu-open .cats { max-height: 8rem; opacity: 1; padding-top: .4rem; }
}

@media (max-width: 640px) {
  .stage { --d: min(58vw, 250px); min-height: clamp(280px, 44vh, 420px); }
  .side { width: 40vw; opacity: .55; }
  .side-prev { left: -17vw; }
  .side-next { right: -17vw; }
  .quick { width: 2.6rem; height: 2.6rem; }
  .info { padding-bottom: 1rem; }
  .buy { width: min(100%, 18rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
