/* Aurelia Giftshop — sistem reka bentuk (mobile-first) */
:root {
  --krim: #FAF6EF;
  --krim-dalam: #F3ECE0;
  --kertas: #FFFFFF;
  --dakwat: #2B2622;
  --dakwat-lembut: #6B6259;
  --plum: #4A2B5E;
  --plum-cerah: #6D4489;
  --emas: #B8934A;
  --emas-lembut: #E4D3AE;
  --garis: #E5DCCD;
  --jaya: #2E6F4E;
  --ralat: #A5372F;
  --amaran: #9A6714;
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --bayang: 0 2px 8px rgba(43, 38, 34, .06);
  --bayang-t: 0 10px 30px rgba(43, 38, 34, .12);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--krim); color: var(--dakwat);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--plum); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--plum-cerah); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; margin: 0 0 .4em; letter-spacing: .01em; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); }
h2 { font-size: clamp(1.4rem, 4.5vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--dakwat-lembut); font-size: .875rem; }
.eyebrow { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--emas); font-weight: 600; }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1rem; background: var(--krim);
  border-bottom: 1px solid var(--garis); position: sticky; top: 0; z-index: 40;
}
.brand { display: block; text-decoration: none; }
.brand-name { display: block; font-family: var(--serif); font-size: 1.4rem; color: var(--plum); }
.brand-sub { display: block; font-size: .58rem; letter-spacing: .3em; color: var(--emas); }
.site-nav { display: flex; gap: 1rem; font-size: .9rem; }
.nav-wa { color: var(--jaya); }

