/*
 * Flexible Search frontend styles.
 *
 * Class prefix: hrtk-fs-
 *
 * Inherits the host theme's typography and color palette where possible.
 * Layout matches the screenshot reference: pill toggle at top, two
 * sections (How long, When), chip strip footer with Clear / Apply.
 *
 * BUILD: edit this file only. The committed .min.css/.debug.css are generated
 * (`npm run build:css`) and are what production/SCRIPT_DEBUG load. The build
 * raises every selector here to (2,x,0) via :not(#\9); see
 * scripts/postcss-hrtk-scope.js and scripts/css-manifest.js.
 */

/* =========================================================================
   Isolation boundary — see assets/css/searchbar-pro.css for the full
   doctrine (why `all: revert` + specificity armor, NOT !important; why svg
   is excluded via zero-specificity :where(); why this rule MUST STAY FIRST —
   later same-specificity rules win by source order).

   FOUR ROOTS, none a descendant of another: the toggle is mounted in the
   core date-modal HEADER, the panel in the modal BODY, the form strip in
   the core SEARCH FORM, and the zero-results empty state is appended into
   core's .hfse-properties-no-items container (flexible-search.js) — each
   disjoint subtree needs its own root or it silently loses the reset
   (searchbar's portaled mobile modal is the precedent). This is a BLEND-IN component: it lives
   inside homerunner-core chrome and inherits the host's typography and
   palette (header contract above), so `font-family: inherit` and
   `color: inherit` are restored AFTER `all: revert` — the UA stylesheet
   sets its own font/color on form controls (this file renders its chips as
   <button>s), and without re-inheritance the reset would break the blend-in
   contract on every one of them.
   ========================================================================= */
