/* ==========================================================================
   Open PO Barang — stylesheet utama
   Pendekatan: mobile-first, CSS custom properties, tanpa framework.
   Palet: teal tua (brand) + amber (aksi) + netral hangat.
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  --brand-900: #06403a;
  --brand-700: #0b6353;
  --brand-600: #0e7c66;
  --brand-500: #14957a;
  --brand-100: #dff3ee;
  --brand-050: #f0faf7;

  --accent-600: #d4552b;
  --accent-500: #ea6a37;
  --accent-100: #fdece3;

  --ink-900: #0e1a18;
  --ink-700: #24332f;
  --ink-500: #52655f;
  --ink-400: #71857f;
  --ink-200: #d5ded9;
  --ink-100: #e8edea;

  --surface: #ffffff;
  --surface-2: #f7faf9;
  --bg: #f2f6f4;

  --ok-600: #1a7f4b;
  --ok-100: #e2f4e9;
  --warn-600: #a4620c;
  --warn-100: #fdf1de;
  --danger-600: #b3261e;
  --danger-100: #fdeceb;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(14, 26, 24, 0.06), 0 1px 3px rgba(14, 26, 24, 0.04);
  --shadow: 0 6px 18px -6px rgba(14, 26, 24, 0.16), 0 2px 6px rgba(14, 26, 24, 0.05);
  --shadow-lg: 0 22px 48px -18px rgba(6, 64, 58, 0.35);

  --font-sans: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --header-h: 62px;
  --container: 1180px;
  --ease: cubic-bezier(0.32, 0.72, 0.24, 1);
}

/* ---------- 2. Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-900);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.015em; font-weight: 700; }
p { margin: 0; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: var(--brand-700); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 16px;
}

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--brand-700); color: #fff; padding: 10px 16px;
  border-radius: var(--radius-sm); text-decoration: none; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 3. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-100);
}

.header-inner {
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 12px;
  padding-block: 8px;
}

.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink-900); flex: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--brand-600); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 10px -3px rgba(14, 124, 102, 0.6);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 15px; letter-spacing: -0.02em; }
.brand-text small { font-size: 11px; color: var(--ink-400); letter-spacing: 0.06em; text-transform: uppercase; }

.main-nav { display: flex; gap: 2px; margin-left: auto; }
.nav-btn {
  position: relative;
  border: 0; background: transparent; cursor: pointer;
  padding: 9px 13px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 600; color: var(--ink-500);
  display: inline-flex; align-items: center; gap: 7px;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
  white-space: nowrap;
}
.nav-btn:hover { background: var(--ink-100); color: var(--ink-900); }
.nav-btn.is-active { background: var(--brand-100); color: var(--brand-900); }

.pill-count {
  min-width: 20px; height: 20px; padding-inline: 6px;
  border-radius: var(--radius-pill); background: var(--accent-500); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center;
}

.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.conn-badge {
  display: none; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-500);
  background: var(--surface-2); border: 1px solid var(--ink-100);
  padding: 5px 10px; border-radius: var(--radius-pill);
}
.conn-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-400); }
.conn-badge[data-state="online"] .dot { background: var(--ok-600); box-shadow: 0 0 0 3px var(--ok-100); }
.conn-badge[data-state="online"] { color: var(--ok-600); border-color: #c9e7d5; background: var(--ok-100); }
.conn-badge[data-state="offline"] .dot { background: var(--warn-600); }
.conn-badge[data-state="offline"] { color: var(--warn-600); border-color: #f0dcbb; background: var(--warn-100); }

/* ---------- 4. Tombol ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink-900);
  --btn-bd: var(--ink-200);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 650; cursor: pointer;
  text-decoration: none;
  transition: transform 0.14s var(--ease), box-shadow 0.16s var(--ease),
              background 0.16s var(--ease), border-color 0.16s var(--ease), opacity 0.16s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary { --btn-bg: var(--brand-600); --btn-fg: #fff; --btn-bd: var(--brand-600); }
.btn-primary:hover { --btn-bg: var(--brand-700); --btn-bd: var(--brand-700); }
.btn-accent { --btn-bg: var(--accent-500); --btn-fg: #fff; --btn-bd: var(--accent-500); }
.btn-accent:hover { --btn-bg: var(--accent-600); --btn-bd: var(--accent-600); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--ink-700); --btn-bd: var(--ink-200); }
.btn-ghost:hover { --btn-bg: var(--surface); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.icon-btn {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--ink-200); background: var(--surface);
  border-radius: 50%; cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s;
}
.icon-btn:hover { background: var(--ink-100); }

.cart-count {
  min-width: 22px; height: 22px; padding-inline: 6px;
  background: rgba(255, 255, 255, 0.24); border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700; display: inline-grid; place-items: center;
}
.btn-cart { position: relative; }

/* ---------- 5. Hero ---------- */
.hero {
  background:
    radial-gradient(1100px 340px at 12% -20%, rgba(20, 149, 122, 0.22), transparent 62%),
    linear-gradient(160deg, var(--brand-900), var(--brand-700) 62%, var(--brand-600));
  color: #fff;
  padding-block: 40px 46px;
}
.hero-inner { display: grid; gap: 28px; }
.eyebrow {
  display: inline-block;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: #a9e7d8; background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 5px 12px; border-radius: var(--radius-pill);
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(27px, 7vw, 44px); font-weight: 800; max-width: 20ch; }
.hero h1 .hl { color: #ffd9a8; }
.hero-lead { margin-top: 14px; max-width: 56ch; color: rgba(255, 255, 255, 0.82); font-size: 15px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-cta .btn-ghost { --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, 0.4); }
.hero-cta .btn-ghost:hover { --btn-bg: rgba(255, 255, 255, 0.12); }

.hero-stats {
  margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.hero-stats .stat {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.hero-stats dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: rgba(255, 255, 255, 0.66); }
.hero-stats dd { margin: 4px 0 0; font-size: 20px; font-weight: 750; letter-spacing: -0.02em; }

/* ---------- 5b. Pilih kategori (landing) ---------- */
.category-picker {
  display: grid; grid-template-columns: 1fr; gap: 14px;
}
.picker-card {
  text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--ink-200); border-radius: var(--radius-lg);
  padding: 20px 18px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), transform 0.16s var(--ease);
}
.picker-card:hover { border-color: var(--brand-500); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.picker-card h3 { font-size: 19px; }
.picker-card p { color: var(--ink-500); font-size: 13.5px; }
.picker-badge {
  align-self: flex-start; font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em;
  padding: 4px 10px; border-radius: var(--radius-pill);
}
.picker-badge-po { background: var(--brand-100); color: var(--brand-900); }
.picker-badge-shopee { background: var(--accent-100); color: var(--accent-600); }

@media (min-width: 640px) {
  .category-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Sembunyikan nav & keranjang di layar pilih-kategori dan dropship */
body[data-active-view="pilih-kategori"] .main-nav,
body[data-active-view="pilih-kategori"] .header-actions,
body[data-active-view="dropship"] .main-nav,
body[data-active-view="dropship"] .header-actions {
  display: none;
}

/* ---------- 6. Toolbar filter ---------- */
.toolbar-wrap {
  position: sticky; top: var(--header-h); z-index: 40;
  background: rgba(242, 246, 244, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink-100);
  padding-block: 12px;
}
.toolbar { display: grid; gap: 10px; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label,
.filter-contact label { font-size: 12px; font-weight: 650; color: var(--ink-500); letter-spacing: 0.01em; }

input[type="text"], input[type="search"], input[type="email"], select, textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--ink-200); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-900);
  font: inherit; font-size: 14.5px;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
textarea { resize: vertical; min-height: 62px; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-400); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(20, 149, 122, 0.18);
}
input[aria-invalid="true"] { border-color: var(--danger-600); box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.12); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2352655f' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 15px;
  padding-right: 32px;
}

