* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  background: #1a1a2e;
  color: #fff;
  padding: 20px 0;
  text-align: center;
}

header h1 {
  font-size: 1.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

header .tagline {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-top: 4px;
}

/* Product Card */
.product-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
  margin: 30px auto;
  max-width: 500px;
}

.product-image {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 280px;
}

.product-image img, .product-image svg {
  max-height: 200px;
}

.product-info {
  padding: 24px;
}

.product-info h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.product-info .description {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.product-info .price {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a2e;
}

/* Quantity & Buttons */
.order-controls {
  padding: 0 24px 24px;
}

.quantity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.quantity-row label {
  font-weight: 600;
}

.quantity-row select {
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

.total-row {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a2e;
}

.buttons {
  display: flex;
  gap: 12px;
}

.btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: #1a1a2e;
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: #16213e; }

.btn-secondary {
  background: #e0e0e0;
  color: #333;
}
.btn-secondary:hover:not(:disabled) { background: #d0d0d0; }

/* Checkout Page */
.checkout-container {
  text-align: center;
  padding: 40px 20px;
}

.checkout-container h2 {
  margin-bottom: 16px;
}

.loading-msg {
  color: #666;
  margin-bottom: 20px;
}

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #ddd;
  border-top-color: #1a1a2e;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

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

.hpp-iframe {
  width: 100%;
  max-width: 600px;
  height: 600px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
}

/* Return Page */
.result-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 40px;
  margin: 30px auto;
  max-width: 500px;
  text-align: center;
}

.result-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.result-card h2 {
  margin-bottom: 12px;
}

.result-card .details {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.status-success { color: #2e7d32; }
.status-fail { color: #c62828; }
.status-pending { color: #f57c00; }

.back-link {
  display: inline-block;
  color: #1a1a2e;
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* Error */
.error-msg {
  background: #ffebee;
  color: #c62828;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
  display: none;
}

@media (max-width: 600px) {
  .buttons { flex-direction: column; }
  .product-image { min-height: 200px; padding: 24px; }
}
