body {
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
  overflow: hidden;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  background-color: #eef0f5;
}

/* CONTROLES */
.control-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.95);
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 160px;
}

.btn-row {
  display: flex;
  gap: 4px;
}

.row-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #888;
  font-weight: 700;
  margin-bottom: -4px;
  margin-top: 4px;
  padding-left: 2px;
}

.btn-toggle {
  flex: 1;
  border: none;
  background: #f0f2f5;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  text-align: center;
}

.btn-toggle:hover {
  background: #e4e6eb;
  color: #000;
}

.btn-toggle.active {
  background: #3f6eb5;
  color: white;
  box-shadow: 0 2px 6px rgba(63, 110, 181, 0.3);
}

.btn-catastro.active {
  background: #d93025;
  color: white;
}

.btn-sat.active {
  background: #2c3e50;
  color: #fff;
}

/* BUSCADOR */
.search-wrapper {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  width: 380px;
}

.search-box {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-box input {
  width: 100%;
  padding: 14px 18px;
  padding-right: 40px;
  /* Space for spinner */
  border: none;
  font-size: 15px;
  outline: none;
  background-color: transparent;
  /* Changed to allow parent background or image */
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 20px;
}

/* Loading Spinner */
.search-box input.loading {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%239ca3af" stroke-width="2"><path d="M12 2v4m0 12v4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83M2 12h4m12 0h4M4.93 19.07l2.83-2.83m8.48-8.48l2.83-2.83" stroke-linecap="round"><animateTransform attributeName="transform" type="rotate" from="0 12 12" to="360 12 12" dur="0.8s" repeatCount="indefinite"/></path></svg>');
}

.suggestions {
  max-height: 400px;
  overflow-y: auto;
  background: white;
  border-top: 1px solid #f0f0f0;
  display: none;
}

.suggestions.visible {
  display: block;
}

.suggestion {
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f9f9f9;
  display: flex;
  align-items: center;
  gap: 14px;
}

.suggestion:hover,
.suggestion.selected {
  background: #f0f9ff;
  border-left: 3px solid #3f6eb5;
}

.suggestion-icon {
  width: 36px;
  height: 36px;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Icon inside the generic container */
.suggestion-icon svg {
  width: 18px;
  height: 18px;
  stroke: #64748b;
  fill: none;
}

.suggestion-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  flex: 1;
}

.suggestion-main {
  font-weight: 600;
  font-size: 14px;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-sub {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* POPUPS */
.maplibregl-popup-content {
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  width: 260px;
}

.popup-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.popup-info {
  padding: 12px;
}

.popup-info h4 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 700;
  color: #222;
}

.popup-info .price {
  color: #d93025;
  font-weight: 800;
  font-size: 16px;
}