/**
 * Custom Checkout Styles
 * 
 * Styles for the multi-step checkout form that wraps MemberPress.
 * This stylesheet controls all visual aspects of the custom checkout UI.
 * 
 * Sections:
 * - Base & Layout
 * - Mobile Product Header
 * - Step Indicator & Navigation
 * - Form Styles
 * - Payment Methods (PayPal, Bank Transfer)
 * - Sidebar & Price Summary
 * - Voucher/Coupon Section
 * - Modals & Popups
 * - Responsive Styles
 */

/* ========================================
   BASE & LAYOUT STYLES
   ======================================== */
body,
body.page {
  background-color: #f7f5f3;
}

/* OVERWRITE SITE PADDING & OVERFLOW (overflow: visible needed for sticky mobile header) */
.bb-grid {
  margin-left: 0px !important;
  margin-right: 0px !important;
}
.site-content,
.container {
  padding-left: 0px !important;
  padding-right: 0px !important;
}
.bb-grid-cell {
  padding: 0px !important;
}
.site-content,
.bb-grid,
.bb-grid-cell,
.entry-content,
#content,
.site {
  /* This is needed to allow the mobile product header to be sticky and not be cut off by overflow:hidden on parent containers */
  overflow: visible !important;
}
/* END OF OVERWRITE SITE PADDING & OVERFLOW */

.sa-custom-checkout {
  max-width: 960px;
  margin: 0 auto;
  padding: 72px 20px 50px;
}

.sa-checkout-layout {
  display: flex;
  gap: 46px;
  align-items: flex-start;
}

.sa-checkout-main {
  flex: 1;
  width: 100%;
}

.sa-checkout-sidebar {
  width: 378px;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* ========================================
   MOBILE PRODUCT HEADER (hidden on desktop, full styles in 900px query)
   ======================================== */
.sa-mobile-product-header {
  display: none;
}

.sa-price-currency {
  font-size: 12px;
  font-weight: 400;
  color: #888;
}

/* ========================================
   BACK LINK
   ======================================== */
.sa-back-link-wrapper {
  height: 22px;
}
.sa-back-link {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #555;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.sa-back-link:hover {
  color: #111;
}

.sa-back-chevron {
  width: 16px;
  height: 16px;
}

/* ========================================
   MOBILE PRICE SUMMARY
   ======================================== */
.sa-mobile-price-summary {
  display: none;
  /* Hidden by default, shown on mobile step 3 via JS (.sa-visible class) */
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 15px;
}

/* ========================================
   STEP INDICATOR
   ======================================== */
.sa-steps-indicator {
  display: grid;
  grid-template-columns: 28px minmax(44px, 1fr) 28px minmax(44px, 1fr) 28px;
  justify-content: start;
  align-items: start;
  gap: 0;
  margin: 0 0 48px;
  padding: 0px 12px;
}

.sa-step {
  text-align: center;
  position: relative;
  z-index: 1;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 26px;
  overflow: visible;
}

.sa-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #c6c6c8;
  color: #999;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.sa-step-check {
  display: none;
  width: 14px;
  height: 14px;
}

.sa-step.active .sa-step-number {
  border-color: #6d6d71;
}

.sa-step.active .sa-step-number:after {
  width: 8px;
  height: 8px;
  content: " ";
  background: #6d6d71;
  border-radius: 50%;
}

.sa-step.completed .sa-step-number {
  background: #6d6d71;
  border-color: #6d6d71;
  color: #fff;
}

.sa-step.completed .sa-step-check {
  display: block;
  color: #fff;
}

.sa-step-label {
  display: block;
  min-width: max-content;
  font-size: 13px;
  color: #76767b;
  font-weight: 500;
  line-height: 1.2;
}

.sa-step.active .sa-step-label {
  color: #303038;
  font-weight: 600;
}

.sa-step.completed .sa-step-label {
  color: #303038;
}

/* Step connectors */
.sa-step-connector {
  height: 2px;
  background: #c8c8cc;
  margin: 12px 13px 0px;
  transition: background 0.3s ease;
}

