/* ============================================================
   Ubicaciones Maps – Frontend styles  v2.1
   Diseño: Autocom / Figma
   ============================================================ */

/* ---------- Futura – tipografía corporativa ------------- */
@font-face {
  font-family: "Futura";
  src: url("../fonts/FuturaPTMedium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- variables globales (sobreescribibles por el tema) --- */
:root {
  --ubic-primary: #cc000c;
  --ubic-primary-dark: #a3000a;
  --ubic-btn-bg: #1a1a1a;
  --ubic-btn-active-bg: var(--ubic-primary);
  --ubic-btn-radius: 999px;
  --ubic-input-radius: 999px;
  --ubic-font: "Futura", "Century Gothic", sans-serif;
  --ubic-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  --ubic-filter-gap: 0.5rem;
}

/* El wrapper del buscador usa flex para separar input y botón */
.ubicaciones-city-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: var(--ubic-search-width, 100%);
  max-width: var(--ubic-search-max-width, 540px);
}
input[type="search"] {
  border: 1px solid #ffffff00;
  border-radius: 3px;
  padding: 0.5rem 1rem;
  transition: all 0.3s;
  width: 100%;
}
.ubicaciones-city-input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  height: var(--ubic-search-height, 44px);
  padding: 0 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: var(--ubic-input-radius);
  font-size: 14px;
  font-family: var(--ubic-font);
  background: #fff;
  color: #222;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.ubicaciones-city-input:focus {
  border-color: var(--ubic-primary);
  box-shadow: 0 0 0 3px rgba(204, 0, 12, 0.1);
}

.ubicaciones-city-input::placeholder {
  color: #aaa;
  font-family: var(--ubic-font);
}

/* ---- Botón lupa – separado del input ---- */
.ubicaciones-search-btn {
  flex-shrink: 0;
  position: static; /* ya no es absolute */
  height: var(--ubic-search-height, 44px);
  width: var(--ubic-search-height, 44px);
  border: none;
  border-radius: 10px;
  background: var(--ubic-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
  padding: 0;
}

.ubicaciones-search-btn:hover {
  background: var(--ubic-primary-dark);
}

.ubicaciones-search-btn img {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
}

/* sugerencias */
.ubicaciones-city-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  /* Se alinea al ancho del input; el botón está fuera del flujo del dropdown */
  right: 52px;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  z-index: 200;
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  padding: 6px 0;
  margin: 0;
  box-shadow: var(--ubic-shadow);
}

.ubicaciones-city-suggestions li {
  padding: 9px 16px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.3;
  color: #333;
  transition: background 0.15s;
}

.ubicaciones-city-suggestions li:hover,
.ubicaciones-city-suggestions li.is-active {
  background: #f5f5f5;
}
.ubicaciones-city-suggestions li .name {
  font-weight: 600;
  display: block;
}
.ubicaciones-city-suggestions li .direction,
.ubicaciones-city-suggestions li .types {
  font-size: 11px;
  color: #888;
  display: block;
}

/* ---- FILTRO TAXONOMÍA (botones) ---- */
.ubicaciones-tax-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ubic-filter-gap);
  align-items: center;
}

.ubicaciones-tax-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 20px;
  background: var(--ubic-btn-bg);
  color: #fff;
  border: none;
  border-radius: var(--ubic-btn-radius);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--ubic-font);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background 0.18s,
    transform 0.1s;
  white-space: nowrap;
  line-height: 1;
}

.ubicaciones-tax-btn:hover {
  background: #333;
}
.ubicaciones-tax-btn.is-active {
  background: var(--ubic-btn-active-bg);
}
.ubicaciones-tax-btn:active {
  transform: scale(0.97);
}

/* ---- Íconos dentro del botón (normal + hover) ---- */
.ubicaciones-tax-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.ubicaciones-tax-filter button {
    width: 175;
    height: 41;
    border-radius: 8px;
    border: 1px solid #CC000C;
    angle: 0 deg;
    opacity: 1;
    padding-top: 10px !important;
    padding-right: 10px !important;
    padding-bottom: 10px !important;
    padding-left: 10px !important;
    outline: none;
    background-color: #fff;
    font-family: 'Futura' !important;
    font-weight: 600;
    font-size: 16px !important;
    leading-trim: CAP_HEIGHT;
    line-height: 100%;
    letter-spacing: 0%;
    text-align: center;
    color: #000;
    width: 190px;
    display: flex;
    justify-content: center;
}


.ubicaciones-tax-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Ícono NORMAL: visible por defecto, se oculta en hover/activo */
.ubicaciones-tax-icon--normal {
  display: inline-flex;
}
.ubicaciones-tax-icon--normal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Ícono HOVER: oculto por defecto, visible en hover/activo */
.ubicaciones-tax-icon--hover {
  display: none;
}
.ubicaciones-tax-icon--hover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Swap en hover o activo */
.ubicaciones-tax-btn:hover .ubicaciones-tax-icon--normal,
.ubicaciones-tax-btn.is-active .ubicaciones-tax-icon--normal {
  display: none !important;
}

