/* ========== Reset & Base ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f7fa;
  color: #1a1a2e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ========== Layout ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ========== Header ========== */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px 0;
  text-align: center;
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.5px;
}

.logo a {
  color: white;
}

.tagline {
  margin-top: 4px;
  opacity: 0.85;
  font-size: 0.95rem;
}

/* ========== Main ========== */
.main {
  flex: 1;
  padding: 48px 0;
}

/* ========== Footer ========== */
.footer {
  background: #1a1a2e;
  color: rgba(255, 255, 255, 0.6);
  padding: 24px 0;
  text-align: center;
  font-size: 0.85rem;
}

/* ========== Hero ========== */
.hero {
  text-align: center;
  margin-bottom: 48px;
}

.hero h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.hero p {
  color: #6b7280;
  font-size: 1.1rem;
}

/* ========== Loading ========== */
.loading {
  text-align: center;
  padding: 80px 0;
  color: #6b7280;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

/* ========== Error ========== */
.error-message {
  text-align: center;
  padding: 60px 0;
  color: #ef4444;
}

.error-message .btn {
  margin-top: 16px;
}

/* ========== Products Grid ========== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 8px 32px rgba(0, 0, 0, 0.08);
}

.product-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-image .placeholder-icon {
  font-size: 3rem;
  opacity: 0.3;
}

.product-info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.product-description {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 20px;
  flex: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
}

/* ========== Buttons ========== */
.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ========== Result Page ========== */
.result-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.result-card {
  background: white;
  border-radius: 20px;
  padding: 48px;
  text-align: center;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 2.5rem;
}

.icon-circle.success {
  background: #ecfdf5;
  color: #10b981;
}

.icon-circle.cancel {
  background: #fef2f2;
  color: #ef4444;
}

.result-card h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #1a1a2e;
}

.result-card p {
  color: #6b7280;
  margin-bottom: 8px;
  line-height: 1.5;
}

.order-info {
  font-size: 0.85rem;
  color: #9ca3af;
  word-break: break-all;
  margin-top: 16px;
  margin-bottom: 24px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}

.order-detail {
  margin-top: 20px;
  text-align: left;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
}

.order-detail p {
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: #374151;
}

.order-detail .label {
  color: #9ca3af;
  font-size: 0.8rem;
}

.result-card .btn {
  margin-top: 24px;
  padding: 12px 32px;
  font-size: 1rem;
}

/* ========== Responsive ========== */
@media (max-width: 640px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .hero h2 {
    font-size: 1.5rem;
  }

  .result-card {
    padding: 32px 24px;
  }
}
