/* ==========================================================
   TOKOKUSHOP - Shared Stylesheet
   Dipakai di semua halaman (index, login, register, user/*, admin/*)
   ========================================================== */

:root {
  --bg-global: #f8fafc;
  --surface: #ffffff;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --secondary: #0f172a;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --success: #15803d;
  --success-soft: #dcfce7;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  background-color: var(--bg-global);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh; /* iOS Safari: address bar dinamis bikin 100vh salah hitung, dvh lebih akurat */
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

a {
  color: inherit;
}

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

/* ---------- Layout Wrapper (auth pages) ---------- */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 460px;
}

.card {
  background: var(--surface);
  padding: 36px 30px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ---------- Brand Header ---------- */
.brand-header {
  text-align: center;
  margin-bottom: 26px;
}

.app-logo-circle {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 3px solid #fff;
  margin: 0 auto 14px;
}

/* Logo BARU berbentuk persegi panjang - GANTI dari app-logo-circle yang
   bulat. Sengaja pakai object-fit: contain (bukan cover) - supaya logo
   PERSEGI PANJANG tidak terpotong/terdistorsi, tampil utuh apa adanya.
   max-width dibatasi supaya tidak kebesaran di layar kecil, height auto
   mengikuti proporsi asli gambar. */
.app-logo-rect {
  max-width: 220px;
  max-height: 70px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto 14px;
  display: block;
}

.app-logo-fallback {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin: 0 auto 14px;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: var(--primary);
}

.brand-header h1,
.brand-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: -0.4px;
}

.brand-header p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.55;
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-group label i {
  margin-right: 4px;
  color: var(--text-muted);
}

.label-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-control {
  width: 100%;
  padding: 13px 16px;
  font-size: 16px; /* 16px agar iOS tidak auto-zoom saat fokus input */
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: #fff;
  color: var(--secondary);
  -webkit-appearance: none;
  appearance: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
  color: #94a3b8;
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper i.leading-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.input-icon-wrapper .form-control {
  padding-left: 44px;
}

.input-toggle-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  font-size: 15px;
}

/* ---------- Alerts ---------- */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.alert i {
  margin-top: 2px;
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fca5a5;
}

.alert-success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.alert-info {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid #bfdbfe;
}

.alert-warning {
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid #fde68a;
}

/* ---------- Buttons ---------- */
.btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  min-height: 48px; /* target sentuh ramah jari */
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
}

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

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

.btn-secondary {
  background: #fff;
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-global);
  border-color: #cbd5e1;
}

.btn-danger-text {
  color: var(--danger);
  font-weight: 700;
}

/* ---------- Footer / Links ---------- */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.auth-footer a,
.forgot-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.auth-footer a:hover,
.forgot-link:hover {
  color: var(--primary-hover);
}

.back-link {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  font-weight: 600;
}

