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

:root {
  --merah: #B00020;
  --merah-gelap: #8a0018;
  --hijau-aksen: #006B3F;
  --hijau-wa: #25D366;
  --hijau-wa-hover: #1da851;
  --biru-footer: #0B1F3A;
  --bg-utama: #d6d1d1;
  --kartu: #FFFFFF;
  --teks: #222222;
  --teks-muted: #666666;
  --border: #e0e0e0;
  --shadow: 0 2px 12px rgba(0,0,0,0.10);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 60px;
  --sidebar-w: 220px;
  --transition: 0.22s ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg-utama);
  color: var(--teks);
  font-size: 14px;
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { display: block; max-width: 100%; }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--merah);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  height: var(--header-h);
}
.header-inner {
  max-width: 1800px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.header-logo {
  color: #fff;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
}
.header-logo svg {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}
.header-title-wrap {
  display: flex;
  flex-direction: column;
}
.header-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.header-tagline {
  font-size: 10px;
  color: rgba(255,255,255,0.80);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* Sidebar Toggle */
.sidebar-toggle {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.32); }
.sidebar-toggle svg {
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
}

/* Search */
.filter-search {
  flex: 1 1 320px;
  min-width: 240px;
  max-width: 560px;
}
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.08);
}
.search-icon {
  padding: 0 10px;
  color: var(--teks-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 9px 0;
  font-size: 14px;
  color: var(--teks);
  background: transparent;
  min-width: 0;
}
.search-clear {
  padding: 0 12px;
  color: var(--teks-muted);
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.search-clear:hover { color: var(--merah); }

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-keranjang {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.45);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  position: relative;
  white-space: nowrap;
  transition: background var(--transition);
}
.btn-keranjang:hover { background: rgba(255,255,255,0.30); }
.badge-keranjang {
  background: #ffcc00;
  color: #333;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
.btn-wa-admin {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--hijau-wa);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 24px;
  white-space: nowrap;
  transition: background var(--transition);
}
.btn-wa-admin:hover { background: var(--hijau-wa-hover); }
.btn-admin-panel {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.45);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition);
}
.btn-admin-panel:hover { background: rgba(255,255,255,0.30); }

/* ============================================================
   LAYOUT WRAPPER (SIDEBAR + MAIN)
   ============================================================ */
.layout-wrap {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  min-height: calc(100vh - var(--header-h));
  max-width: 1800px;
  margin: 0 auto;
}

/* ============================================================
   SIDEBAR KIRI
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  min-height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  transition: width var(--transition), transform var(--transition);
  z-index: 80;
  display: flex;
  flex-direction: column;
}
.sidebar.collapsed {
  width: 0;
  overflow: hidden;
  border-right: none;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--teks-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.sidebar-close-btn {
  font-size: 16px;
  color: var(--teks-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.sidebar-close-btn:hover { background: #f5f5f5; color: var(--merah); }
.sidebar-nav {
  padding: 8px 6px;
  flex: 1;
}
.sidebar-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--teks);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border: none;
  background: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.sidebar-item:hover {
  background: #f1f8f4;
  color: var(--hijau-aksen);
}
.sidebar-item.active {
  background: var(--hijau-aksen);
  color: #fff;
  font-weight: 700;
}
.sidebar-subitem {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 12px 7px 26px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 400;
  color: var(--teks-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border: none;
  background: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1px;
}
.sidebar-subitem:hover {
  background: #f1f8f4;
  color: var(--hijau-aksen);
}
.sidebar-subitem.active {
  background: #e8f5e9;
  color: var(--hijau-aksen);
  font-weight: 700;
}
/* Backdrop mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 79;
}

/* ============================================================
   MAIN AREA
   ============================================================ */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  position: sticky;
  top: var(--header-h);
  z-index: 70;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.filter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--teks-muted);
  white-space: nowrap;
  min-width: 80px;
}
.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  background: #f1f1f1;
  color: var(--teks);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}
.chip:hover {
  background: var(--hijau-aksen);
  color: #fff;
  border-color: var(--hijau-aksen);
}
.chip.active {
  background: var(--hijau-aksen);
  color: #fff;
  border-color: var(--hijau-aksen);
}
.select-filter {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  color: var(--teks);
  background: #fff;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.select-filter:hover, .select-filter:focus { border-color: var(--hijau-aksen); }
.hasil-info {
  font-size: 12px;
  color: var(--teks-muted);
  margin-left: auto;
}
/* Pemisah baris filter — hanya aktif di mobile via media query */
.filter-row-break { display: none; }

/* ============================================================
   GRID PRODUK
   ============================================================ */
.produk-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr); /* Desktop: 6 kolom */
  gap: 10px;
  padding: 12px;
}
@media (max-width: 1400px) {
  .produk-grid { grid-template-columns: repeat(5, 1fr); } /* Tablet besar: 5 kolom */
}
@media (max-width: 1024px) {
  .produk-grid { grid-template-columns: repeat(4, 1fr); } /* Tablet: 4 kolom */
}
@media (max-width: 768px) {
  .produk-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 8px; } /* HP: 3 kolom */
}

