/**
 * LearnDash Stripe Autopilot — Checkout Styles
 *
 * Minimal styles for the Embedded Checkout container.
 * Stripe handles all styling inside its iframe.
 * We only style the wrapper, loading state, guarantee badge, and error state.
 */

/* Checkout wrapper — fills available width, centers on wide screens */
.ldsa-checkout-wrap {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Ensure parent Kadence column gives us full width */
.wp-block-kadence-column .ldsa-checkout-wrap,
.kt-inside-inner-col .ldsa-checkout-wrap {
  width: 100%;
  max-width: 100%;
}

/* Stripe iframe mount point */
.ldsa-checkout-mount {
  min-height: 350px;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

/* Make sure the Stripe iframe takes full width */
.ldsa-checkout-mount iframe {
  width: 100% !important;
}

/* Loading state */
.ldsa-checkout-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 350px;
  color: #6b7280;
  font-size: 14px;
  gap: 16px;
}

.ldsa-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: ldsa-spin 0.7s linear infinite;
}

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

/* Error state */
.ldsa-checkout-error {
  padding: 24px;
  text-align: center;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 14px;
}

.ldsa-checkout-error p {
  margin: 0;
}

/* Guarantee badge */
.ldsa-guarantee {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 16px;
  font-size: 13px;
  color: #6b7280;
  background: #f9fafb;
  border-radius: 8px;
}

.ldsa-guarantee svg {
  flex-shrink: 0;
  color: #10b981;
}

/* Responsive: mobile */
@media (max-width: 639px) {
  .ldsa-checkout-mount {
    border-radius: 8px;
  }
}

/* Tier pills — used when the page hosts multiple price tiers and lets
 * the user switch between them in-place above the embedded checkout. */
.ldsa-tier-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 24px;
  max-width: 800px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ldsa-tier-pill {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 18px;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.ldsa-tier-pill:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.ldsa-tier-pill.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1e3a8a;
}

.ldsa-tier-pill .ldsa-tier-price {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.ldsa-tier-pill.is-active .ldsa-tier-price {
  color: #1d4ed8;
}

.ldsa-tier-pill .ldsa-tier-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  background: #2563eb;
  color: #ffffff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 639px) {
  .ldsa-tier-pills {
    flex-direction: column;
    gap: 8px;
  }
  .ldsa-tier-pill {
    flex-direction: row;
    justify-content: space-between;
    padding: 12px 16px;
  }
  .ldsa-tier-pill .ldsa-tier-price {
    font-size: 16px;
  }
}
