/* ============================================================================
   TPL INDEX — portada
   ----------------------------------------------------------------------------
   Los tokens, el reset y el shell (header, menu movil, footer) viven en
   css/tpl-foundation.css, que se carga antes que este archivo. Aqui solo va el
   layout propio de la portada.

   Contrato con el JS: js/index.js genera las tarjetas y los chips de comuna,
   asi que los nombres de clase de .parcel-*, .combo-*, .commune-* y
   .empty-state no se pueden cambiar sin tocar tambien ese archivo.
   ============================================================================ */

/* === 1. CINTA DE COMUNAS ================================================= */
.commune-ribbon {
  position: sticky;
  top: var(--tpl-header-h);
  z-index: var(--tpl-z-ribbon);
  height: var(--tpl-ribbon-h);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--tpl-line);
  box-shadow: 0 1px 8px rgba(0, 30, 60, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
/* El shell no scrollea: solo se mueve el carril, asi el rotulo de la izquierda
   queda fijo mientras se recorren las comunas. */
.commune-ribbon__shell {
  display: flex;
  align-items: center;
  gap: var(--tpl-space-3);
  height: 100%;
  padding: 0 10px 0 var(--tpl-gutter);
}

.commune-ribbon__intro {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-right: var(--tpl-space-3);
  border-right: 1px solid var(--tpl-line);
}
.commune-ribbon__intro span {
  font-size: var(--tpl-text-xs);
  font-weight: 800;
  letter-spacing: var(--tpl-tracking-caps);
  text-transform: uppercase;
  color: var(--tpl-muted);
  white-space: nowrap;
}
.commune-ribbon__intro strong { display: none; }

.commune-ribbon__track {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--tpl-space-1);
}

.commune-ribbon__groups {
  display: flex;
  align-items: center;
  gap: 6px;
  /* min-width:0 es la clave: sin esto el carril no se encoge por debajo de su
     contenido, nunca desborda y el overflow-x no tiene nada que scrollear, asi
     que las ultimas comunas quedan recortadas y sin acceso. */
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Degradado en los bordes: avisa que queda cinta hacia ese lado. Lo activa el
     JS por atributo, no siempre, para no velar chips sin motivo. */
  --fade-start: 0px;
  --fade-end: 0px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent 100%);
}
.commune-ribbon__groups::-webkit-scrollbar { display: none; }
.commune-ribbon__track[data-overflow-start] .commune-ribbon__groups { --fade-start: 26px; }
.commune-ribbon__track[data-overflow-end] .commune-ribbon__groups { --fade-end: 26px; }

/* Las flechas ocupan sitio siempre (asi nada salta al aparecer) pero solo se
   ven cuando de verdad queda cinta por recorrer hacia ese lado. */
.commune-ribbon__arrow {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  visibility: hidden;
  border: 1px solid var(--tpl-line);
  border-radius: var(--tpl-radius-pill);
  background: #fff;
  color: var(--tpl-navy-900);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--tpl-shadow-xs);
  transition: background-color var(--tpl-duration-fast) ease, color var(--tpl-duration-fast) ease, border-color var(--tpl-duration-fast) ease;
}
.commune-ribbon__arrow:hover {
  background: var(--tpl-navy-900);
  border-color: var(--tpl-navy-900);
  color: #fff;
}
.commune-ribbon__track[data-overflow-start] .commune-ribbon__arrow--prev,
.commune-ribbon__track[data-overflow-end] .commune-ribbon__arrow--next { visibility: visible; }

.commune-region {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
/* El nombre de region (Biobio, Nuble, La Araucania) va antes de sus comunas. */
.commune-region > strong {
  display: inline-block;
  margin-right: 2px;
  font-size: var(--tpl-text-xs);
  font-weight: 800;
  letter-spacing: var(--tpl-tracking-wide);
  text-transform: uppercase;
  color: var(--tpl-muted);
  white-space: nowrap;
}
.commune-region + .commune-region::before {
  content: "";
  flex-shrink: 0;
  display: inline-block;
  width: 1px;
  height: 16px;
  margin-right: 2px;
  background: var(--tpl-line);
}

.commune-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1px solid var(--tpl-line);
  border-radius: var(--tpl-radius-pill);
  background: #fff;
  color: var(--tpl-navy-900);
  font-size: var(--tpl-text-sm);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--tpl-duration-fast) ease, color var(--tpl-duration-fast) ease, border-color var(--tpl-duration-fast) ease;
}
.commune-chip:hover,
.commune-chip.is-active {
  background: var(--tpl-navy-900);
  border-color: var(--tpl-navy-900);
  color: #fff;
}

/* === 2. BARRA DE CONFIANZA =============================================== */
.tpl-trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--tpl-space-2) var(--tpl-space-4);
  padding: 10px var(--tpl-gutter);
  background: #fff;
  border-bottom: 1px solid var(--tpl-line);
  color: var(--tpl-ink-3);
  font-size: var(--tpl-text-sm);
}
.tpl-trust-bar strong { color: var(--tpl-navy-900); font-weight: 800; }
.tpl-trust-sep { color: var(--tpl-line-2); }
.tpl-trust-cta a {
  color: var(--tpl-orange-600);
  font-weight: 700;
  text-decoration: none;
}
.tpl-trust-cta a:hover { text-decoration: underline; }

