/* -----------------------------------------------------------
   Rongsok Elektronik — design tokens
   Palet terinspirasi papan sirkuit & label QC: sage muted,
   tinta gelap, aksen tembaga (solder) dan hijau sirkuit.
----------------------------------------------------------- */
:root {
  --bg: #F1F4EC;
  --surface: #FFFFFF;
  --surface-raised: #FAFBF7;
  --ink: #1C2620;
  --muted: #647065;
  --border: #DCE3D3;
  --accent: #2F6E56;       /* hijau sirkuit — tombol utama, tautan */
  --accent-dark: #234F3F;
  --copper: #C97A3D;       /* tembaga — aksen, highlight kondisi */
  --copper-soft: #F3E3D3;
  --danger: #B4472F;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(28,38,32,0.06) 1px, transparent 0);
  background-size: 22px 22px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand-tagline { font-size: 12.5px; color: var(--muted); }

.search-form {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 4px 4px 16px;
  min-width: 240px;
  flex: 1;
  max-width: 360px;
}
.search-form input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  flex: 1;
  color: var(--ink);
  font-family: var(--font-body);
}
.search-form input::placeholder { color: var(--muted); }
.search-form button {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.search-form button svg { width: 16px; height: 16px; }

/* ---------- Hero ---------- */
.hero { padding-top: 48px; padding-bottom: 32px; }
.hero-inner { max-width: 640px; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--copper);
  background: var(--copper-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin: 0 0 18px;
}
.hero-eyebrow::before { content: '✓'; font-weight: 700; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 14px;
}
.hero p { color: var(--muted); font-size: 16px; line-height: 1.6; margin: 0; }

/* ---------- Kategori ---------- */
.cat-section { padding-bottom: 8px; }
.cat-eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 4px;
}
.cat-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 18px;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.cat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.cat-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(28,38,32,0.08);
}
.cat-tile .icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cat-tile .icon svg { width: 20px; height: 20px; }
.cat-tile .label { font-size: 12.5px; font-weight: 600; line-height: 1.3; }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 32px 0 8px;
}
.filter-label {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-right: 4px;
}
.pill {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pill:hover { border-color: var(--accent); }
.pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.result-count { color: var(--muted); font-size: 13.5px; margin: 18px 0 22px; }

/* ---------- Grid produk ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-bottom: 64px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(28,38,32,0.1);
  border-color: var(--accent);
}
.card-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  overflow: hidden;
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.no-photo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12.5px;
  background:
    repeating-linear-gradient(45deg, var(--border), var(--border) 1px, transparent 1px, transparent 12px);
}
.badge-terjual {
  position: absolute;
  inset: 0;
  background: rgba(28,38,32,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.badge-terjual span {
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 8px 18px;
  border-radius: 999px;
  transform: rotate(-6deg);
}
.kondisi-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
}
.kondisi-like-new     { background: #E4F1EA; color: var(--accent-dark); border-color: #C7E3D3; }
.kondisi-minor-defect { background: var(--copper-soft); color: #8A4E22; border-color: #E7C9A8; }
.kondisi-rusak-ringan { background: #FBE7E1; color: #8A3A22; border-color: #F0C3B3; }
.kondisi-for-parts    { background: #ECECEC; color: #52514f; border-color: #D8D8D6; }

.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.card-kategori { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.card-nama { font-size: 15px; font-weight: 600; line-height: 1.35; }
.card-harga { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--accent-dark); margin-top: 4px; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  font-size: 15px;
  line-height: 1.7;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

/* ---------- Detail produk ---------- */
.back-link { color: var(--muted); font-size: 13.5px; font-weight: 500; }
.back-link:hover { color: var(--accent); }

.detail {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  padding: 24px 0 72px;
}
.detail-photo {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
}
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.detail-info .kategori {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.detail-info h1 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.2;
}
.detail-info .harga {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-dark);
}
.deskripsi {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.btn-wa {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  width: fit-content;
  transition: background 0.15s ease;
}
.btn-wa:hover { background: var(--accent-dark); }
.btn-wa svg { width: 19px; height: 19px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 40px;
}
.site-footer-inner {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.footer-admin-link { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.footer-admin-link:hover { color: var(--accent); }

/* ---------- Admin ---------- */
.admin-body { background: var(--bg); min-height: 100vh; }
.admin-header {
  background: var(--ink);
  color: #fff;
}
.admin-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.admin-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.admin-brand .dot { width: 9px; height: 9px; border-radius: 999px; background: #6FD8A6; box-shadow: 0 0 0 4px rgba(111,216,166,0.2); }
.admin-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-nav a {
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  color: #DDE4DC;
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,0.12); color: #fff; }
.admin-nav .logout-btn {
  background: var(--danger);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.admin-nav .logout-btn:hover { background: #953823; }

.admin-wrap { max-width: 1000px; margin: 0 auto; padding: 32px 24px 64px; }
.admin-page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-page-head h1 { font-family: var(--font-display); font-size: 22px; margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-danger { background: #FBE7E1; color: var(--danger); border-color: #F0C3B3; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }

.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; }
.admin-alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 20px; }
.admin-alert-error { background: #FBE7E1; color: var(--danger); border: 1px solid #F0C3B3; }
.admin-alert-success { background: #E4F1EA; color: var(--accent-dark); border: 1px solid #C7E3D3; }
.admin-alert-warning { background: var(--copper-soft); color: #8A4E22; border: 1px solid #E7C9A8; }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px 32px; }
.login-card h1 { font-family: var(--font-display); font-size: 20px; margin: 0 0 4px; }
.login-card p.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 24px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface-raised);
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.field textarea { resize: vertical; min-height: 100px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--bg); flex-shrink: 0; }
.admin-thumb-empty { width: 48px; height: 48px; border-radius: 8px; background: var(--bg); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.status-dot::before { content: ''; width: 8px; height: 8px; border-radius: 999px; }
.status-live::before { background: #6FD8A6; }
.status-sold::before { background: var(--muted); }

/* ---------- Beli Sekarang button (detail produk) ---------- */
.detail-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.btn-buy { width: 100%; justify-content: center; padding: 14px 22px; font-size: 15px; }

/* ---------- Checkout ---------- */
.checkout-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
  padding: 24px 0 72px;
  align-items: start;
}
.checkout-title { font-family: var(--font-display); font-size: 22px; margin: 0 0 20px; }
.checkout-summary-label {
  font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 14px;
}
.checkout-summary-photo {
  aspect-ratio: 4/3; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); margin-bottom: 14px;
}
.checkout-summary-photo img { width: 100%; height: 100%; object-fit: cover; }
.checkout-summary-nama { font-weight: 600; font-size: 15px; margin: 10px 0 8px; }
.checkout-summary-harga { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--accent-dark); margin-top: 10px; }

/* ---------- Order status page ---------- */
.order-status-shell { max-width: 480px; margin: 0 auto; padding: 40px 0 72px; }
.order-status-card { text-align: center; padding: 36px 30px; }
.order-status-icon {
  width: 56px; height: 56px; border-radius: 999px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
}
.order-status-icon svg { width: 26px; height: 26px; }
.order-status-icon-success { background: #E4F1EA; color: var(--accent-dark); }
.order-status-icon-pending { background: var(--copper-soft); color: #8A4E22; }
.order-status-icon-cancel { background: #FBE7E1; color: var(--danger); }
.order-status-card h1 { font-family: var(--font-display); font-size: 21px; margin: 0 0 10px; }
.order-status-sub { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0; }
.order-transfer-box {
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 18px; margin-top: 20px; text-align: left;
}
.order-transfer-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.order-transfer-label { color: var(--muted); }
.order-transfer-value { font-weight: 600; text-align: right; }
.order-transfer-amount { color: var(--accent-dark); font-family: var(--font-display); font-size: 16px; }
.order-qris-img { width: 100%; max-width: 240px; margin: 16px auto 0; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ---------- Admin nav badge ---------- */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--copper); color: #fff; font-size: 11px; font-weight: 700; margin-left: 4px;
}
.status-pending::before { background: var(--copper); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .field-row { grid-template-columns: 1fr; }
  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-summary-card { order: -1; }
}
@media (max-width: 560px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr 1fr; }
  .site-header-inner { flex-direction: column; align-items: stretch; }
  .search-form { max-width: none; }
}