.back-link a {
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Area Search (dropdown rekomendasi wilayah) ---------- */
.area-search-wrapper {
  position: relative;
}

.area-suggestion-box {
  position: absolute;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.area-suggestion-box.show {
  display: block;
}

.area-suggestion-item {
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.area-suggestion-item:last-child {
  border-bottom: none;
}

.area-suggestion-item:hover {
  background: var(--bg-global);
  color: var(--primary);
}

.area-suggestion-item i {
  color: #94a3b8;
  flex-shrink: 0;
}

.area-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
}

.area-hint.ok {
  color: var(--success);
}

/* ---------- Welcome / Landing Page ---------- */
.welcome-card {
  background: var(--surface);
  padding: 44px 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-text {
  margin-top: 32px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---------- Loading Spinner (dalam tombol) ---------- */
.spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ---------- Utility ---------- */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

/* ---------- Responsive: HP kecil ---------- */
@media screen and (max-width: 480px) {
  .auth-wrapper {
    padding: 16px;
  }
  .card {
    padding: 30px 20px;
    border-radius: var(--radius-md);
  }
  .welcome-card {
    padding: 34px 22px;
  }
}

/* ==========================================================
   NAVBAR (dipakai di user/ & admin/)
   ========================================================== */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: var(--safe-top);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  color: var(--secondary);
  flex-shrink: 0;
}

.navbar-brand img {
  height: 40px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  margin: 0;
}
.navbar-brand .app-logo-fallback {
  width: 36px;
  height: 36px;
  margin: 0;
}

.navbar-search-row {
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.navbar-search {
  max-width: 720px;
  flex: 1;
  margin: 0 auto;
  width: 100%;
  position: relative;
}

.navbar-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 14.5px;
  background: var(--bg-global);
}

.navbar-search input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.navbar-search i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
}

.category-filter-select {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-global);
  color: var(--secondary);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.category-filter-select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

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

.navbar-actions #auth-area {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}

/* Ikon Masuk/Daftar/Keranjang - PAKAI CLASS TERPISAH dari .icon-btn di atas
   (bukan ubah .icon-btn langsung), supaya ikon lonceng notifikasi & chat
   yang JUGA pakai .icon-btn tidak ikut berubah tanpa sengaja. */
.icon-btn-labeled {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: none;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  padding: 2px 4px;
}
.icon-btn-labeled i {
  font-size: 18px;
}
/* Bungkus KHUSUS untuk ikon yang punya badge (misal Keranjang) - supaya
   badge menempel pas di pojok IKON SAJA, bukan di seluruh kotak ikon+label
   yang sekarang lebih tinggi (kalau tidak dibungkus terpisah, badge akan
   "mengambang" di tengah kotak, menutupi ikonnya - itu bug yang diperbaiki
   di sini). */
.icon-btn-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Badge di konteks ikon berlabel (Keranjang) dibuat SEDIKIT LEBIH KECIL &
   posisinya disesuaikan - override KHUSUS di sini saja, TIDAK mengubah
   .cart-badge aslinya (supaya badge lonceng notifikasi yang JUGA pakai
   class sama tidak ikut bergeser). */
.icon-btn-icon-wrap .cart-badge {
  top: -3px;
  right: -6px;
  font-size: 8px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
}
.icon-btn-labeled .btn-label-text {
  font-size: 8px;
  color: var(--text-secondary);
  line-height: 1;
}

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

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
}

/* Dropdown user menu */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}

.user-menu-trigger:hover {
  background: var(--bg-global);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--secondary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: -0.3px;
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  display: none;
  overflow: hidden;
  z-index: 200;
}

.user-menu-dropdown.show {
  display: block;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
  background: var(--bg-global);
}

.user-menu-dropdown .divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ==========================================================
   PAGE CONTAINER & PRODUCT GRID
   ========================================================== */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.page-heading {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.page-heading h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--secondary);
}

.btn-reset-category {
  border: none;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn-next-category {
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
.btn-next-category i {
  font-size: 10px;
}

/* ==========================================================
   BENTO GRID KATEGORI - menggantikan dropdown filter lama sepenuhnya.
   Ukuran & jumlah kotak menyesuaikan kategori yang benar-benar ada.
   ========================================================== */
.category-bento-heading {
  margin: 4px 0 10px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.category-bento-heading h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--secondary);
}

.category-bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 92px;
  grid-auto-flow: dense;
  gap: 10px;
  margin-bottom: 26px;
}

.category-bento-tile {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
  background: var(--bg-global);
  border: 2px solid transparent;
}
.category-bento-tile:active {
  transform: scale(0.97);
}
.category-bento-tile.active {
  border-color: var(--primary);
}
.category-bento-tile--featured {
  grid-column: span 2;
  grid-row: span 2;
}

.category-bento-tile-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.category-bento-tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 40%, rgba(15, 23, 42, 0.78) 100%);
}
.category-bento-tile-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  color: #fff;
}
.category-bento-tile-name {
  font-weight: 800;
  font-size: 12px;
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.category-bento-tile--featured .category-bento-tile-name {
  font-size: 15px;
}
.category-bento-tile-count {
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 2px;
}

/* Kategori yang belum punya produk - tampilan berbeda, ajakan "nanti lagi",
   bukan kotak kosong yang terasa seperti error/bug. */
.category-bento-tile--empty {
  background: repeating-linear-gradient(135deg, #f1f5f9, #f1f5f9 8px, #e8edf5 8px, #e8edf5 16px);
  border: 2px dashed var(--border);
}
.category-bento-tile--empty .category-bento-tile-content {
  color: var(--text-muted);
  align-items: center;
  text-align: center;
  justify-content: center;
}
.category-bento-tile--empty .category-bento-tile-name {
  color: var(--secondary);
  text-shadow: none;
}
.category-bento-tile--empty .category-bento-tile-count {
  color: var(--primary);
  font-style: italic;
}
.category-bento-tile--empty .category-bento-tile-icon {
  font-size: 20px;
  color: #cbd5e1;
  margin-bottom: 4px;
}
.category-bento-tile--featured.category-bento-tile--empty .category-bento-tile-icon {
  font-size: 32px;
}

.category-bento-tile--rating {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  cursor: default; /* bukan tombol filter - jangan kasih kesan bisa diklik */
}
.category-bento-tile--rating:active {
  transform: none;
}
.category-bento-tile--rating .category-bento-tile-content {
  color: #fff;
  align-items: center;
  text-align: center;
  justify-content: center;
}
.category-bento-tile--rating .category-bento-tile-icon {
  font-size: 20px;
  color: #fff;
  margin-bottom: 2px;
}
.category-bento-tile--rating .category-bento-tile-name {
  font-size: 18px;
  text-shadow: none;
}
.category-bento-tile--rating .category-bento-tile-count {
  color: rgba(255, 255, 255, 0.9);
}
.category-bento-tile--rating .category-bento-tile-subcount {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 1px;
}

@media (max-width: 480px) {
  .category-bento {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 82px;
    gap: 8px;
  }
  .category-bento-tile-name {
    font-size: 10.5px;
  }
  .category-bento-tile--featured .category-bento-tile-name {
    font-size: 13px;
  }
}

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

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

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

.product-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-global);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 32px;
  overflow: hidden;
  position: relative;
}

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

