/* Modal mapa de programas FHC */
.fhc-sedes-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.fhc-sedes-trigger:hover {
  color: #fca5a5;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fhc-sedes-trigger i {
  color: #f87171;
}

.fhc-sedes-modal[hidden] {
  display: none !important;
}
.fhc-sedes-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.fhc-sedes-modal.is-open {
  display: flex;
}
.fhc-sedes-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
}
.fhc-sedes-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 1120px);
  max-height: min(92vh, 860px);
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
}
.fhc-sedes-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
}
.fhc-sedes-modal__close:hover {
  background: #fee2e2;
  color: #b91c1c;
}
.fhc-sedes-modal__head {
  padding: 22px 24px 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #3b1d12 100%);
  color: #fff;
}
.fhc-sedes-modal__kicker {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 6px;
}
.fhc-sedes-modal__head h2 {
  margin: 0 0 6px;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 800;
  color: #fff !important;
}
.fhc-sedes-modal__head p {
  margin: 0;
  color: #cbd5e1;
  font-size: 14px;
}
.fhc-sedes-modal__body {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  min-height: 0;
  flex: 1;
}
.fhc-sedes-modal__map-wrap {
  min-height: 420px;
  background: #e2e8f0;
}
.fhc-sedes-modal__map {
  width: 100%;
  height: 100%;
  min-height: 420px;
}
.fhc-sedes-modal__side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid #e2e8f0;
  background: #f8fafc;
}
.fhc-sedes-modal__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.fhc-sedes-filter {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.fhc-sedes-filter.is-active,
.fhc-sedes-filter:hover {
  border-color: #c21f16;
  background: #fef2f2;
  color: #b91c1c;
}
.fhc-sedes-modal__list {
  overflow: auto;
  padding: 10px 12px 12px;
  flex: 1;
}
.fhc-sedes-item {
  width: 100%;
  text-align: left;
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.fhc-sedes-item:hover,
.fhc-sedes-item.is-active {
  border-color: #c21f16;
  box-shadow: 0 8px 20px rgba(194, 31, 22, 0.12);
  transform: translateY(-1px);
}
.fhc-sedes-item__region {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #92400e;
  margin-bottom: 4px;
}
.fhc-sedes-item__name {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}
.fhc-sedes-item__contact {
  list-style: none;
  margin: 8px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid #e2e8f0;
  display: grid;
  gap: 6px;
}
.fhc-sedes-item__contact-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
}
.fhc-sedes-item__contact-row i {
  width: 13px;
  margin-top: 2px;
  color: #c21f16;
  flex-shrink: 0;
  font-size: 11px;
}
.fhc-sedes-item__contact-row strong {
  color: #334155;
  font-weight: 700;
}
.fhc-sedes-item__contact-row a {
  color: #1d4ed8;
  text-decoration: none;
  word-break: break-word;
}
.fhc-sedes-item__contact-row a:hover {
  text-decoration: underline;
}
.fhc-sedes-modal__more {
  display: block;
  padding: 12px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #c21f16;
  text-decoration: none;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.fhc-sedes-modal__more:hover {
  background: #fef2f2;
}

.fhc-sedes-popup .leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}
.fhc-sedes-popup .leaflet-popup-content {
  margin: 12px 14px;
  min-width: 220px;
}
.fhc-sedes-popup h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.fhc-sedes-popup p {
  margin: 0 0 6px;
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}
.fhc-sedes-popup .fhc-sedes-item__contact {
  margin-top: 6px;
  padding-top: 8px;
}
.fhc-sedes-popup .fhc-sedes-item__contact-row {
  font-size: 12px;
}
.fhc-sedes-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}
.fhc-sedes-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}
.fhc-sedes-tag--srpa { background: #ffedd5; color: #c2410c; }
.fhc-sedes-tag--pard { background: #dbeafe; color: #1d4ed8; }
.fhc-sedes-tag--spa { background: #ccfbf1; color: #0f766e; }
.fhc-sedes-tag--psicosocial { background: #fce7f3; color: #9d174d; font-size: 11px; line-height: 1.25; }
.fhc-sedes-tag--regimen { background: #f1f5f9; color: #475569; }
.fhc-sedes-tag--closed {
  background: #334155;
  color: #fff;
}
.fhc-sedes-closed-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  background: #334155;
  color: #fff;
}
.fhc-sedes-item.is-closed {
  opacity: 0.82;
  border-style: dashed;
}
.fhc-sedes-item__desc {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
  text-align: left;
}
.fhc-sedes-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.fhc-sedes-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.fhc-sedes-act--wa { background: #25d366; color: #fff !important; }
.fhc-sedes-act--call { background: #0f172a; color: #fff !important; }
.fhc-sedes-act--map { background: #eff6ff; color: #1d4ed8 !important; }

@media (max-width: 900px) {
  .fhc-sedes-modal__body {
    grid-template-columns: 1fr;
    grid-template-rows: 280px 1fr;
  }
  .fhc-sedes-modal__map-wrap,
  .fhc-sedes-modal__map {
    min-height: 280px;
  }
  .fhc-sedes-modal__side {
    border-left: 0;
    border-top: 1px solid #e2e8f0;
    max-height: 42vh;
  }
}
