/* ===========================
   CONFIGURACIÓN GENERAL
=========================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background-color: #f3f8fb;
  color: #1f2937;
}

.pagina-sucursales {
  width: 92%;
  max-width: 1250px;
  margin: auto;
  padding: 25px 0 40px;
}

/* ===========================
   LOGOTIPO
=========================== */

.encabezado {
  text-align: center;
  margin-bottom: 22px;
}

.logo {
  width: 330px;
  max-width: 80%;
  height: auto;
}

/* ===========================
   PRESENTACIÓN
=========================== */

.presentacion {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 28px 20px;
  margin-bottom: 25px;
  text-align: center;
  color: white;
  background: linear-gradient(135deg, #179bd3, #075783);
  border-radius: 0;
}

.presentacion h1 {
  margin: 0 0 8px;
  font-size: 34px;
}

.presentacion p {
  margin: 0;
  font-size: 18px;
}

/* ===========================
   BUSCADOR
=========================== */

.busqueda {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
  padding: 18px 20px;
  background-color: white;
  border-radius: 16px;
  border: 1px solid #dce9f0;
}

.busqueda label {
  font-size: 17px;
  font-weight: bold;
  color: #075783;
}

.busqueda select {
  width: 280px;
  padding: 13px 15px;
  font-size: 16px;
  color: #1f2937;
  background-color: #ffffff;
  border: 1px solid #bad3e2;
  border-radius: 12px;
  cursor: pointer;
}

/* ===========================
   CONTENIDO PRINCIPAL
=========================== */

.contenido {
  display: grid;
  grid-template-columns:
    minmax(300px, 0.9fr)
    minmax(450px, 1.5fr);
  gap: 22px;
  align-items: stretch;
}

/* ===========================
   PANELES
=========================== */

.panel-sucursales,
.panel-mapa {
  padding: 22px;
  background-color: white;
  border-radius: 20px;
  border: 1px solid #e0ebf1;
}

.titulo-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.titulo-panel h2 {
  margin: 0;
  color: #075783;
  font-size: 23px;
}

.titulo-panel span {
  font-size: 14px;
  color: #667085;
}

/* ===========================
   SUCURSALES
=========================== */

#lista-sucursales {
  display: flex;
  flex-direction: column;
  gap: 13px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 6px;
}

.sucursal {
  padding: 18px;
  border: 1px solid #dce9f0;
  border-radius: 16px;
  background-color: #ffffff;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  cursor: pointer;
}

.sucursal:hover {
  transform: translateY(-2px);
  border-color: #159bd3;
  box-shadow: 0 8px 20px rgba(7, 87, 131, 0.08);
}

.sucursal.activa {
  border: 2px solid #159bd3;
  background-color: #f2fbff;
}

.sucursal h3 {
  margin: 0 0 10px;
  color: #075783;
  font-size: 19px;
}

.sucursal p {
  margin: 6px 0;
  line-height: 1.5;
  color: #5d6875;
  font-size: 15px;
}

/* ===========================
   BOTONES
=========================== */

.acciones-sucursal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.boton {
  display: block;
  padding: 11px;
  text-align: center;
  text-decoration: none;
  border-radius: 10px;
  font-weight: bold;
  font-size: 14px;
}

.boton-llamar {
  color: #075783;
  background-color: #eaf7fc;
}

.boton-mapa {
  color: white;
  background-color: #159bd3;
}

.boton-deshabilitado {
  color: #7a8790;
  background-color: #edf1f3;
  cursor: default;
}

