/**
 * Layout 43 (Travlla) - tour search results (route product/tour_search).
 *
 * Mobile first: a single column result list and the filters as a bottom
 * drawer. From 640px the filter bar becomes an inline toolbar and the grid
 * turns into two, then four columns (the card grid itself comes from the
 * Bootstrap column classes on product/thumb).
 */

.ts43-search-page {
  padding: 8px 0 48px;
  background: #f7f3ec;
}

/* The page container sits inside `.ts43-search-page`, so it is neither a direct
   child of #wrapper nor `.container.content-main` - the 16px page gutter from
   layout43-mobile-compliance.css never reached it and the phone layout kept the
   raw Bootstrap 7.5px half gutter.  Restore the same 16px step here. */
.ts43-search-page > .container {
  box-sizing: border-box;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 640px) {
  .ts43-search-page > .container {
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* ---------------------------------------------------------------- head ---- */

.ts43-search-head {
  padding: 8px 0 16px;
}

.ts43-search-title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.4;
  color: #1d2b26;
}

.ts43-search-count {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: #5d6a64;
}

/* -------------------------------------------------------------- filters ---- */

.ts43-filters {
  position: relative;
  margin: 0 0 16px;
}

.ts43-filters-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: #1d2b26;
  background: #fff;
  border: 1px solid #e3ded3;
  border-radius: 12px;
  cursor: pointer;
}

.ts43-filters-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin-left: auto;
  padding: 0 8px;
  font-size: 12px;
  font-style: normal;
  color: #fff;
  background: #1d2b26;
  border-radius: 999px;
}

/* Bottom drawer on phones. */
.ts43-filters-body {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1002;
  display: none;
  max-height: 88vh;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, .18);
  transform: translateY(100%);
  transition: transform 400ms cubic-bezier(.2, .8, .2, 1);
}

.ts43-filters.is-open .ts43-filters-body {
  display: block;
  transform: translateY(0);
  /* Above the floating support widget so nothing covers the apply button. */
  z-index: 2147483100;
}

.ts43-filters-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(11, 24, 19, .5);
}

.ts43-filters.is-open .ts43-filters-backdrop {
  z-index: 2147483001;
}

.ts43-drawer-open {
  overflow: hidden;
}

.ts43-field {
  display: block;
  margin: 0 0 16px;
}

.ts43-field label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: #1d2b26;
}

.ts43-input,
.ts43-select-wrap select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  font-size: 16px;
  line-height: 1.5;
  color: #1d2b26;
  background: #fff;
  border: 1px solid #e3ded3;
  border-radius: 12px;
}

.ts43-input:focus,
.ts43-select-wrap select:focus {
  border-color: #1d2b26;
  outline: 2px solid rgba(29, 43, 38, .15);
  outline-offset: 1px;
}

/* The vendor sheet paints bare `input[type=...]` controls with the grey
   `#eee` plate and a 3px radius (`body.layout-43 input[type="text"]`,
   `input[type="number"]`, `input[type="date"]`, ...).  The contract above only
   reached <select>, so the date/travellers/price/keyword boxes rendered as
   flat grey rectangles next to the white selects.  Re-assert the field skin
   with a scoped specificity strong enough to win regardless of load order. */
.ts43-search-page .ts43-filters-body .ts43-input {
  background-color: #fff !important;
  border: 1px solid #e3ded3 !important;
  border-radius: 12px !important;
}

.ts43-search-page .ts43-filters-body .ts43-input::placeholder {
  color: #8a938f;
}

.ts43-search-page .ts43-filters-body .ts43-input:focus {
  border-color: #1d2b26 !important;
  outline: 2px solid rgba(29, 43, 38, .15);
  outline-offset: 1px;
}

.ts43-select-wrap {
  position: relative;
}

.ts43-select-wrap select {
  appearance: none;
  padding-right: 32px;
}

.ts43-select-wrap::after {
  content: "\f078";
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  font-family: "FontAwesome";
  font-size: 12px;
  color: #5d6a64;
  pointer-events: none;
}

.ts43-price-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.ts43-actions {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.ts43-submit {
  min-height: 48px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: #1d2b26;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.ts43-submit:hover,
.ts43-submit:focus {
  background: #2f4a3e;
}

.ts43-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: #1d2b26;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e3ded3;
  border-radius: 999px;
}

.ts43-reset:hover,
.ts43-reset:focus {
  color: #1d2b26;
  text-decoration: none;
  background: #f4efe6;
  border-color: #cfc8ba;
}

.ts43-reset:focus-visible {
  outline: 2px solid rgba(29, 43, 38, .35);
  outline-offset: 2px;
}

/* -------------------------------------------------------------- toolbar ---- */

.ts43-search-page .ts43-toolbar.filters-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e3ded3;
  border-radius: 16px;
}

.ts43-toolbar__views {
  flex: 1 1 100%;
  min-width: 0;
}