.sa-step.completed + .sa-step-connector {
  background: #6d6d71;
}

.sa-step-connector.sa-connector-completed {
  background: #6d6d71;
}

/* ========================================
   STEP CONTENT
   ======================================== */
.sa-checkout-step {
  animation: fadeIn 0.3s ease-in;
}

.sa-checkout-step.sa-step-hidden {
  visibility: hidden;
  position: absolute;
  height: 0;
  overflow: hidden;
  animation: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sa-step-title {
  font-size: 31px;
  font-weight: 700;
  color: #23232b;
  margin: 0 0 10px 0;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.sa-step-description {
  font-size: 14px;
  color: #767987;
  margin: 0 0 30px 0;
  line-height: 1.48;
}

/* ========================================
   FORM STYLES
   ======================================== */
.sa-form-row {
  margin-bottom: 17px;
}

.sa-form-row-group {
  display: flex;
  gap: 16px;
  margin-bottom: 17px;
}

.sa-form-row-group .sa-form-row {
  flex: 1;
  margin-bottom: 0;
}

.sa-form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #34343b;
  margin-bottom: 10px;
  line-height: 1.3;
}

.sa-optional {
  font-weight: 400;
  color: #888;
}

.sa-form-input,
.sa-form-select {
  width: 100%;
  padding: 0 14px;
  font-size: 16px;
  border: 1px solid #dddddf;
  border-radius: 7px;
  background: #fff;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
  height: 40px;
  line-height: 1.4;
  color: #25252b;
}

.sa-form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='%23666'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}

.sa-form-input:focus,
.sa-form-select:focus {
  outline: none;
  border-color: #23232b;
  box-shadow: 0 0 0 3px rgba(35, 35, 43, 0.05);
}

.sa-form-input::placeholder,
.sa-voucher-input::placeholder {
  color: #a6a8b2;
}

.sa-form-input.invalid,
.sa-form-select.invalid {
  border-color: #dc3545;
}

.sa-form-row.has-error .sa-form-label {
  color: #dc3545;
}

.sa-error {
  color: #dc3545;
  font-size: 13px;
  margin-top: 6px;
  display: block;
}

/* ========================================
   EMAIL SUGGESTION (mailcheck.js)
   ======================================== */
.sa-email-suggestion {
  font-size: 13px;
  margin-top: 6px;
  padding: 8px 12px;
  background: #f0f7ff;
  color: #0066cc;
  border-radius: 4px;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.sa-email-suggestion:hover,
.sa-email-suggestion:focus {
  background: #0066cc;
  color: #fff;
  outline: none;
}

/* ========================================
   VAT NUMBER FIELD WITH VALIDATE BUTTON
   ======================================== */
.sa-vat-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.sa-vat-input-wrapper .sa-form-input {
  flex: 1;
}

.sa-vat-validate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  background: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 90px;
}

.sa-vat-validate-btn:hover:not(:disabled) {
  background: #e8e8e8;
  border-color: #ccc;
}

.sa-vat-validate-btn:disabled {
  background: #f8f8f8;
  color: #999;
  cursor: not-allowed;
}

.sa-vat-validate-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #999;
  border-top-color: transparent;
  border-radius: 50%;
  animation: sa-spin 0.8s linear infinite;
}

.sa-vat-status {
  font-size: 13px;
  margin-top: 6px;
  display: block;
}

.sa-vat-status.sa-vat-valid {
  color: #198754;
}

.sa-vat-status.sa-vat-invalid {
  color: #dc3545;
}

.sa-vat-status.sa-vat-error {
  color: #fd7e14;
}

/* ========================================
   NAVIGATION BUTTONS
   ======================================== */
.sa-form-row.sa-navigation {
  margin-top: 28px;
}

.sa-next-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 46px;
  padding: 0 24px;
  background: #111;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.sa-next-button:hover {
  background: #1f1f24;
  transform: translateY(-1px);
}

