/* Estilos específicos de la página de mapa. */
:root {
  --header-height: 76px;
  --sidebar-width: 430px;

  /* Parámetros visuales del mapa. En producción deberían venir desde configuración SuperAdmin. */
  --map-overlay-bg: rgba(255, 255, 255, 0.36);
  --map-overlay-bg-strong: rgba(255, 255, 255, 0.48);
  --map-overlay-bg-soft: rgba(248, 250, 252, 0.32);
  --map-overlay-border: rgba(255, 255, 255, 0.24);
  --map-overlay-border-strong: rgba(226, 232, 240, 0.34);
  --map-overlay-blur: 18px;
  --map-overlay-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body.page-mapa {
  background: #f1f5f9;
}

/* v037.3: the map layout uses fixed panels, so the <main> landmark used
   by automated browser smoke tests needs an explicit box. This does not
   change the visual layout; it only makes the page root measurable/visible. */
.map-page-root {
  display: block;
  min-height: 100vh;
}

.map-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: #020617;
  text-decoration: none;
}

.map-brand-mark {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: #1688d8;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(22, 136, 216, 0.2);
}

.map-brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.05;
}

.map-brand-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.map-brand-subtitle {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}


.map-brand-logo {
  display: block;
  width: clamp(128px, 14vw, 168px);
  height: auto;
  max-height: 34px;
  object-fit: contain;
}

.map-brand .map-brand-subtitle {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .map-brand-logo {
    width: 118px;
    max-height: 30px;
  }
  .map-brand .map-brand-subtitle {
    display: none;
  }
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
}
.left-panel {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 800;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.left-panel-top {
  flex: 0 0 auto;
  background: #fff;
}
.results-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
}
.map-shell {
  position: fixed;
  top: var(--header-height);
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  z-index: 1;
  overflow: hidden;
  background: #dbe4ee;
}
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  z-index: 1;
  background: #dbe4ee;
}
.map-info-card {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 4;
  min-width: 220px;
  max-width: min(380px, calc(100% - 92px));
  border-radius: 18px;
  background: var(--map-overlay-bg);
  padding: 9px 11px;
  box-shadow: var(--map-overlay-shadow);
  border: 1px solid var(--map-overlay-border);
  backdrop-filter: blur(var(--map-overlay-blur));
  -webkit-backdrop-filter: blur(var(--map-overlay-blur));
  pointer-events: none;
}
.map-info-kicker {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0d6fb7;
  margin-bottom: 4px;
}
.map-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.map-info-title {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 900;
  color: #0f172a;
}
.map-info-rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 251, 235, 0.36);
  padding: 3px 7px;
  font-size: 10.5px;
  line-height: 1;
  font-weight: 900;
  color: #92400e;
  border: 1px solid rgba(251, 191, 36, 0.18);
  white-space: nowrap;
}
.map-info-rating.hidden {
  display: none;
}
.map-info-stars {
  letter-spacing: -1px;
  color: #f59e0b;
}
.map-info-text {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.32;
  font-weight: 700;
  color: #64748b;
}

.map-zoom-panel {
  position: absolute;
  right: 18px;
  top: 92px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-radius: 18px;
  background: var(--map-overlay-bg);
  padding: 10px 8px;
  box-shadow: var(--map-overlay-shadow);
  border: 1px solid var(--map-overlay-border);
  backdrop-filter: blur(var(--map-overlay-blur));
  -webkit-backdrop-filter: blur(var(--map-overlay-blur));
}
.map-zoom-button {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
  background: var(--map-overlay-bg-soft);
  border: 1px solid var(--map-overlay-border-strong);
  cursor: pointer;
}
.map-zoom-button:hover {
  background: var(--map-overlay-bg-strong);
}
.map-zoom-range-wrap {
  height: 132px;
  width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#zoomRange {
  width: 132px;
  transform: rotate(-90deg);
  accent-color: #0d6fb7;
  cursor: pointer;
}
.map-center-button {
  background: rgba(15, 23, 42, 0.92);
  color: white;
  border-color: rgba(15, 23, 42, 0.92);
  font-size: 16px;
}
.map-center-button:hover:not(:disabled) {
  background: rgba(15, 23, 42, 1);
}
.map-center-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(15, 23, 42, 0.15);
}