/* ==========================================================
   BADGE PROMO DISKON - "trik marketing" ala TikTok/Tokopedia
   ========================================================== */
.price-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px -12px -12px; /* tarik ke tepi kiri-kanan-bawah kartu (imbangi padding 12px) */
}

.xtra-diskon-badge {
  background: linear-gradient(90deg, #0d9488, #14b8a6);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 5px 10px 5px 8px;
  border-radius: 0 999px 999px 0; /* kiri (mepet tepi kartu) persegi, kanan (ke tengah) bulat */
  display: flex;
  align-items: center;
  gap: 3px;
}

.shipping-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 5px 8px 5px 10px;
  border-radius: 999px 0 0 999px; /* kiri (ke tengah) bulat, kanan (mepet tepi kartu) persegi */
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto; /* dorong ke ujung kanan - tetap di kanan walau xtra-diskon-badge tidak ada */
}
.shipping-badge.free-ongkir {
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  color: #fff;
}
.shipping-badge.produk-murah {
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
}

.out-of-stock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.variant-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.variant-price-from {
  font-weight: 800;
  color: var(--secondary);
}

/* ==========================================================
   SELECTOR VARIAN (modal detail produk) - 1 atau 2 dimensi
   ========================================================== */
.variant-dimension-group {
  margin-bottom: 10px;
}
.variant-dimension-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.variant-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.variant-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.variant-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.price-original-strike {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-right: 5px;
  font-weight: 500;
}

.price-promo {
  color: #e11d48;
  font-weight: 800;
}

.promo-percent-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  color: #e11d48;
  border: 1px solid #fecdd3;
  background: #fff1f2;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 4px;
  margin-bottom: 4px;
}

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

.product-card-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-price {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--primary);
  margin-top: auto;
}

.product-card-stock {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.product-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 4px;
}

.stars-mini {
  color: #f59e0b;
  font-size: 12px;
  letter-spacing: 1px;
}

.rating-count {
  font-size: 10.5px;
  color: var(--text-muted);
}

.btn-add-cart {
  width: 100%;
  padding: 9px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--primary-soft);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

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

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

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

.empty-state i {
  font-size: 40px;
  color: #cbd5e1;
  margin-bottom: 14px;
}

/* ==========================================================
   MODAL (detail produk, konfirmasi, dsb)
   ========================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 300;
  padding: 0;
}

.modal-overlay.show {
  display: flex;
}

/* Untuk modal singkat (konfirmasi/notifikasi pendek seperti "Terima Kasih") -
   SELALU di tengah, apapun ukuran layarnya - beda dari modal detail/form yang
   sengaja pakai gaya "bottom sheet" di HP supaya mudah dijangkau jempol. */
.modal-overlay-centered {
  align-items: center !important;
}