/* Bloques de fondo oscuro de la portada. */
.tpl-hero,
.tpl-search-widget,
.tpl-campo-story { --tpl-heading-color: #fff; }

/* === 3. HERO ============================================================= */
.tpl-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(78vh, 760px);
  overflow: hidden;
  background: var(--tpl-navy-900);
}
.tpl-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  opacity: 0.62;
  transform: scale(1.02);
  transition: transform 10s ease;
}
.tpl-hero:hover .tpl-hero__bg { transform: scale(1.05); }
/* Sin texto a la izquierda el degradado lateral ya no protege nada: la foto se
   lee mejor con una vineta centrada que oscurece solo los bordes. */
.tpl-hero__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 42%, rgba(0, 22, 44, 0.18) 0%, rgba(0, 22, 44, 0.62) 62%, rgba(0, 18, 36, 0.86) 100%),
    linear-gradient(0deg, rgba(0, 20, 38, 0.62), transparent 46%);
}
.tpl-hero__inner {
  position: relative;
  z-index: 2;
  width: min(1300px, 100%);
  margin-inline: auto;
  padding: clamp(56px, 8vw, 104px) var(--tpl-gutter) clamp(48px, 7vw, 88px);
}

/* El H1 sigue en el documento por SEO y lectores de pantalla, pero el hero
   visible es solo el buscador. Tecnica estandar de ocultamiento accesible. */
.tpl-hero__h1-seo {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* === 4. BUSCADOR (consola de vidrio ahumado sobre la foto) =============== */
/* Es el unico elemento del hero: se centra, ocupa ancho de consola y separa los
   dos pasos en columnas para que la busqueda se lea de un vistazo. */
.tpl-search-widget {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(20px, 3vw, 48px);
  width: min(1060px, 100%);
  margin-inline: auto;
  padding: clamp(26px, 3.2vw, 40px) clamp(22px, 3vw, 40px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--tpl-radius-xl);
  background: linear-gradient(160deg, rgba(8, 44, 72, 0.78) 0%, rgba(2, 22, 40, 0.9) 100%);
  backdrop-filter: blur(30px) saturate(1.2);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
  color: #fff;
  box-shadow:
    0 32px 80px rgba(0, 12, 26, 0.5),
    0 2px 0 rgba(255, 255, 255, 0.12) inset,
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  animation: tpl-fade-up 1s var(--tpl-ease) 0.1s both;
}
/* Filo dorado superior: el detalle que separa "caja translucida" de "consola". */
.tpl-search-widget::before {
  content: "";
  position: absolute;
  top: -1px;
  right: 14%;
  left: 14%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--tpl-gold-400), transparent);
  opacity: 0.75;
  pointer-events: none;
}
/* Halo calido detras del vidrio para despegarlo de la foto. */
.tpl-search-widget::after {
  content: "";
  position: absolute;
  inset: -40px -20px -30px;
  z-index: -1;
  border-radius: 44px;
  background: radial-gradient(60% 60% at 50% 50%, rgba(242, 207, 74, 0.13), transparent 70%);
  pointer-events: none;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tpl-search-widget { background: linear-gradient(160deg, #08324f 0%, #02182a 100%); }
}

.widget-panel { min-width: 0; }

/* Los titulos de paso son el ancla visual del widget: antes competian de igual
   a igual con las etiquetas chicas de alrededor. */
.tpl-search-widget .widget-panel h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tpl-space-3);
  margin: 0 0 var(--tpl-space-5);
  font-family: var(--tpl-font-sans);
  font-size: var(--tpl-text-lg);
  font-weight: 700;
  line-height: var(--tpl-leading-snug);
  letter-spacing: -0.015em;
  color: #fff;
}
.tpl-search-widget .widget-panel h3 .widget-step-title { min-width: 0; }
/* Numero de paso como ficha dorada: ordena la lectura sin gastar tipografia. */
.widget-step {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(242, 207, 74, 0.55);
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(242, 207, 74, 0.24), rgba(242, 207, 74, 0.06));
  color: var(--tpl-gold-400);
  font-size: var(--tpl-text-base);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 4px rgba(242, 207, 74, 0.07);
}
.tpl-search-widget .widget-panel h3 small {
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--tpl-radius-pill);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.66);
  font-size: var(--tpl-text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.method-hint {
  margin: 0 0 var(--tpl-space-4);
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--tpl-text-base);
  line-height: var(--tpl-leading-normal);
}

/* Separador: vertical entre columnas en escritorio, horizontal al apilar. */
.widget-divider {
  align-self: stretch;
  width: 1px;
  height: auto;
  margin: 0;
  border: none;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.3) 18%, rgba(255, 255, 255, 0.3) 82%, transparent);
}

/* --- Selector de metodo: control segmentado ------------------------------ */
.search-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: var(--tpl-space-5);
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--tpl-radius-pill);
  background: rgba(0, 14, 28, 0.34);
}
.search-method {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--tpl-space-2);
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: var(--tpl-radius-pill);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--tpl-text-base);
  font-weight: 600;
  text-align: center;
  transition: background-color var(--tpl-duration-fast) ease,
              color var(--tpl-duration-fast) ease,
              border-color var(--tpl-duration-fast) ease;
}
.search-method:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.search-method strong { font-weight: 700; }
.search-method__icon { width: 17px; height: 17px; flex: none; }
/* Sobre azul profundo el acento es el dorado de marca: el naranjo del resto del
   sitio esta calibrado para fondo claro y aqui pierde contraste. */
