/* ==========================================================================
   WARUNG SEMBAKO — GAYA BROSUR PASAR MODERN (EYE-CATCHING & MOBILE-FIRST)
   Palet: Hijau Pandan Tua, Kuning Kunyit, Merah Cabai, Putih Kehijauan Segar
   ========================================================================== */

:root {
  /* Warna Dasar & Permukaan (Terang — Kontras Tinggi di Bawah Matahari) */
  --bg-page: #F2F7F1;
  --bg-surface: #FFFFFF;
  --bg-Promo-card: #FFFDF5;
  --bg-subtle: #E3EFE1;
  --bg-sticky: rgba(242, 247, 241, 0.94);

  /* Hijau Pandan Tua */
  --pandan-900: #082618;
  --pandan-800: #0E3A26;
  --pandan-700: #155237;
  --pandan-600: #1E6B49;
  --pandan-100: #D7ECD9;

  /* Kuning Kunyit (Aksen Utama) */
  --kunyit-500: #F7B818;
  --kunyit-400: #FFCA3A;
  --kunyit-200: #FFF0B8;
  --kunyit-ink: #1C1400;

  /* Merah Cabai Kecil (Promo / Stiker / Hemat) */
  --cabai-600: #D9232E;
  --cabai-700: #B31922;
  --cabai-100: #FFE4E6;

  /* Biru & Ungu Segar untuk Stiker Baru / Terlaris */
  --baru-bg: #0284C7;
  --terlaris-bg: #0E3A26;

  /* Tipografi & Garis */
  --text-main: #0D2318;
  --text-muted: #425B4E;
  --text-light: #647D70;
  --border-strong: #0E3A26;
  --border-card: #C6DCC9;
  --border-promo: #F59E0B;

  /* Efek & Sudut */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-card: 0 3px 0 #C4D9C7;
  --shadow-promo: 0 4px 0 #F59E0B;
  --shadow-float: 0 10px 28px rgba(8, 38, 24, 0.28);

  /* Font */
  --font-display: 'Bricolage Grotesque', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Figtree', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Safe Area HP */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Mode Gelap Otomatis (Jika pengguna belum memilih manual) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-page: #091912;
    --bg-surface: #11291E;
    --bg-Promo-card: #182E1E;
    --bg-subtle: #193829;
    --bg-sticky: rgba(9, 25, 18, 0.94);

    --text-main: #F1F8F3;
    --text-muted: #B4CCC0;
    --text-light: #86A695;
    --border-strong: #34694F;
    --border-card: #234936;
    --border-promo: #D99B06;

    --kunyit-200: #3A2E07;
    --cabai-100: #3D1217;
    --pandan-100: #1A3D2C;

    --shadow-card: 0 3px 0 #05110B;
    --shadow-promo: 0 4px 0 #9A6E04;
    --shadow-float: 0 12px 32px rgba(0, 0, 0, 0.6);
  }
}

/* Mode Gelap Manual lewat Tombol */
:root[data-theme="dark"] {
  --bg-page: #091912;
  --bg-surface: #11291E;
  --bg-Promo-card: #182E1E;
  --bg-subtle: #193829;
  --bg-sticky: rgba(9, 25, 18, 0.94);

  --text-main: #F1F8F3;
  --text-muted: #B4CCC0;
  --text-light: #86A695;
  --border-strong: #34694F;
  --border-card: #234936;
  --border-promo: #D99B06;

  --kunyit-200: #3A2E07;
  --cabai-100: #3D1217;
  --pandan-100: #1A3D2C;

  --shadow-card: 0 3px 0 #05110B;
  --shadow-promo: 0 4px 0 #9A6E04;
  --shadow-float: 0 12px 32px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   RESET & DASAR
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.45;
  overflow-x: hidden;
  padding-bottom: calc(105px + var(--safe-bottom));
  min-height: 100dvh;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Fokus Keyboard Jelas */
:focus-visible {
  outline: 3px solid var(--kunyit-500);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  background: var(--kunyit-500);
  color: var(--kunyit-ink);
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   HEADER & HERO RINGKAS WARUNG (Maks ~45% layar HP agar produk langsung terlihat)
   ========================================================================== */
.site-header {
  background-color: var(--pandan-800);
  /* Pola titik halus khas kertas kemas tanpa gradien berat */
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  color: #FFFFFF;
  padding-top: calc(10px + var(--safe-top));
  padding-bottom: 10px;
  border-bottom: 3px solid var(--kunyit-500);
}

.header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 14px;
}

/* Banner Info Warung (Sheet "config" sel B1) */
.Announcement-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  background-color: #082618;
  border: 1.5px solid var(--kunyit-500);
  border-radius: var(--radius-sm);
  padding: 3px 9px 3px 5px;
  margin-bottom: 7px;
  font-size: 0.76rem;
  color: #FFF6D6;
}

