/* Elephant Rent catalog usability polish, October 2026.
   Only home/catalog templates include this file. Keep original max-width,
   vehicle cards, category tiles, theme selection and booking untouched. */

/* The legacy 600px minimum leaves a blank tail when only one vehicle matches.
   Let the filter/results content determine height instead. */
body.ps-home-page .ps-market {
  min-height: 0 !important;
  padding-bottom: 24px !important;
}

/* Keep comments, but avoid a second large blank spacer after the car list. */
body.ps-home-page .ps-comments {
  padding-top: 24px !important;
}

/* The shared CSS forces this header to display:block; explicitly allow a
   compact sort control on the right without widening the catalog. */
body.ps-home-page .ps-section-heading--results {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 12px !important;
  row-gap: 8px !important;
}

body.ps-home-page .ps-section-heading--results > .ps-results-summary {
  width: auto !important;
  flex: 1 1 220px !important;
}

body.ps-home-page .ps-catalog-sort {
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  color: #334155;
  background: #fff;
  box-sizing: border-box;
  cursor: pointer;
}

body.ps-home-page .ps-catalog-sort > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

body.ps-home-page .ps-catalog-sort select {
  min-width: 0;
  max-width: 200px;
  min-height: 36px;
  padding: 0 20px 0 0;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

body.ps-home-page .ps-catalog-sort:focus-within {
  outline: 2px solid #256edb;
  outline-offset: 2px;
}

body.ps-home-page .ps-catalog-sort__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

html[data-theme="dark"] body.ps-home-page .ps-catalog-sort {
  background: #2c3139;
  border-color: #535e6b;
  color: #f1f5f9;
}

html[data-theme="dark"] body.ps-home-page .ps-catalog-sort select {
  color-scheme: dark;
}

html[data-theme="dark"] body.ps-home-page .ps-catalog-sort:focus-within {
  outline-color: #59de68;
}

@media (max-width: 760px) {
  body.ps-home-page .ps-section-heading--results {
    display: flex !important;
    align-items: flex-start !important;
    flex-wrap: wrap;
  }

  body.ps-home-page .ps-section-heading--results > .ps-results-summary {
    flex: 1 1 180px !important;
  }

  body.ps-home-page .ps-catalog-sort {
    min-height: 42px;
    margin-left: auto;
  }

  body.ps-home-page .ps-catalog-sort select {
    min-height: 40px;
  }

  body.ps-home-page .ps-market {
    padding-bottom: 18px !important;
  }

  body.ps-home-page .ps-comments {
    padding-top: 20px !important;
  }
}