.sa-arrow-icon {
  width: 18px;
  height: 18px;
}

/* ========================================
   TRUST INDICATORS
   ======================================== */
.sa-trust-indicators {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.sa-trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #888;
  margin-bottom: 0;
}

.sa-trust-item:last-child {
  margin-bottom: 0;
}

.sa-trust-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sa-trust-icon svg {
  width: 16px;
  height: 16px;
  color: #888;
}

/* Hide arrow on final submit button */
.sa-final-submit .sa-arrow-icon {
  display: none;
}

/* ========================================
   REVIEW STARS (inside sidebar)
   ======================================== */
.sa-review-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 6px;
  padding-top: 0;
}

/* Mobile review stars (outside the card, no border) */
.sa-mobile-review-stars {
  display: none;
}

.sa-mobile-review-stars .sa-review-stars {
  border-top: none;
  padding-top: 0;
  margin-top: 15px;
  justify-content: flex-start;
  margin-bottom: 37px;
}

.sa-review-score {
  font-size: 16px;
  font-weight: 700;
  color: #111;
}

.sa-stars {
  color: #f5a623;
  font-size: 16px;
  letter-spacing: 0.6px;
}

.sa-review-text {
  font-size: 12.5px;
  color: #8a8d98;
}

/* ========================================
   INVOICE ADDRESS TOGGLE
   ======================================== */
.sa-invoice-toggle {
  margin: 20px 0;
}

.sa-add-invoice-address {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #007bff;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.sa-add-invoice-address:hover {
  color: #0056b3;
}

.sa-toggle-icon {
  font-weight: bold;
}

.sa-add-invoice-address.sa-expanded {
  color: #666;
}

.sa-invoice-address-fields {
  margin-top: 20px;
  padding: 20px 16px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  animation: slideDown 0.3s ease-out;
}

/* Generic hidden class */
.sa-hidden {
  display: none !important;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   BILLING ADDRESS REQUIRED STATE
   (When user selects a different country than IP detected)
   ======================================== */

/* Required field indicator on labels */
.sa-invoice-address-fields .sa-field-required .sa-form-label::after {
  content: "*";
  color: #dc3545;
  margin-left: 4px;
}

/* Error state for inputs */
.sa-input-error {
  border-color: #dc3545 !important;
  background-color: #fff5f5 !important;
}

.sa-input-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
}

/* ========================================
   PAYPAL BUTTON
   ======================================== */
.sa-paypal-button-wrapper {
  margin-bottom: 24px;
}

#sa-paypal-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  background: #ffc439;
  color: #111;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sa-paypal-button:hover {
  background: #f0b72e;
}

.sa-paypal-button.sa-loading {
  background: #f0b72e;
  cursor: wait;
}

.sa-paypal-logo {
  height: 22px;
  width: auto;
}

.sa-payment-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: #888;
  font-size: 13px;
}

.sa-payment-divider::before,
.sa-payment-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e5e5;
}

.sa-payment-divider span {
  padding: 0 16px;
}

/* ========================================
   BANK TRANSFER OPTION
   ======================================== */
.sa-bank-transfer-option {
  margin: 16px 0px;
  padding: 8px 0px;
  border-top: 1px solid #f0f0f0;
}

.sa-bank-transfer-text {
  font-size: 13px;
  color: #888;
  text-align: center;
  margin: 0;
}

.sa-bank-transfer-text a {
  color: #666;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.sa-bank-transfer-text a:hover {
  color: #333;
}

/* ========================================
   BANK TRANSFER MODAL
   ======================================== */
.sa-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.sa-modal {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sa-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: all 0.2s ease;
}

.sa-modal-close:hover {
  background: #e0e0e0;
  color: #333;
}

.sa-modal-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: #111;
}

.sa-modal-content {
  font-size: 14px;
  line-height: 1.6;
  color: #444;
  margin-bottom: 16px;
}

.sa-modal-content p {
  margin: 0 0 12px 0;
}

.sa-modal-note {
  font-size: 13px;
  color: #888;
  margin: 0 0 24px 0;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
}