/* ---------- Langkah ---------- */
.steps {
  display: flex; gap: .25rem; list-style: none; margin: 0; padding: .75rem 1rem;
  overflow-x: auto; background: var(--krim-dalam); font-size: .75rem;
}
.steps li { display: flex; align-items: center; gap: .4rem; color: var(--dakwat-lembut); white-space: nowrap; padding-right: .6rem; }
.steps-no {
  width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--kertas); border: 1px solid var(--garis); font-size: .7rem; font-weight: 600;
}
.steps li.is-done { color: var(--jaya); }
.steps li.is-done .steps-no { background: var(--jaya); color: #fff; border-color: var(--jaya); }
.steps li.is-current { color: var(--plum); font-weight: 600; }
.steps li.is-current .steps-no { background: var(--plum); color: #fff; border-color: var(--plum); }

/* ---------- Layout ---------- */
.site-main { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 6rem; }
.site-footer { border-top: 1px solid var(--garis); padding: 1.5rem 1rem 2.5rem; text-align: center; font-size: .8rem; color: var(--dakwat-lembut); }
.site-footer p { margin: .2rem 0; }
.intro { text-align: center; margin-bottom: 1.75rem; }
.grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Kad pilihan ---------- */
.card {
  background: var(--kertas); border: 1px solid var(--garis); border-radius: var(--r-m);
  box-shadow: var(--bayang); overflow: hidden;
}
.pick {
  display: block; width: 100%; text-align: left; background: var(--kertas); cursor: pointer;
  border: 1.5px solid var(--garis); border-radius: var(--r-m); padding: 1rem;
  font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.pick:hover { border-color: var(--emas); box-shadow: var(--bayang); }
.pick[aria-pressed="true"], .pick.is-picked {
  border-color: var(--plum); box-shadow: 0 0 0 3px rgba(74, 43, 94, .12);
}
.pick-emoji { font-size: 1.6rem; }
.pick-title { font-family: var(--serif); font-size: 1.25rem; margin: .3rem 0 .15rem; }
.pick-note { font-size: .82rem; color: var(--dakwat-lembut); margin: 0; }
.pick-price { font-weight: 600; color: var(--plum); font-size: 1.1rem; }
.pick-img { aspect-ratio: 4/3; object-fit: cover; width: 100%; border-radius: var(--r-s); margin-bottom: .6rem; background: var(--krim-dalam); }

/* ---------- Butang ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 .95rem var(--sans); cursor: pointer; text-decoration: none; transition: filter .15s, background .15s;
  min-height: 46px;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; }
.btn-utama { background: var(--plum); color: #fff; }
.btn-emas { background: var(--emas); color: #fff; }
.btn-garis { background: transparent; color: var(--plum); border-color: var(--plum); }
.btn-lembut { background: var(--krim-dalam); color: var(--dakwat); border-color: var(--garis); }
.btn-bahaya { background: var(--ralat); color: #fff; }
.btn-blok { width: 100%; }
.btn-kecil { padding: .45rem .9rem; min-height: 36px; font-size: .84rem; }

/* ---------- Borang ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }
.field .hint { font-size: .78rem; color: var(--dakwat-lembut); margin: .3rem 0 0; }
input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: .7rem .85rem; font: inherit; color: inherit;
  background: var(--kertas); border: 1.5px solid var(--garis); border-radius: var(--r-s);
  min-height: 46px;
}
input:focus, select:focus, textarea:focus { border-color: var(--plum); outline: none; box-shadow: 0 0 0 3px rgba(74,43,94,.1); }
textarea { min-height: 96px; resize: vertical; }
fieldset { border: 1px solid var(--garis); border-radius: var(--r-m); padding: 1rem; margin: 0 0 1.25rem; background: var(--kertas); }
legend { font-family: var(--serif); font-size: 1.15rem; padding: 0 .4rem; }

/* ---------- Mesej ---------- */
.flash { padding: .85rem 1rem; border-radius: var(--r-s); margin-bottom: 1.25rem; font-size: .9rem; border: 1px solid; }
.flash-info { background: #F2F6FA; border-color: #CBD9E6; color: #23455F; }
.flash-jaya { background: #EEF6F1; border-color: #BFD9C9; color: var(--jaya); }
.flash-ralat { background: #FCF0EF; border-color: #EBC7C3; color: var(--ralat); }
.flash-amaran { background: #FDF6E8; border-color: #EBD9B0; color: var(--amaran); }
.ralat-senarai { margin: 0; padding-left: 1.1rem; }

/* ---------- Lencana ---------- */
.lencana { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 600; border: 1px solid var(--garis); background: var(--krim-dalam); color: var(--dakwat-lembut); }
.lencana-jaya { background: #EEF6F1; color: var(--jaya); border-color: #BFD9C9; }
.lencana-amaran { background: #FDF6E8; color: var(--amaran); border-color: #EBD9B0; }
.lencana-ralat { background: #FCF0EF; color: var(--ralat); border-color: #EBC7C3; }
.lencana-plum { background: #F2EDF6; color: var(--plum); border-color: #DCCFE6; }

/* ---------- Bar tindakan melekit ---------- */
.bar-lekat {
  position: sticky; bottom: 0; z-index: 30; background: rgba(250, 246, 239, .97);
  backdrop-filter: blur(8px); border-top: 1px solid var(--garis);
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  margin: 1.5rem -1rem -6rem; display: flex; gap: .75rem; align-items: center;
}
.bar-lekat .bar-info { flex: 1; min-width: 0; font-size: .82rem; line-height: 1.35; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Toast (notifikasi selepas tindakan) ----------
   Sepanduk .flash kekal untuk keadaan halaman (cth. status order);
   toast pula untuk maklum balas sekali lalu selepas sesuatu tindakan. */
.toast-dok {
  position: fixed; z-index: 200; top: calc(.75rem + env(safe-area-inset-top));
  left: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem;
  pointer-events: none;
}
@media (min-width: 640px) {
  .toast-dok { left: auto; right: 1.25rem; top: 1.25rem; max-width: 420px; }
}
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: .7rem;
  background: var(--kertas); color: var(--dakwat);
  border: 1px solid var(--garis); border-left: 4px solid var(--plum);
  border-radius: var(--r-m); padding: .8rem .9rem; box-shadow: var(--bayang-t);
  font-size: .9rem; line-height: 1.45;
  animation: toast-masuk .22s ease-out both;
}
.toast::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%;
  background: var(--plum); flex: none; margin-top: .42rem;
}
.toast-teks { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-tutup {
  flex: none; border: 0; background: transparent; cursor: pointer; font-family: inherit;
  color: var(--dakwat-lembut); font-size: 1.15rem; line-height: 1; padding: .15rem .3rem;
  border-radius: 6px; margin: -.15rem -.2rem 0 0;
}
.toast-tutup:hover { background: var(--krim-dalam); color: var(--dakwat); }

.toast-jaya { border-left-color: var(--jaya); }
.toast-jaya::before { background: var(--jaya); }
.toast-ralat { border-left-color: var(--ralat); }
.toast-ralat::before { background: var(--ralat); }
.toast-amaran { border-left-color: var(--amaran); }
.toast-amaran::before { background: var(--amaran); }

.toast.keluar { animation: toast-keluar .2s ease-in both; }

@keyframes toast-masuk {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes toast-keluar {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-8px) scale(.98); }
}
@media (prefers-reduced-motion: reduce) {
  .toast, .toast.keluar { animation: none; }
}
@media print { .toast-dok { display: none !important; } }

/* Toast "sedang menyimpan": titik berdenyut supaya jelas ia masih berjalan. */
.toast-sibuk .toast-teks::after {
  content: ''; display: inline-block; width: .5em; height: .5em; margin-left: .5em;
  border-radius: 50%; background: currentColor; vertical-align: middle;
  animation: denyut-sibuk 1s ease-in-out infinite;
}
@keyframes denyut-sibuk { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast-sibuk .toast-teks::after { animation: none; opacity: .6; } }