.search-method.is-active,
.search-method.is-active:hover {
  border-color: rgba(242, 207, 74, 0.5);
  background: linear-gradient(160deg, rgba(242, 207, 74, 0.2), rgba(242, 207, 74, 0.08));
  color: var(--tpl-gold-400);
  box-shadow: 0 6px 18px rgba(0, 12, 26, 0.35);
}

.method-panel { padding: 0; }
.status-text {
  display: block;
  min-height: 18px;
  margin-top: var(--tpl-space-3);
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--tpl-text-sm);
}

/* --- Campos sobre fondo oscuro ------------------------------------------
   tpl-foundation.css estiliza input/select para fondo claro. Dentro del widget
   hay que invertirlos a mano; el selector lleva .tpl-search-widget delante para
   ganarle en especificidad a `select:not([multiple]):not([size])`. */
.field-shell {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: var(--tpl-space-4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--tpl-radius-md);
  background: rgba(0, 14, 28, 0.34);
  transition: border-color var(--tpl-duration-fast) ease, box-shadow var(--tpl-duration-fast) ease;
}
.field-shell:hover { border-color: rgba(255, 255, 255, 0.34); }
.field-shell:focus-within {
  border-color: var(--tpl-gold-400);
  box-shadow: 0 0 0 3px rgba(242, 207, 74, 0.2);
}
.tpl-search-widget .method-panel select {
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 14px 44px 14px 16px;
  border: none;
  border-radius: var(--tpl-radius-md);
  background-color: transparent;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23f2cf4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
  color: #fff;
  font-size: var(--tpl-text-md);
  font-weight: 600;
}
/* Opaco a proposito: en Chrome el desplegable hereda este fondo, y con un rgba
   translucido las opciones salian en blanco sobre blanco. */
.tpl-search-widget .method-panel select option { background: #0b2f4d; color: #fff; }
.tpl-search-widget .method-panel select:focus { box-shadow: none; outline: none; }

/* --- Boton primario del widget ------------------------------------------- */
.primary-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--tpl-space-2);
  width: 100%;
  min-height: 56px;
  padding: 15px 20px;
  overflow: hidden;
  border: none;
  border-radius: var(--tpl-radius-pill);
  background: linear-gradient(135deg, var(--tpl-orange-500) 0%, var(--tpl-orange-600) 100%);
  color: #fff;
  font-size: var(--tpl-text-md);
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 26px rgba(0, 16, 32, 0.42), 0 1px 0 rgba(255, 255, 255, 0.22) inset;
  transition: background var(--tpl-duration) var(--tpl-ease-out),
              box-shadow var(--tpl-duration) var(--tpl-ease-out),
              transform var(--tpl-duration) var(--tpl-ease-out);
}
.btn-icon { width: 19px; height: 19px; flex: none; }
.btn-icon--arrow { transition: transform var(--tpl-duration) var(--tpl-ease-out); }
/* Brillo que barre el boton al pasar el cursor. */
.primary-button::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg);
  transition: left var(--tpl-duration-slow) var(--tpl-ease-out);
  pointer-events: none;
}
.primary-button:hover::after { left: 115%; }
/* En hover se oscurece en vez de aclararse: sube el contraste del texto blanco
   en lugar de bajarlo, y el relieve lo da el desplazamiento. */
.primary-button:hover {
  background: linear-gradient(135deg, var(--tpl-orange-600) 0%, var(--tpl-orange-700) 100%);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0, 16, 32, 0.5), 0 1px 0 rgba(255, 255, 255, 0.22) inset;
}
.primary-button:hover .btn-icon--arrow { transform: translateX(4px); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { opacity: 0.6; transform: none; cursor: not-allowed; }
.primary-button:disabled::after { display: none; }

/* El paso 2 es opcional: va en dorado para no competir con el CTA naranjo del
   paso 1 y a la vez destacar sobre el vidrio azul (texto navy sobre oro, 11:1). */
.combo-search-button {
  background: linear-gradient(135deg, var(--tpl-gold-400) 0%, var(--tpl-gold-500) 100%);
  color: var(--tpl-navy-950);
}
.combo-search-button:hover {
  background: linear-gradient(135deg, var(--tpl-gold-500) 0%, var(--tpl-gold-600) 100%);
  color: var(--tpl-navy-950);
}

/* --- Presupuesto combinado ----------------------------------------------- */
.combo-budget-form { display: block; }
.combo-budget-input-wrap {
  gap: var(--tpl-space-2);
  padding: 6px 16px;
}
.combo-budget-input-wrap b {
  color: var(--tpl-gold-400);
  font-size: var(--tpl-text-xl);
  font-weight: 700;
  line-height: 1;
}
.combo-budget-unit {
  flex: none;
  padding-left: var(--tpl-space-2);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--tpl-text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
}
.tpl-search-widget .combo-budget-input-wrap input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: var(--tpl-text-md);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  box-shadow: none;
}
.tpl-search-widget .combo-budget-input-wrap input:focus { box-shadow: none; outline: none; }
.tpl-search-widget .combo-budget-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}

