/* ============================================================
   VEHICLE HIRE search — .rh-* (green, follows rentals.html /
   verticals design). Reuses .search-dock / .field / .v-pill /
   .v-logo-card / .btn-bb. Adds the toggle dock, multi-stop
   legs and the fleet strip. Pairs with rentals-hire.js.
   ============================================================ */

/* ---- search dock (white premium card, like rentals.html) ---- */
.rh-dock {
  position: relative; z-index: 2;
  margin-top: clamp(1.1rem, 0.8rem + 1.4vw, 1.9rem);
  background: #fff; border: 1px solid var(--bb-line-soft);
  border-radius: 26px; box-shadow: var(--shadow-lg);
  padding: clamp(16px, 1rem + 1vw, 24px);
}
.rh-dock__toggles { display: flex; flex-wrap: wrap; gap: 0.9rem 2.2rem; margin-bottom: 1.1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--bb-line-soft); }
.rh-toggle { display: grid; gap: 0.45rem; }
.rh-toggle__lbl { display: inline-flex; align-items: center; gap: 0.4rem; font: 800 0.68rem var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--bb-ink-3); }
.rh-toggle__lbl .bi { color: var(--pg-accent); }
.rh-toggle .v-pills { margin: 0; }
.rh-toggle--hidden { display: none; }
a.v-pill { text-decoration: none; }

