/**
 * Shared checkout modal shell (gate + info).
 * Color tokens come from sell.css (.vmt-checkout-modal).
 */

.vmt-checkout-modal {
  display: none;
  height: 100%;
  width: 100%;
  max-width: 100%;
  position: fixed;
  left: 0;
  top: 0;
  background-color: var(--color-overlay);
  z-index: 10000;
  cursor: default;
  animation: vmt-checkout-modal-fade-in 0.3s ease-out;
  font-family: inherit;
  box-sizing: border-box;
}

.vmt-checkout-modal *,
.vmt-checkout-modal *::before,
.vmt-checkout-modal *::after {
  box-sizing: border-box;
}

.vmt-checkout-modal.is-active {
  display: flex;
}

.vmt-checkout-modal-positioner {
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.vmt-checkout-modal-panel {
  width: min(480px, calc(100vw - 2rem));
  max-width: 480px;
  background: var(--color-white);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
  color: var(--color-text-primary);
}

.vmt-checkout-modal.is-visible .vmt-checkout-modal-panel {
  opacity: 1;
  transform: scale(1);
}

.vmt-checkout-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.vmt-checkout-modal-title {
  margin: 0;
  flex-grow: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.vmt-checkout-modal-close {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.vmt-checkout-modal-body {
  overflow-y: auto;
  padding: 16px 20px;
  flex-grow: 1;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.vmt-checkout-modal-body p {
  margin: 0 0 0.75em;
}

.vmt-checkout-modal-body p:last-child {
  margin-bottom: 0;
}

.vmt-checkout-modal-body a {
  color: var(--color-primary);
  text-decoration: underline;
}

.vmt-checkout-modal-body strong {
  font-weight: 700;
  color: var(--color-text-primary);
}

.vmt-checkout-modal-footer {
  padding: 16px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.vmt-checkout-modal-footer[hidden] {
  display: none;
}

.vmt-checkout-modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.vmt-checkout-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.5rem;
  padding: 0.75rem 1.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.2;
}

.vmt-checkout-modal-btn.is-primary {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.vmt-checkout-modal-btn.is-primary:hover {
  filter: brightness(0.96);
}

.vmt-checkout-modal-btn.is-secondary {
  background: var(--color-white);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.vmt-checkout-modal-btn.is-secondary:hover {
  background: var(--color-background-secondary);
}

/* Gate mode: confirm-heavy actions */
.vmt-checkout-modal[data-mode='gate'] .vmt-checkout-modal-actions {
  justify-content: space-between;
}

/* Tip trigger inside checkbox labels (API: [data-vmt-modal-info]) */
#vmt-sell-checkout [data-vmt-modal-info] {
  color: var(--color-text-primary);
  text-decoration: underline;
  cursor: pointer;
}

@keyframes vmt-checkout-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 780px) {
  .vmt-checkout-modal-panel {
    width: 100%;
    max-width: none;
  }

  .vmt-checkout-modal-actions {
    flex-direction: column-reverse;
  }

  .vmt-checkout-modal-btn {
    width: 100%;
  }

  .vmt-checkout-modal[data-mode='gate'] .vmt-checkout-modal-actions {
    justify-content: stretch;
  }
}
