/* Keep the homepage search compact on phones so Featured listings follows the hero. */
.home-search-filter-toggle {
  display: none;
}

@media (max-width: 700px) {
  #exploreView .hero {
    min-height: 0;
    align-items: initial;
  }

  #exploreView .hero-content {
    padding: 18px 0 22px;
  }

  #exploreView .hero .eyebrow {
    display: none;
  }

  #exploreView .hero h1 {
    max-width: none;
    margin: 0 0 5px;
    font-size: 26px;
    line-height: 1.08;
    letter-spacing: -.8px;
  }

  #exploreView .hero p {
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
  }

  #exploreView .search-panel {
    margin-top: 14px;
    padding: 9px;
  }

  #exploreView .search-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    gap: 3px;
    padding: 4px;
  }

  #exploreView .search-tabs button {
    min-width: 0;
    min-height: 44px;
    padding: 10px 2px;
    font-size: 14px;
  }

  #exploreView .homepage-keyword-search {
    min-height: 48px;
    margin-bottom: 8px;
    padding: 6px 10px !important;
  }

  #exploreView .homepage-keyword-icon {
    width: 30px;
    height: 30px;
    font-size: 19px !important;
  }

  #exploreView #keywordSearch {
    font-size: 13px !important;
  }
}

/* Phones and tablets: filters fold away behind a Filters button. */
@media (max-width: 1024px) {
  .home-search-ready #exploreView .home-search-filter-toggle {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid rgba(34, 39, 48, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .86);
    color: #26332e;
    font-size: 13px;
    font-weight: 800;
  }

  .home-search-ready #exploreView .home-search-filter-toggle span {
    transition: transform .18s ease;
  }

  .home-search-ready #exploreView .home-search-filter-toggle[aria-expanded="true"] span {
    transform: rotate(180deg);
  }

  #exploreView .search-fields {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px;
    margin-top: 8px;
  }

  /* Filters sit in pairs: City | Barangay, Type | Intended use, Min | Max. */
  #exploreView .home-search-extra {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #exploreView #otherUseSearchWrap,
  #exploreView .home-budget-note {
    grid-column: 1 / -1;
  }

  /* Long names end with an ellipsis instead of being cut mid-letter. */
  #exploreView .home-search-extra select {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .home-search-ready #exploreView .home-search-extra:not(.is-open) {
    display: none;
  }

  #exploreView .search-fields > .primary-btn {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 14px;
  }
}

@media (min-width: 1025px) {
  #exploreView .home-search-extra {
    display: contents;
  }
}

@media (max-width: 400px) {
  #exploreView .home-search-extra select {
    font-size: 13px !important;
  }
}

.home-budget-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff1e8;
  color: #b42318 !important;
  font-size: 13px !important;
  font-weight: 700;
  line-height: 1.4 !important;
  text-shadow: none !important;
}

.home-budget-note[hidden] {
  display: none;
}

/* On wide screens the note gets its own row below the filters and Search button. */
#exploreView .home-budget-note {
  grid-column: 1 / -1;
  order: 1;
}

/* Computers and laptops: one row on wide screens, sized so the longest town,
   barangay, type and intended-use names and ₱100,000,000 budgets fit. */
@media (min-width: 1025px) {
  #exploreView .search-fields > label,
  #exploreView .home-search-extra > label {
    padding-left: 9px !important;
    padding-right: 9px !important;
  }

  #exploreView .search-fields select {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px !important;
  }
}

@media (min-width: 1240px) {
  #exploreView .search-fields {
    grid-template-columns: minmax(0, 1.58fr) minmax(0, 1.78fr) minmax(0, 1.71fr) minmax(0, 2.24fr) minmax(0, 1.37fr) minmax(0, 1.37fr) auto !important;
    column-gap: 6px !important;
  }

  /* "Search" alone leaves room for the longest filter names in one row. */
  #exploreView .search-fields > .primary-btn {
    padding-left: 18px;
    padding-right: 18px;
  }

  #exploreView .search-btn-brand {
    display: none;
  }
}

/* Smaller laptops: the same filters in one row, with Search on its own row below. */
@media (min-width: 1025px) and (max-width: 1239px) {
  #exploreView .search-fields {
    grid-template-columns: minmax(0, 1.58fr) minmax(0, 1.78fr) minmax(0, 1.71fr) minmax(0, 2.24fr) minmax(0, 1.37fr) minmax(0, 1.37fr) !important;
    column-gap: 6px !important;
  }

  #exploreView .search-fields > .primary-btn {
    grid-column: 1 / -1;
  }


  #exploreView .search-fields .money-input input {
    font-size: 15px !important;
  }
}

/* "All Cities" and a chosen town start where the other dropdowns' text starts. */
#exploreView #citySearch {
  padding-left: 4px !important;
}

/* The caption matches the other dropdowns' text size at each screen width. */
#exploreView .search-fields .city-select-caption {
  left: 4px;
  font-size: 14px;
}

@media (min-width: 1025px), (max-width: 400px) {
  #exploreView .search-fields .city-select-caption {
    font-size: 13px;
  }
}

/* "Can't find what you're looking for?" link: beside the tabs on wide screens,
   a small line under Search on phones and tablets. */
#exploreView .search-panel {
  position: relative;
}

#exploreView .search-post-request {
  display: block;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .78);
  color: #4a403c !important;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  text-shadow: none;
}

#exploreView .search-post-request b {
  color: #c2410c;
  font-weight: 800;
  white-space: nowrap;
}

#exploreView .search-post-request:hover b,
#exploreView .search-post-request:focus-visible b {
  text-decoration: underline;
}

@media (min-width: 1025px) {
  #exploreView .search-post-request {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 18px;
    font-size: 14px;
  }
}