/* ============================================================
   KARTU PRODUK
   ============================================================ */
.kartu {
  background: var(--kartu);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
  position: relative;
}
.kartu:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.kartu-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.badge-tersedia { background: #e8f5e9; color: #2e7d32; }
.badge-habis    { background: #ffebee; color: #c62828; }
.badge-promo    { background: #fff3e0; color: #e65100; }

.kartu-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f5f5f5;
  position: relative;
}
.kartu-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.kartu:hover .kartu-img { transform: scale(1.06); }
.kartu-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #bdbdbd;
  font-size: 36px;
  background: #f9f9f9;
}
.kartu-img-placeholder span { font-size: 11px; margin-top: 4px; }
.kartu-habis-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  z-index: 1;
}
.kartu-body {
  padding: 7px 8px 5px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kartu-nama {
  font-size: 11px;
  font-weight: 700;
  color: var(--teks);
  line-height: 1.3;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kartu-kode   { font-size: 9px; color: var(--teks-muted); }
.kartu-harga  { font-size: 12px; font-weight: 700; color: var(--merah); margin-top: 2px; }
.kartu-stok   { font-size: 9px; color: var(--teks-muted); }

/* Footer kartu (3 tombol) */
.kartu-footer {
  display: flex;
  gap: 3px;
  padding: 0 6px 6px;
  flex-wrap: wrap;
}
.btn-detail {
  flex: 1;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-weight: 600;
  color: var(--hijau-aksen);
  border: 1.5px solid var(--hijau-aksen);
  background: #fff;
  transition: all var(--transition);
  text-align: center;
  white-space: nowrap;
}
.btn-detail:hover { background: var(--hijau-aksen); color: #fff; }
.btn-wa {
  flex: 1;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-weight: 600;
  background: var(--hijau-wa);
  color: #fff;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: background var(--transition);
  white-space: nowrap;
}
.btn-wa:hover { background: var(--hijau-wa-hover); }
.btn-wa.disabled { background: #ccc; pointer-events: none; }
.btn-keranjang-kartu {
  flex: 1;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-weight: 600;
  background: #fff3e0;
  color: #e65100;
  border: 1.5px solid #e65100;
  text-align: center;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-keranjang-kartu:hover { background: #e65100; color: #fff; }
.btn-keranjang-kartu.disabled {
  background: #f5f5f5;
  color: #bbb;
  border-color: #ddd;
  pointer-events: none;
}

/* ============================================================
   MODAL KERANJANG BELANJA
   ============================================================ */
.modal-keranjang {
  width: min(500px, 96vw);
}
.keranjang-kosong {
  text-align: center;
  padding: 32px 16px;
  color: var(--teks-muted);
  font-size: 14px;
}
.keranjang-kosong .kosong-icon { font-size: 48px; margin-bottom: 10px; }
.keranjang-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 45vh;
  overflow-y: auto;
  margin-bottom: 12px;
}
.keranjang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.keranjang-item-foto {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.keranjang-item-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.keranjang-item-info {
  flex: 1;
  min-width: 0;
}
.keranjang-item-nama {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.keranjang-item-kode {
  font-size: 11px;
  color: var(--teks-muted);
}
.keranjang-item-harga {
  font-size: 12px;
  color: var(--merah);
  font-weight: 600;
  margin-top: 2px;
}
.keranjang-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.btn-qty {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--hijau-aksen);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.btn-qty:hover { background: #004d2d; }
.qty-angka {
  font-size: 14px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}
.btn-hapus-item {
  color: #c62828;
  font-size: 16px;
  padding: 4px;
  flex-shrink: 0;
  border-radius: 4px;
  transition: background var(--transition);
}
.btn-hapus-item:hover { background: #ffebee; }
.keranjang-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 0 0;
  border-top: 2px solid var(--border);
  color: var(--teks);
}
.keranjang-total strong {
  color: var(--merah);
  font-size: 18px;
}
.btn-checkout-wa {
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-sm);
  background: var(--hijau-wa);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  transition: background var(--transition);
}
.btn-checkout-wa:hover { background: var(--hijau-wa-hover); }

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton-card {
  background: var(--kartu);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: skeleton-pulse 1.4s infinite;
}
@keyframes skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.sk-img     { width: 100%; aspect-ratio: 1/1; background: #e0e0e0; }
.sk-line    { height: 12px; background: #e0e0e0; border-radius: 6px; margin: 8px 10px 0; }
.sk-nama    { width: 80%; height: 14px; }
.sk-kode    { width: 40%; }
.sk-harga   { width: 55%; height: 16px; background: #f5c6c6; }
.sk-stok    { width: 45%; margin-bottom: 8px; }
.sk-btns    { height: 28px; background: #e0e0e0; margin: 6px 10px 10px; border-radius: 6px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { text-align: center; padding: 60px 20px; color: var(--teks-muted); }
.empty-icon  { font-size: 64px; margin-bottom: 12px; }
.empty-state h3 { font-size: 20px; color: var(--teks); margin-bottom: 8px; }
.btn-reset {
  margin-top: 16px;
  padding: 10px 24px;
  border-radius: 24px;
  background: var(--hijau-aksen);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  transition: background var(--transition);
}
.btn-reset:hover { background: #004d2d; }

/* ============================================================
   LOAD MORE
   ============================================================ */
.load-more-wrap { text-align: center; padding: 16px; }
.btn-load-more {
  background: var(--merah);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 36px;
  border-radius: 28px;
  box-shadow: 0 3px 10px rgba(176,0,32,0.30);
  transition: background var(--transition), transform var(--transition);
}
.btn-load-more:hover { background: var(--merah-gelap); transform: translateY(-2px); }

/* ============================================================
   MODAL DETAIL PRODUK
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 450;
  display: none;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: block; }
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 451;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 12px 48px rgba(0,0,0,0.28);
  width: min(560px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  display: none;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.modal.open {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 20px;
  color: var(--teks-muted);
  z-index: 1;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  transition: background var(--transition);
}
.modal-close:hover { background: #ffe0e0; color: var(--merah); }
.modal-body { padding: 0 0 20px; }
.modal-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
  background: #f9f9f9;
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-info    { padding: 20px 20px 0; }
.modal-badge   { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 700; margin-bottom: 10px; }
.modal-nama    { font-size: 20px; font-weight: 800; color: var(--teks); margin-bottom: 4px; line-height: 1.3; }
.modal-kode    { font-size: 12px; color: var(--teks-muted); margin-bottom: 12px; }
.modal-harga   { font-size: 24px; font-weight: 800; color: var(--merah); margin-bottom: 10px; }
.modal-meta    { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.modal-meta-item { background: #f5f5f5; border-radius: 8px; padding: 5px 12px; font-size: 12px; color: var(--teks-muted); }
.modal-meta-item strong { color: var(--teks); }
.modal-deskripsi {
  font-size: 13px; color: #444; line-height: 1.6;
  margin-bottom: 16px; padding: 12px;
  background: #fafafa; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.modal-footer { padding: 0 20px; display: flex; gap: 10px; }
.btn-modal-wa {
  flex: 1; padding: 12px; border-radius: var(--radius-sm);
  background: var(--hijau-wa); color: #fff; font-weight: 700;
  font-size: 15px; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--transition);
}
.btn-modal-wa:hover { background: var(--hijau-wa-hover); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--biru-footer);
  color: rgba(255,255,255,0.85);
  padding: 36px 16px 24px;
  margin-top: 32px;
}
.footer-inner {
  max-width: 1800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.footer-col h3   { color: #fff; font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.footer-col p    { font-size: 13px; margin-bottom: 6px; line-height: 1.6; }
.footer-link     { color: var(--hijau-wa); font-weight: 600; }
.footer-link:hover { text-decoration: underline; }

/* ============================================================
   TOAST & LOADING
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #333; color: #fff;
  padding: 10px 24px; border-radius: 24px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  z-index: 500;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0; pointer-events: none; white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.50);
  z-index: 600;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
}
.loading-spinner {
  width: 48px; height: 48px;
  border: 5px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: #fff; font-size: 15px; font-weight: 600; }

/* Scrollbar kustom */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ============================================================
   PANEL ADMIN
   ============================================================ */
.admin-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 400; display: none;
  backdrop-filter: blur(2px);
}
.admin-overlay.open { display: block; }
.admin-panel {
  position: fixed;
  top: 0; right: 0;
  width: min(1100px, 100vw);
  height: 100vh;
  background: #f7f8fa;
  z-index: 401;
  display: flex; flex-direction: column;
  box-shadow: -6px 0 32px rgba(0,0,0,0.22);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  overscroll-behavior: contain;
}
.admin-panel.open { transform: translateX(0); }
.admin-header {
  background: var(--biru-footer); color: #fff;
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-shrink: 0; flex-wrap: wrap;
}
.admin-title    { font-size: 18px; font-weight: 700; margin: 0; }
.admin-subtitle { font-size: 12px; color: rgba(255,255,255,0.7); margin: 2px 0 0; }
.admin-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-admin-action {
  padding: 7px 14px; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer; border: none;
  white-space: nowrap; transition: opacity var(--transition);
}
.btn-admin-action:hover { opacity: 0.85; }
.btn-success        { background: var(--hijau-aksen); color: #fff; }
.btn-info           { background: #0288d1; color: #fff; }
.btn-warning        { background: #f57c00; color: #fff; }
.btn-danger         { background: #c62828; color: #fff; }
.btn-danger-outline { background: transparent; color: #ef5350; border: 1.5px solid #ef5350; }
.btn-secondary {
  background: #f1f1f1; color: var(--teks);
  border: 1px solid var(--border);
  padding: 9px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-secondary:hover { background: #e4e4e4; }
.admin-close-btn {
  background: rgba(255,255,255,0.15); color: #fff; border: none;
  width: 32px; height: 32px; border-radius: 50%; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.admin-close-btn:hover { background: rgba(255,255,255,0.3); }

/* Admin Tabs */
.admin-tabs {
  display: flex;
  background: #fff;
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
}
.admin-tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--teks-muted);
  border-bottom: 3px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  background: none;
  cursor: pointer;
  white-space: nowrap;
}
.admin-tab:hover { color: var(--hijau-aksen); }
.admin-tab.active { color: var(--hijau-aksen); border-bottom-color: var(--hijau-aksen); }

/* Admin Toolbar */
.admin-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: #fff; border-bottom: 1px solid var(--border);
  flex-shrink: 0; flex-wrap: wrap;
}
.admin-search { flex: 1; min-width: 0; padding: 8px 14px !important; }
.admin-count  { font-size: 12px; color: var(--teks-muted); margin-left: auto; white-space: nowrap; }

/* Wrapper search + tombol scan barcode */
.admin-search-wrap {
  flex: 1; min-width: 180px;
  display: flex; align-items: center; gap: 6px;
}
.btn-scan-barcode {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 17px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-scan-barcode:hover { background: #fdf1f2; border-color: #B00020; }
.btn-scan-barcode:active { transform: scale(0.94); }

/* Modal Scan Barcode */
.modal-scan-barcode { width: min(420px, 94vw); }
.scan-barcode-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
}
.scan-barcode-viewport video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.scan-barcode-frame {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 78%; height: 42%;
  border: 2px solid #B00020;
  border-radius: 8px;
  box-shadow: 0 0 0 2000px rgba(0,0,0,0.35);
  pointer-events: none;
}

/* Tabel Admin */
.admin-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.admin-table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.admin-table-wrap::-webkit-scrollbar-thumb { background: #b0b8c0; border-radius: 6px; }
.admin-table-wrap::-webkit-scrollbar-track { background: #eef1f4; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table thead th {
  background: #f0f4f8; padding: 10px 12px;
  text-align: left; font-weight: 700; color: #444;
  border-bottom: 2px solid var(--border);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
.admin-table tbody tr { border-bottom: 1px solid #f0f0f0; transition: background var(--transition); }
.admin-table tbody tr:hover    { background: #f9f9f9; }
.admin-table tbody tr.selected { background: #e8f5e9; }
.admin-table td { padding: 9px 12px; vertical-align: middle; }
.admin-table td.td-nama  { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.admin-table td.td-harga { font-weight: 600; color: var(--merah); }
.tbl-badge   { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.btn-tbl-edit, .btn-tbl-hapus {
  padding: 4px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 600; cursor: pointer; border: none;
}
.btn-tbl-edit  { background: #e3f2fd; color: #1565c0; margin-right: 4px; }
.btn-tbl-edit:hover  { background: #1565c0; color: #fff; }
.btn-tbl-hapus { background: #ffebee; color: #c62828; }
.btn-tbl-hapus:hover { background: #c62828; color: #fff; }

/* Pengaturan Tab */
.pengaturan-wrap {
  padding: 24px;
  max-width: 520px;
}
.pengaturan-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--teks);
}

/* ============================================================
   FORM TAMBAH/EDIT
   ============================================================ */
.modal-sm  { width: min(400px, 96vw); }
.modal-lg  { width: min(680px, 96vw); }
.form-title  { font-size: 18px; font-weight: 800; margin-bottom: 20px; color: var(--teks); }
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 4px; }
.form-group  { display: flex; flex-direction: column; gap: 5px; }
.form-group-full { grid-column: 1 / -1; }
.form-label  { font-size: 12px; font-weight: 700; color: #555; }
.form-input  {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 13px; color: var(--teks);
  font-family: inherit; outline: none;
  transition: border-color var(--transition); background: #fff; width: 100%;
}
.form-input:focus { border-color: var(--hijau-aksen); }
.form-textarea { resize: vertical; min-height: 72px; }
.form-hint  { font-size: 11px; color: #999; margin-top: 2px; }
.form-error {
  background: #ffebee; color: #c62828; padding: 10px 14px;
  border-radius: 8px; font-size: 13px; margin-top: 10px; border: 1px solid #ef9a9a;
}
.form-success {
  background: #e8f5e9; color: #2e7d32; padding: 10px 14px;
  border-radius: 8px; font-size: 13px; margin-top: 10px; border: 1px solid #a5d6a7;
}
.req { color: var(--merah); }
.btn-primary {
  background: var(--hijau-aksen); color: #fff; border: none;
  padding: 10px 24px; border-radius: 8px; font-weight: 700;
  font-size: 14px; cursor: pointer; transition: background var(--transition);
}
.btn-primary:hover    { background: #004d2d; }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; }
.btn-block { width: 100%; }
@media (max-width: 580px) { .form-grid { grid-template-columns: 1fr; } }

/* ============================================================
   IMPORT
   ============================================================ */
.import-info {
  background: #e8f5e9; border: 1px solid #a5d6a7;
  border-radius: 8px; padding: 12px 14px; font-size: 13px;
}
.import-header-code {
  display: block; margin-top: 8px; background: #fff;
  border: 1px solid #c8e6c9; padding: 8px 10px; border-radius: 6px;
  font-size: 11px; word-break: break-all; color: #1b5e20;
}
.file-drop-zone {
  border: 2px dashed #b0bec5; border-radius: 10px;
  padding: 28px 20px; text-align: center; cursor: pointer;
  color: #78909c; font-size: 14px; transition: all var(--transition); background: #fafafa;
}
.file-drop-zone:hover, .file-drop-zone.drag-over {
  border-color: var(--hijau-aksen); background: #f1f8f4; color: var(--hijau-aksen);
}
.file-drop-icon { font-size: 36px; margin-bottom: 8px; }
.import-summary { background: #fff3e0; border: 1px solid #ffe0b2; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #e65100; }
.radio-label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13px; color: var(--teks); }
.radio-label input { margin-top: 2px; flex-shrink: 0; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ============================================================
   UPLOAD GAMBAR
   ============================================================ */
.upload-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}
.upload-wrapper .form-input {
  flex: 1;
}
.btn-upload {
  background: var(--hijau-aksen);
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background var(--transition);
  flex-shrink: 0;
}
.btn-upload:hover {
  background: #004d2d;
}
.upload-zone {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: #fafafa;
}
.upload-zone:hover {
  border-color: var(--hijau-aksen);
  background: #f1f8f4;
}
.upload-icon {
  color: #bbb;
  margin-bottom: 12px;
}
.upload-zone:hover .upload-icon {
  color: var(--hijau-aksen);
}
.upload-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--teks);
  margin-bottom: 4px;
}
.upload-hint {
  font-size: 12px;
  color: #999;
}
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hijau-aksen), var(--hijau-wa));
  border-radius: 10px;
  width: 0%;
  transition: width 0.3s ease;
}

/* ---- Kamera Tab ---- */
.upload-tab-btn {
  outline: none;
  transition: background .2s, color .2s;
}
.upload-tab-btn:focus-visible {
  outline: 2px solid #B00020;
  outline-offset: -2px;
}
#kameraVideo {
  background: #111;
  display: block;
  border-radius: 10px;
}
#kameraViewWrap {
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
#btnAmbilFoto {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .3px;
}
#btnAmbilFoto:active {
  transform: scale(0.97);
}

/* ============================================================
   RESPONSIF MOBILE
   ============================================================ */
@media (max-width: 768px) {
  :root { --sidebar-w: 240px; }
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    height: calc(100vh - var(--header-h));
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: var(--sidebar-w) !important;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar.collapsed {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
    overflow: visible;
  }
  .sidebar-backdrop.show { display: block; }
  .main-area { width: 100%; }
  .header-inner { gap: 8px; }
  .header-brand { min-width: 0; }
  .header-title    { max-width: 170px; font-size: 14px; }
  .header-tagline  { display: none; }
  .btn-wa-admin .btn-label-wa { display: none; }
  .btn-wa-admin    { padding: 9px 10px; }
  .btn-keranjang .btn-label-keranjang { display: none; }
  .footer-inner    { grid-template-columns: 1fr; gap: 20px; }
  .filter-controls { gap: 6px; align-items: center; }
  .filter-search {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
  }
  .view-toggle-wrap { flex-shrink: 0; }
  /* Paksa baris baru setelah search + tombol toggle */
  .filter-row-break {
    flex-basis: 100%;
    height: 0;
    display: block;
  }
  .filter-status { flex: 1 1 calc(50% - 3px); min-width: 0; }
  .filter-sort   { flex: 1 1 calc(50% - 3px); min-width: 0; }
  .filter-info   { width: 100%; margin-left: 0; }
  .search-wrap     { border-radius: 18px; }
  .search-input    { font-size: 13px; padding: 8px 0; }
  .select-filter   { font-size: 12px; padding: 6px 8px; }
  .admin-header    { flex-direction: column; align-items: flex-start; }
  .admin-header-actions { width: 100%; }
  .btn-admin-action { font-size: 11px; padding: 6px 10px; }
  .admin-table     { font-size: 12px; }
}
@media (max-width: 480px) {
  .header-inner { padding: 0 10px; gap: 6px; }
  .header-logo img,
  .header-logo svg { width: 30px; height: 30px; }
  .sidebar-toggle { width: 34px; height: 34px; }
  .header-title-wrap { min-width: 0; }
  .header-title { max-width: 92px; font-size: 13px; }
  .filter-bar { padding: 8px 10px; }
  .search-icon { padding: 0 8px; }
  .search-clear { padding: 0 10px; }
  .btn-wa-admin,
  .btn-admin-panel,
  .btn-keranjang { padding: 8px 9px; }
  .produk-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 5px; }
}

/* ============================================================
   FALLBACK GAMBAR — kompatibilitas browser lama HP/tablet
   ============================================================ */
/* Fallback untuk browser yang tidak support aspect-ratio */
@supports not (aspect-ratio: 1/1) {
  .kartu-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%; /* membuat kotak persegi seperti aspect-ratio: 1/1 */
    height: 0;
  }
  .kartu-img,
  .kartu-img-placeholder,
  .kartu-habis-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
  }
}
/* Pastikan gambar kartu tidak overflow di semua ukuran layar */
.kartu-img-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: 100%;
}
/* Modal gambar di HP — batasi tinggi agar tidak memenuhi layar */
@media (max-width: 768px) {
  .modal-img {
    max-height: 320px;
    width: 100%;
    height: auto;
    object-fit: contain;
  }
  .kartu-img-wrap {
    /* Kurangi tinggi sedikit di HP untuk lebih banyak produk terlihat */
    aspect-ratio: 1 / 1;
  }
  .keranjang-item-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
}

/* ============================================================
   TOMBOL PROMO DI HEADER
   ============================================================ */
.btn-promo {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #ff6b00, #e65100);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  position: relative;
  white-space: nowrap;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 2px 8px rgba(230,81,0,0.40);
  animation: promo-pulse 2.5s ease-in-out infinite;
}
.btn-promo:hover { opacity: 0.9; transform: translateY(-1px); }
@keyframes promo-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(230,81,0,0.40); }
  50%       { box-shadow: 0 4px 18px rgba(230,81,0,0.65); }
}
.badge-promo-nav {
  background: #ffcc00;
  color: #333;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
.btn-label-promo { font-weight: 700; }

/* ============================================================
   HALAMAN PROMO — BANNER
   ============================================================ */
.promo-banner {
  background: linear-gradient(135deg, #b71c1c 0%, #e65100 50%, #f57f17 100%);
  color: #fff;
  padding: 32px 16px 28px;
  position: relative;
  overflow: hidden;
}
.promo-banner::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
}
.promo-banner::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.promo-banner-inner {
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.promo-banner-label {
  display: inline-block;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.40);
  border-radius: 20px;
  padding: 4px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}
.promo-banner-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.2;
}
.promo-banner-sub {
  font-size: 14px;
  opacity: 0.88;
}
.promo-banner-stats {
  display: flex;
  gap: 16px;
}
.promo-stat-box {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.30);
  border-radius: var(--radius);
  padding: 14px 24px;
  text-align: center;
  min-width: 90px;
}
.promo-stat-num {
  display: block;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}
.promo-stat-label {
  display: block;
  font-size: 11px;
  opacity: 0.85;
  margin-top: 4px;
}

/* ============================================================
   HALAMAN PROMO — TOOLBAR
   ============================================================ */
.promo-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  position: sticky;
  top: var(--header-h);
  z-index: 70;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.promo-toolbar-inner {
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-kembali-katalog {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f5f5f5;
  color: var(--teks);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.btn-kembali-katalog:hover {
  background: var(--hijau-aksen);
  color: #fff;
  border-color: var(--hijau-aksen);
}
.promo-search-wrap {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 360px;
  transition: border-color var(--transition);
}
.promo-search-wrap:focus-within { border-color: #e65100; }
.promo-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px 10px 8px 0;
  font-size: 13px;
  color: var(--teks);
  background: transparent;
  min-width: 0;
  font-family: inherit;
}

/* ============================================================
   HALAMAN PROMO — GRID & KARTU
   ============================================================ */
.promo-grid-wrap {
  max-width: 1800px;
  margin: 0 auto;
  width: 100%;
}

/* Kartu promo — badge ribbon khusus */
.kartu.kartu-promo {
  border: 2px solid #ff8f00;
  box-shadow: 0 3px 14px rgba(230,81,0,0.15);
}
.kartu.kartu-promo:hover {
  box-shadow: 0 8px 28px rgba(230,81,0,0.28);
  transform: translateY(-4px);
}
.kartu-promo-ribbon {
  position: absolute;
  top: 0; right: 0;
  background: linear-gradient(135deg, #ff6b00, #e65100);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 4px 10px 4px 6px;
  clip-path: polygon(12px 0%, 100% 0%, 100% 100%, 0% 100%);
  letter-spacing: 0.5px;
  z-index: 3;
}

/* ============================================================
   RESPONSIF HALAMAN PROMO
   ============================================================ */
@media (max-width: 768px) {
  .promo-banner-title { font-size: 20px; }
  .promo-banner-inner { gap: 16px; }
  .promo-stat-box { padding: 10px 16px; min-width: 72px; }
  .promo-stat-num { font-size: 22px; }
  .promo-toolbar-inner { gap: 6px; }
  .btn-kembali-katalog .btn-label-kembali { display: none; }
  .promo-search-wrap { max-width: none; flex: 1 1 120px; }
}
@media (max-width: 480px) {
  .promo-banner { padding: 20px 12px 18px; }
  .promo-banner-title { font-size: 18px; }
  .promo-banner-stats { gap: 10px; }
  .btn-promo .btn-label-promo { display: none; }
  .btn-promo { padding: 8px 10px; }
}

/* ============================================================
   RUNNING TEXT BAR
   ============================================================ */
.running-text-bar {
  background: var(--merah-gelap);
  overflow: hidden;
  height: 30px;
  display: flex;
  align-items: center;
  position: sticky;
  top: var(--header-h);
  z-index: 99;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.running-text-track {
  display: flex;
  white-space: nowrap;
  animation: running-scroll 20s linear infinite;
  will-change: transform;
}
.running-text-content {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding-right: 80px;
  display: inline-block;
}
.running-text-bar.warna-putih .running-text-content  { color: #ffffff; }
.running-text-bar.warna-kuning .running-text-content { color: #FFD600; }
@keyframes running-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.running-text-track:hover { animation-play-state: paused; }

/* Sesuaikan sticky filter-bar jika running text aktif */
.running-text-aktif .filter-bar {
  top: calc(var(--header-h) + 30px);
}
.running-text-aktif .promo-toolbar {
  top: calc(var(--header-h) + 30px);
}

/* ============================================================
   BANNER SLIDER
   ============================================================ */
.banner-slider-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #111;
  max-height: 240px;
  user-select: none;
}
.banner-slider-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
  will-change: transform;
}
.banner-slide {
  flex: 0 0 100%;
  min-width: 100%;
  position: relative;
  overflow: hidden;
}
.banner-slide img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}
.banner-slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  padding: 28px 20px 16px;
  color: #fff;
}
.banner-slide-caption h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.banner-slide-caption p {
  font-size: 13px;
  opacity: 0.9;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
/* Nav arrows */
.banner-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
  flex-shrink: 0;
}
.banner-nav:hover { background: rgba(0,0,0,0.72); }
.banner-nav-prev { left: 10px; }
.banner-nav-next { right: 10px; }
/* Dots */
.banner-dots {
  position: absolute;
  bottom: 10px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 10;
}
.banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.banner-dot.active {
  background: #fff;
  transform: scale(1.25);
}
/* Placeholder saat tidak ada slide */
.banner-placeholder {
  display: none;
}
@media (max-width: 768px) {
  .banner-slider-wrap { max-height: 150px; }
  .banner-slide img { max-height: 125px; }
  .banner-slide-caption h3 { font-size: 14px; }
  .banner-slide-caption p { font-size: 11px; }
  .banner-nav { width: 28px; height: 28px; font-size: 14px; }
}

/* ============================================================
   TOGGLE GRID / LIST VIEW
   ============================================================ */
.view-toggle-wrap {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-shrink: 0;
}
.btn-view-toggle {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--teks-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s;
  padding: 0;
}
.btn-view-toggle:hover {
  border-color: var(--hijau-aksen);
  color: var(--hijau-aksen);
}
.btn-view-toggle.active {
  background: var(--hijau-aksen);
  border-color: var(--hijau-aksen);
  color: #fff;
}

/* === MODE LIST === */
.produk-grid.list-mode {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  grid-template-columns: none;
}
.produk-grid.list-mode .kartu {
  flex-direction: row;
  align-items: stretch;
  border-radius: var(--radius-sm);
  min-height: 90px;
  transform: none !important;
}
.produk-grid.list-mode .kartu:hover {
  box-shadow: var(--shadow-hover);
  transform: none !important;
}
.produk-grid.list-mode .kartu-badge {
  top: 6px;
  left: 6px;
  font-size: 9px;
}
.produk-grid.list-mode .kartu-img-wrap {
  width: 90px;
  min-width: 90px;
  aspect-ratio: unset;
  height: auto;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.produk-grid.list-mode .kartu-habis-overlay { font-size: 11px; }
.produk-grid.list-mode .kartu-body {
  flex: 1;
  padding: 8px 10px 6px;
  gap: 3px;
  justify-content: center;
}
.produk-grid.list-mode .kartu-nama {
  font-size: 13px;
  line-clamp: 1;
  -webkit-line-clamp: 1;
}
.produk-grid.list-mode .kartu-kode  { font-size: 10px; }
.produk-grid.list-mode .kartu-harga { font-size: 13px; margin-top: 1px; }
.produk-grid.list-mode .kartu-stok  { font-size: 10px; }
.produk-grid.list-mode .kartu-footer {
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  width: 74px;
  min-width: 74px;
  border-left: 1px solid var(--border);
}
.produk-grid.list-mode .btn-detail,
.produk-grid.list-mode .btn-wa,
.produk-grid.list-mode .btn-keranjang-kartu {
  flex: unset;
  width: 100%;
  font-size: 10px;
  padding: 5px 4px;
  text-align: center;
  justify-content: center;
}
@media (max-width: 768px) {
  .produk-grid.list-mode .kartu-img-wrap { width: 72px; min-width: 72px; }
  .produk-grid.list-mode .kartu-footer { width: 60px; min-width: 60px; padding: 5px 4px; }
  .produk-grid.list-mode .btn-detail,
  .produk-grid.list-mode .btn-wa,
  .produk-grid.list-mode .btn-keranjang-kartu { font-size: 9px; padding: 4px 2px; }
}
/* Sesuaikan sticky filter-bar jika banner aktif */
.banner-aktif .filter-bar {
  top: var(--header-h);
}

/* ============================================================
   ONGKOS KIRIM — SECTION DI KERANJANG
   ============================================================ */
.ongkir-section {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.ongkir-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.ongkir-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.ongkir-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.ongkir-input {
  border: 1.5px solid #ffe082;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 16px; /* 16px agar iOS tidak auto-zoom */
  font-weight: 700;
  color: var(--teks);
  background: #fff;
  outline: none;
  width: 90px;
  text-align: center;
  font-family: inherit;
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}
.ongkir-input:focus { border-color: #e65100; box-shadow: 0 0 0 3px rgba(230,81,0,0.12); }
.ongkir-satuan-label {
  font-size: 13px;
  color: #888;
  font-weight: 600;
}
.ongkir-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding-top: 8px;
  border-top: 1px dashed #ffe082;
  flex-wrap: wrap;
  gap: 4px;
}
.ongkir-nilai {
  color: #e65100;
  font-size: 14px;
  font-weight: 700;
}
.ongkir-nilai.gratis { color: var(--hijau-aksen); }
.ongkir-pesan {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
  line-height: 1.5;
}
.ongkir-pesan.ok   { color: var(--hijau-aksen); }
.ongkir-pesan.warn { color: #e65100; }
.ongkir-warning {
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #e65100;
  margin-top: 8px;
  text-align: center;
  font-weight: 600;
}

/* Modal keranjang — pastikan scroll bekerja di semua perangkat */
.modal-keranjang {
  width: min(500px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* smooth scroll iOS */
}
.modal-keranjang .modal-body {
  padding: 20px 18px 24px;
}
.keranjang-list {
  max-height: 38vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* HP kecil — perbesar touch target input jarak */
@media (max-width: 480px) {
  .ongkir-input-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .ongkir-input-group {
    margin-left: 0;
    width: 100%;
  }
  .ongkir-input {
    flex: 1;
    width: 100%;
    font-size: 16px;
    padding: 10px 12px;
  }
  .modal-keranjang .modal-body { padding: 16px 14px 20px; }
}
.ongkir-pesan.ok   { color: var(--hijau-aksen); }
.ongkir-pesan.warn { color: #e65100; }
.ongkir-warning {
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #e65100;
  margin-top: 8px;
  text-align: center;
  font-weight: 600;
}

/* ============================================================
   ONGKIR PREVIEW DI PENGATURAN ADMIN
   ============================================================ */
.ongkir-preview {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #2e7d32;
  margin-top: 10px;
}

/* ============================================================
   BANNER SLIDER — PREVIEW DI PANEL PENGATURAN ADMIN
   ============================================================ */
.banner-slide-group {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.banner-slide-group .form-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--hijau-aksen);
  margin-bottom: 8px;
}
.banner-preview-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f0f0f0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  overflow: hidden;
}
.banner-preview-img {
  height: 60px;
  width: auto;
  max-width: 180px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
}
.banner-preview-clear {
  margin-left: auto;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffebee;
  color: #c62828;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  border: none;
  cursor: pointer;
}
.banner-preview-clear:hover { background: #c62828; color: #fff; }

@media (max-width: 480px) {
  .banner-preview-img { height: 48px; max-width: 120px; }
}

/* ============================================================
   RESPONSIF TAMBAHAN
   ============================================================ */
@media (max-width: 768px) {
  .running-text-bar { height: 26px; }
  .running-text-content { font-size: 11px; }
  .running-text-aktif .filter-bar  { top: calc(var(--header-h) + 26px); }
  .running-text-aktif .promo-toolbar { top: calc(var(--header-h) + 26px); }
  .ongkir-input-row { flex-wrap: wrap; gap: 6px; }
}