.area-search-button {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 5;
  display: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: white;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
}
.area-search-button.is-visible {
  display: inline-flex;
}
.map-credit {
  bottom: 20px;
  transition: bottom 0.2s ease;
  background: var(--map-overlay-bg) !important;
  border-color: var(--map-overlay-border) !important;
  box-shadow: var(--map-overlay-shadow) !important;
  backdrop-filter: blur(var(--map-overlay-blur));
  -webkit-backdrop-filter: blur(var(--map-overlay-blur));
}
.map-shell.has-photo-tray .map-credit {
  bottom: 132px;
}

.map-photo-tray {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 4;
  width: min(720px, calc(100% - 260px));
  max-width: calc(100% - 36px);
  border-radius: 22px;
  background: var(--map-overlay-bg);
  box-shadow: var(--map-overlay-shadow);
  border: 1px solid var(--map-overlay-border);
  backdrop-filter: blur(var(--map-overlay-blur));
  -webkit-backdrop-filter: blur(var(--map-overlay-blur));
  overflow: hidden;
}
.photo-tray-icon-button {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--map-overlay-bg-soft);
  color: #334155;
  font-size: 18px;
  font-weight: 900;
  border: 1px solid var(--map-overlay-border-strong);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}
.photo-tray-icon-button:hover {
  background: var(--map-overlay-bg-strong);
  color: #0f172a;
}
.photo-tray-restore {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: white;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.photo-tray-restore:hover {
  background: rgba(15, 23, 42, 1);
}

.photo-tray-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 9px 12px 12px;
  scroll-snap-type: x proximity;
}
.photo-tray-strip::-webkit-scrollbar,
.gallery-thumbs::-webkit-scrollbar {
  height: 8px;
}
.photo-tray-strip::-webkit-scrollbar-thumb,
.gallery-thumbs::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.24);
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.38);
}
.photo-thumb {
  position: relative;
  flex: 0 0 92px;
  height: 62px;
  border: 0;
  border-radius: 15px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  scroll-snap-align: start;
  box-shadow:
    inset 0 -34px 48px rgba(15, 23, 42, 0.22),
    0 8px 18px rgba(15, 23, 42, 0.1);
}
.photo-thumb:hover {
  transform: translateY(-1px);
}
.photo-thumb-number {
  position: absolute;
  right: 6px;
  bottom: 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: white;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 900;
}

.gallery-lightbox {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
}
.gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.gallery-panel {
  position: relative;
  z-index: 1;
  width: min(900px, calc(100% - 56px));
  height: min(720px, calc(100% - 56px));
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.gallery-close {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 24px;
  font-weight: 900;
}
.gallery-hero {
  margin: 16px 64px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 70px;
  box-shadow: inset 0 -120px 160px rgba(15, 23, 42, 0.34);
  min-height: 0;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 34px;
  line-height: 1;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.gallery-nav:hover {
  background: rgba(255, 255, 255, 0.18);
}
.gallery-nav-left {
  left: 16px;
}
.gallery-nav-right {
  right: 16px;
}
.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 16px;
}
.gallery-thumb {
  flex: 0 0 72px;
  height: 48px;
  border-radius: 13px;
  border: 2px solid transparent;
  opacity: 0.68;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
}
.gallery-thumb.is-active {
  border-color: white;
  opacity: 1;
}

.tag-filter-list {
  display: grid;
  gap: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transition: max-height 0.18s ease;
  padding-right: 2px;
}
.tag-filter-list.is-collapsed {
  max-height: 84px;
}
.tag-filter-list.is-expanded {
  max-height: 260px;
}
.tag-filter-list::-webkit-scrollbar {
  width: 8px;
}
.tag-filter-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid #f8fafc;
}
.tag-chip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 12px;
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1;
  font-weight: 850;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  text-align: left;
}
.tag-chip:hover {
  background: #f1f5f9;
}
.tag-chip.is-active {
  border-color: #0d6fb7;
  background: #eef8ff;
  color: #095990;
  box-shadow: 0 8px 18px rgba(22, 136, 216, 0.12);
}
.tag-check {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: transparent;
  font-size: 10px;
  font-weight: 900;
}
.tag-chip.is-active .tag-check {
  border-color: #0d6fb7;
  background: #0d6fb7;
  color: white;
}

