/* =====================================================================
   NipStore.ID — tampilan toko (pelanggan)
   Mobile-first; desktop memakai container lebih lebar, bukan sekadar
   tampilan mobile yang diperbesar.
   ===================================================================== */

body {
  background: var(--surface-2);
}

/* ------------------------------------------------------------- header */

.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
  padding: 0 16px;
  max-width: 1180px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  line-height: 1.2;
}
.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-tagline {
  font-size: 11px;
  color: var(--ink-3);
}

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

/* Chip identitas + saldo. Saldo tinggal di sini, bukan sebagai kartu
   terpisah di badan halaman. */
.header-user {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 4px 13px 4px 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
  max-width: 220px;
}
.header-user:hover {
  border-color: var(--accent-border);
}

.header-user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.header-username {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-balance {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

@media (min-width: 360px) {
  .header-user {
    display: flex;
  }
}

/* Keranjang polos tanpa kotak, senada dengan tombol tema di sebelahnya. */
.cart-btn {
  position: relative;
  background: transparent;
}
.cart-btn:hover {
  background: transparent;
  color: var(--ink);
}
.cart-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  background: var(--blue);
  color: var(--on-accent);
  font-size: 10.5px;
  font-weight: 800;
  border: 2px solid var(--surface);
}

/* -------------------------------------------------------------- layout */

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 900px) {
  .page {
    /* Ruang bawah tetap disediakan karena bilah navigasi mengambang. */
    padding: 32px 24px calc(var(--nav-h) + 40px);
  }
}

.page-head {
  margin-bottom: 24px;
}
.page-head h1 {
  font-size: 26px;
}
.page-head p {
  font-size: 13.5px;
  color: var(--ink-3);
  margin-top: 3px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: none;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
  margin-bottom: 8px;
}
.back-link:hover {
  color: var(--ink);
}

/* -------------------------------------------------- navigasi bawah */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  /* Token, bukan putih mati — supaya ikut benar di tema gelap. */
  background: var(--glass);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--nav-h);
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}

.nav-item:hover {
  color: var(--ink-2);
}

/* Menu aktif: ikon gelap + titik biru di bawahnya. */
.nav-item[aria-current="page"] {
  color: var(--blue);
}
.nav-item[aria-current="page"] .nav-dot {
  opacity: 1;
}

.nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0;
  transition: opacity 0.15s;
}

/* Desktop: tetap menempel di bawah, tapi sebagai bilah mengambang yang
   ditengahkan — bukan bilah mobile yang sekadar dilebarkan.
   (Catatan: `position: sticky` tidak bisa dipakai di sini karena <nav>
   berada setelah <main> di DOM, jadi tidak punya ruang untuk naik.) */
@media (min-width: 900px) {
  .bottom-nav {
    left: 50%;
    right: auto;
    bottom: 20px;
    transform: translateX(-50%);
    width: auto;
    max-width: calc(100vw - 48px);
    justify-content: center;
    gap: 4px;
    padding: 7px 8px;
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    box-shadow: var(--shadow-lg);
  }
  .nav-item {
    flex: none;
    flex-direction: row;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: var(--r-full);
    font-size: 13.5px;
  }
  .nav-item[aria-current="page"] {
    background: var(--blue-soft);
    color: var(--blue-700);
  }
  .nav-dot {
    display: none;
  }
}

/* ------------------------------------------------------- banner saldo */

/* --------------------------------------------------- pencarian katalog */

.catalog-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.result-count {
  font-size: 13px;
  color: var(--ink-3);
  margin: 14px 0 10px;
}

/* ----------------------------------------------------- grid produk */

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

@media (min-width: 720px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

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

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .22s, transform .22s, border-color .22s;
}
.product-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--accent-border);
}

.product-thumb {
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
}

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

.product-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  min-height: 1.3em;
}