.field-search { position: relative; }
.field-search input { padding-left: 38px; padding-right: 34px; }
.field-icon { position: absolute; left: 12px; bottom: 11px; color: var(--ink-400); pointer-events: none; }
.clear-btn {
  position: absolute; right: 6px; bottom: 6px;
  width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: var(--ink-100); color: var(--ink-500);
  font-size: 17px; line-height: 1; cursor: pointer;
}
.clear-btn:hover { background: var(--ink-200); }
.btn-reset { align-self: end; }

.result-line {
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline;
  margin-top: 10px; font-size: 13px; color: var(--ink-500);
}
.result-hint { font-size: 12.5px; color: var(--ink-400); }
.result-hint b { color: var(--brand-700); }

/* ---------- 7. Grid produk ---------- */
.section-block { padding-block: 26px 56px; }
.product-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--ink-200); }
.card.is-closed { opacity: 0.92; }

.card-media {
  position: relative; aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, var(--surface-2), #eef3f1);
  overflow: hidden;
}
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.card:hover .card-media img { transform: scale(1.05); }
.card.is-closed .card-media img { filter: grayscale(0.55) contrast(0.96); }

.badge-row { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  padding: 5px 10px; border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink-700);
  border: 1px solid var(--ink-100);
  box-shadow: var(--shadow-sm);
}
.badge-open { background: var(--ok-100); color: var(--ok-600); border-color: #c9e7d5; }
.badge-closed { background: var(--ink-200); color: var(--ink-500); border-color: var(--ink-200); }
.badge-hot { background: var(--accent-500); color: #fff; border-color: var(--accent-500); }
.badge-urgent { background: var(--danger-100); color: var(--danger-600); border-color: #f6d3d1; }
.badge-cat { background: rgba(255, 255, 255, 0.94); color: var(--brand-900); }

.card-body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-seller { font-size: 11.5px; font-weight: 650; color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.06em; }
.card-title { font-size: 16px; font-weight: 720; letter-spacing: -0.015em; }
.card-highlight {
  font-size: 13px; color: var(--ink-500);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-price { display: flex; align-items: baseline; gap: 7px; }
.card-price strong { font-size: 20px; font-weight: 780; letter-spacing: -0.025em; color: var(--brand-900); }
.card-price span { font-size: 12.5px; color: var(--ink-400); }

.meta-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.meta-list div {
  background: var(--surface-2); border: 1px solid var(--ink-100);
  border-radius: var(--radius-sm); padding: 8px 10px;
}
.meta-list dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-400); }
.meta-list dd { margin: 2px 0 0; font-size: 13px; font-weight: 650; color: var(--ink-900); }
.meta-list dd.is-danger { color: var(--danger-600); }

.quota { display: flex; flex-direction: column; gap: 5px; }
.quota-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-500); }
.quota-top b { color: var(--ink-900); }
.bar { height: 7px; border-radius: var(--radius-pill); background: var(--ink-100); overflow: hidden; }
.bar > span {
  display: block; height: 100%; border-radius: var(--radius-pill);
  background: var(--brand-500); transition: width 0.5s var(--ease);
}
.bar.is-warn > span { background: var(--accent-500); }
.bar.is-full > span { background: var(--ink-400); }

