/* ============================================================================
   lq-search.css — halfway.travel first-party search widget (round 18).
   Companion to assets/js/lq-search.js. Uses the Paper Route tokens declared
   on :root by site.css (--paper, --card, --ink, --ink-soft, --line, --terra,
   --terra-deep, --olive, --serif, --sans). English LTR. Mobile-first.
   ========================================================================== */

/* ---------- outer chrome (emitted by lib/kayak.js searchSlotHtml callers) -- */
.lq-sbx {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 22px 0;
}
.lq-sbx-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.lq-sbx-head h2 { margin: 0; font-size: 1.15rem; }
.lq-sbx .kyk-disc { margin: 10px 0 0; font-size: 0.8rem; color: var(--ink-soft); }

.lq-sbx--town {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-style: dashed;
}
.lq-sbx--town .lq-sbx-head h2 { font-size: 0.95rem; }
.lq-sbx--town .lq-sbx-head { margin-bottom: 8px; }
.lq-sbx--town .kyk-disc { font-size: 0.72rem; margin-top: 6px; }

@media print { .lq-sbx, .lq-search { display: none !important; } }

/* ---------- widget body ---------- */
.lq-search { position: relative; }
.lq { margin: 0; }

.lq-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.lq-tab {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink-soft);
  cursor: pointer;
}
.lq-tab:hover { color: var(--terra-deep); border-color: var(--terra); }
.lq-tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ---------- fields row ---------- */
.lq-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 720px) {
  .lq-row { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .lq-field, .lq-dates { flex: 1 1 200px; }
  .lq-field--guests { flex: 0 0 150px; }
}
.lq-field { position: relative; min-width: 0; margin: 0; }
.lq-flabel {
  display: block;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin: 0 0 4px;
}
.lq-fbox {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: text;
}
.lq-fbox:hover { border-color: var(--ink-soft); }
.lq-fbox.is-err, .lq-finput.is-err { border-color: var(--bad, #A03030); }
.lq-finput {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  outline: none;
  padding: 0;
}
.lq-finput::placeholder { font-weight: 400; color: var(--ink-soft); }
.lq-fbox--static { cursor: default; }
button.lq-fbox { cursor: pointer; text-align: left; }

.lq-swap {
  align-self: flex-end;
  flex: 0 0 auto;
  width: 40px;
  height: 44px;
  margin-bottom: 1px;
  font-size: 1rem;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.lq-swap:hover { color: var(--terra-deep); border-color: var(--terra); }

/* dates pair */
.lq-dates { display: flex; flex-wrap: wrap; gap: 12px; }
.lq-dates .lq-field { flex: 1 1 120px; }
.lq-dbtn .lq-dbtn-v { color: var(--ink); }
.lq-dbtn .lq-dbtn-v:not(.has) { color: var(--ink-soft); font-weight: 400; }
.lq-oneway {
  display: flex;
  align-items: center;
  gap: 7px;
  align-self: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  margin: 0 0 4px;
}

/* ---------- dropdown listbox ---------- */
.lq-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 300px;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(34, 28, 20, 0.14);
  padding: 6px;
}
.lq-opt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.lq-opt.is-active, .lq-opt:hover { background: var(--olive-soft); }
.lq-opt-main { font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.lq-opt-sub { font-size: 0.78rem; color: var(--ink-soft); }
.lq-drop-none {
  padding: 10px 12px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ---------- guests popover ---------- */
.lq-gbtn { justify-content: space-between; }
.lq-gbtn::after {
  content: "▾";
  color: var(--ink-soft);
  font-size: 0.8em;
}
.lq-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: 220px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(34, 28, 20, 0.14);
  padding: 12px 14px;
}
.lq-pop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  font-weight: 600;
}
.lq-pop-ctl { display: inline-flex; align-items: center; gap: 10px; }
.lq-step {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 1.05rem;
  cursor: pointer;
}
.lq-step:hover:not(:disabled) { border-color: var(--terra); color: var(--terra-deep); }
.lq-step:disabled { opacity: 0.35; cursor: default; }
.lq-step-n { min-width: 18px; text-align: center; font-weight: 700; }
.lq-pop-note { margin: 8px 0 0; font-size: 0.76rem; color: var(--ink-soft); }

/* ---------- calendar ---------- */
.lq-calpanel {
  position: relative;
  z-index: 20;
  flex-basis: 100%;
  display: flex;
  justify-content: center;
}
.lq-cal {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(34, 28, 20, 0.14);
  padding: 12px 14px 10px;
}
.lq-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.lq-cal-title { font-family: var(--serif); font-weight: 600; font-size: 1rem; }
.lq-cal-nav {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
}
.lq-cal-nav:hover:not(:disabled) { border-color: var(--terra); color: var(--terra-deep); }
.lq-cal-nav:disabled { opacity: 0.3; cursor: default; }
.lq-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.lq-cal-dow {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 4px 0;
}
.lq-cal-day {
  font: inherit;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  padding: 9px 0;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}
.lq-cal-day:hover:not(:disabled) { background: var(--olive-soft); }
.lq-cal-day.is-past { color: var(--line); cursor: default; }
.lq-cal-day.is-off { visibility: hidden; }
.lq-cal-day.is-in { background: var(--olive-soft); border-radius: 0; }
.lq-cal-day.is-edge { background: var(--terra); color: var(--card); font-weight: 700; }
.lq-cal-day.is-edge:hover:not(:disabled) { background: var(--terra-deep); }
.lq-cal-hint {
  margin: 8px 0 0;
  font-size: 0.76rem;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- footer / submit ---------- */
.lq-foot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 14px;
}
@media (min-width: 720px) {
  .lq-foot { flex-direction: row; align-items: center; justify-content: flex-end; }
}
.lq-go {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  min-height: 48px;
  padding: 10px 34px;
  border: 1px solid var(--terra-deep);
  border-radius: 10px;
  background: var(--terra);
  color: #FFFDF7;
  cursor: pointer;
}
.lq-go:hover { background: var(--terra-deep); }
.lq-go:disabled { opacity: 0.7; cursor: default; }
.lq-err { margin: 0; font-size: 0.8rem; font-weight: 600; color: var(--bad, #A03030); }
@media (min-width: 720px) { .lq-err { margin-right: auto; } }

/* ---------- compact town variant inside cards ---------- */
.lq-sbx--town .lq-tab { padding: 6px 14px; font-size: 0.8rem; }
.lq-sbx--town .lq-go { min-height: 44px; padding: 8px 26px; }
.lq-sbx--town .lq-cal { max-width: 310px; }
@media (max-width: 480px) {
  .card.town .lq-sbx--town { margin-left: -16px; margin-right: -16px; }
}

/* reduced motion: nothing animates anyway — respect it */
@media (prefers-reduced-motion: reduce) {
  .lq * { transition: none !important; animation: none !important; }
}