.modal-box {
  background: #fff;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding-bottom: var(--safe-bottom);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media screen and (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }
  .modal-box {
    border-radius: var(--radius-lg);
    max-height: 85vh;
  }
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* ==========================================================
   MODAL DATA JAKMALL - langkah bernomor + baris data siap-copy
   ========================================================== */
.jakmall-step-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--secondary);
  margin: 18px 0 10px;
}
.jakmall-step-heading:first-of-type {
  margin-top: 0;
}
.jakmall-step-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #d97706;
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.jakmall-copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-global);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin-bottom: 6px;
}
.jakmall-copy-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.jakmall-copy-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
  word-break: break-word;
}
.jakmall-copy-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  background: #fff7ed;
  color: #d97706;
  font-size: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ==========================================================
   KOTAK BANTUAN CARI LINK LACAK - dropdown kurir + tombol buka halaman
   ========================================================== */
.courier-lookup-box {
  background: #f0f9ff;
  border: 1.5px dashed #7dd3fc;
  border-radius: var(--radius-sm);
  padding: 10px;
}
.courier-lookup-label {
  font-size: 11px;
  font-weight: 700;
  color: #0369a1;
  margin-bottom: 6px;
}
.courier-lookup-controls {
  display: flex;
  gap: 6px;
}
.courier-lookup-controls select {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  padding: 8px 10px;
}
.btn-open-tracking {
  flex-shrink: 0;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: #0284c7;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn-open-tracking:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}
.courier-lookup-hint {
  font-size: 10.5px;
  color: #0369a1;
  margin: 6px 0 0;
  line-height: 1.4;
}

.btn-check-cj-status {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed #93c5fd;
  background: #fff;
  color: #1e40af;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-check-cj-status:active {
  background: #eff6ff;
}

.modal-product-img {
  width: 100%;
  height: 320px;
  background: var(--bg-global);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 48px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

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

.modal-body {
  padding: 20px;
}

.modal-body h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 8px;
}

.modal-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}

.modal-description {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-line;
  margin-bottom: 0; /* jarak bawah sekarang diatur oleh .modal-description-box */
}

/* Kotak deskripsi TERPISAH dengan scroll sendiri - supaya kartu detail produk
   tidak ikut memanjang/bergeser semuanya kalau deskripsinya panjang. Bagian
   atas (nama, harga, diskon) & bawah (stok, tombol beli) tetap diam di
   tempat, cuma teks deskripsi ini yang digeser. */
.modal-description-box {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-global);
  padding: 14px; /* SENGAJA tidak terlalu sempit - supaya ruang baca tetap lega */
  max-height: 130px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* scroll halus di iOS */
  margin-bottom: 18px;
}

.btn-description-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--bg-global);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary);
  cursor: pointer;
  margin-bottom: 14px;
  -webkit-tap-highlight-color: transparent;
}
.btn-description-link i {
  color: var(--text-muted);
  font-size: 12px;
}

/* ==========================================================
   MODAL DETAIL PRODUK - versi ringkas KHUSUS modal ini (kelas terpisah,
   TIDAK mengubah --radius-lg global supaya modal lain di situs tidak
   ikut berubah) - tujuannya semua bagian utama (gambar sampai tombol beli)
   muat tanpa perlu digeser naik-turun.
   ========================================================== */
.product-modal-box {
  border-radius: 28px !important;
}

.product-modal-img-wrap {
  padding: 12px 12px 0; /* jarak dari tepi modal - supaya gambar tidak terkesan "keluar" dari popup */
}

.product-modal-img-wrap .modal-product-img {
  height: 225px; /* dinaikkan lagi - ruang ini didapat dari menggabungkan tombol qty & beli jadi 1 baris */
  border-radius: 16px;
  border-bottom: none; /* border pemisah lama tidak perlu lagi - sekarang sudah ada jarak dari padding di atas */
}

.product-modal-box .modal-body {
  padding: 12px 14px;
}

.product-modal-box #modal-product-rating {
  margin-bottom: 3px !important;
}

.product-modal-box #modal-product-name {
  font-size: 13.5px;
  margin-bottom: 4px;
}

.product-modal-box .modal-description-box {
  max-height: 112px; /* titik tengah - lebih tinggi dari versi awal (95px), tapi dikurangi dari 140px demi tetap muat tanpa scroll */
  padding: 10px; /* dirampingkan supaya ruang baca terasa lebih lebar, bukan sempit */
  margin-bottom: 12px;
}

.product-modal-box #modal-product-dimension {
  margin-bottom: 12px !important;
}

.product-modal-box .qty-btn {
  width: 28px;
  height: 28px;
  font-size: 12px;
}
.product-modal-box .qty-value {
  font-size: 13px;
}

/* Qty selector & tombol beli SEKARANG SEJAJAR (1 baris) - bukan lagi
   bertumpuk 2 baris terpisah, supaya hemat ruang vertikal untuk diberikan
   ke gambar produk yang lebih besar. */
