/* ── Whop Payment Gateway ── */

/* Hide billing address section when user already has a saved address */
body.whop-has-billing-address #cfw-customer-info-address {
  display: none !important;
}

/* Make the payment box blend seamlessly */
.payment_method_whop .payment_box,
.cfw-payment-method-information-whop,
#payment .payment_methods li.payment_method_whop .payment_box {
  background: #fff !important;
}

.payment_method_whop .payment_box::before,
.payment_method_whop .payment_box::after {
  display: none !important;
}

/* Whop embed container — remove extra spacing around the iframe */
.whop-embed-container {
  margin: 0;
}

/* Kill the min-height the embed sets so there is no blank space */
.whop-embed-container #whop-embed-inner {
  min-height: 0 !important;
}

/* Loading spinner */
.whop-embed-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 20px;
  color: #999;
  font-size: 14px;
}

.whop-embed-loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid #e2e2e2;
  border-top-color: #666;
  border-radius: 50%;
  animation: whop-spin 0.6s linear infinite;
}

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

/* ── Saved Cards ── */

.whop-saved-cards {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.whop-saved-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid #e2e2e2;
  border-radius: 10px;
  margin: 0;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background-color 0.15s,
    box-shadow 0.15s;
  background: #fff;
}

.whop-saved-card:hover {
  border-color: #c0c0c0;
  background-color: #fafafa;
}

.whop-saved-card--selected {
  border-color: #000;
  background-color: #fafafa;
  box-shadow: 0 0 0 1px #000;
}

.whop-saved-card input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-radius: 50%;
  flex-shrink: 0;
  margin: 0;
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s;
}

.whop-saved-card input[type="radio"]:checked {
  border-color: #000;
}

.whop-saved-card input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  background: #000;
  border-radius: 50%;
}

.whop-saved-card__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.whop-saved-card__icon svg {
  display: block;
  border-radius: 4px;
}

.whop-saved-card__details {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.4;
}

.whop-saved-card__brand {
  font-weight: 600;
  color: #1a1a1a;
}

.whop-saved-card__number {
  color: #666;
  letter-spacing: 0.5px;
}

.whop-saved-card__expiry {
  flex-shrink: 0;
  font-size: 13px;
  color: #999;
}

/* ── Alt gateway embed containers (Klarna, Scalapay, PayPal) ── */

.payment_method_whop_klarna .payment_box,
.payment_method_whop_scalapay .payment_box,
.payment_method_whop_paypal .payment_box,
.cfw-payment-method-information-whop_klarna,
.cfw-payment-method-information-whop_scalapay,
.cfw-payment-method-information-whop_paypal,
#payment .payment_methods li[class*="payment_method_whop_"] .payment_box {
  background: #fff !important;
}

.payment_method_whop_klarna .payment_box::before,
.payment_method_whop_klarna .payment_box::after,
.payment_method_whop_scalapay .payment_box::before,
.payment_method_whop_scalapay .payment_box::after,
.payment_method_whop_paypal .payment_box::before,
.payment_method_whop_paypal .payment_box::after {
  display: none !important;
}

[id$="-embed-inner"] {
  min-height: 0 !important;
}

/* ── PayPal validation overlay ── */
/* Blocks the PayPal button until the checkout form is valid.
   Form validity is monitored in real-time — once all required fields
   are filled and terms are accepted, the overlay disappears and the
   user can click the PayPal button directly (single click). */

.whop-paypal-validation-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  cursor: not-allowed;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.whop-paypal-validation-overlay--valid {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
