/* =============================================================================
   TSF ADS — checkout

   Tokens from Tylers-Code/css/tsf-tokens.css, aliased with var() fallbacks that
   are the token VALUES rather than approximations, so there is nothing to drift.
   ========================================================================== */

.tsf-ads-checkout {
  --ads-bg:      var(--tsf-surface, #0F0F0F);
  --ads-raised:  var(--tsf-surface-raised, #151515);
  --ads-panel:   var(--tsf-surface-panel, #1A1A1A);
  --ads-text:    var(--tsf-text, #CBCBCB);
  --ads-strong:  var(--tsf-text-strong, #F2F2F2);
  --ads-muted:   var(--tsf-text-muted, #8A8A8A);
  --ads-red:     var(--tsf-red, #FF0000);
  --ads-solid:   var(--tsf-red-solid, #BB0000);
  --ads-hover:   var(--tsf-red-hover, #C00000);
  --ads-orange:  var(--tsf-orange, #FF6600);
  --ads-edge:    #2A2A2A;
  --ads-radius:  var(--tsf-radius-md, 10px);

  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
  color: var(--ads-text);
  container-type: inline-size;
}

/* Elementor's mobile flex-wrap default fights container queries below 768px —
   the same collision documented in listing-hero.css. One column below the
   breakpoint sidesteps it entirely. */
@media (max-width: 860px) {
  .tsf-ads-checkout { grid-template-columns: minmax(0, 1fr); }
}

.tsf-ads-form { display: contents; }

/* ── steps ─────────────────────────────────────────────────────────────── */

.tsf-ads-step {
  grid-column: 1;
  margin: 0 0 24px;
  padding: 20px;
  border: 1px solid var(--ads-edge);
  border-radius: var(--ads-radius);
  background: var(--ads-bg);
}

.tsf-ads-step__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  font-size: 19px;
  color: var(--ads-strong);
}

.tsf-ads-step__title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ads-solid);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.tsf-ads-step__hint { margin: 0 0 16px; color: var(--ads-muted); font-size: 14px; }

/* ── fields ────────────────────────────────────────────────────────────── */

.tsf-ads-grid { display: flex; flex-wrap: wrap; gap: 14px; }

.tsf-ads-field { flex: 1 1 100%; margin: 0 0 14px; }
.tsf-ads-field--half { flex: 1 1 calc(50% - 7px); }

@container (max-width: 520px) {
  .tsf-ads-field--half { flex: 1 1 100%; }
}

.tsf-ads-field label {
  display: block;
  margin: 0 0 6px;
  color: var(--ads-strong);
  font-size: 14px;
  font-weight: 600;
}

.tsf-ads-field label span { color: var(--ads-muted); font-weight: 400; }

.tsf-ads-field input[type="text"],
.tsf-ads-field input[type="email"],
.tsf-ads-field input[type="tel"],
.tsf-ads-field input[type="url"],
.tsf-ads-field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--ads-edge);
  border-radius: var(--tsf-radius-sm, 8px);
  background: var(--ads-raised);
  color: var(--ads-strong);
  font: inherit;
  font-size: 15px;
}

.tsf-ads-field input:focus-visible,
.tsf-ads-field textarea:focus-visible {
  outline: 2px solid var(--ads-orange);
  outline-offset: 1px;
}

.tsf-ads-field__hint { display: block; margin: 6px 0 0; color: var(--ads-muted); font-size: 13px; }
.tsf-ads-field__error { margin: 6px 0 0; color: var(--ads-red); font-size: 14px; }

.tsf-ads-resolved {
  margin: 4px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--ads-orange);
  background: var(--ads-panel);
  border-radius: 0 var(--tsf-radius-sm, 8px) var(--tsf-radius-sm, 8px) 0;
}

.tsf-ads-resolved p { margin: 0; }

/* ── products ──────────────────────────────────────────────────────────── */

.tsf-ads-products { display: grid; gap: 12px; }

.tsf-ads-product {
  display: flex;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--ads-edge);
  border-radius: var(--ads-radius);
  background: var(--ads-raised);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.tsf-ads-product:hover:not(.is-disabled) { border-color: var(--ads-solid); }

.tsf-ads-product:has(input:checked) {
  border-color: var(--ads-red);
  background: var(--ads-panel);
}

.tsf-ads-product.is-disabled { opacity: .5; cursor: not-allowed; }

.tsf-ads-product input { margin: 3px 0 0; flex: 0 0 auto; accent-color: var(--ads-red); }
.tsf-ads-product__body { flex: 1 1 auto; min-width: 0; }

.tsf-ads-product__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  color: var(--ads-strong);
  font-size: 16px;
}

.tsf-ads-product__price { color: var(--ads-strong); font-weight: 700; white-space: nowrap; }
.tsf-ads-product__summary { display: block; margin: 4px 0 0; font-size: 14px; color: var(--ads-text); }
.tsf-ads-product__note { display: block; margin: 6px 0 0; font-size: 13px; color: var(--ads-orange); }

/* ── creatives ─────────────────────────────────────────────────────────── */

.tsf-ads-creative {
  margin: 0 0 16px;
  padding: 15px;
  border: 1px solid var(--ads-edge);
  border-radius: var(--ads-radius);
  background: var(--ads-raised);
}

.tsf-ads-creative h3 { margin: 0 0 10px; font-size: 15px; color: var(--ads-strong); }
.tsf-ads-creative.is-ready { border-color: #2E7D32; }
.tsf-ads-creative.has-error { border-color: var(--ads-red); }
.tsf-ads-creative__status { margin: 8px 0 12px; font-size: 13px; color: var(--ads-muted); }
.tsf-ads-creative.has-error .tsf-ads-creative__status { color: var(--ads-red); }
.tsf-ads-creative.is-ready .tsf-ads-creative__status { color: #66BB6A; }

/* ── summary ───────────────────────────────────────────────────────────── */

.tsf-ads-summary {
  grid-column: 2;
  grid-row: 1 / span 20;
  position: sticky;
  top: 20px;
  padding: 18px;
  border: 1px solid var(--ads-edge);
  border-radius: var(--ads-radius);
  background: var(--ads-panel);
}

@media (max-width: 860px) {
  .tsf-ads-summary { grid-column: 1; grid-row: auto; position: static; }
}

.tsf-ads-summary h2 { margin: 0 0 12px; font-size: 16px; color: var(--ads-strong); }
.tsf-ads-summary__lines { margin: 0 0 12px; padding: 0; list-style: none; }

.tsf-ads-summary__lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--ads-edge);
  font-size: 14px;
}

.tsf-ads-summary__total {
  display: flex;
  justify-content: space-between;
  margin: 0 0 10px;
  font-size: 17px;
  color: var(--ads-strong);
}

.tsf-ads-summary__term { margin: 0; font-size: 12px; color: var(--ads-muted); }

/* ── payment ───────────────────────────────────────────────────────────── */

.tsf-ads-payment { margin: 0 0 16px; }

.tsf-ads-pay {
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-radius: var(--tsf-radius-lg, 13px);
  background: var(--ads-solid);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease;
}

.tsf-ads-pay:hover:not(:disabled) { background: var(--ads-hover); }
.tsf-ads-pay:disabled { opacity: .45; cursor: not-allowed; }

.tsf-ads-secure { margin: 10px 0 0; font-size: 12px; color: var(--ads-muted); text-align: center; }
.tsf-ads-error { margin: 0 0 12px; color: var(--ads-red); font-size: 14px; }

/* ── misc ──────────────────────────────────────────────────────────────── */

.tsf-ads-boot, .tsf-ads-done { grid-column: 1; padding: 20px; color: var(--ads-muted); }
.tsf-ads-done h2 { color: var(--ads-strong); margin: 0 0 10px; }
.tsf-ads-fatal { grid-column: 1; }

.tsf-ads-note {
  padding: 12px 14px;
  border-radius: var(--tsf-radius-sm, 8px);
  background: var(--ads-panel);
  font-size: 14px;
}

.tsf-ads-note--warn { border-left: 3px solid var(--ads-orange); }
.tsf-ads-note p { margin: 0; }
.tsf-ads-alt { grid-column: 1; margin: 0; font-size: 14px; color: var(--ads-muted); }
.tsf-ads-alt a, .tsf-ads-note a { color: var(--ads-orange); }

/*
 * Honeypot. Positioned off-canvas rather than display:none — a bot that
 * respects display:none will skip it, and skipping is what we are trying to
 * measure. It keeps its label for screen readers, and carries no
 * autocomplete="off", because suppressing autofill is exactly what made
 * Formidable's honeypot flag real people.
 */
.tsf-ads-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Shown once the order is priced and held server-side; the steps above are
   disabled at that point, so there has to be a way back. */
.tsf-ads-restart { margin: 12px 0 0; font-size: 13px; color: var(--ads-muted); }
.tsf-ads-restart a { color: var(--ads-orange); }

.tsf-ads-checkout.is-locked .tsf-ads-product,
.tsf-ads-checkout.is-locked .tsf-ads-creative { opacity: .6; }
.tsf-ads-checkout.is-locked .tsf-ads-product { cursor: default; }