.combo-budget-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--tpl-space-2);
  margin-bottom: var(--tpl-space-4);
}
.combo-budget-quick button {
  min-height: 42px;
  padding: 8px 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--tpl-radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: var(--tpl-text-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background-color var(--tpl-duration-fast) ease,
              border-color var(--tpl-duration-fast) ease,
              color var(--tpl-duration-fast) ease,
              transform var(--tpl-duration-fast) ease;
}
.combo-budget-quick button:hover {
  background: rgba(242, 207, 74, 0.16);
  border-color: var(--tpl-gold-400);
  color: var(--tpl-gold-400);
  transform: translateY(-1px);
}
.combo-budget-quick button.is-active {
  border-color: var(--tpl-gold-400);
  background: linear-gradient(160deg, rgba(242, 207, 74, 0.26), rgba(242, 207, 74, 0.1));
  color: var(--tpl-gold-400);
}
/* === 5. VIDEO CORPORATIVO ================================================ */
.tpl-video-section {
  width: min(1300px, 100%);
  margin-inline: auto;
  padding: var(--tpl-section-y) var(--tpl-gutter);
}
.tpl-video-section__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(28px, 4.5vw, 64px);
  align-items: center;
}
.tpl-section-eyebrow { margin-bottom: var(--tpl-space-3); }
.tpl-video-section__copy h2 {
  margin: 0 0 var(--tpl-space-4);
  font-size: var(--tpl-text-2xl);
}
.tpl-video-section__copy p {
  margin-bottom: var(--tpl-space-6);
  color: var(--tpl-ink-3);
  line-height: var(--tpl-leading-relaxed);
}
.tpl-video-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 3px;
  border-bottom: 2px solid rgba(0, 63, 122, 0.24);
  color: var(--tpl-navy-800);
  font-size: var(--tpl-text-base);
  font-weight: 700;
  text-decoration: none;
  transition: color var(--tpl-duration-fast) ease, border-color var(--tpl-duration-fast) ease;
}
.tpl-video-link:hover { color: var(--tpl-orange-600); border-color: var(--tpl-orange-600); }

.tpl-video-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--tpl-radius-lg);
  background: #000;
  box-shadow: var(--tpl-shadow-lg);
}
.tpl-video-player-wrap iframe,
.tpl-video-player-wrap .video-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.video-wrapper iframe { width: 100%; height: 100%; border: none; }

.tpl-video-play-hint {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--tpl-space-3);
  background: rgba(0, 43, 84, 0.42);
  cursor: pointer;
  transition: opacity var(--tpl-duration-slow) ease;
}
.tpl-video-play-hint span {
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--tpl-text-sm);
  font-weight: 700;
  letter-spacing: var(--tpl-tracking-wide);
  text-transform: uppercase;
}

/* === 7. RESULTADOS COMBINADOS ============================================ */
.combo-results-wrap {
  width: min(var(--tpl-container), 100%);
  margin: 0 auto var(--tpl-space-12);
  padding-inline: var(--tpl-gutter);
}
.combo-results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--tpl-space-5);
  margin-bottom: var(--tpl-space-6);
}
.combo-results-head h2 { margin: var(--tpl-space-2) 0 var(--tpl-space-1); font-size: var(--tpl-text-2xl); }
.combo-results-head p { color: var(--tpl-ink-3); font-size: var(--tpl-text-base); }

.combo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr));
  gap: var(--tpl-space-6);
}
.combo-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--tpl-line);
  border-radius: var(--tpl-radius-md);
  background: #fff;
  box-shadow: var(--tpl-shadow-sm);
  transition: transform var(--tpl-duration) var(--tpl-ease), box-shadow var(--tpl-duration) var(--tpl-ease);
}
.combo-card:hover { transform: translateY(-3px); box-shadow: var(--tpl-shadow-md); }

.combo-visual {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 1fr;
  background: var(--tpl-surface-2);
}
.combo-visual figure { margin: 0; overflow: hidden; }
.combo-visual figure img { width: 100%; height: 100%; object-fit: cover; }
.combo-visual figure figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 4px 9px;
  background: rgba(0, 22, 44, 0.62);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.combo-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 5px 11px;
  border-radius: var(--tpl-radius-pill);
  background: var(--tpl-navy-900);
  color: #fff;
  font-size: var(--tpl-text-xs);
  font-weight: 800;
}

.combo-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--tpl-space-2);
  padding: var(--tpl-space-5) var(--tpl-space-4);
}
.combo-card-body h3 {
  margin: 0;
  font-family: var(--tpl-font-sans);
  font-size: var(--tpl-text-base);
  font-weight: 800;
  line-height: var(--tpl-leading-snug);
  letter-spacing: 0;
  color: var(--tpl-ink);
}
.combo-location { color: var(--tpl-muted); font-size: var(--tpl-text-sm); }
.combo-specs { flex: 1; display: flex; flex-direction: column; gap: var(--tpl-space-1); }
.combo-specs span { color: var(--tpl-muted); font-size: var(--tpl-text-sm); }

.combo-total {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--tpl-space-2);
  padding-top: var(--tpl-space-3);
  border-top: 1px solid var(--tpl-line);
}
.combo-total small { display: block; color: var(--tpl-muted); font-size: var(--tpl-text-xs); }
.combo-total strong { color: var(--tpl-navy-900); font-size: var(--tpl-text-lg); font-weight: 800; }
.combo-difference {
  padding: 4px 10px;
  border-radius: var(--tpl-radius-pill);
  font-size: var(--tpl-text-xs);
  font-weight: 700;
}
.combo-difference.is-under { background: var(--tpl-success-bg); color: var(--tpl-success); }
.combo-difference.is-over { background: var(--tpl-danger-bg); color: var(--tpl-danger); }