/* ===========================
   INFORMACION TARJETA SUCURALES
=========================== */
.dato-sucursal {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.icono-sucursal {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ===========================
   MAPA
=========================== */

.panel-mapa {
  display: flex;
  flex-direction: column;
}

#mapa {
  width: 100%;
  height: 500px;
  border: 0;
  border-radius: 15px;
  background-color: #edf6fa;
}

/* ===========================
   PIE DE PÁGINA
=========================== */

.pie-pagina {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: 45px;
  min-height: 360px;
  background-image: url("../img/pie_pagina.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% 100%;
  color: #075783;
  display: flex;
  align-items: flex-end;
  box-sizing: border-box;
}

/* ===========================
   CONTENIDO DEL FOOTER
=========================== */

.footer-contenido {
  width: 92%;
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 20px 35px;
  text-align: center;
  box-sizing: border-box;
}

/* ===========================
   MARCA
=========================== */

.footer-marca h2 {
  margin: 0 0 6px;
  color: #165e85;
  font-size: 24px;
}

.footer-marca p {
  margin: 0;
  color: #3f6f89;
  font-size: 15px;
}

/* ===========================
   ENLACES
=========================== */

.footer-enlaces {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.footer-enlaces a {
  padding: 10px 18px;
  color: #075783;
  background-color: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(7, 87, 131, 0.15);
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.footer-enlaces a:hover {
  background-color: rgba(255, 255, 255, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(7, 87, 131, 0.1);
}

/* ===========================
   SEPARADOR
=========================== */

.footer-linea {
  width: 80%;
  height: 1px;
  margin: 22px auto 15px;
  background-color: rgba(7, 87, 131, 0.15);
}

/* ===========================
   COPYRIGHT
=========================== */

.footer-copyright {
  margin: 0;
  color: #52798e;
  font-size: 13px;
}

.footer-contenido {
  width: 92%;
  max-width: 1250px;
  margin: auto;
  padding: 38px 20px 25px;
  text-align: center;
}

.footer-contenido h2 {
  margin: 0 0 7px;
  font-size: 24px;
}

.footer-mensaje {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
}

.boton-regresar {
  display: inline-block;
  padding: 12px 20px;
  color: #075783;
  text-decoration: none;
  font-weight: bold;
}

/* ===========================
   DETALLE DEL MAPA
=========================== */

.detalle-mapa {
  margin-bottom: 16px;
  padding: 18px;
  background-color: #f2fbff;
  border: 1px solid #cceaf7;
  border-radius: 15px;
}

.detalle-mapa h3 {
  margin: 0 0 8px;
  color: #075783;
}

.detalle-mapa p {
  margin: 5px 0;
  color: #5d6875;
}

.acciones-mapa {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.detalle-mapa {
  animation: aparecer 0.25s ease;
}

.barra-sucursales {
  position: sticky;
  top: 0;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  z-index: 1000;
  background: linear-gradient(135deg, #179bd3, #075783);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.barra-sucursales__contenido {
  width: 92%;
  max-width: 1250px;
  margin: auto;
  padding: 18px 20px;
  text-align: center;
}

.barra-sucursales h1 {
  margin: 0 0 5px;
  font-size: 30px;
}

.barra-sucursales p {
  margin: 0;
  font-size: 16px;
}

@keyframes aparecer {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================
   RESPONSIVE
=========================== */

@media (max-width: 850px) {
  .contenido {
    grid-template-columns: 1fr;
  }

  #mapa {
    min-height: 420px;
  }
}

@media (max-width: 600px) {
  .pagina-sucursales {
    width: 94%;
  }

  .presentacion h1 {
    font-size: 27px;
  }

  .presentacion p {
    font-size: 16px;
  }

  .busqueda {
    flex-direction: column;

    align-items: stretch;
  }

  .busqueda select {
    width: 100%;
  }

  .acciones-sucursal {
    grid-template-columns: 1fr;
  }

  .pie-pagina {
    min-height: 360px;
    background-size: auto 100%;
    background-position: center top;
  }

  .footer-contenido {
    min-height: 360px;
    padding: 110px 18px 25px;
  }

  .footer-enlaces {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-enlaces a {
    width: 100%;
  }

  .footer-linea {
    width: 100%;
  }

  #mapa {
    min-height: 330px;
  }
}