.announcement-tag {
  background-color: var(--cabai-600);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.64rem;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

#announcement-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Grid Hero Utama Ringkas */
.hero-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.hero-copy {
  min-width: 0;
  flex: 1;
}

.store-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.28rem, 4.6vw, 1.85rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin-bottom: 3px;
}

.store-tagline {
  font-size: clamp(0.8rem, 2.4vw, 0.92rem);
  line-height: 1.3;
  color: #D7EFE1;
  white-space: normal;
  overflow-wrap: break-word;
  max-height: calc(1.3em * 2);
  overflow: hidden;
  text-overflow: clip;
}

.hero-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hero-illustration {
  width: 68px;
  height: 56px;
  flex-shrink: 0;
}

.hero-illustration svg {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 360px) {
  .hero-illustration {
    width: 54px;
    height: 44px;
  }
}

.btn-theme {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.12);
  color: #FFE58F;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-theme:hover {
  background-color: rgba(255, 255, 255, 0.22);
}

/* Tampilkan ikon matahari/bulan sesuai tema aktif */
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

/* Tiga Chip Info Layanan dalam Satu Baris Geser Horizontal + Efek Fade Tepi Kanan */
.info-pills-scroll {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin: 0 -14px;
  padding: 0 28px 0 14px;
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 28px), transparent 100%);
}

.info-pills-scroll::-webkit-scrollbar {
  display: none;
}

.info-pills {
  list-style: none;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
}

.info-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--pandan-900);
  color: #F4FBF7;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.71rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.info-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--kunyit-500);
  flex-shrink: 0;
}

/* ==========================================================================
   KONTROL STICKY: PENCARIAN & CHIP KATEGORI
   ========================================================================== */
.sticky-controls {
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: var(--bg-sticky);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--border-card);
  padding: 8px 0 8px;
}

.controls-inner {
  max-width: 980px;
  margin: 0 auto;
}

.search-row {
  padding: 0 14px;
  margin-bottom: 8px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 44px 10px 44px;
  background-color: var(--bg-surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--text-main);
  box-shadow: 0 2px 0 var(--border-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-input:focus {
  outline: none;
  border-color: var(--pandan-700);
  box-shadow: 0 0 0 3px var(--kunyit-500);
}

/* Hilangkan tombol X bawaan webkit agar tidak dobel */
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.btn-clear-search {
  position: absolute;
  right: 4px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* Baris Chip Kategori Horizontal */
.category-scroll-wrap {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 16px;
}

.category-scroll-wrap::-webkit-scrollbar {
  display: none;
}

.category-chips {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 2px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 2px solid var(--border-card);
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.chip-btn:active {
  transform: scale(0.96);
}

.chip-btn.is-active {
  background-color: var(--pandan-800);
  color: #FFFFFF;
  border-color: var(--pandan-800);
  box-shadow: 0 2px 0 var(--kunyit-500);
}

:root[data-theme="dark"] .chip-btn.is-active {
  background-color: var(--kunyit-500);
  color: var(--kunyit-ink);
  border-color: var(--kunyit-500);
  box-shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip-btn.is-active {
    background-color: var(--kunyit-500);
    color: var(--kunyit-ink);
    border-color: var(--kunyit-500);
    box-shadow: none;
  }
}

.chip-count {
  font-size: 0.75rem;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 700;
}

.chip-btn.is-active .chip-count {
  background-color: var(--kunyit-500);
  color: var(--kunyit-ink);
}

:root[data-theme="dark"] .chip-btn.is-active .chip-count {
  background-color: var(--pandan-900);
  color: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip-btn.is-active .chip-count {
    background-color: var(--pandan-900);
    color: #FFFFFF;
  }
}

/* ==========================================================================
   AREA UTAMA & KARTU PRODUK ("LABEL HARGA PASAR")
   ========================================================================== */
.main-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 16px 28px;
}

/* Banner Pemberitahuan Keranjang */
.notice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: var(--kunyit-200);
  color: var(--text-main);
  border: 2px solid var(--kunyit-500);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.notice-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.notice-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--cabai-600);
  color: #FFFFFF;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-close-notice {
  min-height: 44px;
  padding: 6px 14px;
  background-color: var(--pandan-800);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* Judul Kategori Aktif & Jumlah Produk */
.catalog-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.section-heading {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.product-count {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Grid Produk: 2 Kolom di HP, 3-4 Kolom di Layar Lebar */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Kartu Produk Dasar */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--bg-surface);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 10px;
  transition: transform 0.18s ease, border-color 0.18s ease;
  /* Animasi muncul bergelombang saat muat awal */
  animation: cardWaveIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: var(--stagger-delay, 0ms);
}

/* Variasi Ritme: Kartu Berlabel PROMO tampil lebih menonjol seperti kupon pasar */
.product-card.is-promo-highlight {
  background-color: var(--bg-Promo-card);
  border: 2.5px solid var(--border-promo);
  box-shadow: var(--shadow-promo);
}

/* Kartu saat item sudah ada di keranjang */
.product-card.in-cart {
  border-color: var(--pandan-700);
}

/* Kartu Stok Habis */
.product-card.is-out {
  background-color: var(--bg-subtle);
  border-style: dashed;
  box-shadow: none;
}

/* Pembungkus Foto Rasio Tetap 3:4 (Sesuai Foto Produk + Bebas Layout Shift + Skeleton Tiap Gambar) */
.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--bg-subtle);
  margin-bottom: 10px;
  border: 1px solid rgba(14, 58, 38, 0.08);
}

