/* Search Bar Wrapper - collapsible */
.search-bar-wrapper {
  position: relative;
}

.search-toggle-btn {
  display: none;
  width: 100%;
  padding: 10px 16px;
  background: white;
  border: none;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
}

.search-toggle-btn:hover {
  background: #f1f5f9;
}

.search-toggle-btn .material-icons:first-child {
  color: var(--primary-green);
}

.search-toggle-btn .toggle-icon {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.search-toggle-btn.open .toggle-icon {
  transform: rotate(180deg);
}

/* Search Bar - 100% width */
.search-bar-container {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  align-items: center;
  transition: all 0.3s ease-in-out;
}

.search-bar-container.open {
  display: flex;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.select-city,
.input-address,
.select-sector,
.btn-search {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: white;
}

.select-city {
  flex: 1 1 110px;
  min-width: 100px;
}

.input-address {
  flex: 2 1 160px;
  min-width: 150px;
}

.select-sector {
  flex: 1 1 130px;
  min-width: 120px;
}

.radius-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 8px;
  height: 36px;
  flex: 0 0 75px;
}

.input-radius {
  width: 55px;
  padding: 6px 0;
  border: none;
  font-size: 13px;
  text-align: center;
  outline: none;
}

.radius-unit {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
}

.btn-search {
  background: var(--primary-green);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
  flex: 0 0 auto;
  padding: 8px 16px;
}

.btn-search:hover {
  background: #21867a;
}

.btn-search .material-icons {
  font-size: 18px;
}

/* ============================================
   RESPONSIVE - COLLAPSIBLE EN MÓVIL
   ============================================ */

@media (max-width: 768px) {
  .search-toggle-btn {
    display: flex !important;
  }
  
  .search-bar-container {
    display: none;
    flex-direction: column;
    padding: 12px;
    gap: 8px;
  }
  
  .search-bar-container.open {
    display: flex;
  }
  
  .select-city,
  .input-address,
  .select-sector,
  .radius-wrapper,
  .btn-search {
    width: 100%;
    flex: none;
  }
  
  .radius-wrapper {
    justify-content: space-between;
  }
  
  .select-city {
    flex: none;
    width: 100%;
  }
  
  .input-address {
    flex: none;
    width: 100%;
  }
  
  .select-sector {
    flex: none;
    width: 100%;
  }
  
  .btn-search {
    justify-content: center;
  }
}

@media (min-width: 769px) {
  .search-bar-container {
    display: flex !important;
  }
  
  .search-toggle-btn {
    display: none !important;
  }
}