/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1B5E4A;
  --primary-light: #e8f5e9;
  --accent-salmon: #e8655a;
  --accent-purple: #7c3aed;
  --text-main: #1a1a1a;
  --text-muted: #6b7280;
  --bg-page: #f3f4f6;
  --bg-white: #ffffff;
  --border: #e5e7eb;
  --radius-card: 12px;
  --radius-pill: 9999px;
  --font: 'Poppins', system-ui, -apple-system, sans-serif;
  --app-w: 448px;
  --app-h: 100dvh;
}

body {
  font-family: var(--font);
  background: #c9cdd4;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 100dvh;
  overflow: hidden;
}

/* ===== APP SHELL ===== */
#app-shell {
  width: min(var(--app-w), 100vw);
  height: var(--app-h);
  background: var(--bg-page);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
}

/* ===== SCREEN LAYOUT ===== */
.screen-header {
  flex-shrink: 0;
  background: var(--bg-white);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.screen-body {
  flex: 1;
  min-height: 0;      /* cegah flex item tumbuh melebihi batas */
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 80px;
}

.screen-body::-webkit-scrollbar { width: 3px; }
.screen-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 99px; }

/* ===== HEADER ELEMENTS ===== */
.btn-back {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  color: var(--text-main);
  flex-shrink: 0;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  color: var(--text-main);
}

.header-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  color: var(--text-main);
}

.btn-bantuan {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font);
  white-space: nowrap;
}

.btn-dropdown-green {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 14px;
  flex-shrink: 0;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
  flex-shrink: 0;
  height: 64px;
  display: flex;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  border: none;
  background: none;
  padding: 0;
}

.bottom-nav-item.active { color: var(--primary); }

/* ===== FIXED BOTTOM ===== */
.fixed-bottom {
  flex-shrink: 0;
  padding: 12px 16px;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
}

.fixed-bottom-bar {
  flex-shrink: 0;
  padding: 10px 16px;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.fixed-bottom-bar .total-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

/* ===== BUTTONS ===== */
.btn-primary {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: opacity 0.15s;
}
.btn-primary:active { opacity: 0.85; }

.btn-secondary {
  width: 100%;
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
}
.btn-secondary:active { opacity: 0.85; }
.btn-secondary.added { background: var(--primary-light); }

.btn-outline {
  width: 100%;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: opacity 0.15s;
}
.btn-outline:active { opacity: 0.85; }

.dual-btns {
  display: flex;
  gap: 10px;
}
.dual-btns .btn-outline,
.dual-btns .btn-primary { flex: 1; }

/* ===== TOAST ===== */
#toast {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.82);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  z-index: 999;
  white-space: nowrap;
  pointer-events: none;
}

/* ===== MALL TOP HEADER (Screen 1) ===== */
.mall-top {
  flex-shrink: 0;
  background: var(--bg-white);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  background: #f3f4f6;
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  gap: 8px;
}

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

.mall-icons { display: flex; gap: 4px; align-items: center; }

.mall-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-main);
}

