/* ─────────────────────────────────────────────────────────────
   Techwish — Calculators frontend styles.
   Consumes theme tokens (--tw-mint, --tw-paper-2, etc) with
   fallbacks so the wizard still works standalone.
   ───────────────────────────────────────────────────────────── */

.tw-calc {
  padding: 48px 0 64px;
  max-width: 880px;
  margin: 0 auto;
}

.tw-calc__header { margin-bottom: 28px; }
.tw-calc__header .tw-eyebrow { display: inline-block; margin-bottom: 8px; }
.tw-calc__header .tw-lede { margin-top: 10px; max-width: 56ch; }

/* Progress */
.tw-calc__progress {
  position: relative;
  height: 4px;
  background: var(--tw-line-soft, #ECEFED);
  border-radius: 4px;
  margin-bottom: 28px;
  overflow: visible;
}
.tw-calc__progress-fill {
  position: absolute; inset: 0 auto 0 0;
  height: 100%;
  background: var(--tw-mint, #2DCE92);
  border-radius: 4px;
  transition: width var(--tw-dur-med, .28s) var(--tw-ease, ease);
  width: 0;
}
.tw-calc__progress-text {
  position: absolute;
  right: 0; top: 12px;
  font-family: var(--tw-mono, ui-monospace);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tw-mute, #6B7470);
}

/* Form / steps */
.tw-calc__form {
  background: var(--tw-paper, #fff);
  border: 1px solid var(--tw-line-soft, #ECEFED);
  border-radius: var(--tw-radius-lg, 18px);
  padding: 32px;
}
.tw-calc__step {
  border: 0;
  padding: 0;
  margin: 0 0 20px;
}
.tw-calc__step[hidden] { display: none; }
.tw-calc__step legend.tw-h3 { padding: 0; margin: 0 0 6px; }
.tw-calc__help {
  margin: 0 0 22px;
  color: var(--tw-mute, #6B7470);
  font-size: 14px;
}

.tw-calc__field {
  padding: 14px 0;
  border-top: 1px solid var(--tw-line-soft, #ECEFED);
}
.tw-calc__field:first-of-type { border-top: 0; padding-top: 0; }

.tw-calc__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 14px;
}
.tw-calc__output {
  font-family: var(--tw-mono, ui-monospace);
  font-size: 14px;
  color: var(--tw-mint-600, #1FB37C);
  background: var(--tw-mint-050, #F1FAF5);
  padding: 2px 10px;
  border-radius: 999px;
}

/* Range slider — minimal cross-browser styling */
.tw-calc__field--range input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--tw-line, #DDE3E0);
  border-radius: 4px;
  outline: none;
}
.tw-calc__field--range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--tw-mint, #2DCE92);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px -2px rgba(11,15,13,.3);
  cursor: pointer;
}
.tw-calc__field--range input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--tw-mint, #2DCE92);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px -2px rgba(11,15,13,.3);
  cursor: pointer;
}

.tw-calc__field--number input[type="number"],
.tw-calc__field--select select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--tw-line, #DDE3E0);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}

.tw-calc__radios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.tw-calc__radio {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--tw-line, #DDE3E0);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  transition: all var(--tw-dur-fast, .15s) ease;
}
.tw-calc__radio input { accent-color: var(--tw-mint, #2DCE92); }
.tw-calc__radio:has(input:checked) {
  border-color: var(--tw-mint, #2DCE92);
  background: var(--tw-mint-050, #F1FAF5);
  color: var(--tw-mint-600, #1FB37C);
  font-weight: 600;
}

/* Nav */
.tw-calc__nav {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--tw-line-soft, #ECEFED);
}
.tw-calc__nav [data-tw-calc-prev]   { margin-right: auto; }
.tw-calc__nav [data-tw-calc-next],
.tw-calc__nav [data-tw-calc-compute]{ margin-left: auto; }

/* Result block */
.tw-calc__result {
  margin-top: 32px;
  padding: 32px;
  background: var(--tw-paper-2, #F4F7F5);
  border-radius: var(--tw-radius-lg, 18px);
  border: 1px solid var(--tw-line-soft, #ECEFED);
}
.tw-calc__result[hidden] { display: none; }
.tw-calc__result-summary {
  font-family: var(--tw-display, sans-serif);
  font-size: 22px;
  line-height: 1.3;
  margin: 0 0 24px;
  color: var(--tw-ink, #0B0F0D);
}
.tw-calc__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.tw-calc__metric {
  background: #fff;
  border: 1px solid var(--tw-line-soft, #ECEFED);
  border-radius: 12px;
  padding: 14px 16px;
}
.tw-calc__metric.is-emphasis {
  border-color: var(--tw-mint, #2DCE92);
  background: var(--tw-mint-050, #F1FAF5);
}
.tw-calc__metric-label {
  font-family: var(--tw-mono, ui-monospace);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tw-mute, #6B7470);
  display: block;
  margin-bottom: 6px;
}
.tw-calc__metric-value {
  font-family: var(--tw-mono, ui-monospace);
  font-size: 18px;
  font-weight: 600;
  color: var(--tw-ink, #0B0F0D);
}
.tw-calc__metric.is-emphasis .tw-calc__metric-value { color: var(--tw-mint-600, #1FB37C); }

.tw-calc__recs h3 {
  font-family: var(--tw-display, sans-serif);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 14px;
}
.tw-calc__rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.tw-calc__rec {
  background: #fff;
  border: 1px solid var(--tw-line-soft, #ECEFED);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tw-calc__rec img {
  width: 100%; aspect-ratio: 1;
  object-fit: cover;
  background: var(--tw-paper-2, #F4F7F5);
}
.tw-calc__rec-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tw-calc__rec-name { font-weight: 600; color: var(--tw-ink, #0B0F0D); text-decoration: none; font-size: 14px; line-height: 1.3; }
.tw-calc__rec-price { font-family: var(--tw-mono, ui-monospace); font-size: 13px; color: var(--tw-mute, #6B7470); }
.tw-calc__rec .tw-btn { margin-top: auto; height: 32px; font-size: 12px; padding: 0 12px; }

.tw-calc__notes {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--tw-line, #DDE3E0);
}
.tw-calc__notes h4 {
  font-family: var(--tw-mono, ui-monospace);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tw-mute, #6B7470);
  margin: 0 0 10px;
}
.tw-calc__notes ul {
  margin: 0; padding: 0; list-style: none;
  font-size: 13px; color: var(--tw-ink-2, #2A2F2C);
}
.tw-calc__notes li {
  padding: 6px 0 6px 18px;
  position: relative;
}
.tw-calc__notes li::before {
  content: ""; width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--tw-mint, #2DCE92);
  position: absolute; left: 0; top: 12px;
}

.tw-calc__restart {
  margin-top: 24px;
}

/* PDP launcher button */
/* Full-width launcher card, sits on its own line under compare + wishlist. */
.tw-calc-launcher {
  margin-top: 12px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--tw-line, #DDE3E0);
  border-radius: 16px;
  background: var(--tw-paper, #fff);
  color: var(--tw-ink, #0B0F0D);
  font-family: var(--tw-display, "Space Grotesk", sans-serif);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.tw-calc-launcher:hover {
  border-color: var(--tw-mint, #2DCE92);
  background: var(--tw-mint-050, #F1FAF5);
  transform: translateY(-1px);
}
.tw-calc-launcher__icon {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--tw-mint-050, #F1FAF5); color: var(--tw-mint-600, #1FB37C);
}
.tw-calc-launcher:hover .tw-calc-launcher__icon { background: #fff; }
.tw-calc-launcher__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tw-calc-launcher__title { font-weight: 600; font-size: 14px; line-height: 1.25; }
.tw-calc-launcher__sub { font-size: 12px; color: var(--tw-mute, #6B7470); }
.tw-calc-launcher__arrow { flex: none; color: var(--tw-mint-600, #1FB37C); font-size: 18px; }

/* Error inline */
.tw-calc__error {
  margin-top: 14px;
  padding: 12px 14px;
  background: #FCEDEC;
  border: 1px solid #F1B7B5;
  border-radius: 10px;
  color: #7A1F1A;
  font-size: 13px;
}
