/* ==========================================================================
   Treehouse Chalets — inline hero booking bar (thc-ibar)
   Replaces the Exely search-form widget.

   Every field is label + value + caret, so the row reads evenly. The
   panels that open from Guests / Nationality live in thc-picker.css and
   the gold calendar in thc-flatpickr-theme.css -- both shared with the
   booking pop-up so the two always match.
   ========================================================================== */

.thc-ibar-wrap {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 1200px;
  margin: -40px auto 0;
  padding: 0 20px;
}

.thc-ibar {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  align-items: center;
  background-color: #fff;
  border-radius: 60px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  padding: 10px;
  font-family: "Montserrat", Helvetica, sans-serif;
}

/* ---------- Fields ---------- */

.thc-ibar__field {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 18px;
  border-right: 1px solid #ececec;
  min-width: 0;
}

.thc-ibar__field:last-of-type {
  border-right: none;
}

.thc-ibar__field label {
  margin: 0 0 4px;
  color: #6c757d;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.thc-ibar__input {
  width: 100%;
  border: 0;
  padding: 0;
  background-color: transparent;
  color: #24262d;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* the visible date field Flatpickr creates (the original input becomes
   hidden once Flatpickr takes over -- see inline-booking-bar.js) */
.thc-ibar__input--alt {
  cursor: pointer;
}

/* ---------- Submit ---------- */

.thc-ibar__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-column: 5;
  margin-left: 6px;
  padding: 18px 36px;
  border: 0;
  border-radius: 50px;
  background-color: #978667;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.thc-ibar__submit:hover {
  background-color: #4b514d;
}

.thc-ibar__submit.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.thc-ibar__error {
  display: none;
  grid-column: 1 / -1;
  margin: 8px 0 2px 24px;
  color: #c0392b;
  font-size: 13px;
  font-weight: 500;
}

.thc-ibar__error.is-visible {
  display: block;
}

/* ---------- Tablet ---------- */

@media (max-width: 1199px) {
  .thc-ibar {
    grid-template-columns: repeat(2, 1fr);
    border-radius: 24px;
    padding: 10px 10px 20px;
  }

  .thc-ibar__field {
    border-right: none;
    border-bottom: 1px solid #ececec;
    padding: 16px 20px;
  }

  .thc-ibar__field:nth-last-of-type(-n+2) {
    border-bottom: none;
  }

  .thc-ibar__submit {
    grid-column: 1 / -1;
    margin: 14px 10px 0;
    height: 54px;
  }

  .thc-ibar__error {
    margin: 0 10px;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 575px) {
  .thc-ibar-wrap {
    margin-top: -28px;
    padding: 0 15px;
  }

  .thc-ibar {
    grid-template-columns: 1fr;
    padding: 8px 8px 18px;
  }

  .thc-ibar__field {
    border-bottom: 1px solid #ececec;
  }

  .thc-ibar__field:last-of-type {
    border-bottom: none;
  }

  .thc-ibar__submit {
    margin: 14px 8px 0;
    height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thc-ibar__submit {
    transition: none;
  }
}