.product-modal-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-ask-whatsapp-modal {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  -webkit-tap-highlight-color: transparent;
}
.btn-share-affiliate-modal {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.product-modal-box .qty-selector {
  gap: 8px;
  margin-bottom: 0;
  flex-shrink: 0; /* jangan sampai tombol qty ikut menyusut, biarkan tombol beli yang fleksibel */
}

.product-modal-box .btn-add-to-cart-compact {
  width: auto;
  min-height: unset;
  padding: 9px 14px;
  font-size: 12.5px;
  flex: 1; /* isi sisa ruang di samping tombol qty */
  margin: 0; /* posisi sejajar sudah diatur oleh flex parent, tidak perlu center manual lagi */
}

/* Kotak ulasan - sama seperti kotak deskripsi, supaya kalau ulasan sudah
   banyak, cukup digeser di dalam kotak ini saja, TIDAK bikin seluruh modal
   memanjang tanpa batas. */
.modal-reviews-box {
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px; /* jarak kecil dari scrollbar supaya teks tidak mepet */
}

.qty-selector {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.qty-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.qty-value {
  font-size: 16px;
  font-weight: 800;
  min-width: 30px;
  text-align: center;
}

/* ==========================================================
   TOAST (notifikasi kecil, contoh: "Ditambahkan ke keranjang")
   ========================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%) translateY(20px);
  background: var(--secondary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast i {
  color: #4ade80;
}

/* ==========================================================
   SKELETON LOADING
   ========================================================== */
.skeleton {
  background: linear-gradient(90deg, #eef1f6 25%, #e4e8f0 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* ==========================================================
   CHECKOUT - Pilihan Kurir
   ========================================================== */
.courier-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.courier-option:hover {
  border-color: #cbd5e1;
}

.courier-option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.courier-option-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-main);
}

.courier-option-eta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.courier-option-price {
  font-weight: 800;
  color: var(--primary);
  font-size: 14px;
  white-space: nowrap;
}

/* ==========================================================
   STATUS BADGE - Riwayat Pesanan
   ========================================================== */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-PENDING {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-PAID,
.status-PROCESSING {
  background: var(--primary-soft);
  color: var(--primary);
}

.status-SHIPPED {
  background: #e0f2fe;
  color: #0369a1;
}

.status-COMPLETED {
  background: var(--success-soft);
  color: var(--success);
}

.status-CANCELLED {
  background: var(--danger-soft);
  color: var(--danger);
}

.order-card {
  cursor: pointer;
  transition: all 0.15s ease;
}

.order-card:hover {
  box-shadow: var(--shadow-md);
}

/* ==========================================================
   ADMIN - Tabel & Tombol Aksi
   ========================================================== */
.admin-table-wrapper {
  overflow-x: auto;
}

/* Di layar kecil (HP), tabel disembunyikan total - diganti kartu mobile
   supaya tidak perlu geser-geser horizontal */
@media (max-width: 860px) {
  .admin-table-wrapper {
    display: none;
  }
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
}

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.table-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-global);
  flex-shrink: 0;
}

.btn-icon-sm {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
}

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

.btn-icon-sm.danger {
  color: var(--danger);
  border-color: #fca5a5;
}

.btn-icon-sm.danger:hover {
  background: var(--danger-soft);
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-nav-tabs {
  display: flex;
  gap: 4px;
}

.admin-nav-tabs a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
}

.admin-nav-tabs a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.status-select {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

/* ==========================================================
   ADMIN - Kartu Mobile (pengganti tabel di layar kecil, HP/tablet)
   ========================================================== */
.admin-cards-mobile {
  display: none;
}

@media (max-width: 860px) {
  .admin-cards-mobile {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (min-width: 560px) and (max-width: 860px) {
  .admin-cards-mobile {
    grid-template-columns: repeat(2, 1fr);
  }
}

.admin-card-mobile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-card-mobile-header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.admin-card-mobile-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-global);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 20px;
}

.admin-card-mobile-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--secondary);
  line-height: 1.35;
}

.admin-card-mobile-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-card-mobile-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: var(--bg-global);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  gap: 8px;
}

.admin-card-mobile-meta-item span {
  display: block;
}

.admin-card-mobile-meta-label {
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 2px;
}

