/*
 * The truck landing family's search card — two mode tabs, dropdown fields,
 * the Route and From panels (PRD-20 sections 4.2, 4.12, 5.2, 5.10).
 * Shared by /truck-repair/ and /reserve-truck-parking/: the canvas draws both
 * cards from the same parts (S5 `.lp4-card`, `.tps-field-btn`, `.lp7-rp`,
 * `.lp8-*`, round 7 of 2026-11-16).
 *
 * THE FIELD ANATOMY UNDER IT IS SERVICES'. `.tp-services-search` and its
 * `__field`/`__label`/`__button` come from services.css, consumed inside
 * `.tp-services-page`; this file adds the tabs, the field button that replaces
 * the native select, and the panels. Every selector is inside
 * `.tp-truck-landing`. Colours are --tpl-* roles, type sizes integer roles;
 * the canvas's 11px and 15px are 12px and 16px here (docs/truck-landing-pages.md
 * section 6, D9).
 */

.tp-truck-landing .tp-tl-search-card {
  position: relative;
  border-radius: 12px;
  background: var(--tpl-white);
  box-shadow: 0 0 0 6px var(--tpl-on-dark-surface), 0 24px 60px rgba(0, 0, 0, 0.42);
}

/* ---------------------------------------------------------------- Tabs ---- */

.tp-truck-landing .tp-tl-modes {
  display: flex;
  gap: 28px;
  padding: 12px 34px 0;
  border-bottom: 1px solid var(--tpl-line-soft);
}

.tp-truck-landing .tp-tl-mode {
  display: inline-flex;
  height: 46px;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--tpl-ink-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: color 150ms ease, border-color 150ms ease;
}

.tp-truck-landing .tp-tl-mode .tp-site-icon {
  width: 18px;
  height: 18px;
  color: var(--tpl-ink-disabled);
  transition: color 150ms ease;
}

.tp-truck-landing .tp-tl-mode:hover {
  color: var(--tpl-ink);
}

.tp-truck-landing .tp-tl-mode:hover .tp-site-icon {
  color: var(--tpl-ink-muted);
}

.tp-truck-landing .tp-tl-mode.is-on {
  border-bottom-color: var(--tpl-blue);
  color: var(--tpl-blue);
  font-weight: 600;
}

.tp-truck-landing .tp-tl-mode.is-on .tp-site-icon {
  color: var(--tpl-blue);
}