.ts43-search-page .ts43-toolbar__views .list-view {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

/* The shared listing sheet prints a small "Grid view:" caption and 33px dark
   squares; on this card the caption sits in a light row, so both are restyled
   to the page palette. */
.ts43-search-page .ts43-toolbar .list-view .btn-gridview {
  float: none;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: #5d6a64;
  background: transparent;
  border: 0;
}

.ts43-search-page .ts43-toolbar .list-view button.btn {
  float: none;
  width: 48px;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 46px;
  color: #1d2b26;
  text-align: center;
  background: #fff;
  border: 1px solid #e3ded3;
  border-radius: 10px !important;
  cursor: pointer;
}

.ts43-search-page .ts43-toolbar .list-view button.btn i {
  color: inherit;
}

.ts43-search-page .ts43-toolbar .list-view button.btn:hover,
.ts43-search-page .ts43-toolbar .list-view button.btn:focus-visible,
.ts43-search-page .ts43-toolbar .list-view button.btn.active {
  color: #fff;
  background: #1d2b26;
  border-color: #1d2b26;
}

.ts43-search-page .ts43-toolbar .list-view button.btn:focus {
  outline: none;
}

.ts43-toolbar__sorts {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}

.ts43-search-page .ts43-toolbar__sorts .form-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.ts43-search-page .ts43-toolbar__sorts label {
  flex: 0 0 auto;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: #5d6a64;
  white-space: nowrap;
}

.ts43-search-page .ts43-toolbar__sorts select.ts43-input {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  padding: 0 12px;
  font-size: 16px;
  line-height: 1.5;
  color: #1d2b26;
  background: #fff;
  border: 1px solid #e3ded3;
  border-radius: 10px;
}

.ts43-search-page .ts43-toolbar__sorts select#ts43-sort {
  width: 190px;
}

.ts43-search-page .ts43-toolbar__sorts select#ts43-limit {
  width: 84px;
}

/* ----------------------------------------------------------------- grid ---- */

.ts43-pagination {
  margin: 24px 0 0;
  text-align: center;
}

.ts43-empty {
  padding: 48px 16px;
  text-align: center;
  background: #fff;
  border-radius: 16px;
}

.ts43-empty i {
  display: block;
  margin: 0 0 16px;
  font-size: 32px;
  color: #9aa5a0;
}

.ts43-empty p {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.6;
  color: #5d6a64;
}

/* ------------------------------------------------------- >= 640px (sm) ---- */

@media (min-width: 640px) {
  .ts43-search-page {
    padding-bottom: 56px;
  }

  .ts43-filters-toggle,
  .ts43-filters-backdrop {
    display: none;
  }

  .ts43-filters-body {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-height: none;
    padding: 16px;
    overflow: visible;
    background: #fff;
    border: 1px solid #e3ded3;
    border-radius: 16px;
    box-shadow: none;
    transform: none;
    transition: none;
  }

  .ts43-field {
    margin: 0;
  }

  /* Labels differ in height ("on or after" wraps), so align every control on
     the same baseline instead of letting the inputs step down. */
  .ts43-search-page .ts43-filters-body {
    align-items: end;
  }

  .ts43-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
  }

  .ts43-actions .ts43-submit {
    flex: 0 0 auto;
    min-width: 200px;
  }

  .ts43-toolbar__views {
    flex: 0 0 auto;
  }

  .ts43-toolbar__sorts {
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  /* Touch-sized controls shrink back to the desktop 40px rhythm. */
  .ts43-search-page .ts43-toolbar .list-view button.btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
    font-size: 14px;
    line-height: 38px;
  }

  .ts43-search-page .ts43-toolbar__sorts select.ts43-input {
    min-height: 40px;
    font-size: 14px;
  }

  .ts43-search-page .ts43-toolbar__sorts select#ts43-sort {
    width: 210px;
  }
}

/* Phones keep the four most useful column choices; 2/3-up grids are unreadable
   at 320-575px and only add toolbar rows. */
@media (max-width: 575px) {
  .ts43-search-page #grid-view-2,
  .ts43-search-page #grid-view-3 {
    display: none;
  }
}

/* ------------------------------------------------------ >= 1024px (lg) ---- */

@media (min-width: 1024px) {
  .ts43-search-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
  }

  .ts43-search-title {
    margin: 0;
  }

  .ts43-filters-body {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ts43-field--keyword,
  .ts43-field--price {
    grid-column: span 2;
  }

  .ts43-actions {
    justify-content: flex-end;
  }

  /* Layout 43's system sheet reserves 190px above #wrapper for inner pages so a
     page-builder banner can clear the fixed header.  This route renders no
     banner and its header is only 108px tall, so the residue reads as a ~80px
     blank band under the header.  Align the page to the header plus one 16px
     step instead.  `:not(#ts43-void)` only exists to outrank the system rule,
     which declares the same specificity and loads after this sheet. */
  html body:is(.layout-43, .header-43):not(.common-home):has(.ts43-search-page) #wrapper:not(#ts43-void) {
    padding-top: 124px !important;
  }
}

/* ------------------------------------------------------ >= 1280px (xl) ---- */

@media (min-width: 1280px) {
  .ts43-filters-body {
    grid-template-columns: 1.2fr 1.2fr 1fr .7fr 1.4fr 1.2fr;
  }

  .ts43-field--price,
  .ts43-field--keyword {
    grid-column: span 1;
  }
}