.sa-modal-button {
  width: 100%;
  padding: 14px 24px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sa-modal-button:hover {
  background: #333;
}

.sa-modal-button.sa-loading {
  background: #333;
  cursor: wait;
}

/* ========================================
   MEMBERPRESS FORM OVERRIDES
   ======================================== */
/* Hide MemberPress payment method radios - we use our own UI */
#mepr_signup_form .mepr-payment-methods-wrapper .mepr-payment-methods-radios,
#mepr_signup_form .mepr-payment-methods-wrapper > hr {
  display: none;
}

/* Hide MemberPress form rows (name, email, address fields, etc) - we use our own UI
   We need display:none to prevent MemberPress validation from running on these hidden fields */
#mepr_signup_form .mp-form-row,
#mepr_signup_form .have-coupon-link,
#mepr_signup_form .mepr-transaction-invoice-wrapper {
  display: none !important;
  /* opacity: 0.5;
  font-size: 8px;
  line-height: 1em; */
}

/* Keep payment method wrapper visible for Stripe/PayPal integration */
#mepr_signup_form .mepr-payment-methods-wrapper,
#mepr_signup_form .mepr-payment-method-desc-text {
  opacity: 1;
}

#mepr_signup_form .mepr-submit-button-row,
#mepr_signup_form .mepr-submit,
#mepr_signup_form .mepr-payment-methods-wrapper > legend,
#mepr_signup_form .mepr-payment-methods-icons,
#mepr_signup_form .mepr-payment-methods-wrapper + .mepr_spacer {
  display: none;
}

/* ========================================
   SIDEBAR — UNIFIED CARD
   ======================================== */
.sa-checkout-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sa-checkout-sidebar .sa-review-stars {
  justify-content: flex-start;
}

.sa-sidebar-card {
  background: #fff;
  border: 1px solid #e3e3e7;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.sa-product-card {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
}

.sa-product-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.sa-product-image img {
  width: 90px;
  height: 82px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
}

.sa-product-header-info {
  flex: 1;
}

.sa-product-title {
  font-size: 18px;
  font-weight: 600;
  color: #2a2a31;
  margin: 0 0 3px 0;
  line-height: 1.25;
}

.sa-product-subtitle {
  font-size: 13px;
  color: #7a7d88;
  margin: 0 0 10px 0;
  line-height: 1.35;
}

.sa-product-price {
  font-size: 15px;
  font-weight: 700;
  color: #222228;
  margin: 0;
}

.sa-product-features {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.sa-product-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #545862;
  margin-bottom: 12px;
  line-height: 1.35;
}

.sa-feature-icon {
  width: 16px;
  height: 16px;
  color: #7d8089;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ========================================
   PRICE SUMMARY
   ======================================== */
.sa-price-summary {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-top: 0;
  display: block;
  /* Always visible on desktop */
}

.sa-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.35;
}

.sa-price-label {
  color: #646874;
}

.sa-price-note {
  font-size: 12px;
  color: #9a9daa;
}

.sa-price-value {
  color: #23232b;
  font-weight: 600;
}

.sa-price-subtotal .sa-price-value,
.sa-price-discount .sa-price-value {
  color: #858996;
}

.sa-price-divider {
  border: none;
  border-top: 1px solid #ececf0;
  margin: 16px 0 18px;
}

.sa-payment-plan-row {
  margin-bottom: 16px;
}

.sa-price-total {
  margin-bottom: 0;
}

.sa-price-total .sa-price-label {
  font-size: 15px;
  font-weight: 600;
  color: #23232b;
}

.sa-price-total .sa-price-value {
  font-size: 15px;
  font-weight: 700;
}

.sa-edit-plan {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #888;
  padding: 0 4px;
}

.sa-edit-plan:hover {
  color: #333;
}

/* ========================================
   PAYMENT PLAN POPUP
   ======================================== */
.sa-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.sa-popup-container {
  background: #fff;
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: saPopupIn 0.3s ease;
}