.ubicaciones-tax-btn:hover .ubicaciones-tax-icon--hover,
.ubicaciones-tax-btn.is-active .ubicaciones-tax-icon--hover {
  display: inline-flex !important;
}

/* ── SELECT de comercio [ubicaciones_filtro_comercio_movil] ── */
/* El usuario decide cuándo y dónde usarlo; no se oculta automáticamente */
.ubicaciones-tax-select-wrap {
  position: relative;
  width: var(--ubic-search-width, 100%);
  max-width: var(--ubic-search-max-width, 540px);
}

.ubicaciones-tax-select {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 40px 0 16px;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: var(--ubic-input-radius);
  font-size: 14px;
  font-family: var(--ubic-font);
  font-weight: 500;
  color: #222;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s;
}

.ubicaciones-tax-select:focus {
  border-color: var(--ubic-primary);
  box-shadow: 0 0 0 3px rgba(204, 0, 12, 0.1);
}

/* Flecha decorativa del select */
.ubicaciones-tax-select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 6px;
  background-color: #555;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}

/* ── SELECT de ciudad ─────────────────────────────────────── */
.ubicaciones-city-select-wrap {
  position: relative;
  width: var(--ubic-search-width, 100%);
  max-width: var(--ubic-search-max-width, 540px);
}

.ubicaciones-city-select {
  width: 100%;
  box-sizing: border-box;
  height: var(--ubic-search-height, 44px);
  padding: 0 40px 0 16px;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: var(--ubic-input-radius);
  font-size: 14px;
  font-family: var(--ubic-font);
  font-weight: 500;
  color: #222;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s;
}

.ubicaciones-city-select:focus {
  border-color: var(--ubic-primary);
  box-shadow: 0 0 0 3px rgba(204, 0, 12, 0.1);
}

.ubicaciones-city-select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 6px;
  background-color: #555;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}

/* ---- FILTRO CIUDAD (pills) ---- */
/* Alta especificidad para ganarle a Elementor/tema */
html body .ubicaciones-city-pills,
html body ul.ubicaciones-city-pills,
html .elementor-widget-container .ubicaciones-city-pills,
html .elementor-widget-container ul.ubicaciones-city-pills {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 20px !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
      justify-content: space-between;
}

/* Modo vertical opcional */
html body .ubicaciones-city-pills[data-direction="vertical"],
html body ul.ubicaciones-city-pills[data-direction="vertical"],
html
  .elementor-widget-container
  .ubicaciones-city-pills[data-direction="vertical"],
html
  .elementor-widget-container
  ul.ubicaciones-city-pills[data-direction="vertical"] {
  flex-direction: column !important;
  align-items: flex-start !important;
}

html body .ubicaciones-city-pills li,
html body ul.ubicaciones-city-pills li,
html .elementor-widget-container .ubicaciones-city-pills li,
html .elementor-widget-container ul.ubicaciones-city-pills li {
  display: inline-flex !important;
  list-style: none !important;
  list-style-type: none !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

/* Eliminar bullet points y decoraciones de Elementor/tema */
html body .ubicaciones-city-pills li::before,
html body ul.ubicaciones-city-pills li::before,
html body .ubicaciones-city-pills li::marker,
html body ul.ubicaciones-city-pills li::marker {
  display: none !important;
  content: none !important;
  width: 0 !important;
}

.ubicaciones-city-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 4px;
  border-radius: 0;
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 500;
  color: #444;
  cursor: pointer;
  transition: color 0.18s;
  white-space: nowrap;
  font-family: var(--ubic-font);
  
}

/* Ícono de radio button: círculo exterior */
.ubicaciones-city-pill:before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #bbb;
  background: transparent;
  flex-shrink: 0;
  transition:
    border-color 0.18s,
    background 0.18s,
    box-shadow 0.18s;
  box-sizing: border-box;
}

.ubicaciones-city-pill:hover {
  color: var(--ubic-primary);
}
.ubicaciones-city-pill:hover:before {
  border-color: var(--ubic-primary);
}

.ubicaciones-city-pill.is-active {
  color: #222;
}
/* Estado activo: círculo relleno (radio button seleccionado) */
.ubicaciones-city-pill.is-active:before {
  background: var(--ubic-primary);
  border-color: var(--ubic-primary);
  box-shadow: inset 0 0 0 3px #fff;
}

/* ---- MAPA ---- */
.ubicaciones-openfreemap {
  min-height: 300px;
  border-radius: 12px;
  overflow: hidden;
  --cluster-small-color: #cc000c;
  --cluster-med-color: #e05020;
  --cluster-large-color: #f08000;
  --cluster-small-size: 22;
  --cluster-med-size: 30;
  --cluster-large-size: 40;
}

.maplibregl-marker,
.maplibregl-popup {
  pointer-events: auto;
}

