/* ==========================================================================
   tell-equipment-product-search-20260917.css
   Advanced product/parts search bar — sits directly beneath the site header.

   COLOR DIVIDE RULE (Nisso, 2026-09-09 — mandatory business-wide):
     SALES  (Zach)  = BLUE  #0f3fa8
     REPAIRS(Brady) = RED   #af1314
   Every result is colour-coded to its division so a customer instantly knows
   whether they are looking at the blue team or the red team.
   ========================================================================== */

:root {
  --ps-sales: #0f3fa8;
  --ps-repair: #af1314;
  --ps-navy: #09225c;
  --ps-line: #d8dde2;
  --ps-ink: #071638;
  --ps-steel: #5a6b7d;
  --ps-radius: 10px;
  --ps-shadow: 0 18px 44px rgba(7, 22, 56, .16);
}

/* ---------- band ---------- */
.product-search-band {
  background: linear-gradient(180deg, #fbfcfe 0%, #f2f5f9 100%);
  border-bottom: 1px solid var(--ps-line);
  padding: 18px 20px 20px;
  position: relative;
  z-index: 900;
}

.product-search-inner {
  max-width: 1180px;
  margin: 0 auto;
}

/* The two division colours meet in the middle — the divide, made visible. */
.product-search-band::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--ps-sales) 0%, var(--ps-sales) 50%,
    var(--ps-repair) 50%, var(--ps-repair) 100%);
}

.ps-label {
  display: block;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ps-steel);
  font-weight: 700;
  margin-bottom: 7px;
}

/* ---------- input ---------- */
.ps-field {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid var(--ps-line);
  border-radius: var(--ps-radius);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.ps-field:focus-within {
  border-color: var(--ps-navy);
  box-shadow: 0 0 0 4px rgba(15, 63, 168, .12);
}

.ps-icon {
  width: 20px;
  height: 20px;
  margin-left: 14px;
  flex: 0 0 auto;
  color: var(--ps-steel);
}

#product-search-input {
  flex: 1 1 auto;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px; /* 16px minimum — prevents iOS zoom-on-focus */
  color: var(--ps-ink);
  padding: 14px 12px;
  min-width: 0;
}

#product-search-input::placeholder { color: #93a1b0; }

.ps-clear {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--ps-steel);
  padding: 0 14px;
  display: none;
}
.ps-clear:hover { color: var(--ps-ink); }
.ps-field.has-value .ps-clear { display: block; }

/* ---------- filter chips ---------- */
.ps-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.ps-chip {
  border: 1.5px solid var(--ps-line);
  background: #fff;
  color: var(--ps-steel);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s ease;
  /* 44px is the WCAG 2.2 / iOS-HIG minimum touch target. Nisso tests on a
     Galaxy S8 Ultra, so chips must be thumb-sized, not 34px. */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.ps-chip:hover { border-color: var(--ps-steel); color: var(--ps-ink); }

.ps-chip[aria-pressed="true"] {
  background: var(--ps-navy);
  border-color: var(--ps-navy);
  color: #fff;
}
/* Division chips carry their own team colour when active. */
.ps-chip[data-filter="sales"][aria-pressed="true"] {
  background: var(--ps-sales); border-color: var(--ps-sales);
}
.ps-chip[data-filter="repairs"][aria-pressed="true"] {
  background: var(--ps-repair); border-color: var(--ps-repair);
}

/* ---------- results ---------- */
.ps-results {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--ps-line);
  border-radius: var(--ps-radius);
  box-shadow: var(--ps-shadow);
  max-height: min(70vh, 560px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: none;
  z-index: 950;
}
.ps-results.open { display: block; }

.ps-result {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #eef1f5;
  text-decoration: none;
  color: inherit;
  border-left: 4px solid transparent;
}
.ps-result:last-child { border-bottom: 0; }
.ps-result:hover,
.ps-result.active { background: #f5f8fc; }

/* The colour divide, applied per result. */
.ps-result[data-division="blue"] { border-left-color: var(--ps-sales); }
.ps-result[data-division="red"]  { border-left-color: var(--ps-repair); }

.ps-r-main { flex: 1 1 auto; min-width: 0; }

.ps-r-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--ps-ink);
  margin: 0 0 2px;
}
.ps-r-name mark {
  background: #fff3b0;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

.ps-r-meta {
  font-size: 12.5px;
  color: var(--ps-steel);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.ps-r-brand { font-weight: 600; }
.ps-r-sep { opacity: .45; }

.ps-r-badge {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 4px;
  color: #fff;
  white-space: nowrap;
}
.ps-r-badge[data-division="blue"] { background: var(--ps-sales); }
.ps-r-badge[data-division="red"]  { background: var(--ps-repair); }

.ps-pn {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  background: #eef2f7;
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--ps-navy);
}

.ps-empty {
  padding: 26px 18px;
  text-align: center;
  color: var(--ps-steel);
  font-size: 14px;
}
.ps-empty strong { color: var(--ps-ink); display: block; margin-bottom: 8px; }
.ps-empty a { color: var(--ps-sales); font-weight: 600; }

.ps-foot {
  padding: 9px 16px;
  font-size: 11.5px;
  color: var(--ps-steel);
  background: #fafbfd;
  border-top: 1px solid #eef1f5;
  display: flex;
  justify-content: space-between;
}

/* ---------- responsive ----------
   Verified widths (Nisso's standard test matrix):
   375 / 430 / 820 / 1140 / 1440 / 1920 — zero horizontal overflow at each. */
@media (max-width: 900px) {
  .product-search-band { padding: 14px 14px 16px; }
  .ps-filters { gap: 6px; }
  .ps-chip { padding: 6px 12px; font-size: 12.5px; min-height: 44px; }
}

@media (max-width: 560px) {
  .ps-label { font-size: 10px; }
  #product-search-input { padding: 12px 10px; }
  /* Horizontal chip rail — never wraps into a cramped stack on a phone. */
  .ps-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .ps-filters::-webkit-scrollbar { display: none; }
  .ps-chip { flex: 0 0 auto; }
  .ps-results { max-height: 62vh; }
  .ps-r-badge { display: none; } /* colour bar already conveys the division */
}

@media (prefers-reduced-motion: reduce) {
  .ps-field, .ps-chip { transition: none; }
}