.card-actions { display: flex; gap: 8px; margin-top: auto; }
.card-actions .btn { flex: 1; }

/* ---------- 8. Empty state & skeleton ---------- */
.empty-state {
  text-align: center; padding: 44px 20px;
  background: var(--surface); border: 1px dashed var(--ink-200);
  border-radius: var(--radius-lg);
}
.empty-icon {
  width: 58px; height: 58px; margin: 0 auto 12px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--brand-050); color: var(--brand-600);
}
.empty-state h3 { font-size: 17px; }
.empty-state p { color: var(--ink-500); font-size: 14px; margin: 6px auto 16px; max-width: 42ch; }

.skeleton {
  background: var(--surface); border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg); overflow: hidden;
}
.sk-line, .sk-media { background: linear-gradient(90deg, #eef3f1 25%, #e2eae7 37%, #eef3f1 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-media { aspect-ratio: 4 / 3; }
.sk-body { padding: 14px 15px; display: flex; flex-direction: column; gap: 9px; }
.sk-line { height: 12px; border-radius: 6px; }
.sk-line.w70 { width: 70%; } .sk-line.w45 { width: 45%; } .sk-line.w90 { width: 90%; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- 9. Modal detail ---------- */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(9, 26, 23, 0.55);
  backdrop-filter: blur(3px);
  padding: 0;
  animation: fade 0.2s var(--ease);
}
.modal-card {
  background: var(--surface);
  width: 100%; max-width: 880px; max-height: 92vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.28s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } }

.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.94); border: 1px solid var(--ink-100);
  display: grid; place-items: center; cursor: pointer;
}
.detail-grid { display: grid; gap: 0; }
.detail-media { background: var(--surface-2); }
.detail-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.detail-main { padding: 18px 16px 22px; display: flex; flex-direction: column; gap: 14px; }
.detail-head { display: flex; flex-direction: column; gap: 7px; }
.detail-head h2 { font-size: clamp(19px, 5vw, 25px); }
.detail-price { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--brand-900); }
.detail-desc { color: var(--ink-500); font-size: 14.5px; }
.spec-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.spec-list li { position: relative; padding-left: 22px; font-size: 14px; color: var(--ink-700); }
.spec-list li::before {
  content: ""; position: absolute; left: 4px; top: 8px;
  width: 8px; height: 8px; border-radius: 3px; background: var(--brand-500);
}
.detail-box {
  background: var(--surface-2); border: 1px solid var(--ink-100);
  border-radius: var(--radius); padding: 12px 14px;
  display: grid; gap: 8px;
}
.detail-box .kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.detail-box .kv span { color: var(--ink-500); }
.detail-box .kv strong { color: var(--ink-900); text-align: right; }