/* Seluruh kotak bisa diketuk: tautan nama produk direntangkan menutupi kartu. */
.product-link {
  color: inherit;
}
.product-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.product-link:focus-visible {
  outline: none;
}
.product-card:has(.product-link:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.product-price {
  font-size: 19px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.02em;
}

.product-meta {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.product-card .btn {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  justify-content: space-between;
  min-height: 38px;
}

/* ------------------------------------------------------ detail produk */

.detail-hero {
  aspect-ratio: 16 / 9;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* HP: judul → pilihan paket → deskripsi paket terpilih (urutan DOM). */
.detail-side {
  margin-top: 16px;
}
.detail-specs:not(:empty) {
  margin-top: 4px;
}

@media (min-width: 900px) {
  /* Desktop: deskripsi kembali ke kolom kiri, kartu paket menempel di kanan. */
  .detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "main side"
      "specs side";
    column-gap: 24px;
    align-items: start;
  }
  .detail-main {
    grid-area: main;
  }
  .detail-specs {
    grid-area: specs;
  }
  .detail-specs:not(:empty) {
    margin-top: 0;
  }
  .detail-side {
    grid-area: side;
    margin-top: 0;
    position: sticky;
    /* Navigasi tidak lagi menempel di bawah header, jadi offsetnya header saja. */
    top: calc(var(--header-h) + 24px);
  }
  .detail-hero {
    aspect-ratio: 16 / 8;
  }
}

.variant-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.variant-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.variant-option:hover:not(:disabled) {
  border-color: var(--blue);
}
.variant-option[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 1px var(--blue) inset;
}
.variant-option:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--surface-2);
}

.variant-name {
  font-size: 14px;
  font-weight: 700;
}
.variant-sub {
  font-size: 12px;
  color: var(--ink-3);
}
.variant-price {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--blue);
  margin-left: auto;
  text-align: right;
  flex: none;
}

/* Pengatur jumlah: satu pil membulat, tombol bundar di kedua sisi. */
.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.qty-control button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.qty-control button:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.qty-control button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.qty-control button:disabled {
  color: var(--ink-4);
  cursor: not-allowed;
}
.qty-control input {
  width: 38px;
  height: 30px;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.qty-control input:focus {
  outline: none;
}
/* Sembunyikan panah bawaan input number. */
.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qty-control input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* --------------------------------------- panel deskripsi & ketentuan */

.spec {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.spec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.spec-head::-webkit-details-marker {
  display: none;
}
.spec-head:hover {
  background: var(--surface-2);
}
.spec-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.spec-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Nama paket yang sedang dipilih — isi panel mengikuti varian ini. */
.spec-for {
  margin-left: auto;
  min-width: 0;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-ink);
}

.spec-chevron {
  display: grid;
  place-items: center;
  color: var(--ink-3);
  flex: none;
  /* Ikon chevron menunjuk ke kanan; diputar jadi bawah saat tertutup. */
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}
.spec[open] .spec-chevron {
  transform: rotate(-90deg);
}

.spec-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
}
.spec-body p {
  margin: 0 0 10px;
}
.spec-body p:last-child {
  margin-bottom: 0;
}
.spec-body a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.spec-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.spec-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
}
.spec-list li:last-child {
  margin-bottom: 0;
}
/* Titik penanda memakai warna aksen, bukan bullet bawaan browser. */
.spec-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* Baris bernomor (mis. langkah cara login) memakai nomornya, bukan titik. */
.spec-list li[data-n] {
  padding-left: 24px;
}
.spec-list li[data-n]::before {
  content: attr(data-n);
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  font-weight: 700;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .spec-chevron {
    transition: none;
  }
}

/* ---------------------------------------------------- keranjang/bayar */

.cart-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-row:last-child,
/* Baris terakhir yang langsung diikuti garis pemisah: cukup satu garis. */
.cart-row:has(+ .divider) {
  border-bottom: 0;
}

.cart-thumb {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--surface-2);
}
.cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pay-method {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.pay-method[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 1px var(--blue) inset;
}
.pay-method:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--surface-2);
}

.pay-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--ink-2);
}
.pay-method[aria-pressed="true"] .pay-icon {
  background: var(--blue);
  color: var(--on-accent);
}

.summary-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px dashed var(--border-strong);
  font-size: 15px;
  font-weight: 700;
}
.summary-total strong {
  font-size: 19px;
  color: var(--blue);
  letter-spacing: -0.02em;
}

.sticky-action {
  position: sticky;
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom, 0px));
  margin-top: 16px;
  z-index: 40;
}

@media (min-width: 900px) {
  .sticky-action {
    position: static;
  }
}

/* -------------------------------------------------------- pembayaran */

.qr-panel {
  text-align: center;
  padding: 20px 16px;
}

.qr-frame {
  width: min(260px, 72vw);
  margin: 0 auto 14px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.qr-frame img {
  width: 100%;
  aspect-ratio: 1;
  image-rendering: pixelated;
}
.qr-frame .skeleton {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-xs);
}

