/* sucursales.css — Estilos. Las reglas adaptables están al final y en bloques de medios. */

nav a[aria-current="page"] {
  box-shadow: inset 0 -4px var(--red);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.locator {
  max-width: 1480px;
  margin: 0 auto;
  padding: 30px 26px 32px;
  color: #133675;
}
.locator-intro {
  text-align: center;
  font-size: 18px;
  line-height: 1.6;
  color: #747984;
  margin: 0 0 20px;
}
.search-panel {
  border: 1px solid #dce0e6;
  border-radius: 9px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 1px 4px #17274705;
}
.search-panel form {
  display: grid;
  grid-template-columns: minmax(220px, 2.1fr) 0.65fr 1.08fr 1fr 1.12fr;
  align-items: center;
  gap: 12px;
}
.search-panel input,
.search-panel select {
  width: 100%;
  height: 54px;
  min-width: 0;
  border: 1px solid #c5c9d0;
  border-radius: 6px;
  background: #fff;
  font-size: 15px;
  color: #616672;
  padding: 0 15px;
  font-family: var(--body);
}
.unified-search {
  position: relative;
}
.unified-search > span {
  position: absolute;
  top: 9px;
  left: 13px;
  font-size: 30px;
  color: #606978;
}
.unified-search input {
  padding-left: 43px;
}
.search-panel .red-button,
.outline-button {
  height: 54px;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.search-panel .red-button {
  background: #ed0018;
}
.outline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #16449b;
  border: 1px solid #2857ad;
  background: #fff;
  cursor: pointer;
}
.outline-button:hover {
  background: #f0f4fc;
}
.outline-button[hidden] {
  display: none;
}
#use-location span {
  font-size: 26px;
}
.search-feedback {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  padding: 6px 3px;
}
.search-feedback p {
  font-size: 12px;
  color: #737c8e;
}
.search-feedback button {
  background: transparent;
  color: #53709b;
  text-decoration: underline;
  font-size: 12px;
  padding: 3px;
  white-space: nowrap;
}
.branch-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  align-items: stretch;
}
.results-panel {
  border: 1px solid #d9dde4;
  border-radius: 10px;
  padding: 14px;
  min-width: 0;
}
.result-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 2px 7px 14px;
}
.result-toolbar h2 {
  font: 700 22px/1.3 var(--body);
  letter-spacing: -0.5px;
}
.result-toolbar span {
  font-size: 14px;
  color: #808590;
  white-space: nowrap;
}
#branch-list {
  display: grid;
  gap: 10px;
  max-height: 728px;
  overflow: auto;
  scrollbar-width: thin;
  padding: 1px;
}
.branch-card {
  border: 1px solid #dedfe5;
  border-radius: 10px;
  padding: 14px;
  background: white;
}
.branch-card.selected {
  border-color: #3562b6;
  box-shadow: 0 0 0 1px #3562b622;
}
.card-main {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
}
.pin-icon {
  width: 34px;
  height: 42px;
  fill: #064595;
}
.branch-card h3 {
  font: 700 17px/1.3 var(--body);
  margin: 0 0 10px;
  color: #133875;
}
.card-heading {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.distance {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.card-line {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
  color: #646b75;
  margin: 0 0 6px;
}
.card-line svg {
  width: 15px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.card-line a:hover {
  text-decoration: underline;
}
.branch-address {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin: 4px 0 9px 48px;
}
.state-label {
  font-size: 11px;
  color: #818995;
}
.hours-badge {
  font-size: 11px;
  color: #375a98;
  background: #edf3ff;
  border: 1px solid #d9e4fc;
  border-radius: 5px;
  padding: 5px 8px;
  white-space: nowrap;
}
.hours-badge.open {
  color: #268138;
  background: #eafaeb;
  border-color: #d1edcb;
}
.hours-badge.soon {
  color: #c46623;
  background: #fff2e9;
  border-color: #ffdcc4;
}
.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
}
.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.service-tag {
  border: 1px solid #e0e6f0;
  border-radius: 6px;
  background: #f0f4fa;
  color: #284f8f;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 6px 7px;
  font-size: 11px;
  font-weight: 600;
}
.card-actions {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}
.details-button {
  height: 39px;
  padding: 7px 10px;
  font-size: 12px;
}
.wa-button {
  width: 40px;
  height: 39px;
  padding: 8px;
  background: #ed0018;
  color: white;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.wa-button svg {
  width: 25px;
  height: 25px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}
.wa-button:hover {
  background: #c50020;
}
#load-more {
  height: 40px;
  width: 100%;
  margin-top: 10px;
  position: relative;
  font-size: 14px;
}
#load-more span {
  position: absolute;
  right: 15px;
  font-size: 25px;
}
#shown-count {
  text-align: center;
  font-size: 13px;
  color: #838896;
  padding: 10px 0 2px;
}
.map-panel {
  position: relative;
  min-height: 710px;
  border: 1px solid #d8dce3;
  border-radius: 10px;
  overflow: hidden;
  background: #edf0f2;
  isolation: isolate;
}
#branch-map {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.map-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #064291;
  color: white;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 8px;
  padding: 12px 17px;
  box-shadow: 0 3px 8px #0002;
  pointer-events: none;
}
.map-badge > span:first-child {
  font-size: 26px;
  line-height: 1;
}
.map-badge strong {
  font-size: 38px;
  line-height: 1.25;
}
.map-badge span {
  font-size: 14px;
  font-weight: 600;
}
.branch-pin {
  background: transparent;
  border: 0;
}
.branch-pin svg {
  width: 34px;
  height: 44px;
  fill: #084899;
  filter: drop-shadow(0 2px 1px #0002);
}
.branch-pin.active svg {
  fill: #ec0028;
}
.cluster-icon {
  border-radius: 50%;
  border: 7px solid #16499520;
  background: #16499520;
  background-clip: padding-box;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cluster-icon span {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #064595;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font: 700 21px var(--body);
}
.leaflet-container {
  font-family: var(--body);
}
.leaflet-popup-content-wrapper {
  border-radius: 13px;
  box-shadow: 0 5px 20px #0003;
}
.leaflet-popup-content {
  margin: 23px;
  line-height: 1.6;
  width: 280px !important;
}
.map-popup h3 {
  font: 700 16px var(--body);
  margin: 0 0 9px;
  color: #133875;
}
.map-popup p {
  font-size: 12px;
  color: #677181;
  margin: 8px 0 14px;
}
.map-popup .red-button {
  width: 100%;
  border-radius: 5px;
  font-size: 13px;
  margin-top: 15px;
}
.map-popup .hours-badge {
  display: inline-block;
}
#map-error {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 28px;
  background: white;
  padding: 12px;
  font-size: 13px;
  border-radius: 6px;
  z-index: 700;
  box-shadow: 0 2px 12px #0002;
}
.availability-note {
  text-align: center;
  color: #818692;
  font-size: 14px;
  line-height: 1.5;
  margin: 16px 0;
}
.locator-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  border-top: 1px solid #eee;
  padding-top: 16px;
}
.locator-foot p {
  font-size: 11px;
  line-height: 1.7;
  color: #818897;
  max-width: 670px;
}
.locator-foot a {
  text-decoration: underline;
}
.locator-foot .outline-button {
  font-size: 12px;
  height: 40px;
}
.empty-state {
  padding: 40px 20px;
  text-align: center;
}
.empty-state h3 {
  font: 700 22px var(--heading);
  margin-bottom: 15px;
}
.empty-state p {
  font-size: 14px;
  line-height: 1.8;
  color: #69778b;
  margin-bottom: 20px;
}
.empty-state .red-button {
  font-size: 13px;
}
#quote-dialog,
#details-dialog {
  max-width: 610px;
}
.close-dialog {
  z-index: 1;
}
#quote-recipient,
#detail-body {
  font-size: 14px;
  color: #5d687f;
  line-height: 1.8;
  margin-bottom: 20px;
}
#detail-body h3 {
  font-size: 24px;
  color: var(--blue);
  margin: 22px 0 8px;
}
#detail-body .service-tags {
  margin-bottom: 20px;
}
#detail-body .service-tag {
  font-size: 13px;
}
#detail-body .outline-button {
  height: 43px;
  margin-right: 10px;
  font-size: 14px;
}
#detail-body .red-button {
  border-radius: 6px;
  font-size: 14px;
  margin-top: 12px;
}
#quote-form label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 9px;
}
#quote-form label span {
  font-weight: 400;
  color: #7e8797;
  font-size: 12px;
}
#quote-form input,
#quote-form select,
#quote-form textarea {
  background: white;
  border: 1px solid #a6afc3;
  border-radius: 8px;
  height: 48px;
  padding: 10px 13px;
  width: 100%;
  min-width: 0;
  font-size: 16px;
  color: var(--blue);
  font-family: var(--body);
  margin-bottom: 18px;
}
.quote-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 15px;
}
#quote-form textarea {
  height: auto;
  resize: vertical;
  margin-bottom: 0;
}
.quote-note {
  font-size: 12px;
  line-height: 1.8;
  color: #717b91;
  margin: 18px 0;
}
#quote-form > .red-button {
  width: 100%;
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
.leaflet-control-attribution {
  font-size: 10px !important;
}
/* ADAPTACIÓN DE PANTALLA O PREFERENCIAS */
@media (min-width: 1600px) {
  .locator {
    max-width: 1720px;
  }
  .card-line {
    font-size: 15px;
  }
  .branch-card h3 {
    font-size: 20px;
  }
  .branch-card {
    padding: 17px;
  }
  .service-tag {
    font-size: 13px;
  }
  .details-button {
    font-size: 14px;
  }
  .card-meta {
    margin-bottom: 15px;
  }
  .result-toolbar h2 {
    font-size: 25px;
  }
  .map-panel {
    min-height: 775px;
  }
  .search-panel input,
  .search-panel select,
  .search-panel .red-button,
  .search-panel .outline-button {
    font-size: 17px;
    height: 60px;
  }
}
/* ADAPTACIÓN DE PANTALLA O PREFERENCIAS */
@media (max-width: 1150px) {
  .search-panel form {
    grid-template-columns: 2fr 1fr 1.4fr;
  }
  .search-panel select {
    grid-row: 2;
  }
  .search-panel select:last-child {
    grid-column: 2/4;
  }
  .branch-layout {
    grid-template-columns: 1fr 1fr;
  }
  .card-bottom {
    flex-wrap: wrap;
  }
  .map-panel {
    min-height: 760px;
  }
  .result-toolbar h2 {
    font-size: 19px;
  }
  .result-toolbar span {
    font-size: 12px;
  }
  .locator-foot {
    flex-direction: column;
    align-items: start;
    gap: 12px;
  }
  .card-meta {
    margin-left: 0;
  }
  .hours-badge {
    font-size: 10px;
  }
}
/* ADAPTACIÓN DE PANTALLA O PREFERENCIAS */
@media (max-width: 760px) {
  .locator {
    padding: 22px 16px;
  }
  .locator-intro {
    font-size: 15px;
  }
  .search-panel {
    padding: 12px;
  }
  .search-panel form {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .unified-search {
    grid-column: 1/-1;
  }
  .search-panel select {
    grid-row: auto;
  }
  .search-panel select:last-child {
    grid-column: auto;
  }
  .search-panel input,
  .search-panel select,
  .search-panel .outline-button,
  .search-panel .red-button {
    font-size: 13px;
    height: 47px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .unified-search input {
    padding-left: 37px;
  }
  .unified-search > span {
    top: 3px;
  }
  .search-panel #use-location {
    font-size: 12px;
    gap: 5px;
  }
  .branch-layout {
    grid-template-columns: 1fr;
  }
  .map-panel {
    min-height: 440px;
  }
  .results-panel {
    padding: 12px;
  }
  #branch-list {
    max-height: none;
  }
  .branch-card h3 {
    font-size: 17px;
  }
  .card-line {
    font-size: 13px;
  }
  .service-tag {
    font-size: 11px;
  }
  .card-bottom {
    flex-wrap: nowrap;
  }
  .result-toolbar h2 {
    font-size: 20px;
  }
  .result-toolbar span {
    font-size: 12px;
  }
  .map-badge strong {
    font-size: 28px;
  }
  .map-badge {
    padding: 8px 12px;
  }
  .map-badge span {
    font-size: 12px;
  }
  .availability-note {
    font-size: 12px;
  }
  .search-feedback p {
    font-size: 11px;
  }
  .leaflet-popup-content {
    width: 230px !important;
    margin: 20px;
  }
  .quote-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
/* ADAPTACIÓN DE PANTALLA O PREFERENCIAS */
@media (max-width: 390px) {
  .card-bottom {
    flex-wrap: wrap;
  }
  .card-main {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 8px;
  }
  .pin-icon {
    width: 25px;
  }
  .card-heading {
    flex-wrap: wrap;
  }
  .result-toolbar h2 {
    font-size: 17px;
  }
}

.pin-icon svg {
  width: 100%;
  height: 100%;
}
/* Photo gallery above the branch name in the details modal. */
#details-dialog {
  max-height: 90svh;
  overflow-y: auto;
  scrollbar-width: thin;
}
#details-dialog .close-dialog {
  background: white;
  border-radius: 50%;
}
.branch-gallery {
  margin: 20px 0 23px;
}
.branch-photo-frame {
  position: relative;
  aspect-ratio: 16/7;
  min-height: 160px;
  border-radius: 12px;
  overflow: hidden;
  background: #f2f5fa;
  border: 1px solid #dde5f0;
}
.branch-photo-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  padding: 18px;
  color: #647da6;
  text-align: center;
}
.branch-photo-empty svg {
  width: 55px;
  height: 43px;
  margin-bottom: 3px;
  opacity: 0.8;
}
.branch-photo-empty strong {
  font: 600 15px var(--body);
  color: #355485;
}
.branch-photo-empty > span {
  font-size: 12px;
  color: #8090a7;
}
.branch-main-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.branch-gallery [hidden] {
  display: none !important;
}
.branch-photo-caption {
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  color: #7a8699;
  margin: 10px 0 0;
}
.branch-photo-thumbs {
  display: flex;
  gap: 9px;
  margin-top: 12px;
  overflow-x: auto;
  padding: 3px;
  scrollbar-width: thin;
}
.branch-photo-thumb {
  position: relative;
  width: 85px;
  height: 57px;
  flex-shrink: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  padding: 0;
  background: #e8eef7;
  color: #25478b;
}
.branch-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.branch-photo-thumb span {
  position: absolute;
  bottom: 3px;
  right: 3px;
  background: #fff;
  padding: 1px 5px;
  font-size: 10px;
  border-radius: 3px;
}
.branch-photo-thumb[aria-pressed="true"] {
  border-color: #243e8b;
}
.branch-photo-thumb:focus-visible {
  outline: 2px solid #ed0035;
  outline-offset: 2px;
}
/* ADAPTACIÓN DE PANTALLA O PREFERENCIAS */
@media (max-width: 600px) {
  .branch-gallery {
    margin: 16px 0 20px;
  }
  .branch-photo-frame {
    aspect-ratio: 16/9;
  }
  .branch-photo-empty strong {
    font-size: 14px;
  }
  .branch-photo-caption {
    font-size: 11px;
  }
}

.branch-photo-frame {
  aspect-ratio: 16/9;
}
.branch-main-photo {
  object-fit: contain;
  background: #f2f5fa;
}