.order-form { border-top: 1px solid var(--ink-100); padding-top: 15px; display: flex; flex-direction: column; gap: 11px; }
.order-form h3 { font-size: 14.5px; }
.field-row { display: grid; gap: 11px; }
.err { color: var(--danger-600); font-size: 12px; font-weight: 600; }
.hint { color: var(--ink-400); font-size: 11.5px; }
.req { color: var(--accent-600); }
.qty-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--ink-200); border-radius: var(--radius-pill); overflow: hidden; background: var(--surface); }
.stepper button {
  width: 38px; height: 40px; border: 0; background: transparent; cursor: pointer;
  font-size: 19px; font-weight: 700; color: var(--brand-700);
}
.stepper button:hover:not(:disabled) { background: var(--brand-050); }
.stepper button:disabled { color: var(--ink-200); cursor: not-allowed; }
.stepper input {
  width: 58px; border: 0; border-left: 1px solid var(--ink-100); border-right: 1px solid var(--ink-100);
  border-radius: 0; text-align: center; font-weight: 700; font-size: 15px; padding: 9px 4px;
  box-shadow: none !important;
}
.subtotal-line {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--brand-050); border: 1px solid var(--brand-100);
  border-radius: var(--radius); padding: 11px 14px;
}
.subtotal-line span { font-size: 13px; color: var(--brand-900); }
.subtotal-line strong { font-size: 20px; font-weight: 800; color: var(--brand-900); letter-spacing: -0.02em; }