.local-thumb {
  position: relative;
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #dbeafe, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: inset 0 -30px 46px rgba(15, 23, 42, 0.26);
}
.local-thumb.has-photo,
.gallery-tile.has-photo,
.photo-thumb,
.gallery-thumb,
.gallery-hero {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.local-thumb.has-photo::after,
.gallery-tile.has-photo::after,
.photo-thumb::after,
.gallery-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0),
    rgba(15, 23, 42, 0.22)
  );
  pointer-events: none;
}
.gallery-hero {
  position: relative;
}
.gallery-hero-caption {
  position: absolute;
  left: 18px;
  bottom: 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: white;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}
.local-thumb-icon {
  font-size: 26px;
  filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.26));
}
.photo-count {
  position: absolute;
  right: 5px;
  bottom: 5px;
  z-index: 1;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: white;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 900;
  backdrop-filter: blur(8px);
}
.card-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.gallery-tile {
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e0f2fe, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  box-shadow: inset 0 -22px 34px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  position: relative;
}
.two-line {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.scroll-panel::-webkit-scrollbar {
  width: 10px;
}
.scroll-panel::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 3px solid #f8fafc;
}
.scroll-panel::-webkit-scrollbar-track {
  background: #f8fafc;
}
.hidden {
  display: none !important;
}
.map-location-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 1300;
  max-height: 300px;
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.map-location-suggestions[hidden] {
  display: none;
}

.responsive-view-toggle {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 1200;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.94);
  color: white;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

@media (max-width: 1023px) {
  html,
  body {
    overflow: hidden;
    height: 100%;
  }
  
.map-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: #020617;
  text-decoration: none;
}

.map-brand-mark {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: #1688d8;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(22, 136, 216, 0.2);
}

.map-brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.05;
}

.map-brand-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.map-brand-subtitle {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.app-header {
    position: fixed;
  }
  .left-panel {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-right: 0;
  }
  .results-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 82px;
  }
  .map-shell {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    min-height: 0;
  }
  body.responsive-list-view .left-panel {
    display: flex;
  }
  body.responsive-list-view .map-shell {
    visibility: hidden;
    pointer-events: none;
  }
  body.responsive-map-view .left-panel {
    display: none;
  }
  body.responsive-map-view .map-shell {
    visibility: visible;
    pointer-events: auto;
  }
  .responsive-view-toggle {
    display: inline-flex;
  }
  body.responsive-map-view .responsive-view-toggle {
    background: rgba(255, 255, 255, 0.94);
    color: #0f172a;
    border-color: rgba(226, 232, 240, 0.9);
  }
}
@media (max-width: 840px) {
  .map-photo-tray {
    width: calc(100% - 24px);
    bottom: 12px;
  }
  .map-shell.has-photo-tray .map-credit {
    bottom: 126px;
  }
  .photo-thumb {
    flex-basis: 82px;
    height: 56px;
  }
  .gallery-panel {
    width: calc(100% - 24px);
    height: min(76vh, calc(100% - 24px));
    border-radius: 24px;
  }
  .gallery-hero {
    margin: 12px 52px;
    font-size: 52px;
  }
}
@media (max-width: 640px) {
  .map-info-card {
    left: 10px;
    top: 10px;
    min-width: 0;
    max-width: calc(100% - 84px);
    padding: 8px 9px;
    border-radius: 16px;
  }
  .map-info-kicker {
    font-size: 8.5px;
    margin-bottom: 3px;
  }
  .map-info-title {
    font-size: 13px;
  }
  .map-info-rating {
    font-size: 10px;
    padding: 3px 6px;
  }
  .map-info-text {
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.28;
  }
}


.app-header {
  border-bottom: 1px solid var(--facilitator-dark-border);
  background: var(--facilitator-header-bg);
  color: var(--facilitator-on-dark);
}

.map-brand {
  color: var(--facilitator-on-dark);
}

.map-header-nav {
  background: var(--facilitator-dark-chip);
  color: var(--facilitator-on-dark-muted);
  border: 1px solid var(--facilitator-dark-border);
}

.map-header-nav a {
  color: inherit;
  text-decoration: none;
}

