/* ============================================
   Checkout Panel — Stripe Buy Button Integration
   ============================================ */

/* Full-screen overlay */
.checkout-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 12, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.checkout-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Card */
.checkout-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 460px;
  margin: 1rem;
  padding: 0.75rem 1.25rem 0.75rem;
  box-shadow: 0 32px 80px rgba(0,0,0,0.28), 0 0 0 1px rgba(0,0,0,0.04);
  position: relative;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s ease;
}
.checkout-overlay.open .checkout-card {
  transform: translateY(0) scale(1);
}

/* Close button */
.checkout-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f3f3;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}
.checkout-close:hover {
  background: #e8e8e8;
  color: #111;
}

/* Badge */
.checkout-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFF3EC;
  color: #DD5100;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 1rem;
  border: 1px solid rgba(221,81,0,0.18);
}
.checkout-badge svg {
  flex-shrink: 0;
}

/* Headline */
.checkout-headline {
  font-size: 1.4rem;
  font-weight: 800;
  color: #111;
  line-height: 1.2;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

/* Price */
.checkout-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 1.5rem;
}
.checkout-price-amount {
  font-size: 2.5rem;
  font-weight: 800;
  color: #111;
  line-height: 1;
  letter-spacing: -0.03em;
}
.checkout-price-per {
  font-size: 0.9rem;
  color: #888;
  font-weight: 500;
}
.checkout-price-cancel {
  font-size: 0.75rem;
  color: #aaa;
  margin-left: auto;
  align-self: center;
}

/* Divider */
.checkout-divider {
  border: none;
  border-top: 1px solid #f0f0f0;
  margin: 0 0 1.25rem;
}

/* Feature list */
.checkout-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  gap: 0.55rem;
}
.checkout-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: #333;
  font-weight: 500;
}
.checkout-check {
  width: 18px;
  height: 18px;
  background: #F0FAF4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #22a55b;
}
.checkout-check svg {
  width: 10px;
  height: 10px;
  stroke-width: 3;
}

/* Stripe buy button wrapper */
.checkout-stripe-wrap {
  zoom: 0.82;
  margin-bottom: 0;
}
/* Override Stripe buy button to fill width */
stripe-buy-button {
  display: block;
  width: 100%;
}

/* Trust footer */
.checkout-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #aaa;
  margin-top: 0.25rem;
}
.checkout-trust svg {
  color: #aaa;
  flex-shrink: 0;
}

/* Loading / error states inside embedded checkout container */
.checkout-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 0;
  font-size: 0.875rem;
  color: #999;
}
/* Larger loader for standalone loading states (not inline in buttons) */
.checkout-loader-lg {
  width: 40px;
  height: 40px;
}
.checkout-error {
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.875rem;
  color: #dc3545;
}

/* Temporary: instrument-paper.css !important override (remove when SP-133 lands) */
.checkout-card { border-radius: 16px !important; box-shadow: 0 32px 80px rgba(0,0,0,0.28), 0 0 0 1px rgba(0,0,0,0.04) !important; transition: transform 0.22s ease !important; }
.checkout-close { border-radius: 50% !important; transition: background 0.12s, color 0.12s !important; }
.checkout-badge { border-radius: 20px !important; }

/* Mobile */
@media (max-width: 500px) {
  .checkout-card {
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 20px 20px 0 0;
    margin: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
  }
  .checkout-overlay {
    align-items: flex-end;
  }
  .checkout-card {
    transform: translateY(100%);
  }
  .checkout-overlay.open .checkout-card {
    transform: translateY(0);
  }
}

