/* ── Reset / Base ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  background: #1a1a2e;
}

/* ── Mapa ────────────────────────────────────────────────────────────── */
#map {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ── Panel de búsqueda ───────────────────────────────────────────────── */
#panel-busqueda {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1000;
  width: 300px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#panel-header {
  background: #1a3a5c;
  color: #fff;
  padding: 14px 16px 10px;
}

#panel-header h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

#vigencia-label {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 3px;
}

#search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid #e8e8e8;
}

#input-busqueda {
  flex: 1;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

#input-busqueda:focus {
  border-color: #1a3a5c;
}

#btn-limpiar {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #888;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
}

#btn-limpiar:hover { color: #333; background: #f0f0f0; }

/* ── Lista de resultados ─────────────────────────────────────────────── */
#lista-resultados {
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  border-bottom: 1px solid #e8e8e8;
}

#lista-resultados li {
  padding: 8px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  border-bottom: 1px solid #f2f2f2;
  transition: background 0.1s;
}

#lista-resultados li:last-child { border-bottom: none; }
#lista-resultados li:hover { background: #f0f5ff; }

.res-municipio { font-weight: 600; font-size: 13px; color: #1a1a2e; }
.res-estado    { font-size: 11px; color: #777; white-space: nowrap; }

.sin-resultados {
  padding: 12px 14px !important;
  color: #999 !important;
  font-style: italic;
  cursor: default !important;
}
.sin-resultados:hover { background: none !important; }

/* ── Resultado seleccionado ──────────────────────────────────────────── */
#info-resultado {
  padding: 12px 16px 14px;
  border-bottom: 1px solid #e8e8e8;
}

.info-nombre {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
}

.info-estado {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
  margin-bottom: 10px;
}

.info-precios {
  display: flex;
  gap: 12px;
}

.precio-item {
  flex: 1;
  background: #f6f8fc;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.precio-label {
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.precio-val {
  font-size: 18px;
  font-weight: 700;
  color: #1a3a5c;
}

.info-nota {
  font-size: 10px;
  color: #aaa;
  text-align: center;
  margin-top: 8px;
}

/* ── Footer del panel ────────────────────────────────────────────────── */
#panel-footer {
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #999;
}

#link-fuente {
  color: #1a3a5c;
  text-decoration: none;
  font-weight: 600;
}
#link-fuente:hover { text-decoration: underline; }

#vigencia-pie { font-size: 10px; color: #bbb; }

/* ── Leyenda ─────────────────────────────────────────────────────────── */
#leyenda {
  position: fixed;
  bottom: 170px; /* encima del banner de 160px */
  right: 12px;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  padding: 10px 14px;
  min-width: 130px;
}

.leyenda-titulo {
  font-size: 11px;
  font-weight: 700;
  color: #444;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.leyenda-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #555;
  margin-bottom: 4px;
}
.leyenda-item:last-child { margin-bottom: 0; }

.dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.12);
}

/* ── Marcadores del mapa ─────────────────────────────────────────────── */
.marcador-pin {
  background: #1a9641;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 5px;
  border-radius: 5px;
  white-space: nowrap;
  box-shadow: 0 1px 5px rgba(0,0,0,0.35);
  border: 1.5px solid rgba(255,255,255,0.6);
  text-align: center;
}

.cluster-pin {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border: 2px solid rgba(255,255,255,0.7);
}

/* ── Popup del mapa ──────────────────────────────────────────────────── */
.popup-content {
  min-width: 160px;
}

.popup-nombre {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 2px;
}

.popup-estado {
  font-size: 11px;
  color: #888;
  margin-bottom: 10px;
}

.popup-precios {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 6px;
}

.popup-precios > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f6f8fc;
  border-radius: 6px;
  padding: 5px 8px;
}

.plabel { font-size: 11px; color: #777; }
.pval   { font-size: 14px; font-weight: 700; color: #1a3a5c; }

.popup-nota {
  font-size: 10px;
  color: #bbb;
  text-align: right;
}

/* ── SEO hidden content ──────────────────────────────────────────────── */
#seo-content {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ── Banner Gasometric ───────────────────────────────────────────────── */
#banner-gasometric {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  /* Gradiente que replica los bordes izq/der de la imagen */
  background: linear-gradient(to right, #b6ac82 0%, #877f77 50%, #675f5c 100%);
  display: flex;
  align-items: stretch;
  justify-content: center;
  box-shadow: 0 -3px 16px rgba(0,0,0,0.35);
  height: 160px;
}

#banner-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  overflow: hidden;
}

#banner-img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  /* Cursor pointer al pasar sobre el banner */
  cursor: pointer;
  transition: opacity 0.15s;
}
#banner-img:hover { opacity: 0.92; }

#banner-close {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 36px;
  background: rgba(0,0,0,0.55);
  border: none;
  border-left: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background 0.15s;
}
#banner-close:hover {
  background: rgba(0,0,0,0.8);
  color: #fff;
}

/* ── FAQ en el panel ─────────────────────────────────────────────────── */
#faq-section {
  border-top: 1px solid #e8e8e8;
}

#faq-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
#faq-toggle:hover { background: #f6f8fc; }

#faq-icon { font-size: 12px; color: #999; }

#faq-lista {
  padding: 0 14px 10px;
}

.faq-item {
  padding: 7px 0;
  border-bottom: 1px solid #f2f2f2;
}
.faq-item:last-child { border-bottom: none; }

.faq-q {
  font-size: 11px;
  font-weight: 600;
  color: #1a3a5c;
  margin-bottom: 3px;
}
.faq-a {
  font-size: 11px;
  color: #666;
  line-height: 1.4;
}

/* ── Promo en el panel ───────────────────────────────────────────────── */
#promo-gasometric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(90deg, #e8f4fd 0%, #f0f8ff 100%);
  border-top: 1px solid #cce4f7;
}

.promo-texto {
  font-size: 11px;
  color: #1a3a5c;
  display: flex;
  align-items: center;
  gap: 5px;
}
.promo-logo { font-size: 14px; }

.promo-link {
  font-size: 11px;
  font-weight: 700;
  color: #0f6fbf;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid #0f6fbf;
  padding: 3px 8px;
  border-radius: 10px;
  transition: all 0.15s;
}
.promo-link:hover {
  background: #0f6fbf;
  color: #fff;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #panel-busqueda {
    left: 8px;
    right: 8px;
    width: auto;
    top: 8px;
  }

  #leyenda {
    bottom: 130px;
    right: 8px;
    padding: 8px 10px;
  }

  #banner-gasometric {
    height: 120px;
  }
}
