/* ===== Variables ===== */
:root {
  --bg: #f8f7f5;
  --bg-alt: #f0eeeb;
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #2d5a3d;
  --accent-light: #e8f0eb;
  --accent-dark: #1e3d29;
  --gold: #d4a853;
  --border: #e5e2de;
  --white: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

/* ===== Base ===== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.25rem; margin-bottom: 1rem; }

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

/* ===== Layout ===== */
.checkout-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent);
}

.checkout-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* ===== Order Summary ===== */
.order-summary {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.product-card {
  display: flex;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.product-preview {
  width: 100px;
  height: 130px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  flex-shrink: 0;
}

.preview-header {
  height: 6px;
  background: linear-gradient(90deg, var(--accent) 40%, var(--gold) 40%);
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

.preview-title {
  font-size: 0.6rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.preview-items {
  display: grid;
  gap: 4px;
}

.preview-item {
  height: 8px;
  background: var(--border);
  border-radius: 2px;
}

.preview-item:nth-child(2) { width: 80%; }
.preview-item:nth-child(3) { width: 60%; }

.product-details h2 {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.product-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.product-includes {
  list-style: none;
}

.product-includes li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.product-includes svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* ===== Price Breakdown ===== */
.price-breakdown {
  margin-bottom: 1.5rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  font-size: 0.9375rem;
}

.price-row.total {
  border-top: 2px solid var(--text);
  font-weight: 600;
  font-size: 1.125rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
}

/* ===== Guarantee Box ===== */
.guarantee-box {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--accent-light);
  border-radius: var(--radius-md);
}

.guarantee-box svg {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.guarantee-box strong {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.guarantee-box p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

/* ===== Payment Section ===== */
.payment-section {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.payment-form {
  display: grid;
  gap: 1.25rem;
}

.form-group {
  display: grid;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
}

.form-group input {
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group input::placeholder {
  color: #aaa;
}

.helper-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-input-wrapper {
  position: relative;
}

.card-input-wrapper input {
  width: 100%;
  padding-right: 3.5rem;
}

.card-icons {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ===== Pay Button ===== */
.pay-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  margin-top: 0.5rem;
}

.pay-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.pay-button:active {
  transform: translateY(0);
}

/* ===== Security Note ===== */
.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
}

.security-note svg {
  color: var(--accent);
}

/* ===== Success Overlay ===== */
.success-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  place-items: center;
  padding: 1.5rem;
}

.success-overlay.active {
  display: grid;
}

.success-modal {
  background: var(--white);
  padding: 3rem;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.success-icon svg {
  color: var(--accent);
}

.success-modal h2 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.success-modal > p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--accent);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background 0.2s;
}

.download-button:hover {
  background: var(--accent-dark);
}

.email-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 1.25rem 0;
}

.back-home {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: underline;
}

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

  .order-summary {
    order: 1;
  }

  .payment-section {
    order: 0;
  }

  .product-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .product-includes {
    text-align: left;
    display: inline-block;
  }
}

@media (max-width: 480px) {
  .checkout-page {
    padding: 1rem;
  }

  .order-summary,
  .payment-section {
    padding: 1.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .success-modal {
    padding: 2rem;
  }
}
