.tn-locator {
  --tn-ink: #333333;
  --tn-ink-soft: #5c5c5c;
  --tn-ink-faint: #8a8a8a;
  --tn-line: #dcdcdc;
  --tn-line-soft: #ebebeb;
  --tn-surface: #ffffff;
  --tn-surface-tint: #f7f7f7;
  --tn-radius: 10px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--tn-ink);
  display: grid;
  grid-template-columns: 400px 1fr;
  height: 720px;
  max-height: 82vh;
  border: 1px solid var(--tn-line);
  border-radius: var(--tn-radius);
  overflow: hidden;
  background: var(--tn-surface);
  position: relative;
}
.tn-locator * { box-sizing: border-box; }
.tn-locator .material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  font-size: 20px; line-height: 1; color: inherit;
}

/* ---------- Panel ---------- */
.tn-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--tn-line);
}
.tn-back {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--tn-line);
  background: var(--tn-surface);
  color: var(--tn-ink);
  cursor: pointer;
  flex-shrink: 0;
}
.tn-panel__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
}
.tn-back:hover { background: var(--tn-surface-tint); }
.tn-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--tn-ink-faint);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.tn-title { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }

.tn-search {
  position: relative;
  margin: 0 20px 14px;
}
.tn-search__icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--tn-ink-faint);
}
.tn-search__input {
  width: 100%;
  padding: 11px 38px 11px 38px;
  border: 1px solid var(--tn-line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: var(--tn-ink);
  background: var(--tn-surface);
}
.tn-search__input:focus {
  outline: none;
  border-color: var(--tn-ink);
}
.tn-search__input::placeholder { color: var(--tn-ink-faint); }
.tn-search__clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border: none; background: transparent; color: var(--tn-ink-faint); cursor: pointer;
}

.tn-loc-filters {
  display: flex;
  gap: 10px;
  margin: 0 20px 14px;
}
.tn-loc-filters__select {
  flex: 1;
  min-width: 0;
  padding: 9px 30px 9px 12px;
  border: 1px solid var(--tn-line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--tn-ink);
  background: var(--tn-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%238a8a8a' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 8px center / 18px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.tn-loc-filters__select:focus { outline: none; border-color: var(--tn-ink); }
.tn-loc-filters__select[hidden] { display: none; }
.tn-loc-filters__select:disabled { opacity: .5; cursor: not-allowed; background-color: var(--tn-surface-tint); }

.tn-geo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 20px 16px;
  padding: 10px 12px;
  border: 1px solid var(--tn-line);
  border-radius: 8px;
  background: var(--tn-surface);
  cursor: pointer;
  text-align: left;
}
.tn-geo:hover { background: var(--tn-surface-tint); }
.tn-geo__icon {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--tn-ink);
  color: #fff;
  flex-shrink: 0;
}
.tn-geo__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tn-geo__title { font-size: 13.5px; font-weight: 600; }
.tn-geo__subtitle { font-size: 12px; color: var(--tn-ink-faint); }
.tn-geo__action {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 16px;
  background: var(--tn-ink);
  color: #fff;
}
.tn-geo.is-loading .tn-geo__action { opacity: .5; }
.tn-geo[hidden] { display: none; }
.tn-geo.is-denied { cursor: default; }
.tn-geo.is-denied .tn-geo__icon { background: var(--tn-ink-faint); }
.tn-geo.is-denied .tn-geo__action { background: var(--tn-ink-faint); }

.tn-filters {
  display: flex;
  gap: 10px;
  margin: 0 20px 16px;
}
.tn-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--tn-line);
  border-radius: 8px;
  cursor: pointer;
  flex: 1;
  user-select: none;
}
.tn-filter input { position: absolute; opacity: 0; width: 0; height: 0; }
.tn-filter__box {
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border: 1.5px solid var(--tn-line);
  border-radius: 4px;
  flex-shrink: 0;
}
.tn-filter__box .material-symbols-outlined { font-size: 13px; color: #fff; opacity: 0; }
.tn-filter input:checked ~ .tn-filter__box {
  background: var(--tn-ink); border-color: var(--tn-ink);
}
.tn-filter input:checked ~ .tn-filter__box .material-symbols-outlined { opacity: 1; }
.tn-filter__pin { width: 18px; height: 24px; object-fit: contain; flex-shrink: 0; }
.tn-filter__label { font-size: 13px; font-weight: 500; }
.tn-filter.is-off { opacity: .45; }

.tn-list__meta {
  padding: 0 20px 8px;
  font-size: 12.5px;
  color: var(--tn-ink-faint);
}

.tn-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 16px;
}
.tn-list::-webkit-scrollbar { width: 8px; }
.tn-list::-webkit-scrollbar-thumb { background: var(--tn-line); border-radius: 4px; }

.tn-card {
  display: flex;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 8px;
  border: none;
  border-bottom: 1px solid var(--tn-line-soft);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}
.tn-card:hover, .tn-card.is-active { background: var(--tn-surface-tint); }
.tn-card__pin { width: 20px; height: 27px; object-fit: contain; flex-shrink: 0; margin-top: 2px; }
.tn-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tn-card__title { font-size: 14px; font-weight: 600; }
.tn-card__address, .tn-card__city { font-size: 12.5px; color: var(--tn-ink-soft); }
.tn-card__distance {
  font-size: 11.5px; font-weight: 600; color: var(--tn-ink-faint);
  margin-top: 2px;
}
.tn-empty {
  padding: 32px 12px; text-align: center; color: var(--tn-ink-faint); font-size: 13.5px;
}