.rh-dock__grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); align-items: end; }
.field--full { grid-column: 1 / -1; }
.field__label em { color: #e5484d; font-style: normal; margin-left: 0.1rem; }

.rh-dock__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1rem; margin-top: 1.15rem; }
.rh-dock__foot .btn-bb { margin-left: auto; min-width: 210px; }
.rh-note { margin: 0; font: 700 0.85rem var(--font-body); color: var(--pg-accent-ink); }
.rh-note.is-error { color: #e5484d; }
.rh-note:empty { display: none; }

/* ---- multi-stop legs ---- */
.rh-legs { display: grid; gap: 0.9rem; }
.rh-leg { padding: 14px; border: 1.5px dashed var(--bb-line); border-radius: 18px; background: var(--bb-bg-1, #f5f9f7); }
.rh-leg__head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.75rem; }
.rh-leg__tag { display: inline-flex; align-items: center; gap: 0.4rem; font: 800 0.82rem var(--font-display); color: var(--pg-accent-ink); }
.rh-leg__tag .bi { color: var(--pg-accent); }
.rh-leg__grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); align-items: end; }
.rh-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.2rem; }
.rh-btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border: 0; border-radius: var(--r-pill); font: 800 0.8rem var(--font-display); cursor: pointer; transition: transform var(--dur-1) var(--ease-out), filter var(--dur-1) var(--ease-out); }
.rh-btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.rh-btn--del { color: #c0392b; background: #fdecea; }
.rh-btn--add { color: #fff; background: linear-gradient(135deg, var(--pg-accent), var(--pg-accent-deep)); box-shadow: 0 10px 22px -10px var(--pg-glow, rgba(0,196,140,0.5)); }

/* ---- offer / fleet note line ---- */
.rh-offer { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.rh-offer li { display: flex; gap: 0.5rem; color: var(--bb-ink-2); font: 600 0.96rem/1.55 var(--font-body); }
.rh-offer li i { color: var(--pg-accent); margin-top: 0.18rem; flex: none; }
.rh-offer li b { color: var(--bb-ink); }

/* ============================================================
   Live search dock — states the static design never had
   Added when the dock stopped being a mock-up: address
   suggestions, per-field errors, busy states and the empty
   state for a site whose rates are not set up yet.
   ============================================================ */

/* --- entrance. Fields fade in as the mode changes, so switching
   Outstation -> Local reads as the panel rearranging itself rather
   than as the page flickering. --- */
@keyframes rh-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rh-out { to { opacity: 0; transform: translateY(-6px); height: 0; margin: 0; padding: 0; } }
@keyframes rh-spin { to { transform: rotate(360deg); } }
@keyframes rh-shake { 10%, 90% { transform: translateX(-1px); } 30%, 70% { transform: translateX(2px); } 50% { transform: translateX(-2px); } }

.rh-in { animation: rh-in .28s cubic-bezier(.2, .7, .3, 1) both; }
.rh-out { animation: rh-out .18s ease forwards; overflow: hidden; }

/* --- a field that failed validation --- */
.field { position: relative; }
.field__err {
  margin: 5px 2px 0;
  min-height: 0;
  font: 600 11.5px/1.35 'Manrope', system-ui, sans-serif;
  color: #d64545;
  display: none;
}
.field.is-invalid .field__err { display: block; animation: rh-in .2s ease both; }
.field.is-invalid .field__control {
  border-color: #d64545 !important;
  background: #fff7f7;
  animation: rh-shake .3s ease both;
}
.field.is-invalid .field__icon { color: #d64545; }
.field__control:focus-visible { outline: 2px solid #00c48c; outline-offset: 1px; }

/* --- address suggestions --- */
.field__wrap { position: relative; }
.rh-ac {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 5px;
  list-style: none;
  max-height: 264px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e6e9f2;
  border-radius: 13px;
  box-shadow: 0 18px 40px -18px rgba(16, 24, 60, .35);
  animation: rh-in .16s ease both;
}
.rh-ac__item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 9px;
  cursor: pointer;
  font: 600 12.5px/1.4 'Manrope', system-ui, sans-serif;
  color: #23262e;
  transition: background .12s ease;
}
.rh-ac__item i { color: #00c48c; font-size: 13px; margin-top: 1px; flex: 0 0 auto; }
.rh-ac__item:hover, .rh-ac__item.is-active { background: #eefaf5; }
.rh-ac__msg {
  padding: 11px;
  font: 600 12.5px/1.4 'Manrope', system-ui, sans-serif;
  color: #7a8194;
}

/* --- the little spinner inside a location box while it searches --- */
.rh-ac__spin, .rh-spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rh-spin .7s linear infinite;
}
.rh-ac__spin {
  position: absolute;
  right: 12px;
  top: 50%;
  margin-top: -7px;
  border-color: rgba(0, 196, 140, .25);
  border-top-color: #00c48c;
}

/* --- the Proceed button while the route is being measured --- */
.js-rh-proceed.is-busy { opacity: .85; cursor: progress; }
.js-rh-proceed[disabled] { opacity: .55; cursor: not-allowed; }

/* --- the note under the dock --- */
.rh-note { transition: color .15s ease; }
.rh-note.is-error { color: #d64545; font-weight: 700; }
.rh-note.is-ok { color: #0f9d63; font-weight: 700; }

/* --- nothing set up yet, or the config could not be loaded --- */
.rh-empty {
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 30px 18px;
  text-align: center;
  color: #5b6172;
  font: 600 13px/1.5 'Manrope', system-ui, sans-serif;
}
.rh-empty i { font-size: 26px; color: #f0a92e; }
.rh-empty p { margin: 0; }
.rh-empty .rh-spin { border-color: rgba(0, 196, 140, .25); border-top-color: #00c48c; }

/* --- touch targets. A 44px minimum is the difference between picking an
   address and picking the one under it, on the device most of these
   searches actually come from. --- */
@media (max-width: 767.98px) {
  .rh-ac { max-height: 220px; }
  .rh-ac__item { padding: 12px 11px; min-height: 44px; }
  .field__control { min-height: 46px; }
  .rh-btn { min-height: 44px; }
  .js-rh-proceed { width: 100%; min-height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .rh-in, .rh-out, .rh-ac, .field.is-invalid .field__control { animation: none !important; }
  .rh-ac__spin, .rh-spin { animation-duration: 1.6s; }
}