.map-header-nav a:hover,
.map-header-current {
  background: var(--facilitator-dark-chip-hover);
  color: var(--facilitator-brand-accent-strong);
}

.map-login-button {
  background: var(--facilitator-brand-accent);
  color: #041111;
}

.map-login-button:hover {
  background: var(--facilitator-brand-accent-strong);
}

/* --------------------------------------------------------------------------
   v0.23 - Visual refresh para la página de mapa.
   No modifica comportamiento. Estos tokens deberían poder parametrizarse desde
   SuperAdmin cuando exista gestión de marca/tema por sitio.
   -------------------------------------------------------------------------- */
:root {
  /* SuperAdmin: Map.HeaderHeight, Map.PanelWidthDesktop */
  --map-header-height: var(--header-height);
  --map-panel-width: var(--sidebar-width);

  /* SuperAdmin: Map.*Color / Map.*Surface */
  --map-page-bg: #f6fbfc;
  --map-panel-bg: #f6fbfc;
  --map-panel-surface: #ffffff;
  --map-panel-surface-soft: #f4fafa;
  --map-panel-border: #d8e5e8;
  --map-text: #050816;
  --map-muted: #475569;
  --map-accent: var(--facilitator-brand-accent, #04d4cb);
  --map-accent-dark: var(--facilitator-brand-accent-dark, #007681);
  --map-accent-strong: var(--facilitator-brand-accent-strong, #01ffff);
  --map-selected-bg: #05070d;
  --map-selected-ring: rgba(4, 212, 203, 0.42);
  --map-featured-bg: #f8b84e;
  --map-featured-text: #3b2300;
  --map-card-shadow: 0 14px 38px rgba(5, 8, 22, 0.08);
  --map-card-shadow-hover: 0 20px 48px rgba(5, 8, 22, 0.13);

  /* SuperAdmin: Map.MarkerDefaultColor / FeaturedColor / SelectedColor */
  --map-marker-default-bg: #007681;
  --map-marker-featured-bg: #f8b84e;
  --map-marker-selected-bg: #05070d;
  --map-marker-selected-ring: rgba(4, 212, 203, 0.6);

  --map-overlay-bg: rgba(255, 255, 255, 0.84);
  --map-overlay-bg-strong: rgba(255, 255, 255, 0.94);
  --map-overlay-bg-soft: rgba(244, 250, 250, 0.86);
  --map-overlay-border: rgba(216, 229, 232, 0.88);
  --map-overlay-border-strong: rgba(0, 118, 129, 0.24);
  --map-overlay-blur: 18px;
  --map-overlay-shadow: 0 18px 48px rgba(5, 8, 22, 0.11);
}

body.page-mapa {
  background: var(--map-page-bg);
  color: var(--map-text);
}

body.page-mapa .app-header {
  height: var(--map-header-height);
  border-bottom: 1px solid var(--facilitator-dark-border);
  background: linear-gradient(180deg, #05070d 0%, #080a12 100%);
  box-shadow: 0 12px 32px rgba(5, 8, 22, 0.22);
}

body.page-mapa .map-brand-logo {
  width: clamp(136px, 13vw, 176px);
  max-height: 38px;
  filter: drop-shadow(0 10px 22px rgba(4, 212, 203, 0.10));
}

body.page-mapa .map-header-nav {
  border-color: rgba(216, 229, 232, 0.16);
  background: rgba(216, 229, 232, 0.08);
  color: var(--facilitator-on-dark-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.page-mapa .map-header-nav a,
body.page-mapa .map-header-current {
  transition:
    background-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

body.page-mapa .map-header-nav a:hover,
body.page-mapa .map-header-current {
  background: rgba(4, 212, 203, 0.13);
  color: var(--map-accent-strong);
}

body.page-mapa .map-login-button {
  border: 1px solid rgba(4, 212, 203, 0.42);
  background: rgba(4, 212, 203, 0.12);
  color: var(--facilitator-on-dark);
  box-shadow: none;
  transition:
    background-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

body.page-mapa .map-login-button:hover {
  transform: translateY(-1px);
  background: rgba(4, 212, 203, 0.2);
  color: var(--map-accent-strong);
}

body.page-mapa .left-panel {
  background: var(--map-panel-bg);
  border-right: 1px solid var(--map-panel-border) !important;
  box-shadow: 16px 0 48px rgba(5, 8, 22, 0.08);
}

body.page-mapa .left-panel-top {
  background: linear-gradient(180deg, #ffffff 0%, #f6fbfc 100%);
  border-bottom: 1px solid var(--map-panel-border) !important;
  box-shadow: 0 12px 28px rgba(5, 8, 22, 0.06) !important;
}

body.page-mapa .results-scroll {
  background:
    radial-gradient(circle at top left, rgba(4, 212, 203, 0.08), transparent 32%),
    var(--map-panel-bg);
}

body.page-mapa .left-panel-top label,
body.page-mapa .left-panel-top select {
  background: #ffffff !important;
  border: 1px solid var(--map-panel-border);
  box-shadow: 0 8px 22px rgba(5, 8, 22, 0.035);
}

body.page-mapa .left-panel-top label:focus-within,
body.page-mapa .left-panel-top select:focus {
  border-color: rgba(0, 118, 129, 0.48);
  box-shadow: 0 0 0 4px rgba(4, 212, 203, 0.14);
}

body.page-mapa #clearButton {
  border: 1px solid rgba(4, 212, 203, 0.34) !important;
  background: var(--map-selected-bg) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 28px rgba(5, 8, 22, 0.18);
}

body.page-mapa #clearButton:hover {
  background: #0b1020 !important;
  color: var(--map-accent-strong) !important;
}

body.page-mapa #locationPrompt,
body.page-mapa #selectedSummary {
  border-color: rgba(0, 118, 129, 0.18) !important;
  background: linear-gradient(135deg, rgba(4, 212, 203, 0.12), rgba(246, 251, 252, 0.96)) !important;
}

body.page-mapa #useLocationButton,
body.page-mapa #showAllButton,
body.page-mapa #prevLocalButton,
body.page-mapa #nextLocalButton {
  border-color: var(--map-panel-border) !important;
  background: #ffffff !important;
  color: var(--map-text) !important;
}

body.page-mapa #useLocationButton:hover,
body.page-mapa #showAllButton:hover,
body.page-mapa #prevLocalButton:hover,
body.page-mapa #nextLocalButton:hover {
  border-color: rgba(0, 118, 129, 0.28) !important;
  background: rgba(4, 212, 203, 0.08) !important;
  color: var(--map-accent-dark) !important;
}

body.page-mapa #tagFilters,
body.page-mapa .tag-filter-list {
  scrollbar-color: rgba(0, 118, 129, 0.35) transparent;
}

body.page-mapa .tag-chip {
  border-color: var(--map-panel-border);
  background: #ffffff;
  color: var(--map-muted);
  box-shadow: 0 6px 16px rgba(5, 8, 22, 0.035);
}

body.page-mapa .tag-chip:hover {
  border-color: rgba(0, 118, 129, 0.24);
  background: rgba(4, 212, 203, 0.07);
  color: var(--map-text);
}

body.page-mapa .tag-chip.is-active {
  border-color: rgba(0, 118, 129, 0.42);
  background: rgba(4, 212, 203, 0.12);
  color: var(--map-accent-dark);
  box-shadow: 0 12px 28px rgba(0, 118, 129, 0.14);
}

body.page-mapa .tag-chip.is-active .tag-check {
  border-color: var(--map-accent-dark);
  background: var(--map-accent-dark);
}

body.page-mapa .map-result-card {
  position: relative;
  border-color: var(--map-panel-border) !important;
  background: #ffffff !important;
  color: var(--map-text) !important;
  box-shadow: var(--map-card-shadow) !important;
  overflow: hidden;
}

body.page-mapa .map-result-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--map-card-shadow-hover) !important;
  border-color: rgba(0, 118, 129, 0.22) !important;
}

body.page-mapa .map-result-card.is-premium:not(.is-selected) {
  border-color: rgba(248, 184, 78, 0.58) !important;
  box-shadow:
    0 0 0 1px rgba(248, 184, 78, 0.14),
    var(--map-card-shadow) !important;
}

body.page-mapa .map-result-card.is-selected {
  border-color: var(--map-accent) !important;
  background:
    linear-gradient(135deg, rgba(4, 212, 203, 0.1), transparent 42%),
    var(--map-selected-bg) !important;
  color: #ffffff !important;
  box-shadow:
    0 0 0 2px var(--map-selected-ring),
    0 22px 52px rgba(5, 8, 22, 0.26) !important;
}

body.page-mapa .map-card-rank {
  border: 1px solid var(--map-panel-border);
  background: #f6fbfc !important;
}

body.page-mapa .map-result-card.is-selected .map-card-rank {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

body.page-mapa .map-card-badge {
  border: 1px solid rgba(216, 229, 232, 0.8);
}

body.page-mapa .map-card-badge.is-featured {
  border-color: rgba(248, 184, 78, 0.42);
  background: rgba(248, 184, 78, 0.16) !important;
  color: #7a4b00 !important;
}

body.page-mapa .map-card-badge.is-selected {
  border-color: rgba(4, 212, 203, 0.28);
  background: rgba(4, 212, 203, 0.14) !important;
  color: var(--map-accent-strong) !important;
}

/* v0.24: result card service/tag chips are explicit CSS instead of dynamic Tailwind classes.
   SuperAdmin future tokens: Map.ResultTagBg, Map.ResultTagText, Map.ResultTagSelectedBg, Map.ResultTagSelectedText. */
body.page-mapa .local-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.375rem;
  overflow: visible;
}

body.page-mapa .local-tag-row.is-selected-card {
  gap: 0.4rem;
  margin-top: 0.5rem;
}

body.page-mapa .local-tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  border: 1px solid rgba(216, 229, 232, 0.92);
  border-radius: 999px;
  background: #eef6f7;
  color: #334155;
  padding: 0.25rem 0.55rem;
  font-size: 0.625rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

body.page-mapa .local-tag-chip.is-more {
  background: #f6fbfc;
  color: #64748b;
}

body.page-mapa .map-result-card.is-selected .local-tag-chip,
body.page-mapa .local-tag-chip.is-on-selected {
  border-color: rgba(4, 212, 203, 0.34);
  background: rgba(4, 212, 203, 0.14);
  color: #eaffff;
}

body.page-mapa .map-result-card.is-selected .local-tag-chip.is-more,
body.page-mapa .local-tag-chip.is-on-selected.is-more {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

body.page-mapa .map-card-primary-action {
  border: 1px solid transparent;
  background: var(--map-accent-dark) !important;
  color: #ffffff !important;
}

body.page-mapa .map-card-primary-action:hover {
  background: #005d63 !important;
}

body.page-mapa .map-result-card.is-selected .map-card-primary-action {
  background: var(--map-accent) !important;
  color: #041111 !important;
}

body.page-mapa .map-card-secondary-action {
  border-color: var(--map-panel-border) !important;
  background: #ffffff !important;
  color: var(--map-text) !important;
}

body.page-mapa .map-card-secondary-action:hover {
  border-color: rgba(0, 118, 129, 0.28) !important;
  background: rgba(4, 212, 203, 0.08) !important;
  color: var(--map-accent-dark) !important;
}

body.page-mapa .map-result-card.is-selected .map-card-secondary-action {
  border-color: rgba(255, 255, 255, 0.18) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

body.page-mapa .map-info-card,
body.page-mapa .map-photo-tray,
body.page-mapa .map-zoom-panel,
body.page-mapa .map-credit {
  border-color: var(--map-overlay-border) !important;
  background: var(--map-overlay-bg) !important;
  box-shadow: var(--map-overlay-shadow) !important;
}

body.page-mapa .map-info-kicker {
  color: var(--map-accent-dark);
}

body.page-mapa .map-info-title {
  color: var(--map-text);
}

body.page-mapa .map-info-text {
  color: var(--map-muted);
}

body.page-mapa .map-info-rating {
  border-color: rgba(248, 184, 78, 0.28);
  background: rgba(248, 184, 78, 0.18);
  color: #6f4300;
}

body.page-mapa .map-zoom-button {
  border-color: var(--map-panel-border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--map-text);
}

body.page-mapa .map-zoom-button:hover {
  border-color: rgba(0, 118, 129, 0.32);
  background: rgba(4, 212, 203, 0.1);
  color: var(--map-accent-dark);
}

body.page-mapa .map-center-button {
  border-color: rgba(4, 212, 203, 0.38);
  background: var(--map-selected-bg);
  color: #ffffff;
}

body.page-mapa .area-search-button {
  border: 1px solid rgba(4, 212, 203, 0.46);
  background: linear-gradient(135deg, var(--map-selected-bg), #0b1020);
  color: #ffffff;
  box-shadow: 0 20px 52px rgba(5, 8, 22, 0.28);
}

body.page-mapa .area-search-button::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--map-accent);
  box-shadow: 0 0 0 4px rgba(4, 212, 203, 0.14);
}

body.page-mapa .area-search-button:hover {
  color: var(--map-accent-strong);
}

body.page-mapa .photo-tray-restore,
body.page-mapa .responsive-view-toggle {
  border-color: rgba(4, 212, 203, 0.42);
  background: var(--map-selected-bg);
  color: #ffffff;
}

body.page-mapa .responsive-view-toggle:hover,
body.page-mapa .photo-tray-restore:hover {
  color: var(--map-accent-strong);
}

body.page-mapa.responsive-map-view .responsive-view-toggle {
  border-color: rgba(216, 229, 232, 0.92);
  background: rgba(255, 255, 255, 0.96);
  color: var(--map-text);
}

body.page-mapa .map-location-suggestions {
  border-color: var(--map-panel-border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(5, 8, 22, 0.14);
}

body.page-mapa .facilitator-map-marker {
  background: transparent !important;
  border: 0 !important;
}

.map-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 950;
  font-size: 13px;
  border: 4px solid #ffffff;
  box-shadow:
    0 16px 34px rgba(5, 8, 22, 0.24),
    0 0 0 1px rgba(5, 8, 22, 0.08);
}

.map-marker-normal {
  background: var(--map-marker-default-bg);
  color: #ffffff;
}

.map-marker-featured {
  background: var(--map-marker-featured-bg);
  color: var(--map-featured-text);
}

.map-marker-selected {
  background: var(--map-marker-selected-bg);
  color: #ffffff;
  border-color: var(--map-accent);
  box-shadow:
    0 18px 44px rgba(5, 8, 22, 0.34),
    0 0 0 6px var(--map-marker-selected-ring);
}

@media (max-width: 1023px) {
  body.page-mapa .left-panel {
    border-right: 0 !important;
    box-shadow: none;
  }

  body.page-mapa .results-scroll {
    padding-bottom: 92px;
  }
}

@media (max-width: 640px) {
  body.page-mapa .app-header > div {
    padding-left: 14px;
    padding-right: 14px;
  }

  body.page-mapa .map-brand-logo {
    width: 132px;
    max-height: 32px;
  }

  body.page-mapa .left-panel-top {
    padding: 10px !important;
  }

  body.page-mapa .map-result-card {
    border-radius: 18px !important;
  }

  body.page-mapa .area-search-button {
    top: 12px;
    max-width: calc(100% - 104px);
    padding: 9px 12px;
    font-size: 12px;
    white-space: nowrap;
  }
}

/* v0.26: selected-card media robustness.
   Uses <img> elements instead of CSS background-image data URLs to avoid intermittent blank/colored-square artifacts after changing selection.
   Future SuperAdmin tokens: Map.ResultThumbRadius, Map.ResultThumbOverlayOpacity, Map.SelectedCardMediaMode. */
body.page-mapa .local-thumb img,
body.page-mapa .gallery-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.page-mapa .local-thumb.has-category-fallback {
  border: 1px solid rgba(216, 229, 232, 0.9);
}

body.page-mapa .map-result-card.is-selected .local-thumb.has-photo {
  border: 1px solid rgba(4, 212, 203, 0.32);
  box-shadow:
    inset 0 -30px 46px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(4, 212, 203, 0.12);
}

body.page-mapa .card-gallery.is-selected-gallery {
  margin-top: 0.65rem;
}

body.page-mapa .card-gallery.is-selected-gallery .gallery-tile {
  border: 1px solid rgba(4, 212, 203, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

/* v038.3: area-search placement and attribution cleanup.
   The map provider already renders the required Leaflet/OSM attribution in its
   native control. The custom credit pill was redundant and visually competed
   with map content, so v038.3 removes the custom node from HTML. */
body.page-mapa .area-search-button {
  left: auto;
  right: 5.25rem;
  top: 1rem;
  transform: none;
  max-width: min(280px, calc(100% - 9rem));
  padding: 0.62rem 0.9rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

@media (max-width: 640px) {
  body.page-mapa .area-search-button {
    right: 4.5rem;
    top: 0.75rem;
    max-width: calc(100% - 8rem);
    padding-inline: 0.75rem;
  }
}

/* v038.4: map overlay and result-card action polish.
   The selected result should feel like a branded active state, not a black error
   state. The primary action in a directory card is opening the full profile;
   centering the map is useful but secondary. */
:root {
  --map-selected-bg: #063b40;
}

body.page-mapa .area-search-button {
  left: auto !important;
  right: 4.75rem !important;
  top: 1rem !important;
  transform: none !important;
  padding: 0.62rem 0.85rem !important;
  font-size: 0.74rem !important;
}

body.page-mapa .map-result-card.is-selected {
  background:
    radial-gradient(circle at 14% 0%, rgba(4, 212, 203, 0.22), transparent 34%),
    linear-gradient(135deg, #063b40 0%, #082d33 58%, #07191d 100%) !important;
}

body.page-mapa .map-card-primary-action {
  border-color: rgba(4, 212, 203, 0.42) !important;
  background: var(--map-accent-dark, #007681) !important;
  color: #ffffff !important;
}

body.page-mapa .map-result-card.is-selected .map-card-primary-action {
  background: var(--map-accent, #04d4cb) !important;
  color: #041111 !important;
}


/* v038.8 contrast and hover sync.
   Map overlays need stronger opacity than decorative glass because they sit on
   busy cartographic tiles. Marker/card hover sync improves list-map scanning. */
body.page-mapa {
  --map-overlay-bg: rgba(255, 255, 255, 0.9);
  --map-overlay-bg-strong: rgba(255, 255, 255, 0.96);
  --map-overlay-bg-soft: rgba(244, 250, 250, 0.9);
  --map-overlay-border: rgba(216, 229, 232, 0.9);
  --map-overlay-shadow: 0 20px 54px rgba(5, 8, 22, 0.13);
}

body.page-mapa .map-info-card {
  background: rgba(255, 255, 255, 0.92) !important;
}

body.page-mapa .map-result-card.is-selected {
  border-color: rgba(4, 212, 203, 0.45) !important;
  background: linear-gradient(135deg, #062e33 0%, #0b3f45 58%, #08282d 100%) !important;
  ring-color: rgba(4, 212, 203, 0.36);
}

body.page-mapa .map-result-card.is-map-hovered:not(.is-selected) {
  border-color: rgba(0, 118, 129, 0.38) !important;
  box-shadow: 0 16px 42px rgba(0, 118, 129, 0.13) !important;
  transform: translateY(-1px);
}

.map-marker-hovered {
  background: #005d63;
  color: #ffffff;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 5px rgba(4, 212, 203, 0.38), 0 16px 30px rgba(5, 8, 22, 0.2);
}

.map-no-results-card {
  border: 1px solid rgba(216, 229, 232, 0.95);
  border-radius: 1.35rem;
  background: linear-gradient(180deg, #ffffff, #f8ffff);
  padding: 1.35rem;
  text-align: center;
  box-shadow: 0 14px 34px rgba(5, 8, 22, 0.07);
}

.map-no-results-icon {
  font-size: 2rem;
}

.map-no-results-card h3 {
  margin: 0.65rem 0 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 950;
}

.map-no-results-card p {
  margin: 0.5rem auto 0;
  max-width: 26rem;
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.55;
  font-weight: 720;
}

.map-no-results-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1rem;
}

.map-no-results-actions button {
  min-height: 2.3rem;
  border: 1px solid rgba(216, 229, 232, 0.95);
  border-radius: 0.9rem;
  background: #ffffff;
  color: #0f172a;
  padding: 0 0.85rem;
  font-size: 0.76rem;
  font-weight: 950;
}

.map-no-results-actions button:first-child {
  border-color: rgba(0, 118, 129, 0.4);
  background: var(--map-accent-dark, #007681);
  color: #ffffff;
}