/* ---------- Loader ---------- */
.tn-loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tn-surface);
  transition: opacity .2s ease;
}
.tn-loader[hidden] { display: none; }
.carrera-loader-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
}
.tn-loader-svg { width: 100%; height: auto; }
.carrera-outline-path {
  fill: none;
  stroke: #AE0E16;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  animation: carrera-draw 2s ease-in-out infinite;
}
@keyframes carrera-draw {
  0%   { stroke-dashoffset: 1500; }
  50%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -1500; }
}

/* ---------- Map ---------- */
/* z-index: 0 (combined with position: relative) creates a new stacking
   context, so Leaflet's/Google Maps' internal panes and controls (which
   use z-index values up to ~1000 by default) stay capped inside the map
   box and can never render on top of the site header/menu. */
.tn-map-desktop { position: relative; z-index: 0; min-height: 0; }
.tn-map-desktop .tn-map { width: 100%; height: 100%; }
.tn-map-mobile { display: none; }
/* Touch drags/pinches inside the map should pan/zoom the map, never the
   page — the wheel-event guard in the JS covers mouse/trackpad wheels,
   this covers touch. */
.tn-map { touch-action: none; }
.tn-marker-pin { background: transparent; border: none; }

/* ---------- Popup ---------- */
.tn-popup .leaflet-popup-content-wrapper {
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.tn-popup .leaflet-popup-content { margin: 0; width: 260px !important; }
.tn-popup .leaflet-popup-tip { box-shadow: none; }
.tn-popup-inner { width: 260px; padding: 16px; font-family: 'Inter', sans-serif; color: #333; }
.tn-popup-inner__title { font-size: 15px; font-weight: 700; margin: 0 0 6px; padding-right: 16px; }
.tn-popup-inner__line { font-size: 13px; color: #5c5c5c; margin: 0 0 2px; line-height: 1.4; }
.tn-popup-inner__hours { font-size: 12px; color: #8a8a8a; margin-top: 8px; line-height: 1.5; }
.tn-popup-inner__actions {
  display: flex; gap: 14px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #ebebeb;
}
.tn-popup-inner__actions a {
  display: flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 600; color: #333; text-decoration: none;
}
.tn-popup-inner__actions .material-symbols-outlined { font-size: 16px; }
.leaflet-popup-close-button {
  top: 2px !important; right: 2px !important;
  width: 22px !important; height: 22px !important;
  color: #333 !important; font-size: 18px !important; line-height: 22px !important;
}

/* ---------- Google Maps InfoWindow (same content, native chrome) ---------- */
/* Collapse the reserved close-button header row so content starts flush
   with the top, matching the Leaflet popup's tight padding. */
.gm-style-iw-chrome { height: 0 !important; padding: 0 !important; }
.gm-style .gm-style-iw-c {
  padding: 0 !important;
  border-radius: 10px !important;
  box-shadow: 0 6px 24px rgba(0,0,0,.18) !important;
}
.gm-style .gm-style-iw-d { padding: 0 !important; overflow: auto !important; }
.gm-style .gm-style-iw-tc::after { background: #fff !important; }
/* Shrink the close button to match the Leaflet one (22px box, small icon) */
.gm-ui-hover-effect {
  top: 2px !important; right: 2px !important;
  width: 22px !important; height: 22px !important;
  opacity: 1 !important;
}
.gm-ui-hover-effect > span {
  width: 15px !important; height: 15px !important;
  margin: 3.5px !important;
  background-color: #333 !important;
}

/* ---------- Mobile expand overlay ---------- */
.tn-map-mobile.is-expanded {
  position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column;
  background: #fff;
}
.tn-map-mobile.is-expanded .tn-map { flex: 1; height: auto; }
.tn-expand { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .tn-locator {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
    max-height: none;
    border-left: none;
    border-right: none;
    border-radius: 0;
  }
  .tn-map-desktop { display: none; }
  .tn-panel { border-right: none; }
  .tn-map-mobile {
    display: block;
    position: relative;
    margin: 4px 20px 16px;
    border: 1px solid var(--tn-line);
    border-radius: 10px;
    overflow: hidden;
  }
  .tn-map-mobile .tn-map { height: 260px; width: 100%; }
  .tn-expand {
    display: flex; align-items: center; gap: 6px;
    position: absolute; right: 10px; bottom: 10px;
    padding: 7px 12px;
    background: #fff;
    border: 1px solid var(--tn-line);
    border-radius: 16px;
    font-size: 12px; font-weight: 600; color: var(--tn-ink);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
    font-family: inherit;
  }
  .tn-map-mobile.is-expanded { margin: 0; border-radius: 0; border: none; }
  .tn-map-mobile.is-expanded .tn-expand .material-symbols-outlined { transform: rotate(180deg); }
  .tn-list {
    max-height: 55vh;
    overflow-y: auto;
  }

  /* Slightly smaller type on small screens; layout/spacing untouched. */
  .tn-locator .material-symbols-outlined { font-size: 18px; }
  .tn-eyebrow { font-size: 10px; }
  .tn-title { font-size: 18px; }
  .tn-search__input { font-size: 13px; }
  .tn-geo__title { font-size: 12.5px; }
  .tn-geo__subtitle { font-size: 11px; }
  .tn-geo__action { font-size: 11.5px; }
  .tn-filter__label { font-size: 12px; }
  .tn-list__meta { font-size: 11.5px; }
  .tn-card__title { font-size: 13px; }
  .tn-card__address, .tn-card__city { font-size: 11.5px; }
  .tn-card__distance { font-size: 10.5px; }
  .tn-empty { font-size: 12.5px; }
  .tn-expand { font-size: 11px; }
  .tn-popup-inner__title { font-size: 14px; }
  .tn-popup-inner__line { font-size: 12px; }
  .tn-popup-inner__hours { font-size: 11px; }
  .tn-popup-inner__actions a { font-size: 11.5px; }
}