.admin-card-mobile-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.admin-card-mobile-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.admin-card-mobile-actions .btn-icon-sm {
  flex: 1;
  width: auto;
  height: 38px;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
}

/* ==========================================================
   TOMBOL WHATSAPP MENGAMBANG - wadah komunikasi transaksi
   ========================================================== */
.whatsapp-float-btn {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  z-index: 500;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.whatsapp-float-btn:hover {
  transform: scale(1.08);
  background: #20bd5a;
}

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

/* ==========================================================
   LONCENG NOTIFIKASI PESANAN (header) - badge angka + panel kecil
   ========================================================== */
.notification-bell-wrap {
  position: relative;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  padding: 6px;
  z-index: 60;
}

.notification-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.notification-line:hover {
  background: var(--bg-global);
}
.notification-line:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.notification-footer {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
  padding: 8px;
  cursor: pointer;
}

.notification-empty {
  padding: 16px 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ==========================================================
   PAGINATION - komponen reusable (lihat assets/js/pagination.js)
   ========================================================== */
.pagination-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
}

.pagination-info {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pagination-btn:hover:not(:disabled):not(.active) {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  cursor: default;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

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

.pagination-arrow {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--primary);
}
.pagination-arrow:hover:not(:disabled):not(.active) {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.4);
  color: var(--primary);
}
.pagination-arrow:disabled {
  background: var(--bg-global);
  border-color: var(--border);
  color: var(--text-muted);
  opacity: 0.6;
}

.pagination-ellipsis {
  min-width: 20px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 700;
}

@media (max-width: 480px) {
  .pagination-btn {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
  }
}

/* ==========================================================
   TRACKING CARD - Kartu resi/pengiriman di riwayat pesanan
   ========================================================== */
.tracking-card {
  background: linear-gradient(135deg, var(--primary-soft) 0%, #f8fafc 100%);
  border: 1px solid #dbeafe;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
}

.tracking-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.tracking-courier-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tracking-courier-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.tracking-courier-name {
  font-weight: 800;
  font-size: 13.5px;
  color: var(--secondary);
  text-transform: uppercase;
}

.tracking-courier-service {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.tracking-status-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.tracking-waybill-box {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.tracking-waybill-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 3px;
}

.tracking-waybill-number {
  font-size: 15px;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: 0.5px;
  font-family: 'Courier New', monospace;
}

.btn-copy-waybill {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-copy-waybill:active {
  transform: scale(0.94);
}

.btn-track-package {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-track-package:active {
  transform: scale(0.98);
}

.tracking-waiting-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

/* ==========================================================
   CJ IMPORT - kartu hasil pencarian produk CJdropshipping
   ========================================================== */
.cj-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.cj-product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cj-product-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.cj-product-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-global);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 28px;
}

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

.cj-product-info {
  padding: 10px;
}

.cj-shipping-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.cj-shipping-badge.from-id {
  background: #dcfce7;
  color: #15803d;
}

.cj-shipping-badge.from-cn {
  background: #fef3c7;
  color: #b45309;
}

.cj-product-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cj-product-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
}

/* ==========================================================
   BANNER SLIDER - promosi otomatis sliding di halaman utama
   ========================================================== */
#banner-slider-wrap {
  margin-bottom: 24px;
}

.banner-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 6;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  background: linear-gradient(135deg, #e0e7ff, #f0f4ff);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.12);
}

@media (max-width: 640px) {
  .banner-slider {
    /* Rasio TETAP SAMA (16/6) dengan desktop - cocok dengan rasio gambar yang
       direkomendasikan (1200x450px). Kalau rasio beda-beda per ukuran layar,
       foto lebar akan terpotong kiri-kanannya di layar yang lebih "kotak". */
    border-radius: 14px;
  }
}

.banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.7s ease, transform 8s linear;
  cursor: default;
}

.banner-slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.banner-slide a,
.banner-slide .banner-slide-img-wrap {
  display: block;
  width: 100%;
  height: 100%;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.banner-slide.has-link a {
  cursor: pointer;
}

.banner-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s ease;
}

.banner-dot.active {
  width: 22px;
  background: var(--primary);
}

.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--secondary);
  font-size: 14px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: background 0.2s ease;
}

.banner-arrow:hover {
  background: #fff;
}

.banner-arrow.prev {
  left: 12px;
}

.banner-arrow.next {
  right: 12px;
}

@media (max-width: 640px) {
  .banner-arrow {
    display: none; /* di mobile cukup swipe/dot, arrow bikin sempit */
  }
}
