/* =========================
   RESET
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background: linear-gradient(180deg,#1260cc,#0a5fa8);
  color: #fff;
}

/* =========================
   HEADER / NAVBAR PAGE
   ========================= */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  height: 52px;
  background: #0274ff;

  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;

  z-index: 99999;          /* 🔥 PALING ATAS */
  pointer-events: auto;
}

/* =========================
   TOMBOL CLOSE (HEADER)
   ========================= */
.btn-close-page {
  background: rgba(255,255,255,0.2);
  border: none;

  padding: 6px 14px;
  border-radius: 14px;

  color: #fff;
  font-size: 14px;
  font-weight: 700;

  cursor: pointer;
  pointer-events: auto;
}

.btn-close-page:active {
  transform: scale(0.95);
}


.app-title {
  color: #fff;
  font-weight: 800;
  font-size: 16px;
}

/* =========================
   PAGE
   ========================= */
.page {
  padding: 16px;
  padding-top: 60px;       /* 🔥 BIAR GA KETUTUP HEADER */
  padding-bottom: 180px;
}

/* =========================
   FOTO PRODUK
   ========================= */
.product-image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 16px;
}

/* =========================
   INFO PRODUK
   ========================= */
.product-info h1 {
  font-size: 26px;
  font-weight: 800;
}

.product-info p {
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.6;
  opacity: .95;
}

/* =========================
   PAKET
   ========================= */
.paket {
  margin-top: 24px;
}

.paket h2 {
  font-size: 20px;
  margin-bottom: 14px;
}

.paket-item {
  background: #2771cc;
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 14px;
  cursor: pointer;
}

.paket-item.active {
  outline: 3px solid #38bdf8;
}

.paket-name {
  font-size: 20px;
  font-weight: 800;
}

.paket-price {
  font-size: 18px;
  margin-top: 6px;
}

/* =========================
   BUY BAR (DITURUNKAN Z-INDEX)
   ========================= */
.buy-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;

  background: #0b3c8a;
  padding: 16px;

  display: flex;
  flex-direction: column;
  gap: 12px;

  z-index: 100;           /* 🔥 PENTING */
  pointer-events: auto;
}

.buy-bar button {
  padding: 20px;
  font-size: 20px;
  font-weight: 800;
  border-radius: 18px;
  border: none;
  cursor: pointer;
}

.btn-buy {
  background: linear-gradient(135deg,#2563eb,#38bdf8);
  color: #fff;
}

.btn-stock {
  background: #e0f2fe;
  color: #0b3c8a;
}

/* =========================
   MODAL GLOBAL
   ========================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);

  display: none;
  align-items: center;
  justify-content: center;

  z-index: 99998;          /* 🔥 DI ATAS BUY BAR */
  pointer-events: auto;

  overflow-y: auto;
  padding: 20px 0;
}

.modal-box {
  background: #0b3c8a;
  width: 90%;
  max-width: 420px;
  padding: 24px;
  border-radius: 20px;
  text-align: center;

  max-height: 85vh;
  overflow-y: auto;

  pointer-events: auto;
}

/* =========================
   MODAL CONTENT
   ========================= */
.modal-box h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 14px;
}

.pay-amount {
  font-size: 16px;
  margin-bottom: 12px;
}

.qris-img {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  margin: 0 auto 16px;
  display: block;
}

.qris-desc {
  text-align: left;
  background: rgba(255,255,255,.08);
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 14px;
}

.qris-desc p {
  font-size: 14px;
  line-height: 1.5;
}

.input {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  border-radius: 14px;
  border: none;
  margin-bottom: 12px;
}

/* =========================
   MODAL ACTIONS
   ========================= */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-actions .btn-buy {
  background: linear-gradient(135deg,#22c55e,#16a34a);
  color: #fff;
}

.modal-actions .btn-close {
  background: #e0f2fe;
  color: #0b3c8a;
}

/* =========================
   RESULT BOX
   ========================= */
#resultBox {
  text-align: center;
}

/* =========================
   AMBIL PESANAN BUTTON (FIX TOTAL)
   ========================= */
#ambilPesananBtn {
  all: unset;
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 18px 0;

  text-align: center;
  font-size: 18px;
  font-weight: 800;

  border-radius: 16px;
  cursor: pointer;
  pointer-events: auto;

  background: linear-gradient(135deg,#22c55e,#16a34a);
  color: #fff;

  box-shadow: 0 10px 26px rgba(0,0,0,.35);
}

#ambilPesananBtn:active {
  transform: scale(0.97);
}

/* =========================
   DESKTOP
   ========================= */
@media (min-width: 768px) {
  .buy-bar {
    max-width: 520px;
    margin: 0 auto;
    border-radius: 18px 18px 0 0;
  }

  .product-image img {
    max-height: 320px;
    object-fit: contain;
    background: #0b3c8a;
  }
}
/* =========================
   FIX TOMBOL MODAL (QRIS)
   ========================= */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

/* tombol konfirmasi */
.modal-actions .btn-buy {
  width: 100%;
  height: 52px;

  background: linear-gradient(135deg,#22c55e,#16a34a);
  color: #fff;

  font-size: 16px;
  font-weight: 800;

  border: none;
  border-radius: 14px;

  cursor: pointer;
}

/* tombol tutup */
.modal-actions .btn-close {
  width: 100%;
  height: 48px;

  background: #e5f1ff;
  color: #0b3c8a;

  font-size: 15px;
  font-weight: 700;

  border: none;
  border-radius: 14px;

  cursor: pointer;
}

/* efek klik */
.modal-actions button:active {
  transform: scale(0.97);
}
.product-detail {
  margin-top: 20px;
  background: rgba(255,255,255,.08);
  padding: 16px;
  border-radius: 16px;
  line-height: 1.6;
}

.product-detail h3 {
  font-size: 16px;
  margin: 12px 0 6px;
  font-weight: 800;
}

.product-detail ul,
.product-detail ol {
  padding-left: 18px;
  font-size: 14px;
  opacity: .95;
}

.product-detail li {
  margin-bottom: 6px;
}
.page {
  padding: 16px;
  padding-bottom: 180px; /* ruang buat buy bar */
  overflow-y: auto;
}
/* =========================
   UPLOAD BUKTI TRANSFER
   ========================= */
.btn-upload {
  width: 100%;
  padding: 16px;
  margin-top: 6px;

  border-radius: 14px;
  border: 2px dashed #38bdf8;

  background: rgba(255,255,255,.1);
  color: #fff;

  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.upload-filename {
  margin-top: 6px;
  font-size: 13px;
  opacity: .85;
  text-align: center;
}