.hrtk-fs-toggle:not(#\9):not(#\9),
.hrtk-fs-toggle:not(#\9):not(#\9)::before,
.hrtk-fs-toggle:not(#\9):not(#\9)::after,
.hrtk-fs-toggle:not(#\9):not(#\9) *:where(:not(svg, svg *)),
.hrtk-fs-toggle:not(#\9):not(#\9) *:where(:not(svg, svg *))::before,
.hrtk-fs-toggle:not(#\9):not(#\9) *:where(:not(svg, svg *))::after,
.hrtk-fs-panel:not(#\9):not(#\9),
.hrtk-fs-panel:not(#\9):not(#\9)::before,
.hrtk-fs-panel:not(#\9):not(#\9)::after,
.hrtk-fs-panel:not(#\9):not(#\9) *:where(:not(svg, svg *)),
.hrtk-fs-panel:not(#\9):not(#\9) *:where(:not(svg, svg *))::before,
.hrtk-fs-panel:not(#\9):not(#\9) *:where(:not(svg, svg *))::after,
.hrtk-fs-form-strip:not(#\9):not(#\9),
.hrtk-fs-form-strip:not(#\9):not(#\9)::before,
.hrtk-fs-form-strip:not(#\9):not(#\9)::after,
.hrtk-fs-form-strip:not(#\9):not(#\9) *:where(:not(svg, svg *)),
.hrtk-fs-form-strip:not(#\9):not(#\9) *:where(:not(svg, svg *))::before,
.hrtk-fs-form-strip:not(#\9):not(#\9) *:where(:not(svg, svg *))::after,
.hrtk-fs-empty:not(#\9):not(#\9),
.hrtk-fs-empty:not(#\9):not(#\9)::before,
.hrtk-fs-empty:not(#\9):not(#\9)::after,
.hrtk-fs-empty:not(#\9):not(#\9) *:where(:not(svg, svg *)),
.hrtk-fs-empty:not(#\9):not(#\9) *:where(:not(svg, svg *))::before,
.hrtk-fs-empty:not(#\9):not(#\9) *:where(:not(svg, svg *))::after,
.hrtk-fs-adjusted-notice:not(#\9):not(#\9),
.hrtk-fs-adjusted-notice:not(#\9):not(#\9)::before,
.hrtk-fs-adjusted-notice:not(#\9):not(#\9)::after,
.hrtk-fs-adjusted-notice:not(#\9):not(#\9) *:where(:not(svg, svg *)),
.hrtk-fs-adjusted-notice:not(#\9):not(#\9) *:where(:not(svg, svg *))::before,
.hrtk-fs-adjusted-notice:not(#\9):not(#\9) *:where(:not(svg, svg *))::after {
  all: revert;
  box-sizing: border-box;
  color: inherit;
  font-family: inherit;
}

/* Tighten core's date modal where fsearch manages it (Eli, 2026-07-16:
 * 800px reads as broken next to the 440px guest picker). Core's
 * explorer.css ships `width:100%; max-width:800px !important` at the same
 * breakpoint; importance trumps specificity, so armor alone can't win and
 * the !important here is forced. Scoped to .hrtk-fs-date-modal (added by
 * flexible-search.js on attach) so unmarked explorer sites keep core's
 * 800px design. 760px is the snug fit around the two side-by-side months. */
@media (min-width: 640px) {
  .hfse-form-date-options.hrtk-fs-date-modal:not(#\9):not(#\9) > .hk-modal-dialog {
    max-width: 760px !important;
  }
}

.hrtk-fs-toggle:not(#\9):not(#\9) {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  margin: 0 auto;
  border-radius: 999px;
  background: #f3f4f6;
  width: -moz-max-content;
  width: max-content;
}

/* When the toggle lives inside the Explorer modal header, give it room
 * below the "When" title so it doesn't crowd the calendar icon. */
.hk-modal-header:not(#\9):not(#\9) .hrtk-fs-toggle {
  margin-top: 12px;
  margin-bottom: 4px;
}

/* Header in the date modal uses a single column flow — let the toggle
 * sit on its own row, centered. */
.hfse-form-date-options .hk-modal-header {
  display: block;
}
.hfse-form-date-options .hk-modal-header > .hk-h4 {
  display: block;
  text-align: left;
}
.hfse-form-date-options:not(#\9):not(#\9) .hk-modal-header > .hrtk-fs-toggle {
  display: flex;
  margin-left: auto;
  margin-right: auto;
}

.hrtk-fs-toggle-btn:not(#\9):not(#\9) {
  padding: 8px 18px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  line-height: 1.2;
}

.hrtk-fs-toggle-btn.is-active:not(#\9):not(#\9) {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  outline: 1px solid #2c5282;
  outline-offset: -1px;
}

.hrtk-fs-panel:not(#\9):not(#\9) {
  padding: 8px 0 16px;
}

/* When the panel lives inside the modal body, mirror the body's own
 * horizontal padding and use full vertical flow. */
.hfse-form-date-options:not(#\9):not(#\9) .hrtk-fs-panel {
  padding: 8px 24px 16px;
}

.hrtk-fs-heading:not(#\9):not(#\9) {
  font-size: 18px;
  font-weight: 600;
  margin: 16px 0 12px;
  color: inherit;
}

.hrtk-fs-chip-group:not(#\9):not(#\9) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hrtk-fs-chip:not(#\9):not(#\9) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  min-height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.2;
  color: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.hrtk-fs-chip:hover:not(#\9):not(#\9) {
  border-color: #9ca3af;
}

.hrtk-fs-chip.is-active:not(#\9):not(#\9) {
  border-color: #2c5282;
  border-width: 2px;
  padding: 7px 17px; /* keep dimensions stable when border grows */
}

.hrtk-fs-month-strip-wrap:not(#\9):not(#\9) {
  position: relative;
  margin: 0 -8px;
  padding: 4px 8px;
}

.hrtk-fs-month-strip:not(#\9):not(#\9) {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Scrollbar is hidden, so the strip itself signals grab-and-drag. Chip
   * labels aren't real content — selectable text mid-drag reads as a bug. */
  cursor: grab;
  -webkit-user-select: none;
  -moz-user-select: none;
       user-select: none;
}

.hrtk-fs-month-strip:not(#\9):not(#\9)::-webkit-scrollbar {
  display: none;
}

/* Mid-drag state (mouse drag-to-scroll): the whole strip reads as grabbed,
 * including over chips, so the cursor doesn't flicker pointer/grabbing as
 * it crosses them. */
.hrtk-fs-month-strip--dragging:not(#\9):not(#\9),
.hrtk-fs-month-strip--dragging:not(#\9):not(#\9) .hrtk-fs-chip {
  cursor: grabbing;
}

.hrtk-fs-month-arrow:not(#\9):not(#\9) {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  color: #374151;
  padding: 0;
}

.hrtk-fs-month-arrow:hover:not(#\9):not(#\9) {
  border-color: #9ca3af;
  background: #f9fafb;
}

.hrtk-fs-month-arrow[hidden]:not(#\9):not(#\9) {
  display: none;
}

.hrtk-fs-month-arrow-left:not(#\9):not(#\9) {
  left: -4px;
}

.hrtk-fs-month-arrow-right:not(#\9):not(#\9) {
  right: -4px;
}

.hrtk-fs-or:not(#\9):not(#\9) {
  color: #6b7280;
  font-size: 13px;
}

.hrtk-fs-month-chip:not(#\9):not(#\9) {
  flex-direction: column;
  min-width: 84px;
  min-height: 76px;
  border-radius: 12px;
  padding: 10px 12px;
  gap: 2px;
}

.hrtk-fs-chip-icon:not(#\9):not(#\9) {
  width: 20px;
  height: 20px;
  color: #6b7280;
  flex-shrink: 0;
}

.hrtk-fs-month-chip-anytime:not(#\9):not(#\9) .hrtk-fs-chip-icon {
  color: #4b5563;
}

.hrtk-fs-month-chip.is-active:not(#\9):not(#\9) .hrtk-fs-chip-icon {
  color: #2c5282;
}

.hrtk-fs-chip-primary:not(#\9):not(#\9) {
  font-weight: 500;
  font-size: 14px;
}

.hrtk-fs-chip-secondary:not(#\9):not(#\9) {
  font-size: 12px;
  color: #6b7280;
}

.hrtk-fs-panel-footer:not(#\9):not(#\9) {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.hrtk-fs-clear:not(#\9):not(#\9) {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  padding: 8px 12px;
  text-decoration: underline;
}

.hrtk-fs-apply:not(#\9):not(#\9) {
  background: #2c5282;
  color: #ffffff;
  border: 0;
  border-radius: 6px;
  padding: 10px 22px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.hrtk-fs-apply:hover:not(#\9):not(#\9) {
  background: #2a4d76;
}

/* Alternative-dates section, rendered inside the flex panel below the
 * month strip. Lets users pick a specific matching range without leaving
 * the modal. Headline is intentionally low-contrast — it's a secondary
 * affordance to the primary stay+month selection above. */
.hrtk-fs-alt-section:not(#\9):not(#\9) {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.hrtk-fs-alt-heading:not(#\9):not(#\9) {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #6b7280;
}

.hrtk-fs-alt-chips:not(#\9):not(#\9) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hrtk-fs-alt-chip:not(#\9):not(#\9) {
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  color: inherit;
}

.hrtk-fs-alt-chip:hover:not(#\9):not(#\9) {
  border-color: #9ca3af;
}

.hrtk-fs-alt-chip.is-active:not(#\9):not(#\9) {
  border-color: #2c5282;
  border-width: 2px;
  padding: 5px 13px;
}

/* Form-side chip strip — appears below the search bar after a flex search
 * is committed. Lets users swap to a different specific range without
 * reopening the modal. */
/* Selector intentionally scoped under .hfse-form to outscore Explorer's
 * `.hfse-form > div + div { margin-top: 15px; }` rule, which would
 * otherwise win on specificity and crush our top margin. */
.hfse-form:not(#\9):not(#\9) .hrtk-fs-form-strip,
.hrtk-fs-form-strip:not(#\9):not(#\9) {
  margin: 20px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.hrtk-fs-form-strip[hidden]:not(#\9):not(#\9) {
  display: none;
}

.hrtk-fs-form-strip-heading:not(#\9):not(#\9) {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.hrtk-fs-form-strip-chips:not(#\9):not(#\9) {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 640px) {
  .hrtk-fs-form-strip:not(#\9):not(#\9) {
    flex-direction: column;
    align-items: flex-start;
  }
}

.hrtk-fs-form-strip-chip:not(#\9):not(#\9) {
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12px;
  color: inherit;
  white-space: nowrap;
}

.hrtk-fs-form-strip-chip:hover:not(#\9):not(#\9) {
  border-color: #9ca3af;
}

.hrtk-fs-form-strip-chip.is-active:not(#\9):not(#\9) {
  border-color: #2c5282;
  border-width: 2px;
  padding: 4px 11px;
  background: #f0f5fa;
}

/* Empty-state replacement — shown when Explorer renders zero results
 * while we're in flex mode. Uses the suggested chips inline so the
 * guest can pivot in one click. */
.hrtk-fs-empty:not(#\9):not(#\9) {
  padding: 32px 24px;
  text-align: center;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  margin: 16px 0;
}

.hrtk-fs-empty-title:not(#\9):not(#\9) {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 6px;
  color: #111827;
}

.hrtk-fs-empty-subtitle:not(#\9):not(#\9) {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 16px;
}

.hrtk-fs-empty-chips:not(#\9):not(#\9) {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hrtk-fs-empty-chip:not(#\9):not(#\9) {
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  color: inherit;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hrtk-fs-empty-chip:hover:not(#\9):not(#\9) {
  border-color: #2c5282;
  background: #f0f5fa;
}

/* Availability-checked chip (#605): a range Central confirmed bookable. */
.hrtk-fs-empty-chip.is-available:not(#\9):not(#\9) {
  border-color: #86b98a;
}

.hrtk-fs-empty-chip.is-available:not(#\9):not(#\9)::before {
  content: "✓ ";
  color: #2f7c3f;
  font-weight: 600;
}

/* "Dates adjusted" notice above the results grid after an empty-state
   chip pivot (#605). Sits OUTSIDE .hrtk-fs-empty, so it styles itself. */
.hrtk-fs-adjusted-notice:not(#\9):not(#\9) {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #bfdbc4;
  border-radius: 12px;
  background: #f2faf3;
  padding: 14px 16px;
  margin: 0 0 16px;
  box-sizing: border-box;
}

.hrtk-fs-adjusted-notice-main:not(#\9):not(#\9) {
  flex: 1 1 auto;
  min-width: 0;
}

.hrtk-fs-adjusted-notice-text:not(#\9):not(#\9) {
  margin: 0;
  font-size: 14px;
  color: #1f2937;
}

.hrtk-fs-adjusted-notice-dismiss:not(#\9):not(#\9) {
  flex: 0 0 auto;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  color: #6b7280;
}

.hrtk-fs-adjusted-notice-dismiss:hover:not(#\9):not(#\9) {
  color: #111827;
}

.hrtk-fs-adjusted-notice-alts:not(#\9):not(#\9) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.hrtk-fs-adjusted-notice-alts-heading:not(#\9):not(#\9) {
  font-size: 13px;
  color: #4b5563;
}

/* Admin settings */
.hrtk-flexible-search-stay-lengths:not(#\9):not(#\9) {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 4px;
}

.hrtk-flexible-search-stay-length-row:not(#\9):not(#\9) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hrtk-flexible-search-months-ahead:not(#\9):not(#\9) {
  width: 80px;
}

.hrtk-flexible-search-status:not(#\9):not(#\9) {
  margin-left: 12px;
  color: #4b7c2f;
  font-size: 13px;
}