.combo-actions { display: flex; flex-wrap: wrap; gap: var(--tpl-space-2); }
.combo-primary, .combo-secondary {
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 8px;
  border: 1px solid transparent;
  border-radius: var(--tpl-radius-xs);
  font-size: var(--tpl-text-sm);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--tpl-duration-fast) ease, border-color var(--tpl-duration-fast) ease, color var(--tpl-duration-fast) ease;
}
.combo-primary { background: var(--tpl-navy-800); color: #fff; }
.combo-primary:hover { background: var(--tpl-navy-900); }
.combo-secondary { background: #fff; border-color: var(--tpl-line-2); color: var(--tpl-navy-900); }
.combo-secondary:hover { background: var(--tpl-navy-050); border-color: var(--tpl-navy-700); }

.combo-empty {
  grid-column: 1 / -1;
  padding: var(--tpl-space-10) var(--tpl-space-6);
  border: 1px dashed var(--tpl-line-2);
  border-radius: var(--tpl-radius-md);
  background: var(--tpl-surface-2);
  color: var(--tpl-ink-3);
  text-align: center;
}

/* === 8. RESULTADOS ======================================================= */
.results-section {
  width: min(var(--tpl-container), 100%);
  margin-inline: auto;
  padding: var(--tpl-space-10) var(--tpl-gutter) var(--tpl-section-y);
}
.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--tpl-space-5);
  margin-bottom: var(--tpl-space-1);
}
/* Sin encabezado de texto la barra solo lleva el boton de mapa: se alinea a la
   derecha y no necesita el margen inferior que separaba del titulo. */
.results-toolbar--bare {
  justify-content: flex-end;
  margin-bottom: 0;
}
.results-toolbar h2 { margin: var(--tpl-space-1) 0; font-size: var(--tpl-text-2xl); }
.results-toolbar p { color: var(--tpl-ink-3); font-size: var(--tpl-text-base); }
.context-label { margin-bottom: var(--tpl-space-1); }

.map-button {
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--tpl-line-2);
  border-radius: var(--tpl-radius-xs);
  background: #fff;
  color: var(--tpl-navy-900);
  font-size: var(--tpl-text-base);
  font-weight: 700;
  white-space: nowrap;
  transition: background-color var(--tpl-duration-fast) ease, border-color var(--tpl-duration-fast) ease, color var(--tpl-duration-fast) ease;
}
.map-button:hover:not(:disabled) { background: var(--tpl-navy-900); border-color: var(--tpl-navy-900); color: #fff; }
.map-button:disabled { opacity: 0.45; cursor: not-allowed; }

.premium-map-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(0, 43, 84, 0.15);
  border-radius: 28px;
  background: #fff;
  color: var(--tpl-navy-900);
  font-size: var(--tpl-text-lg);
  font-weight: 700;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}
.premium-map-btn__bg {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 43, 84, 0.05) 2px, transparent 2px),
    radial-gradient(circle at 30% 60%, rgba(0, 43, 84, 0.05) 2px, transparent 2px),
    radial-gradient(circle at 70% 30%, rgba(0, 43, 84, 0.05) 2px, transparent 2px),
    radial-gradient(circle at 90% 80%, rgba(0, 43, 84, 0.05) 2px, transparent 2px);
  background-size: 40px 40px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}
.premium-map-btn__content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.85);
  padding: 8px 24px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: all 0.3s ease;
}
.premium-map-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 43, 84, 0.15);
  border-color: var(--tpl-navy-300);
}
.premium-map-btn:hover:not(:disabled) .premium-map-btn__content {
  background: var(--tpl-navy-900);
  color: #fff;
}
.premium-map-btn:hover:not(:disabled) .premium-map-btn__bg {
  opacity: 1;
}
.premium-map-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}
.premium-map-btn__icon {
  width: 22px;
  height: 22px;
}

/* --- Filtros de la grilla ------------------------------------------------
   Se pega bajo el header + la cinta de comunas para no perderse al scrollear
   una lista larga de resultados. */