.tp-truck-landing .tp-tl-mode:focus-visible {
  outline: 2px solid var(--tpl-blue);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- Form ---- */

.tp-truck-landing .tp-services-page .tp-tl-search {
  position: relative;
  grid-template-columns: 1.5fr 0.9fr 0.9fr 1.1fr auto;
  border-radius: 0 0 12px 12px;
  background: transparent;
  box-shadow: none;
}

.tp-truck-landing .tp-services-page .tp-tl-search_highway {
  grid-template-columns: 1.2fr 1.3fr 1.4fr auto;
}

/* services.css gives the form `display: grid`, which outranks [hidden]. */
.tp-truck-landing .tp-services-page .tp-tl-search[hidden] {
  display: none;
}

.tp-truck-landing .tp-services-page .tp-tl-search .tp-services-search__field {
  padding: 6px 20px;
}

/* The Check-in field and its date input share one grid cell. */
.tp-truck-landing .tp-tl-field-wrap {
  position: relative;
  display: flex;
  min-width: 0;
}

.tp-truck-landing .tp-tl-field-wrap > .tp-services-search__field {
  flex: 1 1 auto;
}

/* Opened with showPicker(); never seen. */
.tp-truck-landing .tp-tl-date {
  position: absolute;
  bottom: 12px;
  left: 20px;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* The field's value: a button where the canvas has `.tps-field-btn`. */
.tp-truck-landing .tp-tl-field__btn {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tpl-ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 20px;
  font-weight: 500;
  line-height: 30px;
  text-align: left;
}

.tp-truck-landing .tp-tl-field__btn:focus-visible {
  outline: 2px solid var(--tpl-blue);
  outline-offset: 2px;
}

.tp-truck-landing .tp-tl-field__text {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tp-truck-landing .tp-tl-field__text.is-ph {
  color: var(--tpl-ink-soft);
  font-weight: 400;
}

.tp-truck-landing .tp-tl-field__chev {
  display: inline-flex;
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--tpl-ink-muted);
  transition: transform 160ms ease;
}

.tp-truck-landing .tp-tl-field__btn[aria-expanded="true"] .tp-tl-field__chev {
  transform: rotate(180deg);
}

/* The Where box's suggestions, as the canvas sizes them on this card. Like
   every panel below, it starts at the field's text edge — the field's 20px
   padding — not at the box edge (canvas 2026-11-17). */
.tp-truck-landing .tp-services-page .tp-tl-search .tp-services-search__field--where .tp-services-suggest {
  top: calc(100% + 8px);
  left: 20px;
  width: 420px;
}

/* --------------------------------------------------------------- Panels ---- */

.tp-truck-landing .tp-tl-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 20px;
  min-width: 240px;
  box-sizing: border-box;
  padding: 6px;
  border: 1px solid rgba(1, 25, 50, 0.08);
  border-radius: 12px;
  background: var(--tpl-white);
  box-shadow: 0 16px 40px rgba(1, 25, 50, 0.24);
  text-align: left;
}

.tp-truck-landing .tp-tl-panel[hidden] {
  display: none;
}

/* A Stay tier no lot in range sells is left out (reserve.js). */
.tp-truck-landing .tp-tl-opt[hidden] {
  display: none;
}

.tp-truck-landing .tp-tl-opt {
  display: flex;
  width: 100%;
  height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--tpl-ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  text-align: left;
  white-space: nowrap;
  transition: background-color 120ms ease;
}

.tp-truck-landing .tp-tl-opt:hover,
.tp-truck-landing .tp-tl-opt:focus-visible {
  outline: none;
  background: var(--tpl-surface-alt);
}

.tp-truck-landing .tp-tl-opt .tp-site-icon {
  visibility: hidden;
  color: var(--tpl-blue);
}

.tp-truck-landing .tp-tl-opt[aria-selected="true"] {
  color: var(--tpl-blue);
  font-weight: 600;
}

.tp-truck-landing .tp-tl-opt[aria-selected="true"] .tp-site-icon {
  visibility: visible;
}

/* Route and From: the canvas's `.lp8-rp`, a search row on top. */
.tp-truck-landing .tp-tl-panel_wide,
.tp-truck-landing .tp-tl-panel_from {
  padding: 12px;
}

.tp-truck-landing .tp-tl-panel_wide {
  width: 560px;
}

.tp-truck-landing .tp-tl-panel_from {
  width: 420px;
}

.tp-truck-landing .tp-tl-panel__q {
  position: relative;
  display: flex;
  height: 52px;
  align-items: center;
  gap: 8px;
  margin: -12px -12px 8px;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--tpl-line-soft);
  color: var(--tpl-ink-muted);
}

.tp-truck-landing .tp-tl-panel__q input {
  min-width: 0;
  height: 100%;
  flex: 1 1 auto;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--tpl-ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 22px;
}

.tp-truck-landing .tp-tl-panel__q input::placeholder {
  color: var(--tpl-ink-soft);
}

.tp-truck-landing .tp-services-page .tp-tl-panel__q .tp-services-suggest {
  top: 100%;
  right: 0;
  left: 0;
  width: auto;
}

.tp-truck-landing .tp-tl-panel__h {
  margin: 4px 10px 10px;
  color: var(--tpl-ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.11em;
  line-height: 16px;
  text-transform: uppercase;
}

.tp-truck-landing .tp-tl-panel__cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 16px;
}

.tp-truck-landing .tp-tl-panel__dir {
  padding-left: 16px;
  border-left: 1px solid var(--tpl-line-soft);
}

.tp-truck-landing .tp-tl-panel__note,
.tp-truck-landing .tp-tl-panel__none {
  margin: 8px 10px;
  color: var(--tpl-ink-muted);
  font-size: 14px;
  line-height: 20px;
}

.tp-truck-landing .tp-tl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 10px 0;
}

