/* =========================================================
   TURISDAT Mapa · Estilos
   ========================================================= */

:root {
  --tm-primary: #0f766e;
  --tm-primary-dark: #0d5c56;
  --tm-bg: #f8fafc;
  --tm-card: #ffffff;
  --tm-text: #0f172a;
  --tm-muted: #64748b;
  --tm-border: #e2e8f0;
  --tm-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  --tm-radius: 14px;
  --tm-warning-bg: #fff7ed;
  --tm-warning-border: #fdba74;
  --tm-warning-text: #9a3412;
}

/* ----- Trigger button ----- */
.turisdat-mapa-trigger-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 6px 0;
}
.turisdat-mapa-align-left { justify-content: flex-start; }
.turisdat-mapa-align-center { justify-content: center; }
.turisdat-mapa-align-right { justify-content: flex-end; }

.turisdat-mapa-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0f766e;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(15, 118, 110, 0.25);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  font-family: inherit;
  line-height: 1.2;
}
.turisdat-mapa-open-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(15, 118, 110, 0.35);
  filter: brightness(1.06);
}
.turisdat-mapa-open-btn .turisdat-mapa-btn-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.turisdat-mapa-open-btn svg { flex-shrink: 0; width: 16px; height: 16px; }

@media (max-width: 480px) {
  .turisdat-mapa-open-btn {
    padding: 7px 12px;
    font-size: 0.8rem;
    border-radius: 9px;
    gap: 5px;
  }
  .turisdat-mapa-open-btn svg { width: 14px; height: 14px; }
}

/* ----- Modal ----- */
/* display:none por defecto: el mapa NO debe verse ni ocupar espacio hasta abrir */
.turisdat-mapa-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display: none !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  max-width: none !important;
  max-height: none !important;
  width: 100% !important;
  height: 100% !important;
}
.turisdat-mapa-modal.is-open {
  display: flex !important;
}

.turisdat-mapa-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.turisdat-mapa-modal-dialog {
  position: relative;
  width: min(1100px, 96vw);
  height: min(720px, 92vh);
  height: min(720px, 92dvh);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s ease;
  z-index: 1;
}
/* En teléfono: casi pantalla completa para evitar colapso del header al cerrar popups */
@media (max-width: 720px) {
  .turisdat-mapa-modal-dialog {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100% !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  .turisdat-mapa-modal {
    align-items: stretch !important;
    justify-content: stretch !important;
    padding: 0 !important;
  }
  .turisdat-mapa-modal-header {
    flex-shrink: 0 !important;
    padding: 10px 12px !important;
  }
}
/* El app debe ocupar el resto del dialog sin empujar ni ocultar el header del modal ni el bloque de filtros */
.turisdat-mapa-modal-dialog > .turisdat-mapa-app {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
}
.turisdat-mapa-modal.is-open .turisdat-mapa-modal-dialog {
  transform: scale(1);
}

.turisdat-mapa-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: #fff;
  flex-shrink: 0;
}

.turisdat-mapa-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
}

.turisdat-mapa-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.turisdat-mapa-btn-newtab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.turisdat-mapa-btn-newtab:hover { background: rgba(255,255,255,0.28); color: #fff; }
.turisdat-mapa-btn-newtab span { display: inline; }
@media (max-width: 600px) {
  .turisdat-mapa-btn-newtab span { display: none; }
}

.turisdat-mapa-modal-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.turisdat-mapa-modal-close:hover { background: rgba(255,255,255,0.3); }

/* ----- App shell (shared) ----- */
.turisdat-mapa-app {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  font-style: normal !important;
  line-height: 1.4 !important;
  letter-spacing: normal !important;
  color: var(--tm-text) !important;
  background: var(--tm-bg);
  overflow: hidden !important;
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  -webkit-font-smoothing: antialiased;
}

/* Aislar tipografía del tema de WordPress en todo el mapa */
.turisdat-mapa-app,
.turisdat-mapa-app *,
.turisdat-mapa-app *::before,
.turisdat-mapa-app *::after {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  box-sizing: border-box;
}

.turisdat-mapa-app a {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  text-decoration: none !important;
}

.tm-header {
  position: relative;
  z-index: 40;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  flex-basis: auto !important;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: #fff;
  padding: 10px 14px;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

.tm-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
}

.tm-header-actions { display: flex; gap: 8px; }

.tm-btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  padding: 8px 12px;
}

