/* Homepage functional search bar: area dropdown, date range, guest stepper.
   Popovers anchor under each field. Reuses base tokens from home.css. */

.searchbar { position: relative; }
.sb-field { position: relative; display: flex; flex: 1; min-width: 0; }
.sb-field .searchbar-field { width: 100%; }
/* Vertical dividers between fields, matching the listing booking bar */
.sb-field + .sb-field { border-left: 1px solid var(--line); margin-left: 28px; padding-left: 28px; }

/* CTA shows text + arrow on desktop, a search icon on mobile */
.searchbar-cta .sc-icon { display: none; align-items: center; justify-content: center; }
.searchbar-cta .sc-text { display: inline; }

/* Option B on mobile: dates + guests fields visible, compact icon button */
@media (max-width: 900px) {
  .searchbar { gap: 0 !important; padding: 9px 9px 9px 18px !important; align-items: center; }
  .searchbar-field { border-bottom: none !important; }
  .sb-field { flex: 1; }
  .sb-field + .sb-field { border-left: 1px solid var(--line); margin-left: 14px; padding-left: 14px; }
  .searchbar-cta {
    width: 48px !important; height: 48px; padding: 0 !important;
    border-radius: 10px; justify-content: center; flex-shrink: 0; margin-left: 14px;
  }
  .searchbar-cta .sc-text { display: none; }
  .searchbar-cta::after { display: none; }
  .searchbar-cta .sc-icon { display: inline-flex; }
}

.sb-pop {
  position: absolute;
  bottom: calc(100% + 12px);
  top: auto;
  left: 0;
  z-index: 60;
  background: var(--white);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(30, 20, 10, 0.16);
  padding: 10px;
  min-width: 260px;
}
.sb-pop[hidden] { display: none; }
.sb-pop-cal { padding: 8px; min-width: auto; }
.sb-pop-guests { min-width: 300px; padding: 8px; }

/* Where options */
.sb-opt {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-align: left;
  background: transparent; border: 0; cursor: pointer;
  padding: 13px 14px; border-radius: 12px;
  font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--ink);
}
.sb-opt span { font-weight: 500; font-size: 13px; color: var(--ink-3); }
.sb-opt:hover, .sb-opt.is-active { background: var(--sand, #F6EFE7); }

/* Guest rows */
.sb-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 12px;
}
.sb-row + .sb-row { border-top: 1px solid var(--line); }
.sb-row strong { display: block; font-family: var(--sans); font-size: 15px; color: var(--ink); }
.sb-row small { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.sb-step { display: flex; align-items: center; gap: 16px; }
.sb-step button {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--white);
  font-size: 20px; line-height: 1; color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sb-step button:hover { border-color: var(--ink); }
.sb-step button:disabled { opacity: 0.35; cursor: not-allowed; }
.sb-step span { min-width: 20px; text-align: center; font-weight: 600; font-size: 16px; }

/* Calendar popover actions */
.sb-pop-actions { display: flex; justify-content: flex-end; padding: 8px 6px 4px; }
.sb-clear {
  background: transparent; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--ink-2); text-decoration: underline; padding: 6px 8px;
}
.sb-clear:hover { color: var(--terracotta); }

/* Flatpickr accent to match brand */
.sb-pop-cal .flatpickr-day.selected,
.sb-pop-cal .flatpickr-day.startRange,
.sb-pop-cal .flatpickr-day.endRange {
  background: var(--terracotta-dark); border-color: var(--terracotta);
}
.sb-pop-cal .flatpickr-day.inRange {
  background: var(--sand, #F6EFE7); border-color: var(--sand, #F6EFE7);
  box-shadow: -5px 0 0 var(--sand, #F6EFE7), 5px 0 0 var(--sand, #F6EFE7);
}
.sb-pop-cal .flatpickr-calendar { box-shadow: none; }

/* Mobile: popovers float above the fixed bar, full width, not clipped to a field */
@media (max-width: 900px) {
  .sb-pop {
    position: fixed;
    left: 12px; right: 12px;
    bottom: 88px; top: auto;
    min-width: 0; width: auto;
    max-height: 64vh; overflow: auto;
  }
  .sb-pop-cal { left: 12px; right: 12px; transform: none; padding: 6px; }
  .sb-pop-guests { min-width: 0; }
  /* Re-anchor the inline calendar inside its popover, undoing the property-page
     flatpickr fixed-position override that otherwise applies globally on mobile. */
  .sb-pop-cal .flatpickr-calendar,
  .sb-pop-cal .flatpickr-calendar.inline {
    position: static !important;
    left: auto !important; right: auto !important;
    top: auto !important; bottom: auto !important;
    margin: 0 auto !important;
  }
}
