/* ========== CHECKOUT PAGE STYLES ========== */

.checkout-page {
  padding: 120px 24px 60px;
  min-height: 100vh;
}
.checkout-container {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: start;
}

/* Order Summary (Left) */
.checkout-summary {
  background: #fff;
  border: 1px solid var(--border, #E8DDD4);
  border-radius: var(--radius-lg, 20px);
  padding: 32px;
  position: sticky;
  top: 100px;
}
.checkout-summary-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary, #2C2420);
  margin-bottom: 24px;
}
.checkout-product {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border, #E8DDD4);
  margin-bottom: 20px;
}
.checkout-product-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 12px;
  flex-shrink: 0;
}
.checkout-product-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0 0 4px;
}
.checkout-product-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary, #5E8E62);
  margin: 0;
}
.checkout-line-items {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.checkout-line-items li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.95rem;
  color: var(--text-secondary, #6B5D52);
}
.checkout-line-items li:last-child {
  border-top: 1px solid var(--border, #E8DDD4);
  padding-top: 16px;
  margin-top: 8px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
}
.checkout-trust {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border, #E8DDD4);
}
.checkout-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.checkout-trust-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Checkout Form (Right) */
.checkout-form {
  background: #fff;
  border: 1px solid var(--border, #E8DDD4);
  border-radius: var(--radius-lg, 20px);
  padding: 36px;
}
.checkout-section-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted, #A09080);
  margin-bottom: 16px;
  margin-top: 28px;
}
.checkout-section-title:first-child {
  margin-top: 0;
}
.checkout-field {
  margin-bottom: 16px;
}
.checkout-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.checkout-field input,
.checkout-field select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border, #E8DDD4);
  border-radius: var(--radius, 12px);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background: var(--bg-dark, #FDF8F4);
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}
.checkout-field input:focus,
.checkout-field select:focus {
  border-color: var(--primary, #5E8E62);
  box-shadow: 0 0 0 3px rgba(94, 142, 98, 0.1);
}
.checkout-field input::placeholder {
  color: var(--text-muted, #A09080);
}
.checkout-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.checkout-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

/* Stripe Element Container */
#payment-element {
  padding: 12px 0;
  min-height: 80px;
}

/* Submit */
.checkout-submit {
  width: 100%;
  padding: 16px 24px;
  margin-top: 24px;
  border: none;
  border-radius: var(--radius, 12px);
  background: linear-gradient(135deg, var(--primary, #5E8E62), #4a7a50);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(94, 142, 98, 0.3);
}
.checkout-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(94, 142, 98, 0.4);
}
.checkout-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.checkout-secure-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* Error */
.checkout-error {
  background: #fff5f5;
  border: 1px solid var(--rose, #D4727A);
  border-radius: var(--radius, 12px);
  padding: 12px 16px;
  color: #c0392b;
  font-size: 0.9rem;
  margin-top: 16px;
  display: none;
}
.checkout-error.visible {
  display: block;
}

/* Loading Overlay */
.checkout-loading {
  position: fixed;
  inset: 0;
  background: rgba(253, 248, 244, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.checkout-loading.visible {
  opacity: 1;
  pointer-events: auto;
}
.checkout-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border, #E8DDD4);
  border-top-color: var(--primary, #5E8E62);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.checkout-loading-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Checkout Upsells */
.checkout-upsell {
  border: 2px dashed var(--sage, #5E8E62);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
  background: rgba(94,142,98,0.04);
}
.checkout-upsell-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.checkout-upsell-badge {
  background: var(--rose, #D4727A);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.checkout-upsell-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #2C2420);
  margin: 0;
}
.checkout-upsell-desc {
  font-size: 0.85rem;
  color: var(--text-secondary, #6B5E52);
  margin-bottom: 12px;
  line-height: 1.5;
}
.checkout-upsell-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checkout-upsell-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border, #E8DDD2);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.checkout-upsell-option:hover {
  border-color: var(--sage, #5E8E62);
}
.checkout-upsell-option:has(input:checked) {
  border-color: var(--sage, #5E8E62);
  background: rgba(94,142,98,0.06);
}
.checkout-upsell-option input[type="radio"] {
  accent-color: var(--sage, #5E8E62);
}
.checkout-upsell-option-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
  font-size: 0.9rem;
}
.checkout-upsell-price s {
  color: var(--text-muted, #A89888);
  margin-right: 6px;
}
.checkout-upsell-price strong {
  color: var(--sage, #5E8E62);
}
.checkout-upsell-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border, #E8DDD2);
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text-primary, #2C2420);
  cursor: pointer;
}
.checkout-upsell-savings {
  margin-top: 12px;
  padding: 12px;
  background: rgba(94,142,98,0.06);
  border-radius: 8px;
}
.savings-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 4px 0;
  color: var(--text-secondary, #6B5E52);
}
.savings-total {
  border-top: 1px solid var(--border, #E8DDD2);
  padding-top: 8px;
  margin-top: 4px;
  font-weight: 700;
  color: var(--text-primary, #2C2420);
}
.savings-highlight {
  color: var(--sage, #5E8E62);
  font-weight: 700;
  font-size: 0.95rem;
}
.savings-ivf {
  border-top: 1px dashed var(--border, #E8DDD2);
  padding-top: 8px;
  margin-top: 4px;
}
.savings-ivf-amount {
  color: var(--rose, #D4727A);
  font-weight: 800;
}

/* Responsive */
@media (max-width: 768px) {
  .checkout-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .checkout-summary {
    position: static;
  }
  .checkout-form {
    padding: 24px;
  }
  .checkout-row-3 {
    grid-template-columns: 1fr;
  }
}

/* Upsell thumbnails */
.checkout-upsell-thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}
.checkout-upsell-detail {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary, #6B5E52);
  margin: 2px 0 4px;
  line-height: 1.3;
}
.checkout-upsell-link {
  font-size: 0.75rem;
  color: var(--sage, #5E8E62);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin-top: 4px;
}
.checkout-upsell-link:hover {
  text-decoration: underline;
}

/* Bundle contents preview */
.checkout-bundle-details {
  margin-top: 12px;
  padding: 12px;
  background: rgba(94,142,98,0.04);
  border-radius: 8px;
}
.checkout-bundle-contents {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 8px;
}
.bundle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.bundle-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
}
.bundle-item span {
  font-size: 0.65rem;
  color: var(--text-secondary, #6B5E52);
  font-weight: 600;
  text-align: center;
}
.bundle-item-qty {
  position: relative;
}
.bundle-item-qty img:nth-child(2) {
  margin-left: -16px;
  opacity: 0.85;
}
