:root {
  --primary: #00AA5B;
  --primary-hover: #00894A;
  --accent: #03AC0E;
  --bg: #FFFFFF;
  --bg-muted: #F6F7F9;
  --text: #1A1A1A;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --price: #EE4D2D;
  --success: #00AA5B;
  --star: #FFC107;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-card: 8px;
  --radius-btn: 12px;
  --radius-pill: 999px;
  --container: 1200px;
  --header-h: 64px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-muted);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input {
  font-family: inherit;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 22px;
  color: var(--primary);
  white-space: nowrap;
}

.logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.search-bar {
  flex: 1;
  max-width: 560px;
  display: flex;
  align-items: center;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0 8px 0 16px;
  height: 42px;
  transition: border-color 0.2s;
}

.search-bar:focus-within {
  border-color: var(--primary);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
}

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

.search-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.search-btn:hover {
  background: var(--primary-hover);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.icon-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 12px;
  border-radius: var(--radius-card);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: var(--bg-muted);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--price);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Kategori Bar ===== */
.kategori-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.kategori-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  scrollbar-width: none;
}

.kategori-scroll::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.2s;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ===== Main / Katalog ===== */
.main {
  padding: 24px 0 48px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.result-info {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

/* ===== Kartu Produk ===== */
.product-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.product-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-emoji {
  font-size: 64px;
}

.product-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product-cat {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.product-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
}

.product-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--price);
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.stars {
  color: var(--star);
  font-size: 13px;
  letter-spacing: 1px;
}

.add-btn {
  margin-top: auto;
  padding: 9px 12px;
  border-radius: var(--radius-btn);
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s;
}

.add-btn:hover {
  background: var(--primary-hover);
}

.add-btn.added {
  background: var(--bg-muted);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .big {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state h3 {
  color: var(--text);
  font-size: 18px;
  margin-bottom: 6px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .logo span.text {
    display: none;
  }
  .icon-btn .label {
    display: none;
  }
  .icon-btn {
    padding: 8px;
  }
  .header-inner {
    gap: 8px;
  }
}

/* ===== Tombol umum ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}
.btn-primary.added {
  background: var(--bg-muted);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-muted);
}
.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
}
.btn-block {
  width: 100%;
}

.link {
  color: var(--primary);
  font-weight: 600;
}
.link:hover {
  text-decoration: underline;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.breadcrumb a:hover {
  color: var(--primary);
}
.breadcrumb .sep {
  color: var(--border);
}
.breadcrumb .current {
  color: var(--text);
  font-weight: 500;
}

/* ===== Detail Produk ===== */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
}

.detail-gambar {
  aspect-ratio: 1 / 1;
  background: var(--bg-muted);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.detail-gambar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-emoji {
  font-size: 160px;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.detail-nama {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
}
.detail-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}
.rating-angka {
  color: var(--text);
  font-weight: 600;
}
.detail-rating .dot {
  color: var(--border);
}
.detail-harga {
  font-size: 30px;
  font-weight: 800;
  color: var(--price);
}
.detail-stok {
  margin-top: 4px;
}
.stok-label {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
}
.stok-label.ada {
  background: #E6F7EE;
  color: var(--primary);
}
.stok-label.habis {
  background: #FDE8E8;
  color: var(--price);
}
.detail-aksi {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.detail-deskripsi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-top: 20px;
}
.detail-deskripsi p {
  color: var(--text-muted);
  line-height: 1.7;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}

/* ===== Produk Terkait ===== */
.terkait {
  margin-top: 28px;
}
.terkait-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.terkait-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.terkait-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.terkait-img {
  aspect-ratio: 1 / 1;
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}
.terkait-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.terkait-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.terkait-body .product-name {
  min-height: 0;
}
.terkait-rating {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Drawer Keranjang ===== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  z-index: 200;
}
.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 400px;
  max-width: 92vw;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 210;
  display: flex;
  flex-direction: column;
}
.drawer.open {
  transform: translateX(0);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.drawer-header h2 {
  font-size: 18px;
  font-weight: 700;
}
.drawer-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  color: var(--text);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer-close:hover {
  background: var(--border);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.drawer-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
}
.drawer-empty .big {
  font-size: 48px;
  margin-bottom: 10px;
}
.drawer-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.drawer-item-img {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  background: var(--bg-muted);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  overflow: hidden;
}
.drawer-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.drawer-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drawer-item-nama {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.drawer-item-harga {
  font-size: 13px;
  color: var(--text-muted);
}
.drawer-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.drawer-item-subtotal {
  font-size: 13px;
  font-weight: 700;
  color: var(--price);
  white-space: nowrap;
  align-self: flex-start;
}
.drawer-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.drawer-subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}
.drawer-subtotal-nilai {
  font-size: 20px;
  font-weight: 800;
  color: var(--price);
}

/* ===== Kontrol qty ===== */
.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  overflow: hidden;
}
.qty-btn {
  width: 28px;
  height: 28px;
  background: var(--bg-muted);
  color: var(--text);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:hover {
  background: var(--border);
}
.qty-val {
  width: 32px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}
.remove-btn {
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: underline;
}
.remove-btn:hover {
  color: var(--price);
}

/* ===== Halaman Keranjang ===== */
.keranjang-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
.keranjang-list {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 8px 20px;
}
.keranjang-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.keranjang-item:last-child {
  border-bottom: none;
}
.keranjang-item-img {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  background: var(--bg-muted);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
}
.keranjang-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.keranjang-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.keranjang-item-nama {
  font-size: 14px;
  font-weight: 600;
}
.keranjang-item-nama:hover {
  color: var(--primary);
}
.keranjang-item-cat {
  font-size: 12px;
  color: var(--text-muted);
}
.keranjang-item-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}
.keranjang-item-harga {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.keranjang-item-subtotal {
  font-size: 15px;
  font-weight: 700;
  color: var(--price);
}
.keranjang-item-unit {
  font-size: 12px;
  color: var(--text-muted);
}

.ringkasan {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ringkasan-title {
  font-size: 16px;
  font-weight: 700;
}
.ringkasan-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
}
.ringkasan-row.total {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.ringkasan-row.total span:last-child {
  color: var(--price);
}

/* ===== Responsive detail & keranjang ===== */
@media (max-width: 768px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .keranjang-layout {
    grid-template-columns: 1fr;
  }
  .detail-emoji {
    font-size: 100px;
  }
}

/* ===== Checkout ===== */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}
.checkout-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.checkout-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
}
.checkout-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-field.full {
  grid-column: 1 / -1;
}
.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.form-field input,
.form-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
  transition: border-color 0.2s;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.form-error {
  color: var(--price);
  font-size: 13px;
  font-weight: 500;
}

.ongkir-list,
.bayar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ongkir-opt,
.bayar-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.ongkir-opt.selected,
.bayar-opt.selected {
  border-color: var(--primary);
  background: #F0FBF5;
}
.ongkir-opt input,
.bayar-opt input {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}
.ongkir-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ongkir-kurir {
  font-size: 14px;
  font-weight: 600;
}
.ongkir-estimasi {
  font-size: 12px;
  color: var(--text-muted);
}
.ongkir-biaya {
  font-size: 14px;
  font-weight: 700;
  color: var(--price);
}
.bayar-icon {
  font-size: 22px;
}
.bayar-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bayar-nama {
  font-size: 14px;
  font-weight: 600;
}
.bayar-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.checkout-side {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.checkout-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 12px;
  max-height: 280px;
  overflow-y: auto;
}
.checkout-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.checkout-item-img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: var(--bg-muted);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
}
.checkout-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.checkout-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.checkout-item-nama {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.checkout-item-qty {
  font-size: 12px;
  color: var(--text-muted);
}
.checkout-item-sub {
  font-size: 13px;
  font-weight: 700;
  color: var(--price);
  white-space: nowrap;
}

/* ===== Halaman Sukses ===== */
.sukses-card {
  max-width: 520px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 40px 32px;
  text-align: center;
}
.sukses-icon {
  font-size: 56px;
  margin-bottom: 12px;
}
.sukses-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}
.sukses-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}
.sukses-nomor {
  background: var(--bg-muted);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sukses-nomor span {
  font-size: 12px;
  color: var(--text-muted);
}
.sukses-nomor strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
}
.sukses-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-bottom: 20px;
}
.sukses-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
}
.sukses-row strong {
  color: var(--text);
}
.sukses-row .price {
  color: var(--price);
}
.sukses-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Halaman Pesanan ===== */
.pesanan-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pesanan-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.pesanan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
  flex-wrap: wrap;
}
.pesanan-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pesanan-nomor {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
}
.pesanan-tanggal {
  font-size: 13px;
  color: var(--text-muted);
}
.status-badge {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
}
.status-menunggu { background: #FFF4E5; color: #B26A00; }
.status-diproses { background: #E8F0FE; color: #1A56DB; }
.status-dikirim { background: #E6F7EE; color: var(--primary); }
.status-selesai { background: #E6F7EE; color: var(--primary); }
.status-batal { background: #FDE8E8; color: var(--price); }

.pesanan-items {
  padding: 8px 20px;
}
.pesanan-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.pesanan-item:last-child {
  border-bottom: none;
}
.pesanan-item-img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: var(--bg-muted);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
}
.pesanan-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pesanan-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pesanan-item-nama {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pesanan-item-qty {
  font-size: 12px;
  color: var(--text-muted);
}
.pesanan-item-sub {
  font-size: 13px;
  font-weight: 700;
  color: var(--price);
  white-space: nowrap;
}
.pesanan-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pesanan-alamat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--text);
}
.pesanan-alamat-label {
  font-size: 12px;
  color: var(--text-muted);
}
.pesanan-total {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.pesanan-total .price {
  font-size: 17px;
  font-weight: 800;
}

/* ===== Responsive checkout & pesanan ===== */
@media (max-width: 768px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }
  .checkout-side {
    position: static;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Dropdown Akun (Header) ===== */
.account-menu {
  position: relative;
}
.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
  animation: fadeIn 0.15s ease;
}
.account-dropdown a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: background 0.15s;
}
.account-dropdown a:hover {
  background: var(--bg-muted);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Admin Layout ===== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - var(--header-h));
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}
.admin-sidebar {
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  padding: 0 8px;
}
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-card);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s;
}
.admin-nav-item:hover {
  background: var(--bg-muted);
  color: var(--text);
}
.admin-nav-item.active {
  background: var(--primary);
  color: #fff;
}
.admin-nav-icon {
  font-size: 17px;
}
.admin-back {
  margin-top: auto;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.admin-back:hover {
  color: var(--primary);
}
.admin-content {
  padding: 28px 32px;
}
.admin-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}
.admin-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ===== Stat cards ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  flex-shrink: 0;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
}
.stat-value {
  font-size: 22px;
  font-weight: 800;
  display: block;
  margin-top: 2px;
}