.alert {
  border-radius: var(--radius-sm); padding: 10px 13px; font-size: 13px;
  border: 1px solid transparent; display: flex; gap: 8px; align-items: flex-start;
}
.alert::before { font-weight: 800; }
.alert-warn { background: var(--warn-100); border-color: #f0dcbb; color: var(--warn-600); }
.alert-warn::before { content: "!"; }
.alert-error { background: var(--danger-100); border-color: #f6d3d1; color: var(--danger-600); }
.alert-error::before { content: "×"; }
.alert-info { background: var(--brand-050); border-color: var(--brand-100); color: var(--brand-900); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- 10. Panel keranjang ---------- */
.scrim { position: fixed; inset: 0; background: rgba(9, 26, 23, 0.5); z-index: 95; animation: fade 0.2s var(--ease); }

.cart-panel[hidden] { display: none; }
.cart-panel {
  position: fixed; top: 0; right: 0; z-index: 100;
  width: min(440px, 100%);
  height: 100%; height: 100dvh;
  background: var(--surface);
  display: flex; flex-direction: column;
  box-shadow: -18px 0 44px -22px rgba(6, 64, 58, 0.5);
  animation: slideIn 0.26s var(--ease);
}
@keyframes slideIn { from { transform: translateX(30px); opacity: 0.4; } }

.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 16px; border-bottom: 1px solid var(--ink-100);
}
.panel-head h2 { font-size: 18px; }
.panel-sub { font-size: 12.5px; color: var(--ink-400); margin-top: 2px; }
.panel-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.panel-foot {
  border-top: 1px solid var(--ink-100); padding: 15px 16px calc(15px + env(safe-area-inset-bottom));
  background: var(--surface-2); overflow-y: auto; max-height: 74%;
}

.cart-item {
  display: grid; grid-template-columns: 60px 1fr auto; gap: 11px;
  padding: 11px; border: 1px solid var(--ink-100); border-radius: var(--radius);
  background: var(--surface);
}
.cart-item img { width: 60px; height: 60px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.cart-item-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cart-item-info strong { font-size: 13.5px; font-weight: 680; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-item-info small { font-size: 12px; color: var(--ink-400); }
.cart-item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.cart-item-price { font-size: 14px; font-weight: 750; color: var(--brand-900); white-space: nowrap; }
.mini-stepper { display: inline-flex; align-items: center; border: 1px solid var(--ink-200); border-radius: var(--radius-pill); }
.mini-stepper button { width: 26px; height: 26px; border: 0; background: transparent; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--brand-700); }
.mini-stepper button:disabled { color: var(--ink-200); }
.mini-stepper span { min-width: 26px; text-align: center; font-size: 13px; font-weight: 700; }
.link-danger { border: 0; background: transparent; color: var(--danger-600); font-size: 11.5px; font-weight: 650; cursor: pointer; padding: 2px; text-decoration: underline; }

.cart-empty { text-align: center; padding: 34px 12px; color: var(--ink-500); }
.cart-empty h3 { font-size: 16px; margin-bottom: 6px; color: var(--ink-900); }

.cart-total { border-top: 1px dashed var(--ink-200); padding-top: 11px; margin-top: 3px; display: grid; gap: 6px; }
.total-row { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-500); }
.total-row strong { color: var(--ink-900); }
.total-row.grand { font-size: 16px; padding-top: 7px; border-top: 1px solid var(--ink-100); }
.total-row.grand strong { font-size: 22px; font-weight: 800; color: var(--brand-900); letter-spacing: -0.025em; }
.checkout-form { display: flex; flex-direction: column; gap: 11px; }
.checkout-form h3 { font-size: 14.5px; }
.fine-print { font-size: 11.5px; color: var(--ink-400); text-align: center; }
.btn[aria-busy="true"] .btn-label::after { content: "…"; }

/* ---------- 11. Daftar pesanan ---------- */
.section-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: clamp(20px, 5vw, 27px); }
.section-sub { color: var(--ink-500); font-size: 13.5px; margin-top: 4px; max-width: 62ch; }
.section-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-500); cursor: pointer; }
.inline-check input { width: 16px; height: 16px; accent-color: var(--brand-600); }

.filter-contact { display: flex; flex-direction: column; gap: 5px; max-width: 380px; margin-bottom: 16px; }