.tm-btn-locate {
  background: rgba(255,255,255,0.18);
  color: #fff;
  padding: 8px 10px;
}
.tm-btn-locate:hover { background: rgba(255,255,255,0.28); }
.tm-btn-locate.active { background: #fff; color: var(--tm-primary); }

/* Iconos de modal (nueva pestaña + X) dentro del header del app */
.tm-header-actions .turisdat-mapa-btn-newtab {
  padding: 7px 10px;
}
.tm-header-actions .turisdat-mapa-modal-close {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.tm-btn-filters {
  background: rgba(255,255,255,0.18);
  color: #fff;
  display: none;
}
/* Vista mapa (barra cerrada, icono info): mismo aspecto + pulso suave */
.tm-btn-filters.tm-btn-filters--info {
  animation: tm-info-pulse 2.2s ease-in-out infinite;
}
.tm-btn-filters.tm-btn-filters--info svg {
  animation: tm-map-icon-nudge 2.2s ease-in-out infinite;
}
/* Icono de mapa (barra abierta): destaca con fondo blanco, brillo y pulso suave */
.tm-btn-filters.tm-btn-filters--map {
  background: #fff;
  color: #0f766e;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.55), 0 2px 10px rgba(0,0,0,0.18);
  animation: tm-map-pulse 2.2s ease-in-out infinite;
}
.tm-btn-filters.tm-btn-filters--map svg {
  animation: tm-map-icon-nudge 2.2s ease-in-out infinite;
}
/* Solo en dispositivos con hover real (ratón); en táctil el :hover se queda pegado y mataba el pulso */
@media (hover: hover) {
  .tm-btn-filters.tm-btn-filters--map:hover {
    background: #f0fdfa;
    color: #0d9488;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.75), 0 3px 12px rgba(0,0,0,0.22);
    animation: none;
  }
  .tm-btn-filters.tm-btn-filters--map:hover svg {
    animation: none;
  }
  .tm-btn-filters.tm-btn-filters--info:hover {
    background: rgba(255,255,255,0.28);
    animation: none;
  }
  .tm-btn-filters.tm-btn-filters--info:hover svg {
    animation: none;
  }
}
@keyframes tm-info-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255,255,255,0.15);
    transform: scale(1);
    background: rgba(255,255,255,0.18);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.35);
    transform: scale(1.06);
    background: rgba(255,255,255,0.3);
  }
}
@keyframes tm-map-pulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.5), 0 2px 8px rgba(0,0,0,0.15);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(255,255,255,0.85), 0 3px 14px rgba(15,118,110,0.28);
    transform: scale(1.06);
  }
}
@keyframes tm-map-icon-nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}
@media (prefers-reduced-motion: reduce) {
  .tm-btn-filters.tm-btn-filters--map,
  .tm-btn-filters.tm-btn-filters--map svg,
  .tm-btn-filters.tm-btn-filters--info,
  .tm-btn-filters.tm-btn-filters--info svg {
    animation: none;
  }
}
@media (max-width: 720px) {
  .tm-btn-filters { display: inline-flex; }
}

.tm-curated {
  background: #f0fdfa;
  border-bottom: 1px solid #99f6e4;
  padding: 7px 14px;
  font-size: 0.76rem;
  color: #0f766e;
  text-align: center;
  font-weight: 500;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
}

.tm-main {
  flex: 1 1 auto !important;
  display: flex !important;
  min-height: 0 !important;
  min-width: 0;
  position: relative;
  overflow: hidden !important;
}

.tm-sidebar {
  flex: 0 0 340px;
  width: 340px;
  max-width: 100%;
  background: var(--tm-card);
  border-right: 1px solid var(--tm-border);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: transform 0.25s ease;
  overflow: hidden !important; /* el scroll solo en .tm-list */
  min-height: 0;
  flex-shrink: 0 !important;
}
/* Pestaña lateral (solo móvil): hermana del panel, no dentro del translateX */
.tm-sidebar-tab {
  display: none;
}