/* ===== TAGIHAN BANNER ===== */
.tagihan-banner {
  margin: 12px 16px 0;
  background: var(--bg-white);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.tagihan-banner:active { background: #f9fafb; }

.tagihan-icon {
  width: 40px;
  height: 40px;
  background: #e8f5e9;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tagihan-info { flex: 1; }
.tagihan-label { font-size: 14px; font-weight: 600; color: var(--text-main); }
.tagihan-date { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tagihan-date strong { color: var(--text-main); }

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.lihat-semua {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
}

/* ===== CATEGORIES ===== */
.categories-scroll {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 0 16px 12px;
  scrollbar-width: none;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.category-chip {
  flex-shrink: 0;
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.cat-icon {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.cat-icon.cat-request {
  background: #e8f5e9;
  border-color: #c8e6c9;
}
.cat-icon.cat-hp { background: linear-gradient(135deg, #1e293b, #0f172a); }
.cat-icon.cat-fashion { background: linear-gradient(135deg, #fce7f3, #ddd6fe); }
.cat-icon.cat-laptop { background: linear-gradient(135deg, #e0f2fe, #bae6fd); }

.cat-label {
  font-size: 10px;
  text-align: center;
  color: var(--text-main);
  font-weight: 500;
  line-height: 1.3;
}

/* ===== PRODUCT GRID ===== */
#product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 12px;
}

.product-card {
  background: var(--bg-white);
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.1s;
  border: 1px solid var(--border);
}
.product-card:active { transform: scale(0.97); }

.product-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%;
}

.product-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  overflow: hidden;
}

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

.badge-preorder {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent-salmon);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
}

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

.product-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.product-cicilan {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.product-badges { display: flex; gap: 4px; flex-wrap: wrap; }

.badge-pasti-ori {
  font-size: 9px;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 1px 5px;
}

.badge-bergaransi {
  font-size: 9px;
  color: #3b82f6;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  padding: 1px 5px;
}

/* ===== PRODUCT IMAGE COLORS ===== */
.img-color-1 { background: linear-gradient(135deg, #d4a574, #8b5e3c); }
.img-color-2 { background: linear-gradient(135deg, #9ca3af, #4b5563); }
.img-color-3 { background: linear-gradient(135deg, #fde68a, #d97706); }
.img-color-4 { background: linear-gradient(135deg, #ddd6fe, #7c3aed); }

/* ===== PRODUCT DETAIL (Screen 2) ===== */
.product-detail-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 85%;
  overflow: hidden;
  background: #f9fafb;
}

.product-detail-img {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 110px;
  overflow: hidden;
}

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

.detail-badge-preorder {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent-salmon);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
}

.fullscreen-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.5);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 14px;
  border: none;
}

.product-detail-info { padding: 16px; }

.detail-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.detail-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.cicilan-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  margin-bottom: 16px;
}

.cicilan-link .arrow { transition: transform 0.2s; display: inline-block; }
.cicilan-link.open .arrow { transform: rotate(180deg); }

.cicilan-dropdown {
  display: none;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.cicilan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.cicilan-table th {
  text-align: left;
  font-weight: 600;
  padding: 4px 6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.cicilan-table td {
  padding: 5px 6px;
  color: var(--text-main);
  border-bottom: 1px solid #f0f0f0;
}

.variant-section-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.color-group { margin-bottom: 10px; }

.size-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.size-btn {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  background: white;
  color: var(--text-main);
  font-family: var(--font);
  transition: all 0.1s;
  white-space: nowrap;
}
.size-btn:active { transform: scale(0.95); }
.size-btn.selected {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

/* ===== KONFIRMASI PESANAN (Screen 3) ===== */
.konfirmasi-body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.limit-card {
  background: var(--bg-white);
  border-radius: var(--radius-card);
  padding: 16px;
  border: 1px solid var(--border);
}
.limit-card-title { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.limit-card-row { display: flex; align-items: center; gap: 12px; }

.limit-funder-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #e0f2fe, #7dd3fc);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.limit-funder-name { font-size: 14px; font-weight: 600; color: var(--text-main); flex: 1; }
.limit-amount { font-size: 15px; font-weight: 700; color: var(--text-main); }

.info-note {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  color: #78716c;
  line-height: 1.5;
}

.card-section {
  background: var(--bg-white);
  border-radius: var(--radius-card);
  padding: 16px;
  border: 1px solid var(--border);
}

.delivery-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.delivery-option {
  flex: 1;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-muted);
  transition: all 0.15s;
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.delivery-option.selected {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.address-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.address-label { font-size: 12px; color: var(--text-muted); }

.btn-ganti {
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font);
}

.address-ktp-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.address-value { font-size: 14px; font-weight: 600; color: var(--text-main); margin-bottom: 4px; }
.address-phone { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

.produk-section {
  background: var(--bg-white);
  border-radius: var(--radius-card);
  padding: 16px;
  border: 1px solid var(--border);
}
.produk-section-title { font-size: 13px; font-weight: 700; color: var(--text-main); margin-bottom: 12px; }
.produk-row { display: flex; gap: 12px; align-items: flex-start; }

.produk-img-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  position: relative;
}

.produk-variant-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
  margin-top: 8px;
}

/* ===== PAYMENT / CICILAN (Screen 4) ===== */
.batas-card {
  background: var(--primary);
  color: white;
  border-radius: var(--radius-card);
  padding: 16px;
  margin: 12px 16px;
}
.batas-card-title { font-size: 11px; opacity: 0.8; margin-bottom: 6px; }
.batas-card-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; }
.batas-sisa { font-size: 22px; font-weight: 700; }
.batas-total-col { text-align: right; }
.batas-total-label { font-size: 10px; opacity: 0.8; }
.batas-total-value { font-size: 14px; font-weight: 600; }

.progress-track {
  background: rgba(255,255,255,0.25);
  border-radius: var(--radius-pill);
  height: 6px;
  margin-bottom: 6px;
  overflow: hidden;
}
.progress-fill {
  background: white;
  height: 100%;
  border-radius: var(--radius-pill);
  width: 15%;
}
.batas-terpakai { font-size: 11px; opacity: 0.8; }

.payment-tabs {
  display: flex;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}
.payment-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  font-family: var(--font);
  transition: all 0.15s;
}
.payment-tab.active {
  color: var(--accent-purple);
  border-bottom-color: var(--accent-purple);
}

.funder-bar {
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  margin: 8px 16px;
  border-radius: 8px;
}

.installment-list {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.installment-item {
  background: var(--bg-white);
  border-radius: var(--radius-card);
  padding: 14px;
  border: 1.5px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: border-color 0.15s;
}
.installment-item.checked-state { border-color: var(--accent-purple); }

.installment-check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--accent-purple);
  cursor: pointer;
}

.installment-info { flex: 1; }

.badge-belum-lunas {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #ef4444;
  margin-bottom: 4px;
}

.installment-product {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.installment-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  font-size: 11px;
}
.installment-meta-item { display: flex; flex-direction: column; gap: 1px; }
.installment-meta-label { font-size: 10px; color: var(--text-muted); }
.installment-meta-value { font-size: 12px; font-weight: 600; color: var(--text-main); }

.btn-bayar-sekarang {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  transition: opacity 0.15s;
}
.btn-bayar-sekarang:active { opacity: 0.85; }

/* ===== JAMINAN SECTION ===== */
.jaminan-card {
  margin: 0 16px 12px;
  background: #f0faf4;
  border: 1px solid #c3e6cb;
  border-radius: var(--radius-card);
  padding: 14px;
}

.jaminan-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.jaminan-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.jaminan-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.jaminan-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.jaminan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #9ca3af;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-main);
  background: white;
}

.jaminan-link {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
}

/* ===== SPESIFIKASI ===== */
.spek-card {
  margin: 0 16px 12px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
}

.spek-table { width: 100%; border-collapse: collapse; }
.spek-table tr { border-bottom: 1px solid var(--border); }
.spek-table tr:last-child { border-bottom: none; }
.spek-label {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
  width: 45%;
}
.spek-value {
  font-size: 12px;
  color: var(--text-main);
  padding: 8px 0;
}

/* ===== DESKRIPSI PRODUK ===== */
.desc-card {
  margin: 0 16px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
}

.desc-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
}

.desc-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.desc-link {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 10px;
  cursor: pointer;
}

/* ===== PAYMENT MODAL (iframe overlay) ===== */
.payment-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: white;
}

.payment-loading-overlay p {
  font-size: 13px;
  opacity: 0.9;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.payment-modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: white;
}

.payment-modal-header {
  flex-shrink: 0;
  background: var(--primary);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.payment-modal-header span {
  font-size: 15px;
  font-weight: 600;
}

.pm-close-btn {
  width: 30px;
  height: 30px;
  background: rgba(0,0,0,0.25);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.payment-modal-overlay iframe {
  flex: 1;
  width: 100%;
  border: none;
}

.payment-error-toast {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #dc2626;
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  z-index: 999;
  white-space: nowrap;
  pointer-events: none;
}

/* ===== UTILITY ===== */
.divider { height: 8px; background: var(--bg-page); flex-shrink: 0; }

/* ===== SPLASH SCREEN ===== */
#splash-screen {
  position: absolute;
  inset: 0;
  z-index: 9999;
  background: #fff;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

#splash-screen img {
  width: 60%;
  max-width: 240px;
  height: auto;
  object-fit: contain;
}

#splash-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ===== CART / CHECKOUT ===== */
.cart-edit-btn {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}

.cart-select-all {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
}

.cart-select-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.cart-item-count {
  font-size: 13px;
  color: var(--text-muted);
}

/* custom checkbox */
.cart-checkbox-wrap {
  position: relative;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}
.cart-checkbox-wrap input { position: absolute; opacity: 0; width: 0; height: 0; }
.cart-checkbox {
  position: absolute;
  inset: 0;
  border: 2px solid var(--border);
  border-radius: 5px;
  background: white;
  transition: all 0.15s;
}
.cart-checkbox-wrap input:checked ~ .cart-checkbox {
  background: var(--primary);
  border-color: var(--primary);
}
.cart-checkbox-wrap input:checked ~ .cart-checkbox::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* cart item row */
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

.cart-item-img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 6px;
}

.cart-variant-chip {
  display: inline-block;
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  margin-bottom: 8px;
}

.cart-item-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

/* qty control */
.cart-qty-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.qty-btn {
  width: 34px;
  height: 34px;
  background: white;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

.qty-val {
  min-width: 34px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

/* bottom bar */
.cart-bottom-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
}

.cart-total-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.cart-total-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}

.btn-checkout-main {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
}

/* empty state */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

/* add to cart button on product card */
.btn-add-cart {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-pill);
  background: white;
  padding: 4px 12px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
  margin-top: 4px;
  display: inline-block;
}
.btn-add-cart.added {
  background: var(--primary);
  color: white;
}

/* cart badge on header icon */
.mall-icon-btn { position: relative; }
.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-salmon);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}
