/* Compra (empezar.html). Paso 1: página de precios a todo el ancho, con
   los módulos solo si se arma el plan y una barra fija con el total. Pasos
   2 y 3: formulario a la izquierda y el pedido a la derecha, como un
   checkout. */

body.compra { padding-inline: 0; margin: 0; overflow-x: hidden; }
/* Nada de la compra se desplaza de costado: solo la tabla, dentro de su marco. */
html:has(body.compra) { overflow-x: hidden; }
/* styles.css le da a todo form una tarjeta y a toda section un relleno
   grande (son de la landing): acá no van. */
.compra form { display: block; background: none; border: 0; border-radius: 0; padding: 0; }
.compra section { padding-block: 0; }
.compra .wrap { padding-inline: 20px; }
.compra [hidden] { display: none !important; }

/* ---------- paso 1: planes ---------- */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Lo que ocupa la barra fija del total, más aire: así lo último de la
   tabla queda a la vista. Con .compra delante porque «.compra section»
   pone el relleno en cero. */
.compra .planes-pagina { padding-bottom: calc(var(--alto-barra, 80px) + 56px); overflow-x: clip; }
.planes-cab { text-align: center; padding-block: 20px 40px; display: grid; justify-items: center; gap: 12px; }
.planes-cab h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; }
.planes-cab .sub { color: var(--muted); max-width: 46ch; }
.planes-controles { display: flex; flex-wrap: wrap; gap: 14px 22px; justify-content: center; align-items: center; margin-top: 14px; }
.segmentos em { font: 500 0.72rem var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.segmentos input:checked + span em { color: inherit; }
.personas-chip { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.95rem; }
.personas-chip .contador input { width: 64px; text-align: center; border: 0; background: var(--surface); color: var(--ink); font: 500 1rem var(--mono); -moz-appearance: textfield; }
.personas-chip .contador input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Un resplandor del acento detrás de las tarjetas, que se corta abajo. */
.planes-fondo { position: relative; padding-block: 18px 8px; }
.planes-fondo::before { content: ""; position: absolute; inset: 0 0 34% 0; z-index: 0; pointer-events: none; background: radial-gradient(60% 90% at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }

.planes { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.plan { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: 20px; background: var(--surface); border: 1.5px solid var(--line); cursor: pointer; box-shadow: 0 1px 2px rgb(15 30 46 / .04), 0 18px 40px -30px rgb(15 30 46 / .25); transition: border-color .15s ease, box-shadow .15s ease; }
.plan input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
/* La tarjeta destacada, en relieve y con borde de tinta. */
.plan.destacado { border: 2px solid var(--ink); margin-top: -14px; padding-block: 34px; box-shadow: 0 30px 60px -36px rgb(15 30 46 / .5); }
.plan:has(input:checked) { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 30px 60px -36px rgb(15 30 46 / .4); }
.plan:not(.destacado):has(input:checked) { border-color: var(--accent); }
.plan:has(input:focus-visible) { outline: 3px solid var(--mark); outline-offset: 3px; }
.plan.corporativo { cursor: default; }
.plan-insignia { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 600 0.72rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.plan-nombre { font: 700 1.25rem var(--display); letter-spacing: -0.02em; }
.plan-desc { color: var(--muted); font-size: 0.95rem; min-height: 3em; }
.plan-precio { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; color: var(--muted); font-size: 0.9rem; }
.plan-precio strong { font: 700 2.6rem var(--display); letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.plan-precio .tachado { font: 500 1.2rem var(--display); color: var(--muted); text-decoration-thickness: 2px; }
.plan-cta { display: inline-flex; justify-content: center; padding: 12px 18px; border-radius: 12px; border: 1.5px solid var(--ink); font-weight: 600; text-decoration: none; color: var(--ink); background: var(--surface); transition: background .15s ease, color .15s ease; }
.plan.destacado .plan-cta, .plan:has(input:checked) .plan-cta { background: var(--ink); color: var(--bg); }
.plan-lista { list-style: none; margin: 0; padding: 4px 0 0; display: grid; gap: 9px; font-size: 0.94rem; }
.plan-lista li { display: flex; gap: 10px; }
.plan-lista li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 4px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%231f8fbf' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.plan-lista li.mas { color: var(--muted); }
.plan-lista li.mas::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 3.5v9M3.5 8h9' fill='none' stroke='%23566572' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* ---------- tabla comparativa ---------- */

.comparar { margin-top: 72px; }
.comparar-cab { display: grid; gap: 8px; margin-bottom: 18px; }
.comparar-cab h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
.comparar-cab .sub { color: var(--muted); }
/* En pantallas chicas la tabla se desliza de costado dentro de su marco,
   con la primera columna fija. */
.comparar-marco { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.comparar-tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.94rem; }
.comparar-tabla th, .comparar-tabla td { padding: 13px 18px; text-align: center; border-bottom: 1px solid var(--line); vertical-align: middle; }
.comparar-tabla th:first-child, .comparar-tabla td:first-child { text-align: left; width: 40%; background: var(--surface); }
.comparar-tabla thead th { background: var(--surface); padding-block: 20px 16px; vertical-align: bottom; }
.ct-nombre { display: block; font: 700 1.05rem var(--display); }
.ct-precio { display: block; color: var(--muted); font-size: 0.85rem; margin: 2px 0 10px; }
.ct-boton { display: inline-flex; justify-content: center; width: 100%; max-width: 170px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); font: 600 0.86rem var(--body); text-decoration: none; cursor: pointer; }
.ct-boton.lleno { background: var(--ink); color: var(--bg); }
.ct-destacado { box-shadow: inset 0 3px 0 var(--accent); }
.comparar-tabla thead th:first-child { border-top-left-radius: 20px; }
.comparar-tabla thead th:last-child { border-top-right-radius: 20px; }
.comparar-tabla tr.ct-grupo th { text-align: left; padding-top: 26px; font: 700 1.05rem var(--display); color: var(--ink); background: var(--surface); }
.comparar-tabla tr.ct-grupo small { display: block; font: 400 0.85rem var(--body); color: var(--muted); margin-top: 2px; }
.comparar-tabla td small { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.35; margin-top: 2px; }
.comparar-tabla tbody tr:last-child td { border-bottom: 0; }
.ct-si { display: inline-block; width: 18px; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%230f1e2e' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat; }
.ct-no { color: var(--dim); }
.ct-extra { font: 500 0.86rem var(--mono); color: var(--muted); }
.ct-texto { color: var(--ink); font-weight: 500; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ct-si { filter: invert(1); }
}

/* ---------- módulos (A tu medida) ---------- */

.modulos { margin-top: 48px; }
.modulos-cab h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.modulos-cab .sub { color: var(--muted); margin-top: 6px; }
/* Dos columnas que se llenan como un diario (sin huecos entre grupos de
   distinto largo). */
.modulos-grupos { margin-top: 22px; columns: 2; column-gap: 28px; }
.modulos-grupo { break-inside: avoid; margin-bottom: 22px; }
.modulos-grupo h3 { font: 500 0.75rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.modulos-filas { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.modulo-fila { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.modulo-fila + .modulo-fila { border-top: 1px solid var(--line); }
.modulo-fila:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.modulo-fila input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.modulo-fila:has(input:focus-visible) { outline: 3px solid var(--mark); outline-offset: -3px; }
.mf-icono { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--bg); color: var(--muted); }
.mf-icono svg { width: 18px; height: 18px; }
.modulo-fila:has(input:checked) .mf-icono { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.mf-txt { min-width: 0; }
.mf-txt strong { display: block; font-weight: 600; font-size: 0.98rem; }
.mf-txt span { display: block; color: var(--muted); font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-precio { font: 500 0.9rem var(--mono); color: var(--muted); white-space: nowrap; }
.interruptor { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--dim); transition: background .15s ease; flex: none; }
.interruptor::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s ease; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.modulo-fila:has(input:checked) .interruptor { background: var(--accent); }
.modulo-fila:has(input:checked) .interruptor::after { transform: translateX(16px); }
.sugerencia { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: 0.95rem; }

/* Barra fija con el total. */
.barra-compra { position: fixed; inset: auto 0 0 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.barra-compra-fila { display: flex; align-items: center; gap: 18px; padding-block: 14px; }
.barra-detalle { flex: 1; min-width: 0; color: var(--muted); font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-detalle #b-plan { color: var(--ink); font-weight: 600; }
.barra-sep { margin-inline: 6px; }
.bc-total { display: grid; justify-items: end; line-height: 1.2; }
.barra-monto strong { font: 700 1.4rem var(--display); letter-spacing: -0.02em; }
.barra-monto span { color: var(--muted); font-size: 0.9rem; }
.barra-ahorro { font: 500 0.75rem var(--mono); color: var(--accent); }

/* ---------- pasos 2 y 3: checkout ---------- */

.checkout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.checkout-form { padding: 32px clamp(20px, 6vw, 88px) 56px; display: grid; align-content: start; gap: 22px; max-width: 620px; justify-self: end; width: 100%; }
.checkout-form .logo { margin-bottom: 6px; }
.volver { justify-self: start; border: 0; background: none; color: var(--muted); font: 500 0.95rem var(--body); cursor: pointer; padding: 0; }
.volver:hover { color: var(--ink); }
.pasos-mini { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; font: 500 0.75rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.pasos-mini li + li::before { content: "→"; margin-right: 8px; color: var(--dim); }
.pasos-mini li[aria-current="step"] { color: var(--accent); }
.pasos-mini li.hecho { color: var(--ink); }
.checkout fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 20px; min-width: 0; }
.checkout legend { padding: 0; }
.checkout h1 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); font-weight: 700; }
.checkout legend { margin-bottom: 4px; }
.checkout .sub { color: var(--muted); }
.btn.ancho { justify-content: center; width: 100%; padding-block: 14px; margin-top: 6px; }

.checkout-pedido { background: var(--surface); border-left: 1px solid var(--line); padding: 32px clamp(20px, 6vw, 88px); }
.pedido { position: sticky; top: 32px; max-width: 420px; display: grid; gap: 18px; padding-top: 78px; }
.pedido-titulo { font: 500 0.75rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.pedido-plan { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 1.2rem; }
.cambiar { border: 0; background: none; color: var(--accent); font: 600 0.9rem var(--body); cursor: pointer; }
.pedido .lineas { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pedido .lineas li { display: flex; justify-content: space-between; gap: 12px; font-size: 0.95rem; }
.pedido .lineas small { display: block; color: var(--muted); font: 0.8rem var(--mono); }
.pedido .lineas b { font: 500 0.95rem var(--mono); }
.pedido .cuentas { margin: 0; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.pedido .cuentas div { display: flex; justify-content: space-between; font-size: 0.95rem; }
.pedido .cuentas dt { color: var(--muted); }
.pedido .cuentas dd { margin: 0; font-family: var(--mono); }
.pedido .cuentas .descuento dd { color: var(--accent); }
.pedido .total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; border-top: 1px solid var(--line); }
.pedido .total strong { font: 700 2rem var(--display); letter-spacing: -0.02em; }
.pedido .equivale, .pedido-dominio { color: var(--muted); font-size: 0.92rem; }
.pedido .garantias { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--muted); font-size: 0.9rem; }
.pedido .garantias li::before { content: "✓ "; color: var(--accent); }

/* ---------- celular ---------- */

@media (max-width: 900px) {
  .planes { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; gap: 26px; }
  .plan.destacado { margin-top: 0; order: -1; }
  .plan-desc { min-height: 0; }
  .comparar { margin-top: 48px; }
  /* La tabla se desliza de costado dentro de su marco, con la primera
     columna fija. */
  .comparar-marco { overflow-x: auto; }
  .comparar-tabla { min-width: 560px; }
  .comparar-tabla th, .comparar-tabla td { padding: 11px 12px; }
  .comparar-tabla th:first-child, .comparar-tabla td:first-child { width: 150px; min-width: 150px; position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
  .ct-boton { padding-inline: 8px; }
  .modulos-grupos { columns: 1; }
  .checkout { grid-template-columns: 1fr; }
  .checkout-form { justify-self: stretch; max-width: none; }
  .checkout-pedido { border-left: 0; border-top: 1px solid var(--line); order: -1; padding-block: 18px; }
  .pedido { position: static; padding-top: 0; max-width: none; }
  .pedido .lineas, .pedido .garantias, .pedido-dominio, .pedido .equivale { display: none; }
}
@media (max-width: 560px) {
  .barra-compra-fila { gap: 12px; justify-content: space-between; }
  .barra-detalle { display: none; }
  .bc-total { justify-items: start; }
  .barra-monto strong { font-size: 1.2rem; }
  .mf-txt span { display: none; }
  .comparar-tabla td small { display: none; }
}