/* Efek Skeleton Shimmer saat file gambar sedang diunduh */
.card-media.is-img-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    110deg,
    var(--bg-subtle) 25%,
    var(--pandan-100) 45%,
    var(--bg-subtle) 65%
  );
  background-size: 220% 100%;
  animation: shimmerSweep 1.25s linear infinite;
}

.card-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.25s ease;
}

.card-img.is-loaded {
  opacity: 1;
}

.product-card.is-out .card-img.is-loaded,
.product-card.is-out .fallback-art {
  filter: grayscale(85%) contrast(0.9);
  opacity: 0.48;
}

/* Ilustrasi Cadangan jika Gambar Kosong / Gagal Dimuat */
.fallback-art {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--pandan-100);
  color: var(--pandan-800);
  padding: 12px;
  text-align: center;
}

.fallback-emoji {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 6px;
}

.fallback-cat {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* Stiker Miring untuk Label: Promo / Baru / Terlaris (Di Bawah Kiri agar Tidak Menutupi Tulisan Foto di Atas) */
.sticker-label {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 3;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.7rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 7px;
  color: #FFFFFF;
  transform: rotate(-3deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  letter-spacing: 0.02em;
  pointer-events: none;
}

.sticker-Promo {
  background-color: var(--cabai-600);
  border: 1.5px solid #FFF0B8;
}

.sticker-Terlaris {
  background-color: var(--terlaris-bg);
  color: var(--kunyit-400);
  border: 1.5px solid var(--kunyit-500);
  transform: rotate(-2deg);
}

.sticker-Baru {
  background-color: var(--baru-bg);
  border: 1.5px solid #E0F2FE;
  transform: rotate(2.5deg);
}

/* Badge Hemat % di Pojok Kanan Bawah Foto */
.saving-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  z-index: 3;
  background-color: var(--kunyit-500);
  color: var(--kunyit-ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.68rem;
  padding: 4px 7px;
  border-radius: 6px;
  border: 1.5px solid var(--pandan-900);
  pointer-events: none;
}

/* Penanda Stok Menipis (Sisa <= 5) */
.low-stock-pill {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  background-color: #FFF3CD;
  color: #7C2D12;
  border: 1.5px solid #F59E0B;
  font-weight: 800;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  pointer-events: none;
}

/* Indikator Klik untuk Perbesar Foto */
.card-media.is-zoomable {
  cursor: zoom-in;
}

.card-media.is-zoomable:hover .card-img.is-loaded {
  transform: scale(1.03);
}

.zoom-hint-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: rgba(8, 38, 24, 0.58);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  pointer-events: none;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.card-media.is-zoomable:hover .zoom-hint-badge {
  background-color: var(--pandan-800);
  transform: scale(1.08);
}

/* Penanda Stok Habis (Stempel Pasar di Tengah Foto) */
.out-stock-stamp {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(8, 38, 24, 0.28);
}

.out-stock-stamp span {
  background-color: #1F2937;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.88rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid #FFFFFF;
  transform: rotate(-6deg);
  letter-spacing: 0.05em;
}

/* Detail Teks Produk */
.card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.card-unit {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.card-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.28;
  color: var(--text-main);
  margin-bottom: 8px;
  white-space: normal;
  overflow-wrap: break-word;
  overflow: visible;
  text-overflow: clip;
}

/* Area Harga ("Label Harga Pasar" yang Paling Menonjol) */
.price-block {
  margin-top: auto;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
}

.price-pill {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.12rem;
  line-height: 1.15;
  color: var(--kunyit-ink);
  background-color: var(--kunyit-400);
  padding: 3px 9px;
  border-radius: 8px;
  border: 1.5px solid var(--pandan-900);
}

.product-card.is-out .price-pill {
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  border-color: var(--border-card);
}

.price-strike {
  font-size: 0.78rem;
  color: var(--text-light);
  text-decoration: line-through;
  font-weight: 600;
}

/* Tombol Tambah & Stepper (− jumlah +) */
.card-action {
  width: 100%;
}

.btn-add {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--pandan-800);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-add:hover:not(:disabled) {
  background-color: var(--pandan-700);
}

.btn-add:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-add:disabled {
  background-color: var(--bg-subtle);
  color: var(--text-light);
  border: 1.5px solid var(--border-card);
  cursor: not-allowed;
}

:root[data-theme="dark"] .btn-add:not(:disabled) {
  background-color: var(--pandan-600);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-add:not(:disabled) {
    background-color: var(--pandan-600);
  }
}

/* Stepper Saat Barang Sudah di Keranjang */
.stepper-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--pandan-900);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  border: 2px solid var(--pandan-800);
  overflow: hidden;
  min-height: 44px;
}

