/*!
 * egpi-cotizador.css — cotizador de lote o casa (va con egpi-cotizador.js).
 *
 * Diseño compacto de nov-2026: blanco y azul, con la tipografia y los botones
 * del resto del sitio, y pensado para que todo quepa en una pantalla de
 * portatil (1366 x 768): filas de etiqueta y control, resumen corto y las
 * condiciones plegadas. En el celular una barra deja la cuota a la vista.
 */

.egpi-cot {
  --cot-azul: #044887;
  --cot-azul-hondo: #03396b;
  --cot-cian: #10A0D6;
  --cot-texto: #0F2740;
  --cot-suave: #566E84;
  --cot-linea: #DDE5EA;
  --cot-niebla: #F2F5F7;

  position: relative;
  padding: clamp(40px, 5vw, 64px) clamp(20px, 4vw, 48px);
  background: #fff;
  color: var(--cot-texto);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  scroll-margin-top: 72px;
}
.egpi-cot *,
.egpi-cot *::before,
.egpi-cot *::after { box-sizing: border-box; }
.egpi-cot__inner { max-width: 1240px; margin: 0 auto; }
.egpi-cot [hidden] { display: none !important; }

/* ---- Encabezado: titulo a la izquierda, lote o casa a la derecha ---- */
.egpi-cot .egpi-cot__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 24px;
  margin: 0 0 18px;
}
.egpi-cot .egpi-cot__title {
  margin: 0;
  font: 700 clamp(1.6rem, 1.2rem + 1.3vw, 2.25rem)/1.1 "Plus Jakarta Sans", "Inter", sans-serif;
  letter-spacing: -.025em;
  color: var(--cot-texto);
}
.egpi-cot .egpi-cot__sub { margin: 6px 0 0; font-size: .9375rem; line-height: 1.5; color: var(--cot-suave); }
.egpi-cot .egpi-cot__producto {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--cot-niebla);
  border: 1px solid var(--cot-linea);
}
.egpi-cot .egpi-cot__producto .egpi-cot__chip {
  min-height: 40px;
  padding: 8px 20px;
  border: 0;
  background: transparent;
  font-weight: 600;
}
.egpi-cot .egpi-cot__producto .egpi-cot__chip[aria-pressed="true"] { background: var(--cot-azul); color: #fff; box-shadow: 0 6px 16px -8px rgba(4, 72, 135, .6); }

/* ---- Rejilla ---- */
.egpi-cot__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr);
  gap: clamp(14px, 2vw, 24px);
  align-items: start;
}
.egpi-cot__card {
  position: relative;
  padding: 6px clamp(16px, 2vw, 24px);
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--cot-linea);
}

/* ---- Campos ---- */
.egpi-cot__campo {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 8px 16px;
  padding: 14px 0;
  animation: egpi-cot-entra .25s ease;
}
/* Linea entre filas visibles (las del otro modo estan ocultas) */
.egpi-cot__campo:not([hidden]) ~ .egpi-cot__campo:not([hidden]) { border-top: 1px solid var(--cot-linea); }
.egpi-cot .egpi-cot__campo-label { font-size: .9375rem; font-weight: 600; line-height: 1.3; color: var(--cot-texto); }
.egpi-cot .egpi-cot__campo-label small { display: block; margin-top: 2px; font-size: .78rem; font-weight: 400; color: var(--cot-suave); }
@keyframes egpi-cot-entra { from { opacity: 0; } to { opacity: 1; } }

/* Deslizador: etiqueta y valor arriba, la barra debajo */
.egpi-cot__campo--rango { grid-template-columns: 1fr; gap: 4px; }
.egpi-cot__campo-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.egpi-cot__campo-valor { font: 700 1.25rem/1 "Plus Jakarta Sans", sans-serif; color: var(--cot-azul); font-variant-numeric: tabular-nums; white-space: nowrap; }
.egpi-cot__campo-valor small { margin-left: 3px; font: 500 .8125rem/1 "Inter", sans-serif; color: var(--cot-suave); }