.pay-amount {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.countdown.is-urgent {
  background: var(--red-soft);
  color: var(--red);
}

.step-list {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}
/* Nomor langkah diposisikan absolut, bukan sebagai flex item — supaya teks
   yang diselingi <strong> tetap mengalir sebagai satu paragraf. */
.step-list li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.step-list li:last-child {
  margin-bottom: 0;
}
.step-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue-700);
  font-size: 11px;
  font-weight: 800;
}

/* --------------------------------------------------------- transaksi */

.tx-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: box-shadow 0.15s;
}
.tx-card:hover {
  box-shadow: var(--shadow);
}

.tx-icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--ink-3);
}
.tx-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tx-body {
  flex: 1;
  min-width: 0;
}

.tx-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.tx-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.tx-id {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 5px;
}

.tx-amount {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.tx-amount.is-credit {
  color: var(--green);
}

/* Judul + status di satu baris. Status yang panjang ("Menunggu Pembayaran")
   turun ke baris sendiri alih-alih menjepit teks di sebelahnya. */
.tx-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px 8px;
}
.tx-head .tx-title {
  flex: 1 1 9rem;
  min-width: 0;
}
.tx-head .badge {
  flex: none;
}

/* ID pesanan tidak dipatahkan di tengah; tanggal & nominal sebaris. */
.tx-id.mono {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
}
.tx-foot .tx-id {
  margin-top: 0;
}

.tx-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 900px) {
  .tx-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

/* ------------------------------------------------------------- saldo */

.balance-card {
  position: relative;
  padding: 20px;
  border-radius: var(--r-lg);
  /* Dongker — senada dengan warna aksen toko. */
  background: linear-gradient(145deg, #243b63 0%, #101d35 62%);
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* Cahaya biru muda halus di pojok kartu saldo. */
.balance-card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -70px;
  top: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143, 178, 240, 0.30), transparent 68%);
  pointer-events: none;
}

.balance-card-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}
.balance-card-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 4px;
}
.balance-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  position: relative;
  z-index: 1;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 380px) {
  .amount-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.amount-option {
  padding: 13px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all 0.15s;
}
.amount-option:hover {
  border-color: var(--blue);
}
.amount-option[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-700);
  box-shadow: 0 0 0 1px var(--blue) inset;
}

/* ------------------------------------------------------------ profil */

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-box {
  padding: 13px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  text-align: center;
}
.stat-value {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}

.menu-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  width: 100%;
}
.menu-item:last-child {
  border-bottom: 0;
}
.menu-item:hover {
  background: var(--surface-2);
}
.menu-item svg:first-child {
  color: var(--ink-3);
  flex: none;
}
.menu-item .menu-chevron {
  margin-left: auto;
  color: var(--ink-4);
  flex: none;
}
.menu-item.is-danger {
  color: var(--red);
}
.menu-item.is-danger svg:first-child {
  color: var(--red);
}

/* -------------------------------------------------------------- auth */

.auth-wrap {
  max-width: 440px;
  margin: 44px auto calc(var(--nav-h) + 40px);
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
}

.auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--blue);
  color: var(--on-accent);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
/* Sama seperti .brand-logo: logo gambar tanpa kotak warna di belakangnya. */
.auth-logo:has(> img) {
  background: transparent;
}

.auth-forgot {
  display: block;
  width: fit-content;
  margin: 8px 0 0 auto;
  font-weight: 600;
}

.auth-switch {
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-3);
  margin-top: 18px;
}
.auth-switch button {
  background: none;
  border: 0;
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
}

/* -------------------------------------------------------- pagination */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.page-info {
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  min-width: 90px;
  text-align: center;
}

/* --------------------------------------------- data pengiriman produk */

