:root {
  /* Warna Tema PUBG Combat & Electric Lightning */
  --bg-dark: #080d1a;
  --card-bg: rgba(10, 20, 38, 0.75); /* Frosted Glass Gelap */
  --card-border: rgba(0, 210, 255, 0.35); /* Electric Blue Border */
  --header-gradient: linear-gradient(135deg, rgba(0, 102, 204, 0.85) 0%, rgba(15, 23, 42, 0.9) 100%);
  
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --electric-blue: #00d2ff;
  --electric-glow: rgba(0, 210, 255, 0.5);
  
  --btn-blue: linear-gradient(135deg, #0088ff 0%, #0044ff 100%);
  --btn-blue-hover: linear-gradient(135deg, #0066cc 0%, #0022cc 100%);
  --success: #00ff88;
  --danger: #ff0055;
}

* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* Canvas Animasi Hujan / Kilat Electric di Latar Belakang */
#rain-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

body {
  /* Tetapkan gambar PUBG sebagai latar belakang */
  background: url('bg.jpg') no-repeat center center fixed;
  background-size: cover;
  color: var(--text-main);
  margin: 0;
  padding: 16px 12px;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Overlay gelap separa lutsinar supaya teks & kad mudah dibaca atas gambar PUBG */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 13, 26, 0.45);
  z-index: 0;
}

.container {
  max-width: 440px;
  width: 100%;
  margin: auto;
  position: relative;
  z-index: 1; /* Supaya kandungan kad duduk di atas latar belakang */
}

/* 1. Header Terapung (Floating Tactical Header) */
@keyframes floatHeader {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}

.header {
  text-align: center;
  margin-bottom: 20px;
  background: var(--header-gradient);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 22px 16px;
  border-radius: 22px;
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px var(--electric-glow);
  position: relative;
  overflow: hidden;
  animation: floatHeader 4s ease-in-out infinite;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 10px var(--electric-glow);
}

.header p {
  margin: 6px 0 0 0;
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* 2. Butang Muzik Cahaya Berdenyut (Pulse Glow) */
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(0, 210, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 210, 255, 0); }
}

.music-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 210, 255, 0.2);
  border: 1px solid rgba(0, 210, 255, 0.4);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 18px;
  backdrop-filter: blur(8px);
  touch-action: manipulation;
  transition: all 0.2s ease;
  animation: pulseGlow 2s infinite;
}

.music-btn:active {
  transform: scale(0.9);
}

/* Product List Section */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 3. Animasi Kad Barang Masuk Dari Bawah */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.4s ease-out forwards;
  transition: transform 0.2s, border-color 0.2s;
}

.product-card:hover {
  border-color: var(--electric-blue);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 12px var(--electric-glow);
}

.product-info h4 {
  margin: 0 0 4px 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* 4. Animasi Harga Barang Berdenyut (Electric Price Pulse) */
@keyframes pricePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.product-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--electric-blue);
  text-shadow: 0 0 10px var(--electric-glow);
  display: inline-block;
  animation: pricePulse 3s ease-in-out infinite;
}

.stock-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
  display: inline-block;
}

.badge-out {
  color: var(--danger);
  font-weight: 800;
  text-transform: uppercase;
}

/* Quantity Controls Tactical Style */
.qty-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(8, 13, 26, 0.7);
  padding: 6px 8px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
}

.btn-qty {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 210, 255, 0.4);
  background: var(--btn-blue);
  color: #ffffff;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(0, 136, 255, 0.4);
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.btn-qty:active {
  transform: scale(0.9);
}

.btn-qty:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  box-shadow: none;
  background: #334155;
  border-color: transparent;
}

.qty-val {
  font-weight: 800;
  width: 24px;
  text-align: center;
  font-size: 16px;
  color: #ffffff;
}

/* Checkout Box */
.checkout-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 20px;
  margin-top: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--card-border);
}

.total-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.total-title {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.total-amount {
  font-size: 24px;
  font-weight: 900;
  color: var(--success);
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 12px;
  color: var(--electric-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(8, 13, 26, 0.85);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  font-size: 16px; /* Mencegah auto-zoom iOS Safari */
  color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
}

.form-group input:focus {
  border-color: var(--electric-blue);
  box-shadow: 0 0 15px var(--electric-glow);
}

/* 5. Animasi Silauan Cahaya Pada Butang Bayar (Shimmer Shine) */
@keyframes shineBtn {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.btn-pay {
  width: 100%;
  padding: 16px;
  background: linear-gradient(90deg, #0088ff 0%, #00d2ff 50%, #0044ff 100%);
  background-size: 200% 100%;
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 16px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 136, 255, 0.5);
  touch-action: manipulation;
  animation: shineBtn 3.5s infinite linear;
  transition: all 0.2s ease;
}

.btn-pay:active {
  transform: scale(0.98);
}

/* Modal Window */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 13, 26, 0.85);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  z-index: 99;
  padding: 15px;
}

.modal-content {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--electric-blue);
  padding: 24px;
  border-radius: 28px;
  max-width: 350px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 25px var(--electric-glow);
}

.qr-container {
  background: #ffffff;
  padding: 12px;
  border-radius: 16px;
  display: inline-block;
  margin: 14px 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.qr-img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border-radius: 8px;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  margin-top: 14px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-close:hover {
  color: #ffffff;
}