/* CE-945: sedes, contacto institucional, rutas y tratamiento visual de WhatsApp. */

.locations-grid.locations-grid--detailed {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.location-card.location-card--detailed {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100%;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 7px 22px rgba(28, 57, 112, .06);
}

.location-card__top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.location-card__pin {
  width: 46px;
  height: 46px;
  min-width: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #edf2fa;
  color: var(--blue);
}

.location-card__pin svg {
  width: 24px;
  height: 24px;
}

.location-card__address {
  margin-top: 6px !important;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.location-card__details {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.location-detail {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.location-detail > svg {
  width: 19px;
  height: 19px;
  margin-top: 1px;
  color: var(--blue);
}

.location-detail strong,
.location-detail span,
.location-detail a {
  display: inline-block;
}

.location-detail strong {
  width: 100%;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.location-detail a {
  overflow-wrap: anywhere;
}

.contact-separator {
  margin: 0 6px;
  color: #97a3b7;
}

.location-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 2px;
}

.location-card__actions .btn {
  margin-top: 0;
}

.location-card__directions svg {
  width: 17px;
  height: 17px;
}

.btn.whatsapp,
a.btn.whatsapp,
.contact-links a.whatsapp {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
}

.btn.whatsapp:hover,
a.btn.whatsapp:hover,
.contact-links a.whatsapp:hover,
.btn.whatsapp:focus-visible,
a.btn.whatsapp:focus-visible,
.contact-links a.whatsapp:focus-visible {
  background: #1cae53;
  border-color: #1cae53;
  color: #fff;
  text-decoration: none;
}

.whatsapp-icon {
  width: 19px;
  height: 19px;
}

.electoral-contact-notice {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 22px;
  padding: 20px 22px;
  border: 1px solid #d8e2f1;
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  background: #f7f9fd;
}

.electoral-contact-notice__icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
}

.electoral-contact-notice__icon svg {
  width: 23px;
  height: 23px;
}

.electoral-contact-notice strong {
  color: var(--blue-dark);
  font-size: 16px;
}

.electoral-contact-notice p {
  margin-top: 6px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.electoral-contact-notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 10px;
}

.business-days-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

.institutional-contact {
  margin-top: 34px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.institutional-contact__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.institutional-contact__heading .eyebrow {
  margin-bottom: 7px;
}

.institutional-contact__heading p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.institutional-contact__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.institutional-contact__card {
  min-width: 0;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow);
}

.institutional-contact__card:first-child {
  grid-column: 1 / -1;
  border-top: 3px solid var(--blue);
}

.institutional-contact__card h3 {
  margin-bottom: 10px;
  font-size: 17px;
}

.institutional-contact__card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.institutional-contact__card p strong {
  color: var(--ink);
}

.institutional-contact__card .btn {
  margin-top: 14px;
}

/* CTA final de orientación: conserva los canales rápidos sin repetir todo el bloque institucional. */
.institutional-contact + .panel.mt {
  display: grid;
  grid-template-columns: minmax(230px, .8fr) minmax(0, 1.2fr);
  column-gap: 26px;
  row-gap: 4px;
  align-items: center;
  margin-top: 20px;
  padding: 20px 22px;
}

.institutional-contact + .panel.mt h2 {
  grid-column: 1;
  margin: 0;
  font-size: 22px;
}

.institutional-contact + .panel.mt > p:not(.small) {
  grid-column: 1;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
}

.institutional-contact + .panel.mt .contact-links {
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 0;
}

.institutional-contact + .panel.mt .contact-links .btn {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 13px;
}

.institutional-contact + .panel.mt .contact-links a[href^="mailto:"] {
  display: none;
}

.institutional-contact + .panel.mt > p.small {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.45;
}

/* En escritorio/tablet ancho el botón "Cómo llegar" comparte la misma fila de la sede. */
@media (min-width: 561px) {
  .location-card.location-card--detailed {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
  }

  .location-card__top {
    min-width: 0;
  }

  .location-card__actions {
    margin-top: 0;
    padding-top: 0;
    align-self: center;
    justify-self: end;
    flex-wrap: nowrap;
  }
}

@media (max-width: 900px) {
  .locations-grid.locations-grid--detailed,
  .institutional-contact__grid {
    grid-template-columns: 1fr;
  }

  .institutional-contact__card:first-child {
    grid-column: auto;
  }

  .institutional-contact + .panel.mt {
    display: block;
    padding: 20px;
  }

  .institutional-contact + .panel.mt .contact-links {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .institutional-contact + .panel.mt > p.small {
    margin-top: 12px;
  }
}

@media (max-width: 560px) {
  .location-card.location-card--detailed {
    display: flex;
    flex-direction: column;
    padding: 19px;
  }

  .location-card__actions {
    flex-direction: column;
  }

  .location-card__actions .btn {
    width: 100%;
  }

  .electoral-contact-notice {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .electoral-contact-notice__icon {
    width: 42px;
    height: 42px;
  }

  .institutional-contact__card {
    padding: 18px;
  }
}
