/* =====================================================
   ZAP 2026 · VISOR INTEGRADO EN HOME · V2
   Namespaced para no interferir con el resto de la plataforma.
===================================================== */

.hyc-zap-embed {
  width: 100%;
}

/* Por defecto: Entidad + Municipio ocupan todo el ancho */
.hyc-zap-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}

/* Cuando realmente hay varias localidades, pasa a 3 columnas */
.hyc-zap-filters.has-localidad {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hyc-zap-field {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: #40534b;
}

.hyc-zap-field[hidden] {
  display: none !important;
}

.hyc-zap-field > span {
  display: block;
  margin-bottom: 6px;
}

.hyc-zap-field select {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 9px 36px 9px 11px;
  border: 1px solid #cddbd5;
  border-radius: 8px;
  background: #fff;
  color: #293a34;
  font: inherit;
  font-size: 13px;
}

.hyc-zap-field select:disabled {
  background: #f5f7f6;
  color: #98a49f;
}

.hyc-zap-layer-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 2px 0 12px;
  color: #5c6c65;
  font-size: 11px;
}

.hyc-zap-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 500;
}

.hyc-zap-check input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.hyc-zap-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0,0,0,.22);
  border-radius: 3px;
}

.hyc-zap-swatch-urban {
  background: #2f80c3;
}

.hyc-zap-swatch-rural {
  background: linear-gradient(
    135deg,
    #5d4037 0 20%,
    #c0392b 20% 40%,
    #f39c12 40% 60%,
    #7cb342 60% 80%,
    #2e7d32 80%
  );
}

/* Solo ocupa espacio cuando hay un mensaje real */
.hyc-zap-status {
  margin: 0 0 8px;
  color: #346a5d;
  font-size: 11px;
  font-weight: 700;
}

.hyc-zap-status:empty {
  display: none;
}

#hyc-zap-map {
  width: 100%;
  height: 460px;
  border: 1px solid #dbe6e1;
  border-radius: 12px;
  overflow: hidden;
  background: #e9f0ed;
}

/* Resumen que sustituye al botón "Abrir el mapa completo" */
.home-priority-zap-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  text-align: right;
}

.home-priority-zap-summary-label {
  color: #6a7973;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#hyc-zap-count {
  color: #315f52;
  font-size: 12px;
  line-height: 1.35;
}

/* Popup */
.hyc-zap-popup h3 {
  margin: 0 0 8px;
  color: #23352e;
  font-size: 14px;
}

.hyc-zap-popup dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  margin: 0;
  font-size: 11px;
}

.hyc-zap-popup dt {
  font-weight: 700;
}

.hyc-zap-popup dd {
  margin: 0;
}

/* Leaflet conserva sus propios estilos internos. */

@media (max-width: 760px) {
  .hyc-zap-filters,
  .hyc-zap-filters.has-localidad {
    grid-template-columns: 1fr;
  }

  #hyc-zap-map {
    height: 420px;
  }

  .home-priority-zap-summary {
    width: 100%;
    align-items: flex-start;
    text-align: left;
    margin-top: 8px;
  }
}

/* ZAP integrada visualmente con el fondo de la sección */
.home-priority-map-wrap,
.hyc-zap-embed {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

/* Aire únicamente para los controles */
.hyc-zap-filters,
.hyc-zap-layer-row,
.hyc-zap-status {
  margin-left: 16px;
  margin-right: 16px;
}

.hyc-zap-filters {
  padding-top: 16px;
}

.hyc-zap-layer-row {
  margin-top: 18px;
  margin-bottom: 20px;
}