/* Laporan masalah (klaim garansi) di detail pesanan. */
.claim-row {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.claim-row:first-of-type {
  border-top: 0;
  padding-top: 4px;
}

.delivery-box {
  padding: 12px 14px;
  border: 1px solid var(--blue-soft-2);
  border-radius: var(--r-sm);
  background: var(--blue-soft);
}
/* Syarat & ketentuan produk, dikirim bersama data akun. */
.delivery-terms {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.delivery-terms-body {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
}
.delivery-terms-body p { margin: 0 0 8px; }
.delivery-terms-body p:last-child { margin-bottom: 0; }
.delivery-terms-body a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }

.delivery-content {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 6px;
}

/* ------------------------------------------------------- beranda toko */

.catalog-section { scroll-margin-top: 24px; }

/* Bar pencarian: kategori, kolom cari, dan tombol jadi satu pil. */
.catalog-search {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 5px 5px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  transition: border-color .16s, box-shadow .16s;
}
.catalog-search:focus-within {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.catalog-search-cat {
  position: relative;
  display: flex;
  align-items: center;
  flex: none;
  padding-right: 10px;
  margin-right: 4px;
  border-right: 1px solid var(--border);
}
.catalog-search-cat select {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 22px 8px 10px;
  max-width: 132px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-overflow: ellipsis;
}
.catalog-search-cat select:focus {
  outline: none;
}
.catalog-search-cat select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--r-xs);
}
/* Chevron ikut kotak select, dibuat menunjuk ke bawah. */
.catalog-search-cat > svg {
  position: absolute;
  right: 10px;
  color: var(--ink-3);
  pointer-events: none;
  transform: rotate(90deg);
}

/* Dropdown yang bisa didesain penuh sudah membawa panahnya sendiri
   (::picker-icon), jadi chevron manual di atas tidak dipakai lagi. */
@supports (appearance: base-select) {
  .catalog-search-cat select {
    appearance: base-select;
    gap: 6px;
    padding-right: 8px;
  }
  .catalog-search-cat > svg {
    display: none;
  }
  .catalog-search-cat selectedcontent {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.catalog-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 10px 6px;
  font-size: 14px;
  color: var(--ink);
}
.catalog-search-input::placeholder {
  color: var(--ink-4);
}
.catalog-search-input:focus {
  outline: none;
}
.catalog-search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.catalog-search-go {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  transition: background .16s;
}
.catalog-search-go:hover {
  background: var(--accent-hover);
}
.catalog-search-go:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.catalog-section .result-count {
  margin: 0 0 16px 2px;
}
.product-category { font-size: 10px; font-weight: 600; color: var(--ink-3); }
.product-pricing { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 4px 8px; border-top: 1px solid var(--border); padding-top: 11px; margin-top: auto; }
.product-pricing .product-meta { font-size: 10px; margin-bottom: 3px; }
.product-thumb .thumb-placeholder { font-size: 27px; }
.product-badge { top: 10px; left: 10px; font-size: 9px; padding: 4px 8px; box-shadow: 0 2px 6px rgb(var(--shade) / 4%); }
.is-unavailable .product-thumb > img, .is-unavailable .thumb-placeholder { opacity: .65; filter: saturate(.55); }
.store-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 11px; color: var(--ink-3); }
.store-footer > .fw-700 { color: var(--ink-2); }
.store-footer a { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.home-page #product-host > .state { border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface); padding-block: 60px; }
.tx-card { color: var(--ink); }
.detail-layout > *, .checkout-layout > * { min-width: 0; }
.card-pad { padding: 20px; }
.auth-wrap .field { margin-bottom: 18px; }
.header-right > .btn { min-height: 38px; }
.header-user { color: var(--ink-2); }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .product-card:hover { transform: translateY(-4px); }
  .tx-card:hover { transform: translateY(-2px); }
  .btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
}
@media (prefers-reduced-motion: no-preference) {
  .product-grid > .product-card { animation: enter-page .4s ease-out backwards; }
  .product-grid > .product-card:nth-child(2) { animation-delay: .04s; }
  .product-grid > .product-card:nth-child(3) { animation-delay: .08s; }
  .product-grid > .product-card:nth-child(4) { animation-delay: .12s; }
}
@media (min-width: 900px) {
  /* Di atas bilah navigasi mengambang (bottom 20px + tinggi ±56px),
     bukan menimpanya. */
  #toasts { bottom: 92px; }
  .app-header-inner { padding-inline: 24px; }
}
@media (max-width: 899px) {
  .header-username { max-width: 110px; }
}
@media (max-width: 600px) {
  :root { --header-h: 66px; }
  .input, .select, .textarea { font-size: 16px; }
  html { scroll-padding-top: 80px; }
  .app-header-inner { gap: 10px; }
  .brand-name { font-size: 16px; }
  .brand-tagline { font-size: 9px; }
  .brand-logo { width: 36px; height: 36px; }
  .header-user { gap: 7px; padding: 3px 11px 3px 3px; max-width: 150px; }
  .header-user .avatar { width: 30px; height: 30px; }
  .header-username { display: none; }
  .header-balance { font-size: 12.5px; }
  .page { padding-top: 18px; }
  .header-right { gap: 4px; }
  .header-right .icon-btn { width: 36px; height: 36px; }

  /* Kotak produk HP: dibuat pendek dengan jarak yang rapat; tombol tetap ada
     tapi lebih ramping. */
  .product-grid { gap: 12px; }
  .product-body { padding: 10px 11px 11px; gap: 4px; }
  .product-category { font-size: 9.5px; }
  .product-name { font-size: 13px; min-height: 0; }
  .product-card .social-line.compact { font-size: 11px; margin: 0; gap: 4px; }
  .product-pricing { padding-top: 8px; }
  .product-price { font-size: 16px; }
  .product-card .btn { font-size: 11.5px; min-height: 34px; margin-top: 6px; padding-inline: 10px; }
  .product-thumb .thumb-placeholder { font-size: 21px; }
  .product-badge { top: 7px; left: 7px; font-size: 8px; padding: 3px 6px; }
  .product-pricing .product-meta { display: none; }

  /* Profil: nominal panjang ("Rp1.250.000") tetap satu baris. */
  .stat-grid { gap: 8px; }
  .stat-box { padding: 12px 6px; }
  .stat-value { font-size: clamp(13px, 4.2vw, 17px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .store-footer { gap: 9px; margin-top: 28px; }
  .store-footer > span:nth-child(2) { flex-basis: 100%; order: 3; }
  .auth-wrap { margin: 24px 16px calc(var(--nav-h) + 32px); padding: 26px 22px; max-width: none; border-radius: 20px; }
  .page-head h1 { font-size: 23px; }
  .card-pad { padding: 16px; }
}
/* Saat login, chip saldo memakan tempat: tagline disembunyikan supaya nama
   toko tidak terpotong, dan di layar sempit avatar di chip ikut disembunyikan. */
@media (max-width: 400px) {
  .app-header-inner:has(.header-user) .brand-tagline { display: none; }
}
@media (max-width: 380px) {
  .header-user .avatar { display: none; }
  .header-user { padding: 7px 12px; }
}
@media (max-width: 359px) {
  .brand-tagline { display: none; }
  .product-grid { gap: 10px; }
  .product-body { padding: 9px 10px 10px; }
  .product-price { font-size: 15px; }
}

/* =====================================================================
   Menu Info — daftar artikel & halaman baca
   ===================================================================== */

.info-search {
  margin-bottom: 14px;
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

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

@media (min-width: 1000px) {
  .info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }
}

.info-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.16s, transform 0.16s;
}
.info-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.info-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
}
.info-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-cover-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--thumb-1), var(--thumb-2));
  color: var(--thumb-ink);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.info-pin {
  position: absolute;
  top: 10px;
  left: 10px;
}

