.page-header {
  background-size: auto !important;
}

/* Custom button styles */
.btn-white {
  background: #ffffff !important;
  color: #2d3748 !important;
  border: 1px solid #e6e6e6 !important;
}
.btn-white:hover {
  background: #f8f9fa !important;
}

.btn-success-dark {
  background: #156515 !important;
  color: #ffffff !important;
  border-color: #0f4f0f !important;
}
.btn-success-dark:hover {
  background: #125012 !important;
}

/* Select2: use custom focus color (#498467) */
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-selection--single:focus,
.select2-container--default.select2-container--open .select2-selection--multiple,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-selection--multiple:focus {
  border-color: #498467 !important;
  box-shadow: 0 0 0 .2rem rgba(73,132,103,0.25) !important;
  outline: none !important;
}

/* Ensure dropdown arrow / text remain readable */
.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  color: inherit;
}

/* Search autocomplete input focus (searchAddress) */
#searchAddress:focus,
#search-section .form-control:focus,
input[type="search"]:focus {
  border-color: #498467 !important;
  box-shadow: 0 0 0 .2rem rgba(73,132,103,0.25) !important;
  outline: none !important;
}

/* Highlight suggestion items when input focused — solid, non-transparent */
#search-section .list-group .list-group-item:hover,
#search-section .list-group .list-group-item.active {
  background-color: rgb(178, 216, 198) !important;
  color: #043d2a !important;
  opacity: 1 !important;
}

/* Slightly increase label font-size for better readability */
label,
.form-label,
.form-check-label {
  font-size: 0.95rem !important;
}

/* Reduce input padding in search section to 7px (px) */
#search-section .form-control,
#search-section input,
#search-section textarea,
#search-section .select2-selection--single {
  padding-left: 7px !important;
}

/* Remove default 5px margin from Select2 containers and selections */
.select2-container,
.select2-container .select2-selection,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  margin: 0 !important;
}

/* If any specific inline margin present, override it */
.select2-container [style*="margin"] {
  margin: 0 !important;
}
.select2-search__field {
    margin-left: 0px !important;
}

/* Fix search results clipping: allow shadows and card overflow to be visible
   and slightly reduce grid gutters within the search section */
#search-section .container,
#search-section .row,
#search-section .card,
#search-section .card-body,
#search-section .card-footer {
  overflow: visible !important;
}

/* Reduce horizontal gutter in results grid to avoid horizontal overflow */
#search-section .row {
  --bs-gutter-x: 0.75rem !important;
}

/* Ensure map and other full-width widgets don't cause horizontal scroll */
#search-section #map, #search-section #map-grid {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Make grid cards slightly narrower on large screens to avoid clipping */
@media (min-width: 992px) {
  #search-section .col-lg-4 {
    flex: 0 0 31% !important;
    max-width: 31% !important;
  }
}

/* LIST VIEW: keep vertical scroll but allow horizontal overflow so cards aren't clipped */
#search-section .col-lg-6 > div[style*="max-height"] {
  overflow-y: auto !important;
  overflow-x: visible !important;
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
  box-sizing: border-box !important;
}

/* Ensure cards inside the scroll area don't get clipped and can show shadows */
#search-section .col-lg-6 > div[style*="max-height"] .card {
  overflow: visible !important;
  box-sizing: border-box !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Keep card-footer/buttons inside visible area and avoid negative margins */
#search-section .col-lg-6 > div[style*="max-height"] .card .card-footer,
#search-section .col-lg-6 > div[style*="max-height"] .card .card-body {
  overflow: visible !important;
}

/* If shadows are still clipped by a parent, make that parent visible as well */
#search-section .col-lg-6 {
  overflow: visible !important;
}

/* Overlap search card on top of hero */
.search-card-overlap {
  margin-top: -72px !important;
  position: relative !important;
  z-index: 1050 !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12) !important;
}

@media (max-width: 991.98px) {
  .search-card-overlap {
    margin-top: -40px !important;
  }
}

@media (max-width: 575.98px) {
  .search-card-overlap {
    margin-top: -20px !important;
  }
}