@keyframes saPopupIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.sa-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  z-index: 10;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.sa-popup-close:hover {
  background: #e0e0e0;
  color: #333;
}

.sa-popup-content {
  padding: 24px;
}

@media (max-width: 600px) {
  .sa-popup-container {
    max-height: 95vh;
    border-radius: 12px;
  }

  .sa-popup-content {
    padding: 16px;
  }
}

/* ========================================
   VOUCHER SECTION
   ======================================== */
.sa-voucher-section {
  margin-top: 16px;
}

.sa-add-voucher {
  color: #2978ff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

.sa-add-voucher:hover {
  text-decoration: underline;
}

.sa-voucher-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.sa-voucher-input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  font-size: 16px;
  border: 1px solid #dddddf;
  border-radius: 7px;
  color: #25252b;
}

.sa-voucher-apply {
  height: 36px;
  padding: 0 14px;
  font-size: 14px;
  background: #f7f7f8;
  border: 1px solid #dddddf;
  border-radius: 7px;
  cursor: pointer;
  color: #666a76;
  font-weight: 500;
}

.sa-voucher-apply:hover {
  background: #efeff1;
  color: #23232b;
}

.sa-voucher-apply.sa-loading {
  opacity: 0.8;
  pointer-events: none;
  min-width: 60px;
}

.sa-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: sa-spin 0.8s linear infinite;
}

.sa-spinner.sa-spinner-light {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

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

.sa-voucher-message {
  margin-top: 8px;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
}

.sa-voucher-message.sa-success {
  background: #d4edda;
  color: #155724;
}

.sa-voucher-message.sa-error {
  background: #f8d7da;
  color: #721c24;
}

.sa-price-voucher {
  color: #28a745;
}

.sa-price-voucher .sa-price-value {
  color: #28a745;
}

/* ========================================
   REFUND POLICY
   ======================================== */
.sa-refund-policy {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  background: none;
  border-top: 1px solid #ececf0;
  border-radius: 0;
}

.sa-refund-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  color: #8b8f98;
}

.sa-refund-icon svg {
  width: 100%;
  height: 100%;
}

.sa-refund-text strong {
  display: block;
  font-size: 14px;
  color: #23232b;
  margin-bottom: 6px;
  line-height: 1.3;
}

