/* ═══════════════════════════════════════════════════════════════════════
   Freight Header Search Bar  —  fhsb.css  v1.1
   - Desktop: horizontal bar between nav and breadcrumb, centred
   - Mobile : hidden bar + floating FAB bottom-left → slim slide-up panel
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --fhsb-primary: #1e3a8a;
  --fhsb-accent:  #f97316;
  --fhsb-bg:      #ffffff;
  --fhsb-bg2:     #f8fafc;
  --fhsb-border:  #e2e8f0;
  --fhsb-text:    #0f172a;
  --fhsb-muted:   #64748b;
}

/* ──────────────────────────────────────────────
   Hidden host — keeps the original form markup in the DOM so the
   existing query logic can be moved into the popup unchanged.
   ────────────────────────────────────────────── */
.fhsb-bar {
  display: none !important;
}

/* Form card */
.fhsb-form {
  background: var(--fhsb-bg);
  border-radius: 14px;
  padding: 18px 22px 20px;
  box-shadow: 0 10px 32px -10px rgba(15,23,42,.35), 0 2px 6px -2px rgba(15,23,42,.18);
  position: relative;
}

.fhsb-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 1.7fr 0.8fr;
  gap: 14px;
  align-items: end;
}
.fhsb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fhsb-lbl {
  font-size: 12px;
  font-weight: 700;
  color: var(--fhsb-text);
  letter-spacing: .3px;
  text-transform: uppercase;
}
.fhsb-input, .fhsb-lwh-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--fhsb-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--fhsb-text);
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.fhsb-input:focus, .fhsb-lwh-input:focus {
  outline: none;
  border-color: var(--fhsb-primary);
  box-shadow: 0 0 0 3px rgba(30,58,138,.12);
}
select.fhsb-input { padding-right: 28px; cursor: pointer; }

.fhsb-lwh-row {
  display: grid;
  grid-template-columns: 1fr 12px 1fr 12px 1fr;
  align-items: center;
  gap: 4px;
}
.fhsb-x {
  text-align: center;
  font-weight: 700;
  color: var(--fhsb-muted);
  font-size: 13px;
}
.fhsb-lwh-input { text-align: center; padding: 0 6px; }

.fhsb-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.fhsb-modes {
  display: inline-flex;
  border: 1.5px solid var(--fhsb-border);
  border-radius: 999px;
  padding: 4px;
  background: var(--fhsb-bg2);
}
.fhsb-mode-btn {
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--fhsb-muted);
  transition: all .15s;
  font-family: inherit;
}
.fhsb-mode-btn.active {
  background: var(--fhsb-primary);
  color: #fff;
  box-shadow: 0 2px 6px -1px rgba(30,58,138,.4);
}
.fhsb-mode-btn:not(.active):hover { color: var(--fhsb-text); background: rgba(255,255,255,.6); }

.fhsb-btn {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border: 0;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 0 28px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: .4px;
  box-shadow: 0 6px 18px -6px rgba(249,115,22,.7);
  transition: transform .12s, box-shadow .15s;
  white-space: nowrap;
}
.fhsb-btn:hover:not(:disabled)  { transform: translateY(-1px); box-shadow: 0 10px 24px -6px rgba(249,115,22,.85); }
.fhsb-btn:active:not(:disabled) { transform: translateY(0); }
.fhsb-btn:disabled              { opacity: .65; cursor: progress; }

.fhsb-notice {
  margin-top: 10px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #92400e;
}
.fhsb-results { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--fhsb-border); }

/* ──────────────────────────────────────────────
   Popup launcher + panel
   ────────────────────────────────────────────── */
.fhsb-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: fixed;
  left: 14px;
  bottom: 16px;
  z-index: 998;
  padding: 10px 16px 10px 12px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #1e3a8a 0%, #f97316 130%);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 24px -6px rgba(15,23,42,.45),
              0 0 0 4px rgba(249,115,22,.18);
  cursor: pointer;
  max-width: calc(100vw - 28px);
  animation: fhsb-fab-bob 2.6s ease-in-out infinite;
}
@keyframes fhsb-fab-bob {
  0%,100% { transform: translateY(0);    }
  50%     { transform: translateY(-3px); }
}
.fhsb-fab-icon {
  font-size: 18px;
  filter: drop-shadow(0 0 6px rgba(252,211,77,.7));
}
.fhsb-fab-text  { line-height: 1.2; white-space: nowrap; }
.fhsb-fab-3s {
  display: inline-block;
  font-weight: 900;
  font-size: 19px;
  background: linear-gradient(180deg, #fde047 0%, #fb923c 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 0 2px;
}
.fhsb-fab-3s .fhsb-s { font-size: .55em; }
.fhsb-fab[aria-expanded="true"] { display: none; }

.fhsb-mobile-overlay {
  display: block;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(2px);
  z-index: 999;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.fhsb-mobile-overlay[hidden] { display: block; }
.fhsb-mobile-overlay.is-open { opacity: 1; pointer-events: auto; }

.fhsb-mobile-panel {
  display: flex;
  flex-direction: column;
  position: fixed;
  left: max(12px, calc((100vw - 980px) / 2));
  right: max(12px, calc((100vw - 980px) / 2));
  bottom: 12px;
  z-index: 1000;
  background: #fff;
  border-radius: 18px 18px 14px 14px;
  box-shadow: 0 -10px 40px -10px rgba(15,23,42,.5);
  transform: translateY(110%);
  transition: transform .25s ease-out;
  max-height: min(84vh, 860px);
  overflow: hidden;
}
.fhsb-mobile-panel[hidden] { display: flex; }
.fhsb-mobile-panel.is-open { transform: translateY(0); }

.fhsb-mobile-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
  border-radius: 18px 18px 0 0;
}
.fhsb-mobile-title { font-weight: 800; font-size: 14px; }
.fhsb-mobile-title strong {
  color: #fde047;
  font-size: 18px;
  padding: 0 2px;
}
.fhsb-mobile-close {
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.fhsb-mobile-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}
.fhsb-mobile-body .fhsb-form {
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}

@media (min-width: 881px) {
  .fhsb-mobile-body .fhsb-grid {
    grid-template-columns: 1.4fr 0.9fr 1.7fr 0.8fr;
  }
}

@media (max-width: 880px) {
  .fhsb-mobile-panel {
    left: 8px; right: 8px;
    bottom: 8px;
    max-height: 78vh;
  }
  .fhsb-mobile-body {
    padding: 16px;
  }
  .fhsb-mobile-body .fhsb-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .fhsb-mobile-body .fhsb-field-lwh { grid-column: 1 / -1; }
  .fhsb-mobile-body .fhsb-bottom { justify-content: stretch; flex-direction: column; }
  .fhsb-mobile-body .fhsb-modes  { width: 100%; justify-content: center; }
  .fhsb-mobile-body .fhsb-btn    { width: 100%; }
}

@media (max-width: 1024px) and (min-width: 881px) {
  .fhsb-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .fhsb-field-lwh { grid-column: 1 / -1; }
}

@media (max-width: 360px) {
  .fhsb-fab-text { font-size: 11.5px; }
  .fhsb-fab-3s   { font-size: 16px; }
}