.egpi-cot input[type=range] {
  --p: 50%;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 26px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.egpi-cot input[type=range]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cot-azul) var(--p), var(--cot-linea) var(--p));
}
.egpi-cot input[type=range]::-moz-range-track { height: 6px; border-radius: 99px; background: var(--cot-linea); }
.egpi-cot input[type=range]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--cot-azul); }
.egpi-cot input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--cot-azul);
  box-shadow: 0 3px 10px rgba(4, 72, 135, .25);
  transition: transform .15s ease;
}
.egpi-cot input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--cot-azul); }
.egpi-cot input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.1); }
.egpi-cot input[type=range]:focus-visible { outline: 3px solid var(--cot-cian); outline-offset: 3px; border-radius: 8px; }

/* ---- Fichas ---- */
.egpi-cot__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.egpi-cot .egpi-cot__chip {
  appearance: none;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid var(--cot-linea);
  border-radius: 999px;
  background: #fff;
  color: var(--cot-texto);
  font: 500 .875rem/1.2 "Inter", sans-serif;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.egpi-cot .egpi-cot__chip:hover { border-color: var(--cot-azul); color: var(--cot-azul); }
.egpi-cot .egpi-cot__chip:focus-visible { outline: 3px solid var(--cot-cian); outline-offset: 2px; }
.egpi-cot .egpi-cot__chip[aria-pressed="true"] { background: var(--cot-azul); border-color: var(--cot-azul); color: #fff; }
.egpi-cot .egpi-cot__chip small { margin-left: 5px; font-size: .78rem; font-weight: 400; color: var(--cot-suave); }
.egpi-cot .egpi-cot__chip[aria-pressed="true"] small { color: rgba(255, 255, 255, .78); }

/* ---- Modelo de casa: miniatura y datos ---- */
.egpi-cot__modelo { display: flex; align-items: flex-start; gap: 12px; margin-top: 10px; }
.egpi-cot__chips + .egpi-cot__modelo { margin-top: 10px; }
.egpi-cot__modelo:first-child { margin-top: 0; }
.egpi-cot__modelo picture { flex: none; display: block; }
.egpi-cot__modelo img { display: block; width: 112px; height: 72px; object-fit: cover; border-radius: 10px; }
.egpi-cot__modelo-tx { min-width: 0; }
.egpi-cot .egpi-cot__modelo-nombre { margin: 0; font: 700 .9375rem/1.3 "Plus Jakarta Sans", sans-serif; color: var(--cot-texto); }
.egpi-cot .egpi-cot__modelo-pisos { margin: 2px 0 0; font-size: .8125rem; line-height: 1.4; color: var(--cot-suave); }
.egpi-cot__mas { margin-top: 4px; font-size: .8125rem; color: var(--cot-suave); }
.egpi-cot__mas > summary { cursor: pointer; font-weight: 600; color: var(--cot-azul); list-style: none; }
.egpi-cot__mas > summary::-webkit-details-marker { display: none; }
.egpi-cot__mas > summary::after { content: " +"; }
.egpi-cot__mas[open] > summary::after { content: " −"; }
.egpi-cot .egpi-cot__mas p { margin: 6px 0 0; line-height: 1.5; color: var(--cot-texto); }

/* ---- Resumen (tarjeta azul) ---- */
.egpi-cot__resumen {
  position: sticky;
  top: 88px;
  padding: clamp(18px, 2vw, 24px);
  border-radius: 20px;
  background: var(--cot-azul);
  background-image: radial-gradient(120% 80% at 100% 0%, rgba(16, 160, 214, .35), rgba(16, 160, 214, 0) 60%);
  color: #fff;
  box-shadow: 0 24px 50px -28px rgba(4, 72, 135, .7);
  scroll-margin-top: 90px;
}
.egpi-cot .egpi-cot__resumen-label { margin: 0; font-size: .875rem; color: rgba(255, 255, 255, .8); }
.egpi-cot .egpi-cot__cuota {
  margin: 2px 0 0;
  font: 800 clamp(1.9rem, 1.5rem + 1.3vw, 2.5rem)/1.1 "Plus Jakarta Sans", sans-serif;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.egpi-cot .egpi-cot__cuota-pie { margin: 4px 0 12px; font-size: .8125rem; line-height: 1.45; color: rgba(255, 255, 255, .82); }
.egpi-cot .egpi-cot__cuota-pie b { color: #fff; font-weight: 600; }

.egpi-cot__filas { margin: 0 0 14px; border-top: 1px solid rgba(255, 255, 255, .18); }
.egpi-cot__fila {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  font-size: .875rem;
}
.egpi-cot__fila dt { color: rgba(255, 255, 255, .92); }
.egpi-cot__fila dt small { font-size: .75rem; color: rgba(255, 255, 255, .62); }
.egpi-cot__fila dd { margin: 0; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.egpi-cot__fila--total { border-bottom: 0; }
.egpi-cot__fila--total dt, .egpi-cot__fila--total dd { font-weight: 700; color: #fff; }

.egpi-cot a.egpi-cot__wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #25D366;
  color: #06301a;
  font: 600 .9375rem/1.2 "Inter", sans-serif;
  text-decoration: none;
  transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.egpi-cot a.egpi-cot__wa:hover { background: #1fc25c; color: #06301a; transform: translateY(-1px); box-shadow: 0 12px 26px rgba(37, 211, 102, .35); }
.egpi-cot a.egpi-cot__wa:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.egpi-cot__wa svg { width: 19px; height: 19px; flex: none; fill: currentColor; }
.egpi-cot .egpi-cot__ver {
  appearance: none;
  display: block;
  margin: 8px auto 0;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .9);
  font: 500 .875rem/1.2 "Inter", sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.egpi-cot .egpi-cot__ver:hover { color: #fff; }
.egpi-cot .egpi-cot__ver:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 6px; }

/* ---- Plan mes a mes ---- */
.egpi-cot__plan { margin-top: 8px; border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, .08); }
.egpi-cot__plan-scroll { max-height: 220px; overflow-y: auto; }
.egpi-cot table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.egpi-cot thead th { position: sticky; top: 0; padding: 8px 12px; background: var(--cot-azul-hondo); color: rgba(255, 255, 255, .75); font-weight: 500; text-align: left; }
.egpi-cot thead th:last-child, .egpi-cot tbody td:last-child { text-align: right; }
.egpi-cot tbody td { padding: 7px 12px; border-top: 1px solid rgba(255, 255, 255, .1); color: #fff; font-variant-numeric: tabular-nums; }

/* ---- Condiciones (plegadas) ---- */
.egpi-cot__condiciones-caja { margin-top: 12px; font-size: .8125rem; color: var(--cot-suave); }
.egpi-cot__condiciones-caja > summary { display: inline-flex; align-items: center; min-height: 36px; cursor: pointer; font-weight: 600; color: var(--cot-azul); list-style: none; }
.egpi-cot__condiciones-caja > summary::-webkit-details-marker { display: none; }
.egpi-cot__condiciones-caja > summary::after { content: "+"; margin-left: 6px; }
.egpi-cot__condiciones-caja[open] > summary::after { content: "−"; }
.egpi-cot__condiciones { margin: 4px 0 0; padding-left: 18px; max-width: 95ch; line-height: 1.55; }
.egpi-cot__condiciones li + li { margin-top: 3px; }
.egpi-cot .egpi-cot__legal { margin: 8px 0 0; max-width: 95ch; line-height: 1.55; }

/* ---- Barra de la cuota en el celular ---- */
.egpi-cot a.egpi-cot__mini { display: none; }

@media (max-width: 980px) {
  .egpi-cot__grid { grid-template-columns: 1fr; }
  .egpi-cot__resumen { position: static; }
  /* Pegada abajo mientras se mueven las opciones; deja libre el boton de WhatsApp */
  .egpi-cot a.egpi-cot__mini {
    position: sticky;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 6px 12px;
    flex-wrap: wrap;
    width: calc(100% - 64px);
    margin: 8px 0 12px;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--cot-azul);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 12px 28px -10px rgba(4, 72, 135, .6);
  }
  .egpi-cot__mini span { font-size: .78rem; color: rgba(255, 255, 255, .8); }
  .egpi-cot__mini strong { font: 700 1.0625rem/1.1 "Plus Jakarta Sans", sans-serif; font-variant-numeric: tabular-nums; }
  .egpi-cot__mini em { margin-left: auto; font-size: .78rem; font-style: normal; text-decoration: underline; text-underline-offset: 3px; }
}
@media (max-width: 560px) {
  .egpi-cot__campo { grid-template-columns: 1fr; gap: 8px; }
  .egpi-cot .egpi-cot__head { align-items: stretch; }
  .egpi-cot .egpi-cot__producto { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .egpi-cot *, .egpi-cot *::before, .egpi-cot *::after { animation: none !important; transition: none !important; }
}
