/* ==========================================================================
   Treehouse Chalets — shared field picker (thc-picker)

   The trigger (label + value + caret) and the panel that opens from it.
   Used for Guests and Nationality in BOTH the inline hero booking bar and
   the booking pop-up, so every field in a row looks the same at rest.
   ========================================================================== */

.thc-picker {
  position: relative;
  width: 100%;
}

/* ---------- Trigger (looks like a plain value, not a button) ---------- */

.thc-picker__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #24262d;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.thc-picker__trigger:focus-visible {
  outline: 2px solid #978667;
  outline-offset: 4px;
  border-radius: 4px;
}

.thc-picker__caret {
  flex: 0 0 auto;
  width: 10px;
  height: 7px;
  fill: #978667;
  transition: transform 0.2s ease;
}

.thc-picker__trigger[aria-expanded="true"] .thc-picker__caret {
  transform: rotate(180deg);
}

/* Nationality shows its value in gold -- it's the one field the visitor
   must actively choose, so it reads as the accent in the row. */
.thc-picker--gold .thc-picker__trigger {
  color: #978667;
}

.thc-picker__value.is-placeholder {
  font-weight: 600;
  opacity: 0.75;
}

/* ---------- Panel ---------- */

.thc-picker__panel {
  position: fixed;
  z-index: 1000000; /* above the pop-up (100000) and the page */
  display: none;
  min-width: 240px;
  padding: 20px;
  border-radius: 12px;
  background-color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  font-family: "Montserrat", Helvetica, sans-serif;
}

.thc-picker__panel.is-open {
  display: block;
  animation: thcPickerIn 0.18s ease;
}

@keyframes thcPickerIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.thc-picker__panel-title {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ececec;
  color: #24262d;
  font-size: 15px;
  font-weight: 700;
}

/* ---------- Guests: stepper rows ---------- */

.thc-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0;
}

.thc-step-row__label {
  color: #24262d;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.thc-step-row__hint {
  display: block;
  color: #8a9099;
  font-size: 11px;
  font-weight: 500;
}

.thc-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 4px;
  border-radius: 30px;
  background-color: #f7f5f1;
}

.thc-step__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: #fff;
  color: #978667;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.thc-step__btn:hover:not(:disabled) {
  background-color: #978667;
  color: #fff;
}

.thc-step__btn:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

.thc-step__value {
  min-width: 26px;
  color: #24262d;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.thc-picker__done {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border: 0;
  border-radius: 30px;
  background-color: #978667;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

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

/* ---------- Choice: option list ---------- */

.thc-picker__option {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 13px 16px;
  border: 1px solid #ececec;
  border-radius: 8px;
  background-color: #fff;
  color: #24262d;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.thc-picker__option:last-child {
  margin-bottom: 0;
}

.thc-picker__option:hover {
  border-color: #978667;
  background-color: rgba(151, 134, 103, 0.08);
}

.thc-picker__option.is-selected {
  border-color: #978667;
  background-color: #978667;
  color: #fff;
}

/* ==========================================================================
   Mobile — centre the panel, same as the calendar does, so it can never
   hang off the edge of a narrow screen.
   ========================================================================== */

@media (max-width: 575px) {
  /* Centred WITHOUT transform -- same reasoning as the calendar in
     thc-flatpickr-theme.css: a transform here would make this panel
     the positioning anchor for its own fixed-position ::before
     backdrop, causing it to render as a misplaced grey block instead
     of covering the full screen. Fixed top + negative margin-left
     avoids that trap while still landing centred. */
  .thc-picker__panel--centered.is-open {
    top: 6vh !important;
    left: 50% !important;
    right: auto !important;
    margin-left: -170px !important; /* half of max-width below */
    transform: none !important;
    width: 88vw;
    max-width: 340px;
    max-height: 82vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: none;
  }

  .thc-picker__panel--centered.is-open:before {
    content: "";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    z-index: -1;
  }

  .thc-step__btn {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thc-picker__panel.is-open,
  .thc-picker__caret,
  .thc-step__btn,
  .thc-picker__done {
    animation: none;
    transition: none;
  }
}