.tp-truck-landing .tp-tl-chip {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--tpl-line-strong);
  border-radius: 4px;
  background: var(--tpl-white);
  color: var(--tpl-ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

.tp-truck-landing .tp-tl-chip[hidden] {
  display: none;
}

.tp-truck-landing .tp-tl-chip:hover {
  border-color: var(--tpl-blue);
  color: var(--tpl-blue);
}

.tp-truck-landing .tp-tl-chip[aria-pressed="true"] {
  border-color: var(--tpl-blue);
  background: var(--tpl-blue-wash);
  color: var(--tpl-blue-strong);
}

.tp-truck-landing .tp-tl-chip:focus-visible,
.tp-truck-landing .tp-tl-seg__b:focus-visible {
  outline: 2px solid var(--tpl-blue);
  outline-offset: 2px;
}

.tp-truck-landing .tp-tl-seg {
  display: flex;
  margin: 2px 10px 0;
  padding: 3px;
  border-radius: 4px;
  background: var(--tpl-surface);
}

.tp-truck-landing .tp-tl-seg__b {
  height: 34px;
  flex: 1 1 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--tpl-ink-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}

.tp-truck-landing .tp-tl-seg__b.is-on {
  background: var(--tpl-white);
  box-shadow: 0 1px 2px rgba(1, 25, 50, 0.12);
  color: var(--tpl-ink);
  font-weight: 600;
}

/* The phone sheet's backdrop: the shared modal overlay (design-system.md 4.7),
   inside the card beside the panel it sits under. The hero is lifted over the
   fixed site header (z-index 1450 at most) while a sheet is open. */
.tp-truck-landing .tp-tl-sheet-backdrop {
  position: fixed;
  z-index: 2000;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.tp-truck-landing .tp-tl-hero.is-sheet-open {
  z-index: 1500;
}

/* ------------------------------------------------------- Narrower screens ---- */

@media screen and (max-width: 1199px) {
  .tp-truck-landing .tp-services-page .tp-tl-search,
  .tp-truck-landing .tp-services-page .tp-tl-search_highway {
    grid-template-columns: 1fr 1fr;
  }

  /* From sits in the right-hand column here, and 420px from its left text
     edge would run off the card: it lines up with the right text edge
     instead. The canvas does this at its own two-column width (1099). */
  .tp-truck-landing .tp-tl-panel_from {
    right: 20px;
    left: auto;
  }
}

/* Phone: one field a row, and a panel is a sheet from the bottom (the canvas's
   phone boards, State › panel). */
@media screen and (max-width: 809px) {
  .tp-truck-landing .tp-tl-modes {
    gap: 20px;
    padding: 12px 18px 0;
  }

  .tp-truck-landing .tp-services-page .tp-tl-search,
  .tp-truck-landing .tp-services-page .tp-tl-search_highway {
    grid-template-columns: minmax(0, 1fr);
  }

  .tp-truck-landing .tp-services-page .tp-tl-search .tp-services-search__field {
    padding: 14px 18px;
  }

  .tp-truck-landing .tp-tl-field__btn {
    font-size: 18px;
    line-height: 28px;
  }

  .tp-truck-landing .tp-services-page .tp-tl-search .tp-services-search__field--where .tp-services-suggest {
    width: auto;
    right: 0;
  }

  .tp-truck-landing .tp-tl-panel,
  .tp-truck-landing .tp-tl-panel_wide,
  .tp-truck-landing .tp-tl-panel_from,
  .tp-truck-landing .tp-tl-field_last .tp-tl-panel {
    position: fixed;
    z-index: 2001;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    max-height: 80vh;
    overflow-y: auto;
    padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
  }

  .tp-truck-landing .tp-tl-panel__cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .tp-truck-landing .tp-tl-panel__dir {
    padding-left: 0;
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tp-truck-landing .tp-tl-mode,
  .tp-truck-landing .tp-tl-mode .tp-site-icon,
  .tp-truck-landing .tp-tl-field__chev,
  .tp-truck-landing .tp-tl-opt,
  .tp-truck-landing .tp-tl-chip {
    transition: none;
  }
}