/* ===== Charts ===== */
.admin-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.admin-chart-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.admin-chart-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}
.chart-empty {
  color: var(--text-muted);
  font-size: 13px;
}
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bar-label {
  width: 120px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  min-width: 28px;
  transition: width 0.4s ease;
}
.bar-fill-status {
  background: #3B82F6;
}
.bar-value {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* ===== Admin table ===== */
.admin-table-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th {
  text-align: left;
  padding: 14px 16px;
  background: var(--bg-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td {
  border-bottom: none;
}
.admin-table tbody tr:hover {
  background: #FAFBFC;
}
.admin-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
}
.admin-chip {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.stok-habis {
  color: var(--price);
  font-weight: 700;
}
.admin-aksi {
  display: flex;
  gap: 8px;
}
.admin-produk-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-produk-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-card);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.admin-produk-nama {
  font-weight: 600;
}
.admin-nomor {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.admin-item-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-item-chip {
  font-size: 12px;
  color: var(--text-muted);
}
.admin-status-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.admin-status-select {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

/* ===== Admin head & buttons ===== */
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-ghost {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
  padding: 6px 12px;
  font-size: 13px;
}
.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-danger-ghost {
  background: var(--bg);
  border-color: var(--border);
  color: var(--price);
  padding: 6px 12px;
  font-size: 13px;
}
.btn-danger-ghost:hover {
  border-color: var(--price);
  background: #FFF5F3;
}

/* ===== Modal form produk ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal {
  background: var(--bg);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.modal-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 20px;
}
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  color: var(--text);
  background: var(--bg);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 170, 91, 0.12);
}
.field textarea {
  resize: vertical;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* ===== Responsive admin ===== */
@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }
  .admin-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 8px;
    gap: 12px;
  }
  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-back {
    margin-top: 0;
    border-top: none;
    margin-left: auto;
  }
  .admin-content {
    padding: 20px 8px;
  }
  .admin-charts {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .admin-head {
    flex-direction: column;
    align-items: flex-start;
  }
}