.info-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
  flex: 1;
}

.info-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.info-tag {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.info-tag:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft-strong);
  color: var(--accent-ink);
}

.info-title {
  font-size: 15px;
  line-height: 1.35;
}
.info-title a {
  color: var(--ink);
}
.info-title a:hover {
  color: var(--accent-ink);
}

.info-excerpt {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-3);
  margin: 0;
}

.info-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.info-read {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-ink);
  white-space: nowrap;
}

/* HP: kartu mendatar — sampul kecil di kiri, teks di kanan — supaya daftar
   artikel tidak memanjang. Tag tetap bisa dipilih lewat baris filter di atas. */
@media (max-width: 559px) {
  .info-grid { gap: 10px; }
  .info-card { flex-direction: row; border-radius: var(--r); }
  .info-cover { flex: none; width: 96px; aspect-ratio: auto; min-height: 104px; }
  .info-cover-fallback { font-size: 18px; }
  .info-pin { top: 6px; left: 6px; font-size: 9px; padding: 2px 6px; }
  .info-body { min-width: 0; gap: 4px; padding: 11px 12px; }
  .info-tags { display: none; }
  .info-title { font-size: 14px; }
  .info-excerpt { font-size: 12.5px; line-height: 1.45; }
  .info-foot { padding-top: 4px; border-top: 0; }
  .info-read { font-size: 12.5px; }
}

/* ----------------------------------------------------- halaman baca */

.info-article {
  max-width: 760px;
  margin: 0 auto;
}

.info-article-title {
  font-size: 25px;
  line-height: 1.25;
  margin: 10px 0 0;
}

@media (min-width: 760px) {
  .info-article-title {
    font-size: 32px;
  }
}

