/* 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: center !important;
  justify-content: space-between;
  flex-wrap: nowrap;
  column-gap: 12px !important;
  row-gap: 8px !important;
}

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

body.ps-home-page .ps-section-heading--results > .ps-results-summary h2 {
  margin: 0;
  line-height: 1.2;
}

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

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

body.ps-home-page .ps-catalog-sort select {
  width: auto;
  min-width: 0;
  max-width: 120px;
  min-height: 34px;
  padding: 0 18px 0 0;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  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: center !important;
    justify-content: space-between;
    flex-wrap: nowrap;
  }

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

  body.ps-home-page .ps-catalog-sort {
    min-height: 38px;
    margin-left: auto;
    padding: 0 6px;
    gap: 4px;
  }

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

  body.ps-home-page .ps-catalog-sort select {
    max-width: 94px;
    min-height: 36px;
    padding-right: 16px;
    font-size: 11px;
  }

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

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


@media (max-width: 420px) {
  body.ps-home-page .ps-section-heading--results > .ps-results-summary h2 {
    font-size: 16px;
  }

  body.ps-home-page .ps-catalog-sort {
    border-radius: 8px;
  }

  body.ps-home-page .ps-catalog-sort select {
    max-width: 86px;
  }
}

/* Keep the sort control beside the result count. Active filter chips occupy
   their own full-width row, so adding/removing filters cannot move the sort. */
body.ps-home-page .ps-section-heading--results {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center !important;
  column-gap: 10px !important;
  row-gap: 8px !important;
}

body.ps-home-page .ps-section-heading--results > .ps-results-summary {
  grid-column: 1;
  grid-row: 1;
  min-width: 0 !important;
}

body.ps-home-page .ps-section-heading--results > .ps-catalog-sort {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  margin-left: 0;
}

body.ps-home-page .ps-section-heading--results > .ps-active-filters {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 0;
}

@media (max-width: 420px) {
  body.ps-home-page .ps-section-heading--results {
    column-gap: 6px !important;
  }
}

/* Compact price sort: single label and native dropdown caret. */
body.ps-home-page .ps-catalog-sort {
  min-height: 32px;
  gap: 0;
  padding: 0 5px 0 8px;
}

body.ps-home-page .ps-catalog-sort select {
  min-height: 30px;
  max-width: 100px;
  padding-right: 12px;
  font-size: 10.5px;
  font-weight: 500;
}

@media (max-width: 760px) {
  body.ps-home-page .ps-catalog-sort {
    min-height: 32px;
    padding: 0 5px 0 7px;
  }

  body.ps-home-page .ps-catalog-sort select {
    min-height: 30px;
    max-width: 100px;
    font-size: 10.5px;
    font-weight: 500;
    padding-right: 12px;
  }
}

/* Cross-region return eligibility displayed below each destination. */
body.ps-home-page .ps-custom-select__option.ps-cross-region-return-option {
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: center;
  gap: 3px 8px;
}
body.ps-home-page .ps-cross-region-return-option .ps-return-region-year-note {
  display: block;
  width: 100%;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
  color: #175fba;
  white-space: normal;
}
html[data-theme="dark"] body.ps-home-page .ps-cross-region-return-option .ps-return-region-year-note {
  color: #87eaa0;
}

/* Keep the selected tick at the right on two-line cross-region options. */
body.ps-home-page .ps-custom-select__option.ps-cross-region-return-option {
  position: relative;
  display: block;
  padding-right: 40px;
  min-height: 66px;
}
body.ps-home-page .ps-cross-region-return-option .ps-custom-select__option-name,
body.ps-home-page .ps-cross-region-return-option .ps-return-region-year-note {
  display: block;
  width: auto;
  line-height: 1.4;
}
body.ps-home-page .ps-cross-region-return-option .ps-return-region-year-note {
  margin-top: 3px;
}
body.ps-home-page .ps-cross-region-return-option::after { right: 13px !important; }

/* Fullscreen mobile picker is portaled directly under body. */
body > .ps-custom-select__menu.ps-mobile-picker-portal .ps-cross-region-return-option {
  position: relative !important;
  display: block !important;
  min-height: 69px !important;
  padding: 12px 42px 12px 14px !important;
  box-sizing: border-box;
}
body > .ps-custom-select__menu.ps-mobile-picker-portal .ps-cross-region-return-option .ps-custom-select__option-name,
body > .ps-custom-select__menu.ps-mobile-picker-portal .ps-cross-region-return-option .ps-return-region-year-note {
  display: block !important;
  width: auto !important;
  margin: 0;
  line-height: 1.45 !important;
}
body > .ps-custom-select__menu.ps-mobile-picker-portal .ps-cross-region-return-option .ps-return-region-year-note {
  margin-top: 4px !important;
}
html[data-theme="light"] body > .ps-custom-select__menu.ps-mobile-picker-portal .ps-cross-region-return-option.is-selected::after {
  position: absolute !important;
  right: 13px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
}

/* Return choices: name top-left, selection tick top-right, note and fare on row 2. */
body .ps-custom-select__menu .ps-cross-region-return-option,
body > .ps-custom-select__menu.ps-mobile-picker-portal .ps-cross-region-return-option {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content;
  grid-template-rows: auto auto;
  align-items: center;
  min-height: 74px !important;
  padding: 11px 15px !important;
  column-gap: 12px;
  row-gap: 5px;
  position: relative;
}
body .ps-cross-region-return-option > .ps-custom-select__option-name {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}
body .ps-cross-region-return-option > .ps-return-region-year-note {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  margin: 0 !important;
  font-size: 11px;
}
body .ps-cross-region-return-option > .ps-custom-select__option-meta {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  margin: 0 !important;
  position: static !important;
  align-self: center;
  text-align: right;
}
body .ps-custom-select__menu .ps-cross-region-return-option.is-selected::after,
body > .ps-custom-select__menu.ps-mobile-picker-portal .ps-cross-region-return-option.is-selected::after {
  grid-column: 2;
  grid-row: 1;
  position: static !important;
  transform: none !important;
  margin: 0 !important;
  justify-self: end;
}
/* Only the first catalog page is visible until Show more is pressed. */
body.ps-home-page .ps-grid > [data-vehicle-card].is-extra:not(.is-revealed) {
  display: none !important;
}
body.ps-home-page .ps-grid > [data-vehicle-card].is-extra.is-revealed {
  display: block !important;
}

/* Keep the selected tick by the city, never overlapping the fare. */
body .ps-custom-select__menu .ps-cross-region-return-option.is-selected::after,
body > .ps-custom-select__menu.ps-mobile-picker-portal .ps-cross-region-return-option.is-selected::after,
html[data-theme="light"] body > .ps-custom-select__menu.ps-mobile-picker-portal .ps-cross-region-return-option.is-selected::after {
  position: absolute !important;
  top: 11px !important;
  right: 15px !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  margin: 0 !important;
  line-height: 18px !important;
  width: 20px;
  text-align: center;
  grid-column: auto;
  grid-row: auto;
}
body .ps-custom-select__menu .ps-cross-region-return-option > .ps-custom-select__option-name,
body > .ps-custom-select__menu.ps-mobile-picker-portal .ps-cross-region-return-option > .ps-custom-select__option-name {
  padding-right: 23px;
}

/* Desktop price sort: larger readable text; mobile unchanged. */
@media (min-width: 761px) {
  body.ps-home-page .ps-catalog-sort { min-height: 38px; padding: 0 10px; }
  body.ps-home-page .ps-catalog-sort select { min-height: 36px; max-width: 135px; font-size: 14px; font-weight: 550; padding-right: 17px; }
}