.sa-refund-text p {
  font-size: 12.5px;
  color: #8a8d98;
  margin: 0;
  line-height: 1.45;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */
@media (max-width: 900px) {
  .sa-custom-checkout {
    max-width: 100%;
    padding: 18px 18px 26px;
  }

  .sa-checkout-layout {
    flex-direction: column;
    gap: 0;
  }

  .sa-steps-indicator {
    width: 100%;
    margin: 26px 0 58px;
  }

  .sa-checkout-main {
    max-width: 100%;
  }

  /* Hide desktop sidebar completely on mobile */
  .sa-checkout-sidebar {
    display: none;
  }

  /* ---- Mobile Product Header (consolidated, only rendered on mobile) ---- */
  .sa-mobile-product-header {
    display: block;
    position: sticky;
    top: var(--bb-header-height, 0px);
    z-index: 100;
    background: #f7f5f3;
    padding-bottom: 12px;
  }

  .sa-product-card-mini {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e0e0e4;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(21, 24, 37, 0.04);
  }

  .sa-product-image-mini img {
    width: 96px;
    height: 82px;
    object-fit: cover;
    border-radius: 12px;
  }

  .sa-product-info-mini {
    flex: 1;
    min-width: 0;
  }

  .sa-product-info-mini .sa-product-title {
    /* margin: 0 0 4px 0; */
    font-size: 22px;
    /* font-weight: 600; */
    line-height: 1.12;
    color: #2a2a31;
    letter-spacing: -0.02em;
  }

  .sa-product-info-mini p {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #666b7f;
    line-height: 1.3;
  }

  .sa-product-mini-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 0;
  }

  .sa-product-mini-price {
    font-size: 18px;
    font-weight: 700;
    color: #23232b;
    line-height: 1.1;
  }

  .sa-product-mini-price .sa-price-currency {
    font-size: 12px;
    color: #6d717d;
  }

  .sa-toggle-details {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2f76ff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
  }

  .sa-toggle-details:hover {
    text-decoration: underline;
  }

  .sa-toggle-chevron {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
  }

  .sa-chevron-up {
    transform: rotate(180deg);
  }

  .sa-toggle-details.sa-expanded .sa-toggle-chevron {
    transform: rotate(180deg);
  }

  .sa-mobile-product-details {
    width: 100%;
    padding: 16px 0 0;
  }

  .sa-mobile-product-details .sa-product-features {
    margin: 0;
  }

  .sa-mobile-product-details .sa-product-features li {
    margin-bottom: 12px;
    font-size: 14px;
  }

  .sa-mobile-product-details .sa-product-features li:last-child {
    margin-bottom: 4px;
  }

  .sa-toggle-details-bottom {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
  }

  .sa-product-card-mini.sa-details-open
    > .sa-product-info-mini
    .sa-toggle-details {
    display: none;
  }

  .sa-mobile-product-details.sa-hidden .sa-toggle-details-bottom {
    display: none;
  }

  /* Mobile price summary is controlled by JS (adds .sa-visible class on step 3) */

  .sa-step {
    width: 28px;
    gap: 9px;
  }

  .sa-step-number {
    width: 28px;
    height: 28px;
  }

  .sa-step.active .sa-step-number:after {
    width: 8px;
    height: 8px;
  }

  .sa-step-label {
    font-size: 14px;
    font-weight: 500;
    color: #5e616b;
  }

  .sa-step.active .sa-step-label,
  .sa-step.completed .sa-step-label {
    font-weight: 500;
    color: #383b44;
  }

  /* Show mobile price summary only on mobile when .sa-visible is added by JS */
  .sa-mobile-price-summary.sa-visible {
    display: block;
  }

  /* Show mobile review stars on mobile */
  .sa-mobile-review-stars {
    display: block;
  }

  .sa-mobile-review-stars .sa-review-stars {
    margin-top: 28px;
    gap: 8px;
  }

  /* Trust indicators as rows on mobile */
  .sa-trust-indicators {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 600px) {
  .sa-step-title {
    font-size: 30px;
    line-height: 1.12;
    margin-bottom: 16px;
  }

  .sa-step-description {
    font-size: 18px;
    line-height: 1.48;
    margin-bottom: 40px;
  }

  .sa-form-label {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .sa-form-row {
    margin-bottom: 22px;
  }

  .sa-form-input,
  .sa-form-select {
    height: 46px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 16px;
  }

  .sa-form-row.sa-navigation {
    margin-top: 34px;
  }

  .sa-next-button {
    height: 48px;
    border-radius: 10px;
    font-size: 16px;
    gap: 14px;
  }

  .sa-arrow-icon {
    width: 20px;
    height: 20px;
  }

  .sa-mobile-review-stars .sa-review-stars {
    justify-content: flex-start;
    margin-top: 30px;
  }

  .sa-review-score {
    font-size: 17px;
  }

  .sa-stars {
    font-size: 18px;
    letter-spacing: 0.4px;
  }

  .sa-review-text {
    font-size: 13.5px;
  }

  .sa-form-row-group {
    flex-direction: column;
    gap: 0;
  }

  .sa-form-row-group .sa-form-row {
    margin-bottom: 20px;
  }

  /* Mobile modal adjustments */
  .sa-modal {
    margin: 16px;
    padding: 24px;
  }

  .sa-modal-title {
    font-size: 18px;
  }
}

/* ==========================================================================
   MemberPress Payment Method Overrides
   Override MemberPress display toggling - we control visibility in our custom UI
   ========================================================================== */

.mepr-payment-method-stripe {
  display: block !important;
}

.mepr-payment-method-paypal {
  display: none !important;
}

.mepr-payment-method-offline {
  display: none !important;
}
