.tsubs-confirm-payment-section {
  background: #ffffff;
  width: 100%;
  max-width: 440px;
  border-radius: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: tsubs-fade-in 0.2s ease-out;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  margin: auto;
}

@media (max-width: 767px) {
  .tsubs-confirm-payment-section {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    animation: tsubs-slide-up 0.3s ease-out;
    margin: 0;
  }
}

/* Shared Backdrop and Animations (extracted from base_modals.css) */
[id^="tsubs-"][id$="-backdrop"] {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1060;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Payment Confirmation Popups (from subscribe_modal.css) */
.tsubs-payment-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
}
.tsubs-payment-overlay.tsubs-active {
  display: flex;
}

.tsubs-payment-popup {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  animation: tsubs-popup-in 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tsubs-popup-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tsubs-reviewing-popup {
  width: min(480px, 92vw);
  padding: 40px 36px 36px;
  text-align: center;
}

.tsubs-payment-title {
  font-size: 22px;
  font-weight: 700;
  color: #111;
  margin: 0 0 32px;
  letter-spacing: -0.3px;
}

.tsubs-spinner-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tsubs-spinner {
  position: absolute;
  inset: 0;
  width: 100px;
  height: 100px;
  animation: tsubs-spin 1.4s linear infinite;
}

.tsubs-spinner-track {
  stroke: #e5e7eb;
}
.tsubs-spinner-arc {
  stroke: #111;
  stroke-linecap: round;
  stroke-dasharray: 180;
  stroke-dashoffset: 90;
}

.tsubs-lock-icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes tsubs-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.tsubs-payment-hint {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

@media (max-width: 767px) {
  [id^="tsubs-"][id$="-backdrop"] {
    align-items: flex-end;
    padding: 0;
  }
}

@keyframes tsubs-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes tsubs-slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shared Component Styles for this modal (from base_modals.css) */
.tsubs-cmpay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 0;
}

.tsubs-cmpay-confirm-btn {
  width: 100%;
  padding: 14px;
  background: #ff2500;
  color: #fff;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tsubs-cmpay-confirm-btn:hover {
  background: #e02100;
}

.tsubs-cmpay-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 0;
}

.tsubs-cmpay-back-btn,
.tsubs-cmpay-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tsubs-cmpay-content {
  padding: 24px;
  overflow-y: visible;
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-top: auto;
  align-items: center;

  .tsubs-cmpay-confirm-btn {
    height: auto;
    text-align: center;
  }

  > p {
    text-align: center;
  }

  .tsubs-cmpay-title,
  .tsubs-cmpay-order-summary,
  .tsubs-cmpay-payment-method-section {
    width: 100%;
  }
}

.tsubs-cmpay-title {
  font-size: 24px;
  font-weight: 700;
  color: #121117;
  margin: 16px 0 24px;
  line-height: 1.2;
}

.tsubs-cmpay-order-summary {
  display: flex;
  flex-direction: column;
}

.tsubs-cmpay-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tsubs-cmpay-summary-label {
  font-size: 14px;
  color: #4d4c5c;
  display: flex;
  align-items: center;
}

.tsubs-cmpay-pill {
  background: #e8e8e8;
  color: #121117;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 500;
}

.tsubs-cmpay-summary-value {
  font-size: 14px;
  color: #121117;
  font-weight: 500;
}

.tsubs-cmpay-divider {
  height: 1px;
  background: #f4f4f8;
  margin: 16px 0;
}

.tsubs-cmpay-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tsubs-cmpay-total-label,
.tsubs-cmpay-total-value {
  font-size: 16px;
  font-weight: 700;
  color: #121117;
}

.tsubs-cmpay-payment-dropdown {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid #dcdce5;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  margin-top: 24px;
}