.info-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.info-article-cover {
  margin: 20px 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.info-article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.info-lead {
  margin-top: 18px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  font-weight: 500;
  padding-left: 14px;
  border-left: 3px solid var(--accent-soft-strong);
}

.info-article-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* -------------------------------------------------- artikel lainnya */

.info-related-block {
  max-width: 760px;
  margin: 32px auto 0;
}

.info-related-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

@media (min-width: 720px) {
  .info-related-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.info-related {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  transition: box-shadow 0.15s;
}
.info-related:hover {
  box-shadow: var(--shadow-sm);
}

.info-related-thumb {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--surface-2);
}
.info-related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.info-related-thumb .info-cover-fallback {
  font-size: 15px;
}

.info-related-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 3px;
}

/* Tombol masuk lewat Telegram */
.tg-button,
.google-button {
  border-color: var(--border-strong);
}
.tg-button:hover:not(:disabled),
.google-button:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}
/* Logo "G" Google tetap berwarna asli di mode gelap maupun terang. */
.google-g {
  flex-shrink: 0;
}
.tg-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  font-size: 11.5px;
  color: var(--ink-4);
}
.tg-divider::before,
.tg-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Ajakan "Hubungkan Telegram untuk kabar pesanan" (checkout & pesanan) */
.page > .tg-nudge {
  margin-top: 12px;
}
.tg-nudge {
  border-color: var(--accent-border);
}

/* Ajakan "Simpan pesananmu ke akun" untuk pembeli tanpa daftar */
.guest-save {
  border-color: var(--accent-border);
}
.guest-save-icon {
  color: var(--blue);
  flex-shrink: 0;
  margin-top: 1px;
}
.tg-nudge-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.tg-nudge-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.tg-nudge-title {
  font-size: 14px;
  line-height: 1.35;
}
.tg-nudge-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  margin: -6px -6px 0 0;
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.tg-nudge-close:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* ===================================================================
   Bukti sosial, harga grosir, kode promo, ulasan
   =================================================================== */

:root { --star: #f59e0b; }
:root[data-theme="dark"] { --star: #fbbf24; }

/* "120 terjual" di katalog & halaman produk (ulasan hanya di checkout). */
.social-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-2);
}
.social-line.compact { font-size: 12px; margin-top: 2px; margin-bottom: 4px; }

/* Bintang: yang "mati" tetap tampil, redup. */
.stars { color: var(--star); letter-spacing: 1px; font-size: 13px; white-space: nowrap; }
.stars-off { color: var(--border-strong); }

/* Tabel harga grosir di halaman produk. */
.tier-table {
  margin: -4px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.tier-title { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.tier-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 8px;
  margin: 0 -8px;
  border-radius: var(--r-xs);
  font-size: 13px;
  color: var(--ink-2);
}
.tier-row.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.tier-row .muted { font-weight: 400; font-size: 12px; }

/* Ulasan pembeli di checkout, dikelompokkan per produk di keranjang. */
.review-group + .review-group { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.rating-summary { display: flex; align-items: center; gap: 8px; }
.rating-big { font-family: var(--font-price); font-size: 18px; font-weight: 800; color: var(--ink); }
.review-list { display: flex; flex-direction: column; gap: 10px; }
.review-item {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.review-item:first-child { border-top: 0; padding-top: 0; }
.review-item p { color: var(--ink-2); white-space: pre-line; }
.mt-4 { margin-top: 4px; }

/* Kode promo di checkout. */
.promo-form { display: flex; gap: 8px; }
.promo-form .input { flex: 1; min-width: 0; text-transform: uppercase; }
/* Kode diketik kapital & monospace, tapi petunjuknya tetap teks biasa. */
.promo-form .input::placeholder { text-transform: none; font-family: var(--font); letter-spacing: 0; }
.promo-applied {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--accent-border);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
}

/* Form ulasan di detail pesanan. */
.review-form { padding: 12px 0; border-top: 1px solid var(--border); }
.review-form:first-of-type { border-top: 0; padding-top: 0; }
.star-picker { display: flex; gap: 2px; margin: 6px 0 8px; }
.star-btn {
  border: 0;
  background: none;
  padding: 2px 3px;
  font-size: 26px;
  line-height: 1;
  color: var(--border-strong);
  cursor: pointer;
  transition: color .12s, transform .12s;
}
.star-btn.is-on { color: var(--star); }
.star-btn:hover { transform: scale(1.12); }
.star-btn:focus-visible { outline-offset: 1px; border-radius: var(--r-xs); }