.orders-list { display: grid; gap: 14px; }
.order-card {
  background: var(--surface); border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg); padding: 15px 16px; box-shadow: var(--shadow-sm);
}
.order-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding-bottom: 11px; border-bottom: 1px solid var(--ink-100); }
.order-id { font-family: var(--font-mono); font-size: 13.5px; font-weight: 700; color: var(--brand-900); }
.order-date { font-size: 12.5px; color: var(--ink-400); }
.order-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: var(--radius-pill); background: var(--brand-050); color: var(--brand-900); border: 1px solid var(--brand-100); }
.tag-ok { background: var(--ok-100); color: var(--ok-600); border-color: #c9e7d5; }
.tag-warn { background: var(--warn-100); color: var(--warn-600); border-color: #f0dcbb; }
.tag-src { background: var(--ink-100); color: var(--ink-500); border-color: var(--ink-100); }
.order-body { padding-top: 11px; display: grid; gap: 9px; }
.order-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.order-item img { width: 40px; height: 40px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.order-item .oi-name { font-weight: 650; }
.order-item .oi-sub { font-size: 12px; color: var(--ink-400); }
.order-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding-top: 11px; border-top: 1px dashed var(--ink-200); }
.order-buyer { font-size: 12.5px; color: var(--ink-500); }
.order-buyer b { color: var(--ink-900); }
.order-total { font-size: 17px; font-weight: 800; color: var(--brand-900); letter-spacing: -0.02em; }
.order-shopee {
  margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--ink-200);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
}
.order-shopee p { font-size: 12.5px; color: var(--ink-500); max-width: 44ch; }

/* ---------- 12. Toast ---------- */
.toast-stack {
  position: fixed; z-index: 120;
  left: 50%; bottom: 74px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  width: min(420px, calc(100% - 24px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 14px; border-radius: var(--radius);
  background: var(--ink-900); color: #fff; font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.24s var(--ease);
}
.toast.is-out { animation: toastOut 0.22s var(--ease) forwards; }
.toast-ok { background: var(--ok-600); }
.toast-err { background: var(--danger-600); }
.toast-warn { background: var(--warn-600); }
.toast b { font-weight: 700; }
@keyframes toastIn { from { transform: translateY(14px); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(10px); opacity: 0; } }

/* ---------- 13. Bar keranjang mobile ---------- */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px calc(11px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--ink-100);
  box-shadow: 0 -8px 22px -14px rgba(6, 64, 58, 0.4);
}
.mobile-bar-info { display: flex; flex-direction: column; line-height: 1.25; }
.mobile-bar-info span { font-size: 11.5px; color: var(--ink-400); }
.mobile-bar-info strong { font-size: 16px; font-weight: 800; color: var(--brand-900); }

/* ---------- 14. Footer ---------- */
.site-footer { background: var(--brand-900); color: rgba(255, 255, 255, 0.82); padding-block: 26px; margin-top: 8px; }
.footer-inner { display: grid; gap: 14px; }
.site-footer strong { color: #fff; font-size: 15px; }
.site-footer p { font-size: 13px; margin-top: 5px; max-width: 60ch; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: rgba(255, 255, 255, 0.66); }

/* ==========================================================================
   15. Responsive — breakpoint mengikuti kebutuhan konten
   ========================================================================== */
@media (min-width: 560px) {
  .field-row { grid-template-columns: 1.6fr 1fr; }
  .hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .conn-badge { display: inline-flex; }
}

@media (min-width: 720px) {
  body { font-size: 16px; }
  .container { padding-inline: 22px; }
  .toolbar { grid-template-columns: minmax(200px, 2.4fr) repeat(3, minmax(130px, 1fr)) auto; align-items: end; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .modal { align-items: center; padding: 26px; }
  .modal-card { border-radius: var(--radius-lg); max-height: 88vh; }
  .detail-grid { grid-template-columns: 0.92fr 1.08fr; }
  .detail-media img { aspect-ratio: auto; height: 100%; }
  .toast-stack { bottom: 24px; left: auto; right: 24px; transform: none; }
  .footer-inner { grid-template-columns: 1fr auto; align-items: center; }
}

@media (min-width: 1000px) {
  .hero { padding-block: 58px 64px; }
  .hero-inner { grid-template-columns: 1.25fr 1fr; align-items: center; gap: 40px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mobile-bar { display: none !important; }
  .toolbar-wrap { top: var(--header-h); }
}

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

@media (max-width: 999px) {
  .mobile-bar:not([hidden]) { display: flex; }
  body.has-mobile-bar { padding-bottom: 74px; }
}

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

/* Cetak sederhana */
@media print {
  .site-header, .toolbar-wrap, .mobile-bar, .site-footer, .cart-panel, .scrim, .modal, .toast-stack { display: none !important; }
  .card { break-inside: avoid; box-shadow: none; }
}