.stepper-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--kunyit-500);
  color: var(--kunyit-ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  transition: background-color 0.12s ease;
}

.stepper-btn:hover:not(:disabled) {
  background-color: var(--kunyit-400);
}

.stepper-btn:disabled {
  background-color: #4B5563;
  color: #9CA3AF;
  cursor: not-allowed;
}

.stepper-qty {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  padding: 0 6px;
  text-align: center;
  min-width: 32px;
}

/* ==========================================================================
   SKELETON LOADING & EMPTY STATE
   ========================================================================== */
.product-card.is-skeleton {
  pointer-events: none;
}

.skeleton-img,
.skeleton-line,
.skeleton-box {
  background-color: var(--bg-subtle);
  border-radius: 8px;
  animation: pulseSkeleton 1.4s ease-in-out infinite;
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  margin-bottom: 10px;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-line.w-75 { width: 75%; }
.skeleton-line.w-85 { width: 85%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-55 { width: 55%; }
.skeleton-line.w-45 { width: 45%; }

.skeleton-box {
  height: 44px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
}

.empty-state {
  text-align: center;
  background-color: var(--bg-surface);
  border: 2px dashed var(--border-card);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  margin-top: 12px;
}

.empty-illustration {
  font-size: 3rem;
  margin-bottom: 8px;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.empty-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.btn-reset-filter {
  min-height: 44px;
  padding: 10px 20px;
  background-color: var(--pandan-800);
  color: #FFFFFF;
  font-weight: 700;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   BILAH KERANJANG MELAYANG (FLOATING BAR)
   ========================================================================== */
.floating-cart-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 10px 14px calc(12px + var(--safe-bottom));
  pointer-events: none;
}

.floating-cart-btn {
  pointer-events: auto;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  min-height: 62px;
  background-color: var(--pandan-900);
  color: #FFFFFF;
  border: 2.5px solid var(--kunyit-500);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.15s ease;
}

.floating-cart-btn:active {
  transform: scale(0.98);
}

.cart-btn-left {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.cart-icon-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: var(--kunyit-500);
  color: var(--kunyit-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Animasi Ikon Keranjang Melompat Saat Menambah Barang */
.cart-icon-wrap.is-bouncing {
  animation: cartBounce 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-count-pill {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background-color: var(--cabai-600);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--pandan-900);
}

.cart-summary-text {
  display: flex;
  flex-direction: column;
}

.cart-items-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  color: #FFFFFF;
}

.cart-hint-label {
  font-size: 0.76rem;
  color: #B4E4CA;
}

.cart-btn-right {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--kunyit-500);
  color: var(--kunyit-ink);
  padding: 8px 12px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ==========================================================================
   BOTTOM SHEET KERANJANG & FORM CHECKOUT WA
   ========================================================================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(6, 24, 15, 0.65);
  backdrop-filter: blur(2px);
}

.cart-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  max-width: 640px;
  max-height: 90dvh;
  margin: 0 auto;
  background-color: var(--bg-surface);
  color: var(--text-main);
  border-top: 4px solid var(--kunyit-500);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  animation: sheetSlideUp 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.sheet-handle-bar {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}

.sheet-pill {
  width: 44px;
  height: 5px;
  border-radius: var(--radius-pill);
  background-color: var(--border-card);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 18px 12px;
  border-bottom: 1.5px solid var(--border-card);
}

.sheet-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
}

.sheet-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.btn-close-sheet {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--bg-subtle);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sheet-body {
  overflow-y: auto;
  padding: 14px 18px calc(22px + var(--safe-bottom));
}

.cart-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.btn-clear-cart {
  min-height: 44px;
  padding: 4px 10px;
  color: var(--cabai-600);
  font-weight: 700;
  font-size: 0.82rem;
}

.cart-items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background-color: var(--bg-page);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-md);
}

