/* GeoMap · pantalla nueva (OT-G02). Dorado C21, Montserrat, mismo lenguaje que la propuesta. */
@font-face { font-family: 'Montserrat'; font-weight: 400; font-display: swap; src: url('../vendor/montserrat/montserrat-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 500; font-display: swap; src: url('../vendor/montserrat/montserrat-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url('../vendor/montserrat/montserrat-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url('../vendor/montserrat/montserrat-latin-700-normal.woff2') format('woff2'); }

:root {
  --oro: #c3af7d;
  --oro-osc: #9c8858;
  --oro-claro: #f4efe2;
  --tinta: #1f1f1f;
  --gris: #6b6b6b;
  --linea: #e6e1d6;
  --fondo: #faf8f4;
  --ambar: #b26a00;
  --ambar-fondo: #fff1d6;
  --verde: #2f7d4f;
  --rojo: #b3261e;
  --sombra: 0 2px 10px rgba(0, 0, 0, .08);
  --radio: 10px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--tinta);
  background: var(--fondo);
  font-size: 14px;
  display: flex;
  flex-direction: column;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.oculto { display: none !important; }

/* ---------------------------------------------------------------- cabecera */
.cab {
  background: #fff;
  border-bottom: 1px solid var(--linea);
  padding: 10px 16px 8px;
  position: relative;
  z-index: 1100;
}
.cab-fila { display: flex; align-items: center; gap: 12px; }
.marca { display: flex; flex-direction: column; line-height: 1; text-decoration: none; color: var(--tinta); flex: none; }
.marca b { font-weight: 700; letter-spacing: .14em; font-size: 15px; }
.marca span { font-size: 10px; letter-spacing: .3em; color: var(--oro-osc); margin-top: 3px; }
.barra {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  border: 1.5px solid var(--linea);
  border-radius: 999px;
  background: #fff;
  padding: 0 6px 0 16px;
  min-width: 0;
  transition: border-color .15s;
}
.barra:focus-within { border-color: var(--oro); box-shadow: 0 0 0 3px rgba(195, 175, 125, .25); }
.barra svg { flex: none; color: var(--oro-osc); }
.barra input {
  flex: 1;
  border: 0;
  outline: 0;
  padding: 11px 10px;
  min-width: 0;
  background: transparent;
  font-size: 15px;
}
.btn {
  border: 1.5px solid var(--linea);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { border-color: var(--oro); }
.btn-oro { background: var(--oro); border-color: var(--oro); color: #fff; }
.btn-oro:hover { background: var(--oro-osc); border-color: var(--oro-osc); }
.btn-chico { padding: 5px 10px; font-size: 12px; }
.contador {
  background: var(--tinta);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.enlace-clasico { color: var(--gris); font-size: 12px; text-decoration: none; white-space: nowrap; }
.enlace-clasico:hover { color: var(--oro-osc); text-decoration: underline; }

/* vista previa mientras escribe */
.previa {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 10px 12px;
  z-index: 1200;
}
.previa-tit { font-size: 11px; color: var(--gris); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.previa-resto { font-size: 12px; color: var(--gris); margin-top: 6px; }
.previa-ayuda { font-size: 11px; color: var(--gris); margin-top: 8px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; min-height: 8px; }
.chips:empty { padding-top: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--oro-claro);
  border: 1px solid #e3d8bb;
  border-radius: 999px;
  padding: 3px 4px 3px 10px;
  font-size: 12.5px;
  font-weight: 500;
}
.chip.pref { background: #fff; border-style: dashed; }
.chip.texto { background: #fff; }
.chip .ia { color: var(--oro-osc); font-size: 11px; }
.chip button {
  border: 0;
  background: transparent;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gris);
  padding: 0;
}
.chip button:hover { background: rgba(0, 0, 0, .07); color: var(--tinta); }
.chip button.candado.on { color: var(--oro-osc); }
.chip-limpiar { border: 0; background: none; color: var(--gris); font-size: 12px; text-decoration: underline; padding: 3px 6px; }
.chips-vista { display: flex; flex-wrap: wrap; gap: 5px; }
.chips-vista .chip { padding-right: 10px; }

/* barra de progreso */
.progreso { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; }
.progreso.on::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 30%;
  background: var(--oro);
  animation: ir 1s ease-in-out infinite;
}
@keyframes ir { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

.avisos { background: var(--ambar-fondo); color: #6a4100; font-size: 12.5px; padding: 6px 16px; border-bottom: 1px solid #f1dcb0; }
.error {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--tinta);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 3000;
  box-shadow: var(--sombra);
  font-size: 13px;
  max-width: 90vw;
}

/* ---------------------------------------------------------------- cuerpo */
.cuerpo { flex: 1; display: flex; min-height: 0; position: relative; }
.resultados {
  width: 440px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--linea);
  min-height: 0;
  position: relative;
}
.res-cab { padding: 12px 14px 8px; border-bottom: 1px solid var(--linea); }
.res-tit { font-weight: 700; font-size: 15px; }
.res-sub { font-size: 12px; color: var(--gris); margin-top: 2px; }
.res-controles { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.segmento { display: inline-flex; border: 1.5px solid var(--linea); border-radius: 999px; overflow: hidden; }
.segmento button { border: 0; background: #fff; padding: 6px 12px; font-size: 12.5px; font-weight: 600; }
.segmento button.on { background: var(--oro); color: #fff; }
.orden { margin-left: auto; border: 1.5px solid var(--linea); border-radius: 999px; padding: 6px 10px; background: #fff; font-size: 12.5px; }
.lista { flex: 1; overflow-y: auto; padding: 10px 12px 30px; }
.seccion { font-weight: 700; font-size: 13px; margin: 14px 2px 8px; display: flex; align-items: center; gap: 8px; }
.seccion:first-child { margin-top: 2px; }
.seccion small { font-weight: 500; color: var(--gris); }
.seccion.casi { color: var(--ambar); }
.vacio { color: var(--gris); font-size: 13px; padding: 16px 4px; }
.sugerencias { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.sugerencia { text-align: left; border: 1.5px solid var(--oro); background: var(--oro-claro); border-radius: 8px; padding: 8px 12px; font-weight: 600; font-size: 13px; }
.sugerencia small { color: var(--gris); font-weight: 500; }

.tarjeta {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  margin-bottom: 8px;
  cursor: pointer;
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.tarjeta:hover, .tarjeta.activa { border-color: var(--oro); box-shadow: var(--sombra); }
.tarjeta.casi { border-style: dashed; }
.foto {
  width: 128px;
  height: 96px;
  flex: none;
  border-radius: 7px;
  background: #eee center/cover no-repeat;
  position: relative;
  overflow: hidden;
}
.foto.sin::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f4efe2, #e6dcc2);
}
.t-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.t-precio { font-weight: 700; font-size: 15px; }
.t-precio small { font-weight: 500; color: var(--gris); font-size: 11.5px; }
.t-titulo { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-datos { font-size: 12px; color: var(--gris); }
.t-lugar { font-size: 12px; color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etiquetas { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.etq { font-size: 10.5px; font-weight: 600; border-radius: 4px; padding: 2px 6px; background: var(--oro-claro); color: #6f5d2e; }
.etq.motivo { background: var(--ambar-fondo); color: var(--ambar); }
.etq.otra { background: #fbe9e7; color: var(--rojo); }
.afavor { font-size: 11px; color: var(--verde); margin-top: 2px; }

.galeria .grilla { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.galeria .tarjeta { flex-direction: column; margin: 0; }
.galeria .foto { width: 100%; height: 130px; }
.centinela { height: 30px; display: flex; align-items: center; justify-content: center; color: var(--gris); font-size: 12px; }

/* ---------------------------------------------------------------- mapa */
.mapa-caja { flex: 1; position: relative; min-width: 0; }
#mapa { position: absolute; inset: 0; background: #eae6dd; }
.mapa-ctrl {
  position: absolute;
  top: 12px;
  left: 56px;
  z-index: 1000;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pildora {
  background: #fff;
  border-radius: 999px;
  box-shadow: var(--sombra);
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
}
.interruptor { position: relative; width: 30px; height: 17px; flex: none; }
.interruptor input { opacity: 0; width: 0; height: 0; position: absolute; }
.interruptor span { position: absolute; inset: 0; background: #ccc; border-radius: 999px; transition: .15s; }
.interruptor span::before { content: ''; position: absolute; width: 13px; height: 13px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; }
.interruptor input:checked + span { background: var(--oro); }
.interruptor input:checked + span::before { transform: translateX(13px); }
.interruptor input:disabled + span { opacity: .5; }
.capas-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 8px 12px;
  min-width: 230px;
}
.capa { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13px; }
.capa small { color: var(--gris); font-size: 11px; display: block; }
.mapa-total {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  pointer-events: none;
}

/* elementos del mapa */
.gm-icono { background: none; border: 0; }
.leaflet-container.dibujando .gm-icono.leaflet-interactive { pointer-events: none; }
.gm-grupo {
  border-radius: 50%;
  background: rgba(195, 175, 125, .92);
  border: 3px solid rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 2px rgba(156, 136, 88, .5), 0 2px 6px rgba(0, 0, 0, .2);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.gm-grupo.casi { background: rgba(255, 255, 255, .92); color: var(--oro-osc); box-shadow: 0 0 0 2px var(--oro); }
.gm-pin {
  position: absolute;
  transform: translate(-50%, calc(-100% - 6px));
  background: var(--tinta);
  color: #fff;
  font-weight: 700;
  font-size: 11.5px;
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
  cursor: pointer;
  border: 2px solid var(--tinta);
}
.gm-pin::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: inherit;
  border-bottom: 0;
}
.gm-pin.casi { background: #fff; color: var(--oro-osc); border-color: var(--oro); }
.gm-pin.activo, .gm-pin:hover { background: var(--oro); border-color: var(--oro); color: #fff; z-index: 1000; }

/* ficha emergente */
.gm-ficha .leaflet-popup-content-wrapper { border-radius: 12px; padding: 0; overflow: hidden; }
.gm-ficha .leaflet-popup-content { margin: 0; width: 290px !important; font-family: 'Montserrat', system-ui, sans-serif; }
.ficha-foto { height: 160px; background: #eee center/cover no-repeat; }
.ficha-cuerpo { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.ficha-precio { font-size: 17px; font-weight: 700; }
.ficha-acciones { display: flex; gap: 6px; margin-top: 8px; }
.ficha-acciones a, .ficha-acciones button { flex: 1; text-align: center; text-decoration: none; }
.ficha-cargando { padding: 18px; color: var(--gris); }

/* ---------------------------------------------------------------- panel de filtros */
.panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 440px;
  background: #fff;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--linea);
  box-shadow: 4px 0 18px rgba(0, 0, 0, .08);
}
.panel-cab { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--linea); gap: 8px; }
.panel-cab b { font-size: 15px; flex: 1; }
.panel-cuerpo { flex: 1; overflow-y: auto; padding: 4px 16px 20px; }
.panel-pie { padding: 10px 14px; border-top: 1px solid var(--linea); display: flex; gap: 8px; }
.panel-pie .btn { flex: 1; justify-content: center; padding: 10px; }
.grupo-f { border-bottom: 1px solid var(--linea); }
.grupo-f > summary { list-style: none; cursor: pointer; padding: 13px 0; font-weight: 700; display: flex; justify-content: space-between; }
.grupo-f > summary::-webkit-details-marker { display: none; }
.grupo-f > summary::after { content: '+'; color: var(--oro-osc); font-size: 18px; line-height: 1; }
.grupo-f[open] > summary::after { content: '−'; }
.principal-tit { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--gris); margin: 14px 0 2px; }
.campo { margin: 10px 0 14px; }
.campo > label, .campo-et { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 6px; }
.opciones { display: flex; flex-wrap: wrap; gap: 6px; }
.op {
  border: 1.5px solid var(--linea);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
}
.op.on { background: var(--oro); border-color: var(--oro); color: #fff; }
.rango { display: flex; align-items: center; gap: 6px; }
.rango input, .texto-f, .moneda {
  border: 1.5px solid var(--linea);
  border-radius: 8px;
  padding: 7px 10px;
  width: 100%;
  min-width: 0;
  background: #fff;
}
.rango input:focus, .texto-f:focus { outline: 0; border-color: var(--oro); }
.moneda { width: auto; flex: none; }
.fila-int { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 13px; cursor: pointer; }
.comodidades { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
.lugares-sel { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.autocomp { position: relative; }
.autocomp-lista {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: 8px;
  box-shadow: var(--sombra);
  z-index: 5;
  max-height: 260px;
  overflow-y: auto;
}
.autocomp-lista button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 8px 12px; font-size: 13px; }
.autocomp-lista button:hover, .autocomp-lista button.sel { background: var(--oro-claro); }
.autocomp-lista small { color: var(--gris); margin-left: 6px; }
.nota { font-size: 11.5px; color: var(--gris); margin-top: 4px; }

/* geoman en castellano y con nuestros colores */
.leaflet-pm-toolbar .leaflet-buttons-control-button { width: 34px; height: 34px; }

/* ---------------------------------------------------------------- celular */
.cambiar-vista { display: none; }
@media (max-width: 860px) {
  .cab { padding: 8px 10px 6px; }
  .marca span, .enlace-clasico { display: none; }
  /* la barra de texto va en su propia fila, a todo el ancho */
  .cab-fila { flex-wrap: wrap; justify-content: space-between; row-gap: 8px; }
  .barra { order: 3; flex-basis: 100%; }
  .btn-texto { display: none; }
  .resultados, .panel { width: 100%; }
  .modo-mapa .resultados { display: none; }
  .modo-lista .mapa-caja { display: none; }
  .cambiar-vista {
    display: inline-flex;
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    background: var(--tinta);
    color: #fff;
    border: 0;
  }
  .mapa-ctrl { left: 52px; right: 56px; } /* a la derecha está la barra de dibujo */
  .foto { width: 108px; height: 84px; }
}
