/* =====================================================
 * Mapbox CPT Pins — frontend styles
 * v1.2.0 — pin icons via mask-image, new popup, no count
 * ===================================================== */

.mb-pins-wrap {
  display: grid;
  gap: 18px;
  font-family: inherit;
  color: #1a1a1a;
}

/* ---------- Filter bar ---------- */
.mb-pins-filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0;
}

.mb-pins-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  flex: 1 1 180px;
}

.mb-pins-filter-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6b6b;
}

.mb-pins-select-wrap { position: relative; display: block; }

.mb-pins-select,
.mb-pins-reset {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 44px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  color: #1a1a1a;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-sizing: border-box;
}
.mb-pins-select { width: 100%; padding-right: 38px; }
.mb-pins-select:hover, .mb-pins-reset:hover { border-color: rgba(0, 0, 0, 0.25); }
.mb-pins-select:focus, .mb-pins-reset:focus {
  outline: none;
  border-color: #c2410c;
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.18);
}

.mb-pins-chev {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  pointer-events: none;
  fill: none; stroke: #6b6b6b;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.mb-pins-reset {
  font-weight: 600;
  white-space: nowrap;
}
.mb-pins-reset:hover { background: #f3f3f0; }

/* ---------- Map ---------- */
.mb-pins-mapwrap {
  position: relative;
}
#mb-pins-map {
  width: 100%;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 30px rgba(20, 20, 20, 0.08);
}

/* Click-to-activate overlay — sits over the map until the user clicks once. */
.mb-pins-mapwrap.is-locked::after {
  content: "Clique para interagir";
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(20, 20, 20, 0.18);
  cursor: pointer;
  pointer-events: none; /* let the click reach the map underneath */
  transition: opacity 0.2s ease;
}
.mb-pins-mapwrap:not(.is-locked)::after { opacity: 0; }

/* ---------- Fixed-position popup (top-left overlay) ---------- */
.mb-fixed-popup {
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  width: 320px;
  max-width: calc(100% - 36px);
  max-height: calc(100% - 36px);
  overflow-y: auto;
  z-index: 10;
  background: #ffffff;
  border-radius: 0;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
}
.mb-fixed-popup[hidden] { display: none; }

.mb-fixed-popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0;
  font-size: 20px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: background 0.15s ease, transform 0.15s ease;
}
.mb-fixed-popup-close:hover {
  background: #fff;
  transform: scale(1.08);
}

@media (max-width: 640px) {
  .mb-fixed-popup { left: 10px; right: 10px; width: auto; }
}

/* ---------- Marker (pin icon) ---------- */
.mb-marker {
  width: 26px;
  height: 32px;
  background-color: #000000;
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.25s ease;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}
.mb-marker:hover { transform: scale(1.18); }

.mb-marker--dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #fff;
  -webkit-mask: none;
          mask: none;
  filter: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

/* ---------- Popup ---------- */
/* Mapbox's own popup is no longer used; fixed-position popup below replaces it. */
.mapboxgl-popup { display: none !important; }
/* (Mapbox-native close-button styles intentionally removed — the native popup is hidden) */
.mb-popup { display: block; }
.mb-popup-imgwrap { display: block; }
.mb-popup-img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}
.mb-popup-body { padding: 12px 14px 14px; }
.mb-popup-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
  line-height: 1.3;
  margin-right: 30px;
}
.mb-popup-title a { color: inherit; text-decoration: none; }
.mb-popup-title a:hover { color: #c2410c; }

/* Chips in the popup mirror the chips on the result cards for visual coherence */
.mb-popup-chips {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.mb-popup-chips .mb-chip {
  margin: 0;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  border-left-width: 3px;
  background: rgba(0, 0, 0, 0.04);
}
.mb-popup-chips .mb-chip-icon {
  width: 18px;
  height: 18px;
}

.mb-popup-desc {
  font-size: 13px;
  color: #444;
  line-height: 1.5;
}

/* ---------- Chips (in list cards) ---------- */
.mb-chip {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cat-color, #444);
  background: rgba(0, 0, 0, 0.06);
  border-radius: 0;
  text-decoration: none;
  border-left: 3px solid var(--cat-color, transparent);
}
.mb-chip--area {
  color: #444;
  border-left: none;
  background: rgba(0, 0, 0, 0.08);
}

/* ---------- Result list ---------- */
.mb-pins-list {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.mb-pin-card {
  padding: 16px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mb-pin-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
.mb-pin-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.3;
}
.mb-pin-title a { color: inherit; text-decoration: none; }
.mb-pin-title a:hover { color: #c2410c; }
.mb-pin-chips { margin-bottom: 10px; }
.mb-pin-excerpt {
  margin: 0 0 12px;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}
.mb-pin-zoom {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mb-pin-zoom:hover {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.mb-empty {
  padding: 24px;
  text-align: center;
  color: #777;
  font-style: italic;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 14px;
}
.mb-error {
  padding: 18px;
  border-radius: 14px;
  background: #fff3f3;
  border: 1px solid rgba(255, 0, 0, 0.25);
  color: #8a1f1f;
}

@media (max-width: 640px) {
  .mb-pins-filterbar { padding: 12px; }
}

/* =========================================================
   Custom dropdown (Categoria filter — colors work in Safari too)
   ========================================================= */
.mb-custom-select { position: relative; width: 100%; }

.mb-custom-select-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  padding: 0 38px 0 14px;
  font-size: 15px;
  font-family: inherit;
  text-align: left;
  font-weight: 600;
  color: #1a1a1a;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mb-custom-select-toggle:hover { border-color: rgba(0, 0, 0, 0.25); }
.mb-custom-select-toggle:focus {
  outline: none;
  border-color: #c2410c;
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.18);
}
.mb-custom-select-current {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mb-custom-select-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
}
.mb-custom-select-list li { width: 100%; }

.mb-custom-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 14px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  color: #1a1a1a;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}
.mb-custom-select-option:hover,
.mb-custom-select-option:focus { background: rgba(0, 0, 0, 0.05); outline: none; }

.mb-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