.cart-item-info {
  min-width: 0;
  flex: 1;
}

.cart-item-name {
  font-weight: 700;
  font-size: 0.94rem;
  margin-bottom: 2px;
}

.cart-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cart-item-subtotal {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.94rem;
  color: var(--text-main);
  margin-top: 2px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sheet-qty-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-color: var(--bg-surface);
  border: 2px solid var(--border-strong);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sheet-qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sheet-qty-num {
  min-width: 26px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
}

.btn-remove-item {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: var(--cabai-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Ringkasan Total di Dalam Sheet */
.cart-totals-card {
  background-color: var(--kunyit-200);
  border: 2px solid var(--kunyit-500);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 18px;
}

.totals-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.totals-row.is-saving {
  font-size: 0.86rem;
  color: var(--cabai-600);
  font-weight: 700;
}

.totals-row.is-grand {
  font-size: 1.05rem;
  font-weight: 700;
}

.grand-total-value {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 800;
}

.totals-note {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Form Input Pelanggan */
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-label {
  font-size: 0.86rem;
  font-weight: 700;
}

.req-mark {
  color: var(--cabai-600);
}

.opt-mark {
  font-weight: 500;
  color: var(--text-muted);
}

.form-input,
.form-textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  background-color: var(--bg-page);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--pandan-700);
  box-shadow: 0 0 0 3px var(--kunyit-500);
}

.form-input.is-invalid {
  border-color: var(--cabai-600);
}

.field-error {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cabai-600);
}

.sheet-footer-action {
  margin-top: 6px;
}

.btn-submit-wa {
  width: 100%;
  min-height: 54px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background-color: #15803D;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 0 #082618;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.btn-submit-wa:hover {
  background-color: #166534;
}

.btn-submit-wa:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #082618;
}

/* ==========================================================================
   FOOTER & TOAST
   ========================================================================== */
.site-footer {
  max-width: 980px;
  margin: 12px auto 0;
  padding: 20px 16px 32px;
  text-align: center;
  border-top: 2px dashed var(--border-card);
}

.footer-message {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.footer-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-sync-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-light);
}

.footer-sync {
  font-weight: 500;
}

.cache-badge {
  background-color: var(--kunyit-200);
  color: var(--text-main);
  border: 1px solid var(--border-promo);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.7rem;
}

.toast {
  position: fixed;
  top: calc(16px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background-color: var(--pandan-900);
  color: #FFFFFF;
  border: 2px solid var(--kunyit-500);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow-float);
  max-width: 92vw;
  text-align: center;
}

/* ==========================================================================
   MODAL PERBESAR FOTO PRODUK (LIGHTBOX)
   ========================================================================== */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
}

.image-lightbox[hidden] {
  display: none !important;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(6, 24, 15, 0.86);
  backdrop-filter: blur(4px);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 2.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  animation: cardWaveIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-close-lightbox {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(8, 38, 24, 0.78);
  color: #FFFFFF;
  border: 2px solid var(--kunyit-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn-close-lightbox:hover {
  background-color: var(--cabai-600);
  transform: scale(1.05);
}

.lightbox-img-wrap {
  width: 100%;
  max-height: 72dvh;
  background-color: #0B1F15;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-img {
  width: 100%;
  max-height: 72dvh;
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background-color: var(--bg-surface);
  border-top: 1.5px solid var(--border-card);
}

.lightbox-caption-text {
  min-width: 0;
}

.lightbox-unit {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.lightbox-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.lightbox-price {
  flex-shrink: 0;
  background-color: var(--kunyit-400);
  color: var(--kunyit-ink);
  border: 1.5px solid var(--pandan-900);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 5px 10px;
  border-radius: 8px;
}

/* ==========================================================================
   KEYFRAMES & PREFERS-REDUCED-MOTION
   ========================================================================== */
@keyframes cardWaveIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cartBounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.26) rotate(-6deg); }
  75% { transform: scale(0.94) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes sheetSlideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes pulseSkeleton {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.95; }
}

@keyframes shimmerSweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Hormati pengguna yang memilih kurangi animasi */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