/* ──────────────────────────────────────────────────────────
   POPUP / CARD  (diseño Figma: fondo rojo, imagen izquierda)
   Futura + layout responsivo para móvil
────────────────────────────────────────────────────────── */
.maplibregl-popup.ubic-popup .maplibregl-popup-content {
  font-family: var(--ubic-font);
  border-radius: 12px;
  padding: 0;
  background: var(--ubic-primary);
  color: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  width: 340px;
  max-width: 92vw;
  overflow: hidden;
}

.maplibregl-popup.ubic-popup .maplibregl-popup-tip {
  border-top-color: var(--ubic-primary) !important;
  border-bottom-color: var(--ubic-primary) !important;
}

.ubic-popup-inner {
  display: flex;
  flex-direction: row;
  gap: 0;
}

.ubic-popup-img {
  flex-shrink: 0;
  width: 120px;
  min-height: 140px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.ubic-popup-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ubic-popup-img--empty {
  display: none;
}

.ubic-popup-body {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ubic-popup-tipo {
  font-family: var(--ubic-font);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 2px;
}

.ubic-popup-title {
  font-family: var(--ubic-font);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 3px;
  line-height: 1.25;
  word-break: break-word;
}

.ubic-popup-dir {
  font-family: var(--ubic-font);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  display: block;
  margin-bottom: 4px;
  line-height: 1.4;
  word-break: break-word;
}

.ubic-popup-row {
  font-family: var(--ubic-font);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
}

.ubic-popup-label {
  font-family: var(--ubic-font);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
}

.ubic-popup-tel {
  font-family: var(--ubic-font);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.ubic-popup-tel:hover {
  text-decoration: underline;
}

.ubic-popup-maps-btn {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-family: var(--ubic-font);
  color: rgba(255, 255, 255, 0.85);
  text-decoration: underline;
}

.maplibregl-popup.ubic-popup .maplibregl-popup-close-button {
  color: rgba(255, 255, 255, 0.85) !important;
  background: transparent !important;
  font-size: 22px;
  line-height: 1;
  top: 4px;
  right: 8px;
  font-weight: 300;
  padding: 0;
  z-index: 10;
}

.maplibregl-popup.ubic-popup .maplibregl-popup-close-button:hover {
  color: #fff !important;
  background: transparent !important;
}

/* ──────────────────────────────────────────────────────────
   RESPONSIVE
────────────────────────────────────────────────────────── */

/* Tablet (≤ 900px): botones un poco más compactos */
@media (max-width: 900px) {
  .ubicaciones-tax-btn {
    height: 38px;
    padding: 0 16px;
    font-size: 13px;
  }
  .ubicaciones-tax-icon {
    width: 16px;
    height: 16px;
  }
}

/* Móvil (≤ 600px) */
@media (max-width: 600px) {
  /* Buscador */
  .ubicaciones-city-input {
    height: 42px;
    font-size: 13px;
  }
  .ubicaciones-search-btn {
    height: 42px;
    width: 42px;
  }

  /* Filtro taxonomía botones: más compactos */
  .ubicaciones-tax-btn {
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  /* Pills ciudad */
  .ubicaciones-city-pill {
    height: 26px;
    font-size: 12px;
    padding: 0 4px;
  }

  /* Select ciudad */
  .ubicaciones-city-select {
    height: 42px;
    font-size: 13px;
  }

  /* Select comercio móvil */
  .ubicaciones-tax-select {
    height: 42px;
    font-size: 13px;
  }

  /* ── Card / Popup desktop: ajuste fino en pantallas medianas ── */
  .maplibregl-popup.ubic-popup .maplibregl-popup-content {
    width: 300px;
  }
  .ubic-popup-img {
    width: 100px;
  }
}

/* ──────────────────────────────────────────────────────────
   BOTTOM SHEET – card en móvil (posicionada dentro del mapa)
────────────────────────────────────────────────────────── */
.ubicaciones-openfreemap {
  position: relative; /* asegura que el sheet se posicione dentro */
}

.ubic-bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.22);
  animation: ubic-sheet-in 0.22s ease-out;
  max-height: 55%;
  overflow-y: auto;
}

@keyframes ubic-sheet-in {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* El contenido interior (ubic-popup-inner) ocupa el ancho completo */
.ubic-bottom-sheet .ubic-popup {
  width: 100%;
}

.ubic-bottom-sheet .ubic-popup-inner {
  display: flex;
  flex-direction: row;
  width: 100%;
}

.ubic-bottom-sheet .ubic-popup-img {
  width: 110px;
  min-height: 0;
  flex-shrink: 0;
}

.ubic-bottom-sheet .ubic-popup-img img {
  height: 100%;
  min-height: 110px;
}

.ubic-bottom-sheet .ubic-popup-body {
  flex: 1;
  min-width: 0;
  padding: 14px 14px 14px 12px;
}

.ubic-bottom-sheet .ubic-popup-title {
  font-size: 13px;
}

.ubic-bottom-sheet .ubic-popup-dir,
.ubic-bottom-sheet .ubic-popup-row {
  font-size: 11px;
}

/* Botón cerrar del bottom sheet */
.ubic-bottom-sheet-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: none;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 0;
}

.ubic-bottom-sheet-close:hover {
  background: rgba(0, 0, 0, 0.55);
}