.tsubs-cmpay-payment-info {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.tsubs-cmpay-card-details {
  font-size: 14px;
  color: #121117;
  font-weight: 500;
}

/* Dropdown Container and List Styles */
.tsubs-cmpay-dropdown-container {
  position: relative;
  width: 100%;
}

.tsubs-cmpay-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #dcdce5;
  border-radius: 12px;
  list-style: none;
  padding: 8px 0;
  margin: 4px 0 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 100;
  animation: tsubs-fade-in 0.2s ease-out;
}

.tsubs-cmpay-dropdown-list.is-active {
  display: block;
}

.tsubs-cmpay-dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
}

.tsubs-cmpay-dropdown-item:hover {
  background: #f8f8fb;
}

.tsubs-cmpay-dropdown-item.selected {
  background: #f0f0f5;
}

.tsubs-cmpay-dropdown-item .tsubs-cmpay-payment-info {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.tsubs-cmpay-visa-icon {
  height: 20px;
  width: auto;
  object-fit: contain;
}

/* Make Apple/Google Pay icons black on white backgrounds */
.tsubs-cmpay-visa-icon[alt*="Pay"] {
  filter: brightness(0);
}

.tsubs-dropdown-arrow {
  transition: transform 0.3s ease;
}

.tsubs-cmpay-payment-dropdown[aria-expanded="true"] .tsubs-dropdown-arrow {
  transform: rotate(180deg);
}

/* Confirm Button Icons (Keep white on black button) */
.tsubs-confirm-apple-logo,
.tsubs-confirm-google-logo {
  filter: none;
}

/* New Card Panel Styles */
#tsubs-new-card-panel.tsubs-new-card-panel {
  margin-top: 0;
  animation: tsubs-fade-in 0.3s ease-out;
  border: 0 !important;
  border-radius: 0 !important;
}

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

.tsubs-form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.tsubs-form-col {
  flex: 1;
}

.tsubs-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4d4c5c;
  margin-bottom: 8px;
}

.tsubs-form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #dcdce5;
  border-radius: 8px;
  font-size: 14px;
  color: #121117;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  background: #fcfcfd;
}

.tsubs-form-input:focus {
  outline: none;
  border-color: #ff2500;
  box-shadow: 0 0 0 4px rgba(255, 37, 0, 0.1);
  background: #fff;
}

.tsubs-input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.tsubs-input-icon {
  position: absolute;
  right: 12px;
  pointer-events: none;
}

.tsubs-form-checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.tsubs-form-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #ff2500;
}

.tsubs-form-checkbox-label {
  font-size: 13px;
  color: #4d4c5c;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.tsubs-cmpay-confirm-btn {
  background: #ff2500;
  color: #fff;
  border-radius: 8px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  transition: 0.2s;
  margin-top: 24px;
}

.tsubs-cmpay-confirm-btn:hover {
  background: #e02100;
}

.tsubs-cmpay-footer-text {
  font-size: 11px;
  color: #4d4c5c;
  margin-top: 12px;
  line-height: 1.5;
  text-align: left;
}

.tsubs-cmpay-footer-text a {
  color: #4d4c5c;
  text-decoration: underline;
}

.tsubs-cmpay-header-cp {
  display: flex;
  flex-direction: column;
  width: 100%;
}

@media (max-width: 767.98px) {
  #tsubs-confirm-payment-modal-backdrop {
    .tsubs-cmpay-header-cp {
      padding: 0;
    }

    .tsubs-cmpay-content {
      justify-content: space-between;
    }

    .tsubs-confirm-payment-section {
      min-height: 100%;
      border-radius: 0;
    }
  }
}

/* Mobile Bottom Sheet Styling for Reviewing Payment Details */
@media (max-width: 767.98px) {
  #tsubs-reviewing-overlay.tsubs-payment-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  #tsubs-reviewing-overlay .tsubs-reviewing-popup {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    padding: 40px 24px 24px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15) !important;
    position: relative !important;
    transform: translateY(100%);
    animation: slideUpReviewingSheet 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards !important;
  }

  @keyframes slideUpReviewingSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* Bottom sheet handle */
  #tsubs-reviewing-overlay .tsubs-reviewing-popup::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 10px;
    z-index: 10;
  }
}