.priority-bar {
  position: sticky;
  top: calc(var(--tpl-header-h) + var(--tpl-ribbon-h));
  z-index: 100;
  display: flex;
  gap: var(--tpl-space-2);
  margin: var(--tpl-space-4) calc(var(--tpl-gutter) * -1) var(--tpl-space-6);
  padding: var(--tpl-space-3) var(--tpl-gutter);
  overflow-x: auto;
  background: rgba(246, 249, 252, 0.94);
  border-bottom: 1px solid var(--tpl-line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  scrollbar-width: none;
}
.priority-bar::-webkit-scrollbar { display: none; }
.priority-bar button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 20px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: transparent;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: all 0.25s ease;
}
.priority-bar button:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.priority-bar button.is-active {
  background: #0f172a;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}
/* El filtro de oportunidades se distingue sutilmente */
.priority-bar .priority-opportunity {
  color: #b45309;
  background: #fffbeb;
}
.priority-bar .priority-opportunity:hover {
  background: #fef3c7;
  color: #92400e;
}
.priority-bar .priority-opportunity.is-active {
  background: #d97706;
  color: #fff;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.2);
}
.priority-inline-status {
  display: block;
  margin-top: var(--tpl-space-2);
  color: var(--tpl-muted);
  font-size: var(--tpl-text-sm);
}

/* === 9. ESQUELETOS DE CARGA ============================================== */
.skeleton-card {
  overflow: hidden;
  border: 1px solid var(--tpl-line);
  border-radius: var(--tpl-radius-md);
  background: #fff;
  animation: tpl-pulse 1.5s ease-in-out infinite;
}
.skeleton-img { width: 100%; aspect-ratio: 4 / 3; background: var(--tpl-surface-3); }
.skeleton-body { display: flex; flex-direction: column; gap: var(--tpl-space-2); padding: var(--tpl-space-4) var(--tpl-space-4) var(--tpl-space-5); }
.skeleton-line { height: 11px; border-radius: var(--tpl-radius-xs); background: var(--tpl-surface-3); }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-55 { width: 55%; }

/* === 10. MAPA ============================================================ */
.map-panel {
  margin-bottom: var(--tpl-space-6);
  overflow: hidden;
  border: 1px solid var(--tpl-line);
  border-radius: var(--tpl-radius-md);
  background: #fff;
  box-shadow: var(--tpl-shadow-sm);
}
.map-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tpl-space-3);
  padding: var(--tpl-space-3) var(--tpl-space-4);
  border-bottom: 1px solid var(--tpl-line);
}
.map-panel-head strong { color: var(--tpl-ink); font-size: var(--tpl-text-base); }
.map-panel-head button {
  min-height: 38px;
  padding: 6px 12px;
  border: none;
  border-radius: var(--tpl-radius-xs);
  background: none;
  color: var(--tpl-navy-800);
  font-size: var(--tpl-text-base);
  font-weight: 700;
  transition: background-color var(--tpl-duration-fast) ease;
}
.map-panel-head button:hover { background: var(--tpl-surface-2); }
.map-canvas {
  height: clamp(320px, 50vh, 460px);
  /* Leaflet pone position:relative pero deja z-index:auto en su contenedor,
     así que sus capas internas (controles hasta 1000, panes hasta 400) se
     escapan del flujo normal y flotan sobre el header/cinta/filtros sticky
     al hacer scroll. z-index:0 crea un contexto de apilamiento propio que
     las contiene, dejando el mapa a la misma profundidad que la grilla. */
  position: relative;
  z-index: 0;
}

/* === 11. TARJETAS DE PARCELA ============================================= */
.parcel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--tpl-space-6);
}

article.parcel-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--tpl-line);
  border-radius: var(--tpl-radius-md);
  background: #fff;
  box-shadow: var(--tpl-shadow-sm);
  cursor: pointer;
  transition: transform var(--tpl-duration-slow) var(--tpl-ease),
              box-shadow var(--tpl-duration-slow) var(--tpl-ease),
              border-color var(--tpl-duration) ease;
}
@media (prefers-reduced-motion: no-preference) {
  .parcel-card { animation: tpl-fade-up 0.5s var(--tpl-ease) both; }
}
article.parcel-card:hover,
article.parcel-card:focus-within {
  transform: translateY(-6px);
  border-color: var(--tpl-line-2);
  box-shadow: var(--tpl-shadow-lg);
}
.parcel-card.is-opportunity { border-color: var(--tpl-gold-500); }
.parcel-card:focus-visible { outline: 2px solid var(--tpl-navy-700); outline-offset: 3px; }

.parcel-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, var(--tpl-surface-3), #e4eaf1);
}
.parcel-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--tpl-ease);
}
.parcel-card:hover .parcel-image img { transform: scale(1.06); }
.parcel-image.is-broken img { display: none; }
.parcel-image.is-broken::after {
  content: "\1F3DE";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: 0.5;
}

.parcel-price {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 7px 14px;
  border-radius: var(--tpl-radius-pill);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--tpl-navy-900);
  font-size: var(--tpl-text-md);
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 14px rgba(0, 30, 60, 0.18);
}
.parcel-distance {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  border-radius: var(--tpl-radius-pill);
  background: rgba(0, 43, 84, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: var(--tpl-text-xs);
  font-weight: 700;
}
.parcel-opportunity {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 11px;
  border-radius: var(--tpl-radius-pill);
  background: var(--tpl-gold-500);
  color: #2a2306;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.parcel-body { flex: 1; display: flex; flex-direction: column; padding: var(--tpl-space-5); }
.parcel-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 var(--tpl-space-3);
  font-family: var(--tpl-font-display);
  font-size: var(--tpl-text-lg);
  font-weight: 600;
  line-height: var(--tpl-leading-snug);
  letter-spacing: -0.01em;
  color: var(--tpl-navy-900);
}
.parcel-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: var(--tpl-space-3);
  color: var(--tpl-muted);
  font-size: var(--tpl-text-sm);
}
.parcel-fact { white-space: nowrap; }
.parcel-fact--comuna { color: var(--tpl-ink-2); font-weight: 600; }
.parcel-fact:not(:last-child)::after { content: "\B7"; margin: 0 7px; color: var(--tpl-line-2); }

