/* Selector de consulta */
html.cs-lock { overflow: hidden; }

.cs {
  width: min(560px, calc(100% - 32px));
  max-width: none;
  max-height: min(760px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: var(--ink, #22313f);
  font: inherit;
  box-shadow: 0 32px 80px rgba(34, 49, 63, 0.24);
  overflow: auto;
  overscroll-behavior: contain;
}
.cs:not([open]) { display: none; }
.cs[open] { position: fixed; inset: 0; z-index: 60; }
.cs::backdrop { background: rgba(34, 49, 63, 0.5); }

.cs-inner { padding: 14px 22px 22px; }
.cs-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin-bottom: 6px;
}
.cs-step {
  margin: 0;
  color: var(--muted, #5c6b78);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cs-close { margin-left: auto; }
.cs-icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 1px solid var(--line, #e6ecf0);
  border-radius: 50%;
  background: #fff;
  color: var(--ink, #22313f);
  cursor: pointer;
}
.cs-icon-btn:hover { background: var(--paper, #f4f7f8); }
.cs-icon-btn:focus-visible,
.cs-opt:focus-visible,
.cs-field input:focus-visible,
.cs .btn:focus-visible { outline: 2px solid var(--cta, #036f7f); outline-offset: 2px; }
.cs-back[hidden] { display: none; }
.cs-ic-sm { display: inline-grid; }
.cs-ic-sm svg { width: 20px; height: 20px; }

.cs-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.cs-text {
  margin: 8px 0 0;
  color: var(--muted, #5c6b78);
  font-size: 15px;
  line-height: 1.45;
}
.cs-text[hidden] { display: none; }
.cs-origin {
  margin: 8px 0 0;
  color: var(--muted, #5c6b78);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.cs-origin[hidden] { display: none; }

.cs-body { margin-top: 18px; }
.cs-options {
  display: grid;
  gap: 8px;
}
.cs-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid var(--line, #e6ecf0);
  border-radius: 12px;
  background: #fff;
  color: var(--ink, #22313f);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.cs-opt:hover {
  border-color: color-mix(in srgb, var(--cta, #036f7f) 45%, #e6ecf0);
  background: #f7fbfc;
}
.cs-opt[aria-pressed="true"] {
  border-color: var(--cta, #036f7f);
  background: #eef8f9;
}
.cs-opt-text { flex: 1; min-width: 0; }
.cs-opt strong {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.cs-opt small {
  display: block;
  margin-top: 2px;
  color: var(--muted, #5c6b78);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
}
.cs-opt.is-rich { min-height: 68px; }
.cs-ic {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 12px;
  background: #eef8f9;
  color: var(--cta, #036f7f);
}
.cs-ic svg { width: 22px; height: 22px; }
.cs-ic-end {
  display: inline-grid;
  flex: none;
  color: var(--muted, #5c6b78);
}
.cs-ic-end svg { width: 20px; height: 20px; }
.cs-opt[aria-pressed] .cs-ic-end { visibility: hidden; color: var(--cta, #036f7f); }
.cs-opt[aria-pressed="true"] .cs-ic-end { visibility: visible; }

.cs-field { margin-top: 18px; }
.cs-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}
.cs-field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line, #e6ecf0);
  border-radius: 12px;
  background: #fff;
  color: var(--ink, #22313f);
  font: inherit;
  font-size: 16px;
}
.cs-field input:focus { border-color: var(--cta, #036f7f); }
.cs-field input[aria-invalid="true"] { border-color: #b42318; }
.cs-hint {
  margin: 6px 0 0;
  color: var(--muted, #5c6b78);
  font-size: 13px;
}
.cs-error {
  margin: 6px 0 0;
  color: #b42318;
  font-size: 14px;
  font-weight: 600;
}
.cs-error[hidden] { display: none; }

.cs-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 14px;
  background: var(--paper, #f4f7f8);
}
.cs-note p { margin: 0; font-size: 15px; line-height: 1.45; }
.cs-note .cs-ic { width: 32px; height: 32px; border-radius: 10px; background: #fff; }
.cs-note .cs-ic svg { width: 18px; height: 18px; }
.cs-note.is-warn { margin-top: 12px; background: #fff7ed; }
.cs-note.is-warn .cs-ic { color: #c2410c; }

.cs-summary { margin: 0; }
.cs-summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line, #e6ecf0);
}
.cs-summary div:last-child { border-bottom: 1px solid var(--line, #e6ecf0); }
.cs-summary dt { color: var(--muted, #5c6b78); font-size: 14px; }
.cs-summary dd {
  margin: 0;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.cs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.cs-actions[hidden] { display: none; }
.cs-actions .btn { flex: 1 1 auto; }
.cs .btn[disabled] { opacity: 0.6; cursor: progress; }

/* Duración y dominio: radios accesibles */
.cs-terms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.cs-term,
.cs-radio {
  position: relative;
  width: 100%;
  border: 1.5px solid var(--line, #e6ecf0);
  border-radius: 14px;
  background: #fff;
  color: var(--ink, #22313f);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.cs-term:hover,
.cs-radio:hover {
  border-color: color-mix(in srgb, var(--cta, #036f7f) 45%, #e6ecf0);
  background: #f7fbfc;
}
.cs-term[aria-checked="true"],
.cs-radio[aria-checked="true"] {
  border-color: var(--cta, #036f7f);
  background: #eef8f9;
  box-shadow: inset 0 0 0 1px var(--cta, #036f7f);
}
.cs-term:focus-visible,
.cs-radio:focus-visible { outline: 2px solid var(--cta, #036f7f); outline-offset: 2px; }
.cs-term {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "len mark" "price price" "cycle cycle";
  align-items: center;
  gap: 4px 8px;
  min-height: 112px;
  padding: 14px;
}
.cs-mark {
  grid-area: mark;
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border: 1.5px solid #c9d5da;
  border-radius: 50%;
  background: #fff;
  color: #fff;
}
.cs-mark-ic { display: inline-grid; visibility: hidden; }
.cs-mark-ic svg { width: 14px; height: 14px; stroke-width: 2.4; }
[aria-checked="true"] > .cs-mark { border-color: var(--cta, #036f7f); background: var(--cta, #036f7f); }
[aria-checked="true"] > .cs-mark .cs-mark-ic { visibility: visible; }
.cs-term-len { grid-area: len; font-size: 15px; font-weight: 600; }
.cs-term-price {
  grid-area: price;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.cs-term-price small,
.cs-total-amount small {
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted, #5c6b78);
}
.cs-term-price.is-ask { font-size: 20px; }
.cs-term-cycle { grid-area: cycle; color: var(--muted, #5c6b78); font-size: 13.5px; }

.cs-domain { margin-top: 18px; }
.cs-label { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.cs-domain-opts { display: grid; gap: 8px; }
.cs-radio {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
}
.cs-radio-text { flex: 1; min-width: 0; }
.cs-radio-text strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.cs-radio-text small { display: block; margin-top: 2px; color: var(--muted, #5c6b78); font-size: 13px; }
.cs-radio-extra { flex: none; font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--cta, #036f7f); }
.cs-domain-off { margin-top: 12px; }

.cs-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--paper, #f4f7f8);
}
.cs-total-label span { display: block; font-size: 14px; font-weight: 600; }
.cs-total-label small { display: block; margin-top: 2px; color: var(--muted, #5c6b78); font-size: 13px; }
.cs-total-amount {
  flex: none;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.cs-total-amount.is-ask { font-size: 18px; }
.cs-body > .cs-error { margin-top: 12px; }

.cs-summary .is-price dd { font-size: 16px; color: var(--cta, #036f7f); }

.cs-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 640px) {
  .cs-options.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .cs {
    width: 100%;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 40px rgba(34, 49, 63, 0.2);
  }
  .cs-inner { padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); }
  .cs-title { font-size: 21px; }
  .cs-body { margin-top: 14px; }
  .cs-actions { flex-direction: column; }
  .cs-actions .btn { width: 100%; }
  .cs-summary div { gap: 12px; padding: 8px 0; }
  .cs-summary dt { flex: none; max-width: 48%; }
  .cs-terms { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cs-term {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "mark len price" "mark cycle price";
    gap: 0 12px;
    min-height: 64px;
    padding: 10px 14px;
  }
  .cs-term-price { justify-self: end; font-size: 22px; }
  .cs-term-price.is-ask { font-size: 17px; }
  .cs-domain { margin-top: 14px; }
  .cs-summary .is-price dd { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .cs-opt,
  .cs-term,
  .cs-radio { transition: none; }
}