@media (max-width: 720px) {
  .tm-sidebar {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--tm-shadow);
    width: min(340px, 92vw);
    flex: none;
    overflow: hidden !important;
    touch-action: pan-y;
    will-change: transform;
    z-index: 1000;
  }
  .tm-sidebar.open { transform: translateX(0); }

  .tm-sidebar-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 0;
    width: 22px;
    height: 56px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0 10px 10px 0;
    background: linear-gradient(180deg, #0f766e 0%, #0d9488 100%);
    box-shadow: 2px 2px 8px rgba(15, 118, 110, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
    color: #fff;
    cursor: pointer;
    z-index: 1100;
    transform: translateY(-50%);
    transition: left 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    pointer-events: auto;
  }
  .tm-sidebar-tab--open {
    left: min(340px, 92vw);
  }
  .tm-sidebar-tab:active {
    filter: brightness(1.08);
  }
  .tm-sidebar-tab-icon {
    display: block;
    width: 10px;
    height: 16px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: 0.95;
  }
  .tm-sidebar-tab--open .tm-sidebar-tab-icon {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}

.tm-sidebar-header {
  padding: 14px;
  border-bottom: 1px solid #99f6e4;
  flex-shrink: 0 !important;
  position: relative;
  z-index: 5;
  background: linear-gradient(180deg, #f0fdfa 0%, #ecfeff 100%);
  box-shadow: inset 0 -1px 0 rgba(15, 118, 110, 0.08);
}

.tm-search { position: relative; margin-bottom: 12px; }
.tm-search input {
  width: 100%;
  padding: 11px 12px 11px 38px;
  border: 2px solid #5eead4;
  border-radius: 12px;
  font-size: 14px;
  background: #fff;
  outline: none;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.08);
  font-family: inherit;
  color: var(--tm-text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.tm-search input:focus {
  border-color: var(--tm-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}
.tm-search input::placeholder { color: #94a3b8; }
.tm-search svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--tm-primary);
}

/* Filtros en una sola línea tipo carrusel (scroll horizontal) */
.tm-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #99f6e4 transparent;
  padding-bottom: 2px;
  margin: 0 -2px;
  padding-left: 2px;
  padding-right: 2px;
}
.tm-filters::-webkit-scrollbar {
  height: 4px;
}
.tm-filters::-webkit-scrollbar-track {
  background: transparent;
}
.tm-filters::-webkit-scrollbar-thumb {
  background: #99f6e4;
  border-radius: 4px;
}

.tm-chip {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  color: #475569;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  flex: 0 0 auto;
  white-space: nowrap;
}
.tm-chip:hover { background: #f1f5f9; border-color: #94a3b8; }
.tm-chip.active { background: var(--tm-primary); color: #fff; border-color: var(--tm-primary); }
.tm-chip[data-tipo="Hospedajes"].active { background: #0f766e; border-color: #0f766e; }
.tm-chip[data-tipo="Gastronomía"].active { background: #c2410c; border-color: #c2410c; }
.tm-chip[data-tipo="Comercios"].active { background: #7c3aed; border-color: #7c3aed; }
.tm-chip[data-tipo="Lugares"].active { background: #0369a1; border-color: #0369a1; }

/* Carrusel de filtros en modo icono (igual que Mapa Destino) */
.tm-filters--icons {
  gap: 10px;
  align-items: center;
  margin-top: 6px;
  padding-top: 5px;
  padding-bottom: 5px;
  overflow-x: auto;
  overflow-y: visible;
}
.tm-filters--icons + .tm-count {
  display: none !important;
}
.tm-chip.tm-chip--icon {
  width: 46px;
  height: 46px;
  min-width: 46px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex: 0 0 auto;
}
.tm-chip.tm-chip--icon:hover {
  background: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}
.tm-chip.tm-chip--icon .tm-chip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  line-height: 0;
}
.tm-chip.tm-chip--icon .tm-chip-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}
.tm-chip.tm-chip--icon.active {
  background: #fff;
  color: #1a1a1a;
  border: none;
  box-shadow: 0 0 0 3px var(--tm-primary), 0 2px 8px rgba(0, 0, 0, 0.18);
}
.tm-chip.tm-chip--icon[data-tipo="Hospedajes"].active {
  box-shadow: 0 0 0 3px #0f766e, 0 2px 8px rgba(0, 0, 0, 0.18);
}
.tm-chip.tm-chip--icon[data-tipo="Gastronomía"].active {
  box-shadow: 0 0 0 3px #c2410c, 0 2px 8px rgba(0, 0, 0, 0.18);
}
.tm-chip.tm-chip--icon[data-tipo="Comercios"].active {
  box-shadow: 0 0 0 3px #7c3aed, 0 2px 8px rgba(0, 0, 0, 0.18);
}
.tm-chip.tm-chip--icon[data-tipo="Lugares"].active {
  box-shadow: 0 0 0 3px #0369a1, 0 2px 8px rgba(0, 0, 0, 0.18);
}

.tm-count {
  font-size: 12px;
  color: #0f766e;
  margin-top: 10px;
  font-weight: 600;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.tm-notice {
  margin: 0 8px 8px;
  padding: 11px 12px;
  background: var(--tm-warning-bg);
  border: 1px solid var(--tm-warning-border);
  border-radius: 11px;
  font-size: 0.8rem;
  color: var(--tm-warning-text);
  line-height: 1.4;
  display: none;
}
.tm-notice strong { font-weight: 700; }

.tm-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
}

.tm-card {
  background: #fff !important;
  border: 1px solid var(--tm-border) !important;
  border-radius: var(--tm-radius) !important;
  padding: 10px !important;
  margin: 0 0 7px 0 !important;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  color: var(--tm-text) !important;
}
.tm-card:hover {
  border-color: var(--tm-primary) !important;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.12);
}
.tm-card.active {
  border-color: var(--tm-primary) !important;
  background: #f0fdfa !important;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.18);
}
.tm-card.far { opacity: 0.9; }

.tm-card-body {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.tm-card-thumb {
  width: 64px;
  height: 64px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #e2e8f0;
  content-visibility: auto;
}
.tm-card-info {
  flex: 1 1 auto;
  min-width: 0;
}

.tm-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 5px;
}
.tm-card-title {
  font-weight: 700 !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  color: #0f172a !important;
  margin: 0 !important;
  padding: 0 !important;
}
.tm-dist {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: var(--tm-primary) !important;
  background: #ccfbf1 !important;
  padding: 2px 7px !important;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.3 !important;
}
.tm-dist.far {
  background: #ffedd5 !important;
  color: #c2410c !important;
}

.tm-meta {
  font-size: 12px !important;
  font-weight: 400 !important;
  color: #64748b !important;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 6px 0 !important;
  line-height: 1.4 !important;
}

.tm-badge {
  display: inline-block;
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 2px 7px !important;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.3 !important;
}
.tm-badge-hospedajes { background: #ccfbf1 !important; color: #0f766e !important; }
.tm-badge-gastronomia { background: #ffedd5 !important; color: #c2410c !important; }
.tm-badge-comercios { background: #ede9fe !important; color: #7c3aed !important; }
.tm-badge-lugares { background: #e0f2fe !important; color: #0369a1 !important; }

.tm-stars { color: #f59e0b !important; letter-spacing: 1px; font-size: 13px !important; font-weight: 400 !important; }
.tm-price { font-weight: 700 !important; color: #0f172a !important; font-size: 13px !important; }

.tm-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tm-actions a {
  flex: 1 1 auto;
  min-width: calc(50% - 5px);
  text-align: center;
  padding: 6px !important;
  border-radius: 7px;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  text-decoration: none !important;
}
.tm-wa { background: #dcfce7; color: #15803d; }
.tm-call { background: #e0f2fe; color: #0369a1; }
.tm-web { background: #f1f5f9; color: #475569; }
.tm-dir { background: #fef3c7; color: #b45309; }
.tm-uber {
  background: #111827 !important;
  color: #ffffff !important;
  border: 1px solid #111827;
}
.tm-uber:hover {
  background: #1f2937 !important;
  color: #ffffff !important;
}

/* Contenedor del mapa compatible con flex: Leaflet rellena en absoluto */
.tm-map {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: auto !important;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.tm-map .leaflet-container {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

.tm-marker {
  width: 30px; height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 7px rgba(0,0,0,0.25);
  border: 2px solid #fff;
}
.tm-marker span { transform: rotate(45deg); font-size: 13px; line-height: 1; }
.tm-m-hospedajes { background: #0f766e; }
.tm-m-gastronomia { background: #c2410c; }
.tm-m-comercios { background: #7c3aed; }
.tm-m-lugares { background: #0369a1; }

.tm-user {
  width: 16px; height: 16px;
  background: #3b82f6;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(59,130,246,0.25);
}

.leaflet-popup-content-wrapper {
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden;
  box-shadow: var(--tm-shadow) !important;
}
.leaflet-popup-content { margin: 0 !important; min-width: 250px; }
.tm-popup { padding: 12px; }
.tm-popup-body {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.tm-popup-thumb {
  width: 72px;
  height: 72px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #e2e8f0;
}
.tm-popup-info {
  flex: 1 1 auto;
  min-width: 0;
}
.tm-popup-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 3px; }
.tm-popup-addr { font-size: 0.78rem; color: var(--tm-muted); margin-bottom: 7px; }
.tm-popup-meta {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.tm-popup-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tm-popup-actions a {
  flex: 1 1 auto;
  min-width: calc(50% - 5px);
  text-align: center;
  padding: 5px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  font-family: inherit;
}

.tm-empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--tm-muted);
  font-size: 0.9rem;
}

.tm-toast {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: #0f172a;
  color: #fff;
  padding: 11px 18px;
  border-radius: 11px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s;
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  max-width: 90%;
  text-align: center;
  pointer-events: none;
}
.tm-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.tm-legend {
  position: absolute;
  bottom: 16px;
  right: 12px;
  background: #fff;
  border-radius: 9px;
  padding: 9px 11px;
  box-shadow: var(--tm-shadow);
  font-size: 0.72rem;
  z-index: 10;
  display: none;
}
@media (min-width: 721px) { .tm-legend { display: block; } }
.tm-legend-item { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.tm-legend-item:last-child { margin-bottom: 0; }
.tm-legend-dot { width: 9px; height: 9px; border-radius: 50%; }

/* Embed / Full wrappers */
.turisdat-mapa-embed {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--tm-border);
  box-shadow: var(--tm-shadow);
}
.turisdat-mapa-full { height: 100vh; }