.parcel-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--tpl-space-2); }
.parcel-tag {
  padding: 4px 10px;
  border-radius: var(--tpl-radius-pill);
  background: var(--tpl-teal-100);
  color: var(--tpl-teal-700);
  font-size: 0.7rem;
  font-weight: 700;
}
.parcel-value-note {
  display: block;
  margin-top: 2px;
  color: var(--tpl-navy-700);
  font-size: var(--tpl-text-sm);
  font-weight: 700;
}
.parcel-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: var(--tpl-space-3);
  color: var(--tpl-navy-700);
  font-size: var(--tpl-text-base);
  font-weight: 700;
}
.parcel-cta svg { transition: transform var(--tpl-duration) ease; }
.parcel-card:hover .parcel-cta svg { transform: translateX(3px); }

.empty-state {
  grid-column: 1 / -1;
  padding: var(--tpl-space-12) var(--tpl-space-6);
  border: 1px dashed var(--tpl-line-2);
  border-radius: var(--tpl-radius-md);
  background: var(--tpl-surface-2);
  color: var(--tpl-ink-3);
  text-align: center;
}

/* --- Radar de mercado: estado vacio con propuesta de servicio ------------ */
.market-radar-state {
  grid-column: 1 / -1;
  display: grid;
  gap: var(--tpl-space-5);
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--tpl-line);
  border-radius: var(--tpl-radius-md);
  background: #fff;
  box-shadow: var(--tpl-shadow-sm);
  text-align: left;
}
.market-radar-state__tag {
  justify-self: start;
  padding: 5px 14px;
  border-radius: var(--tpl-radius-pill);
  background: var(--tpl-navy-800);
  color: #fff;
  font-size: var(--tpl-text-xs);
  font-weight: 800;
  letter-spacing: var(--tpl-tracking-wide);
}
.market-radar-state h3 { margin: 0; font-size: var(--tpl-text-xl); color: var(--tpl-navy-900); }
.market-radar-state p { color: var(--tpl-ink-3); }
.market-radar-state__summary {
  padding: var(--tpl-space-4) var(--tpl-space-5);
  border: 1px solid var(--tpl-line);
  border-radius: var(--tpl-radius-sm);
  background: var(--tpl-surface-2);
}
.market-radar-state__summary strong { display: block; margin-bottom: var(--tpl-space-2); color: var(--tpl-navy-800); }
.market-radar-state__summary ul { display: grid; gap: 6px; padding-left: var(--tpl-space-5); list-style: disc; color: var(--tpl-ink-3); }
.market-radar-state__offer {
  padding: var(--tpl-space-5);
  border-left: 4px solid var(--tpl-navy-700);
  border-radius: 0 var(--tpl-radius-sm) var(--tpl-radius-sm) 0;
  background: var(--tpl-navy-050);
}
.market-radar-state__offer strong { display: block; margin-bottom: var(--tpl-space-2); color: var(--tpl-navy-900); font-size: var(--tpl-text-lg); }
.market-radar-state__offer p { margin-bottom: var(--tpl-space-4); color: var(--tpl-ink-2); }

/* === 12. VER MAS ========================================================= */
.load-more {
  display: block;
  min-height: 48px;
  margin: var(--tpl-space-8) auto 0;
  padding: 13px 34px;
  border: 1px solid var(--tpl-navy-900);
  border-radius: var(--tpl-radius-pill);
  background: #fff;
  color: var(--tpl-navy-900);
  font-size: var(--tpl-text-base);
  font-weight: 700;
  transition: background-color var(--tpl-duration-fast) ease, color var(--tpl-duration-fast) ease, box-shadow var(--tpl-duration-fast) ease;
}
.load-more:hover { background: var(--tpl-navy-900); color: #fff; box-shadow: var(--tpl-shadow-sm); }

/* === 13. BANNER DEL TASADOR ============================================== */
.tpl-valuation-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--tpl-space-6);
  width: min(var(--tpl-container), 100%);
  margin-inline: auto;
  padding: var(--tpl-space-8) var(--tpl-gutter);
  border-block: 1px solid var(--tpl-navy-200);
  background: linear-gradient(135deg, var(--tpl-navy-050) 0%, var(--tpl-navy-100) 100%);
}
.tpl-valuation-banner__copy span {
  display: block;
  margin-bottom: var(--tpl-space-1);
  color: var(--tpl-navy-800);
  font-size: var(--tpl-text-xs);
  font-weight: 800;
  letter-spacing: var(--tpl-tracking-caps);
  text-transform: uppercase;
}
.tpl-valuation-banner__copy strong {
  display: block;
  margin-bottom: var(--tpl-space-1);
  font-family: var(--tpl-font-sans);
  font-size: var(--tpl-text-lg);
  font-weight: 800;
  color: var(--tpl-ink);
}
.tpl-valuation-banner__copy p { max-width: 62ch; color: var(--tpl-ink-3); font-size: var(--tpl-text-base); }
.tpl-valuation-banner__cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 13px 24px;
  border-radius: var(--tpl-radius-pill);
  background: var(--tpl-navy-900);
  color: #fff;
  font-size: var(--tpl-text-base);
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0, 43, 84, 0.22);
  transition: background-color var(--tpl-duration) var(--tpl-ease-out),
              transform var(--tpl-duration) var(--tpl-ease-out),
              box-shadow var(--tpl-duration) var(--tpl-ease-out);
}
.tpl-valuation-banner__cta:hover {
  background: var(--tpl-navy-800);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 43, 84, 0.3);
}

/* === 14. HISTORIA DEL CAMPO ============================================== */
.tpl-campo-story {
  position: relative;
  width: min(1300px, 100% - (var(--tpl-gutter) * 2));
  min-height: 360px;
  margin: var(--tpl-section-y) auto;
  overflow: hidden;
  border-radius: var(--tpl-radius-lg);
  box-shadow: var(--tpl-shadow-lg);
}
.tpl-campo-story::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("../assets/tpl-bienvenida-campo.webp") center / cover no-repeat;
  transition: transform 0.8s ease;
}
.tpl-campo-story:hover::before { transform: scale(1.03); }
.tpl-campo-story::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(105deg, rgba(0, 22, 44, 0.94) 0%, rgba(0, 43, 84, 0.82) 45%, rgba(0, 43, 84, 0.2) 100%);
}
.tpl-campo-story__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--tpl-space-10);
  padding: clamp(40px, 6vw, 72px) clamp(24px, 5vw, 64px);
}
.tpl-campo-story__eyebrow {
  margin-bottom: var(--tpl-space-5);
  padding: 7px 16px;
  border-radius: var(--tpl-radius-pill);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--tpl-gold-400);
  letter-spacing: 0.18em;
}
.tpl-campo-story__content h2 {
  margin: 0 0 var(--tpl-space-5);
  font-size: var(--tpl-text-3xl);
  font-weight: 500;
  color: #fff;
}
.tpl-campo-story__content p {
  max-width: 52ch;
  margin-bottom: var(--tpl-space-8);
  color: rgba(255, 255, 255, 0.84);
  font-size: var(--tpl-text-lg);
  line-height: var(--tpl-leading-relaxed);
}
.tpl-campo-story__action {
  display: inline-flex;
  align-items: center;
  gap: var(--tpl-space-2);
  min-height: 52px;
  padding: 14px 28px;
  border-radius: var(--tpl-radius-pill);
  background: var(--tpl-gold-400);
  color: var(--tpl-navy-900);
  font-size: var(--tpl-text-md);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  transition: background-color var(--tpl-duration) var(--tpl-ease-out),
              transform var(--tpl-duration) var(--tpl-ease-out),
              box-shadow var(--tpl-duration) var(--tpl-ease-out);
}
.tpl-campo-story__action:hover {
  background: #fff;
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
}

/* === 15. RESPONSIVE ====================================================== */

/* Escritorio angosto / notebook */
@media (max-width: 1180px) {
  .parcel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Tablet */
@media (max-width: 1024px) {
  /* La consola pasa de dos columnas a una sola: el separador vuelve a ser una
     linea horizontal entre los dos pasos. */
  .tpl-search-widget {
    grid-template-columns: minmax(0, 1fr);
    width: min(560px, 100%);
    gap: var(--tpl-space-6);
  }
  .widget-divider {
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3) 12%, rgba(255, 255, 255, 0.3) 88%, transparent);
  }
  .tpl-video-section__inner { grid-template-columns: minmax(0, 1fr); }
  .tpl-campo-story__inner { grid-template-columns: minmax(0, 1fr); }
}

/* Movil grande */
@media (max-width: 820px) {
  .parcel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpl-valuation-banner { flex-direction: column; align-items: flex-start; text-align: left; }
  .tpl-valuation-banner__cta { align-self: stretch; justify-content: center; }
  /* En tactil la cinta se arrastra con el dedo: las flechas solo roban ancho. */
  .commune-ribbon__arrow { display: none; }
  .commune-ribbon__shell { gap: var(--tpl-space-2); padding-right: var(--tpl-space-2); }
  .combo-card { grid-template-columns: minmax(0, 1fr); }
  .combo-visual { grid-template-rows: 160px 160px; }
}

/* Movil */
@media (max-width: 620px) {
  .tpl-hero { min-height: 0; }
  .tpl-search-widget { border-radius: var(--tpl-radius-lg); }
  .tpl-search-widget::after { display: none; }
  .search-method { flex-direction: column; gap: 3px; padding: 9px 6px; font-size: var(--tpl-text-sm); }
  /* En pantallas angostas el sufijo CLP le comia el placeholder al campo. */
  .combo-budget-unit { display: none; }
  .parcel-grid { grid-template-columns: minmax(0, 1fr); }
  .results-toolbar { align-items: flex-start; }
  .map-button { align-self: stretch; text-align: center; }
  .combo-budget-quick button { padding: 8px 2px; font-size: var(--tpl-text-xs); }
  .tpl-trust-sep { display: none; }
  .tpl-trust-bar { gap: 6px var(--tpl-space-3); font-size: var(--tpl-text-xs); }
  /* "EXPLORA POR ZONA" se comia casi la mitad del ancho y dejaba la cinta en
     ~200px utiles. El rotulo de region (BIOBIO, NUBLE...) ya va dentro. */
  .commune-ribbon__intro { display: none; }
  .commune-ribbon__shell { padding-inline: var(--tpl-space-3); }
  .market-radar-state__offer { padding: var(--tpl-space-4); }
}

/* === 16. MOVIMIENTO REDUCIDO ============================================= */
@media (prefers-reduced-motion: reduce) {
  .tpl-hero__bg,
  .tpl-campo-story::before,
  .tpl-search-widget,
  .parcel-card,
  .skeleton-card { animation: none !important; transition: none !important; }
}
