/* Bill Luke Customs — catalog search (pairs with blc-search.js)
   Uses the catalog tokens when present (--accent, --bg-card, --border, --text, --muted) with safe fallbacks. */
.blcs {
  --blcs-accent: var(--accent, #E07A2E);
  --blcs-bg: var(--bg, #121417);
  --blcs-card: var(--bg-card, #1e242c);
  --blcs-elev: var(--bg-elev, #181c22);
  --blcs-border: var(--border, #2c333d);
  --blcs-text: var(--text, #f2f4f6);
  --blcs-muted: var(--muted, #9aa3af);
  position: relative; flex: 1 1 260px; min-width: 0; max-width: 440px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--blcs-text);
}
.blcs *, .blcs *::before, .blcs *::after { box-sizing: border-box; }
.blcs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Field */
.blcs-field {
  display: flex; align-items: center; gap: .55rem; height: 44px; padding: 0 .55rem 0 .9rem; margin: 0;
  background: rgba(18,20,23,.78); border: 1px solid rgba(255,255,255,.16); border-radius: 999px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; cursor: text;
}
.blcs-field:hover { border-color: rgba(255,255,255,.28); }
.blcs-field:focus-within { border-color: var(--blcs-accent); background: rgba(18,20,23,.94); box-shadow: 0 0 0 3px rgba(224,122,46,.22); }
.blcs-icon { width: 18px; height: 18px; flex: 0 0 18px; color: var(--blcs-accent); }
.blcs-input {
  flex: 1 1 auto; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--blcs-text);
  font: 500 16px/1.2 Inter, system-ui, sans-serif; /* 16px keeps iOS from zooming */
  -webkit-appearance: none; appearance: none;
}
.blcs-input::placeholder { color: rgba(242,244,246,.55); }
.blcs-input::-webkit-search-cancel-button, .blcs-input::-webkit-search-decoration { -webkit-appearance: none; }
.blcs-kbd {
  flex: 0 0 auto; font: 600 .72rem/1 Inter, sans-serif; color: var(--blcs-muted); border: 1px solid var(--blcs-border);
  border-radius: 6px; padding: .22rem .42rem;
}
.blcs-field:focus-within .blcs-kbd { display: none; }
.blcs-clear {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08);
  color: var(--blcs-text); font-size: 1.15rem; line-height: 1; cursor: pointer;
}
.blcs-clear:hover { background: rgba(255,255,255,.16); }
.blcs-clear[hidden] { display: none; }

/* Results panel — floats over the page, so opening it never shifts layout */
.blcs-panel {
  position: fixed; z-index: 1200; top: var(--blcs-sheet-top, 80px); left: 50%;
  width: min(1120px, calc(100vw - 32px)); margin-left: max(-560px, calc(16px - 50vw));
  max-height: min(calc(100vh - var(--blcs-sheet-top, 80px) - 16px), 820px); overflow: auto; overscroll-behavior: contain;
  background: var(--blcs-elev); border: 1px solid var(--blcs-border); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55); padding: .9rem .9rem 1.1rem;
  opacity: 0; transform: translateY(-6px); transition: opacity .16s ease, transform .16s ease;
}
.blcs-panel.is-in { opacity: 1; transform: none; }
.blcs-panel[hidden] { display: none; }
.blcs-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: 0 .2rem .7rem; border-bottom: 1px solid var(--blcs-border); margin-bottom: .85rem;
}
.blcs-status { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .82rem; color: var(--blcs-muted); min-width: 0; }
.blcs-status > span:first-child {
  font-family: "Bebas Neue", Impact, sans-serif; font-size: 1.15rem; letter-spacing: .04em; color: var(--blcs-text);
}
.blcs-vehicle strong { color: var(--blcs-accent); font-weight: 600; }
.blcs-linkbtn { background: none; border: 0; padding: 0; color: var(--blcs-accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.blcs-close {
  flex: 0 0 auto; background: transparent; border: 1px solid var(--blcs-border); color: var(--blcs-text);
  border-radius: 999px; padding: .35rem .8rem; font: 600 .78rem/1 Inter, sans-serif; cursor: pointer;
}
.blcs-close:hover { border-color: var(--blcs-accent); }

/* Cards — same language as the catalog's logo/model cards */
.blcs-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); }
.blcs-grid > li { min-width: 0; }
.blcs-card {
  display: flex; flex-direction: column; width: 100%; height: 100%; text-align: left; padding: 0; margin: 0; cursor: pointer;
  background: #171b21; border: 1px solid var(--blcs-border); border-radius: 12px; overflow: hidden; color: inherit; font: inherit;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.blcs-card:hover, .blcs-card[aria-selected="true"] { border-color: var(--blcs-accent); box-shadow: 0 10px 28px rgba(0,0,0,.3); transform: translateY(-2px); }
.blcs-card:focus-visible { outline: 2px solid var(--blcs-accent); outline-offset: 2px; }
.blcs-card-media {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; width: 100%;
  background: radial-gradient(120% 90% at 50% 40%, #222a33 0%, #14181d 70%); padding: .7rem;
}
.blcs-card-media img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.blcs-card-media img.is-logo { max-width: 72%; max-height: 52%; }
.blcs-card--style .blcs-card-media { padding: 0; }
.blcs-card--style .blcs-card-media img:not(.is-logo) { width: 100%; height: 100%; object-fit: cover; max-height: none; }
.blcs-noimg { font: 400 2.6rem/1 "Bebas Neue", Impact, sans-serif; color: rgba(224,122,46,.55); }
.blcs-card-body { display: flex; flex-direction: column; gap: .22rem; padding: .7rem .8rem .85rem; min-width: 0; }
.blcs-eyebrow { font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--blcs-accent); }
.blcs-card-title {
  font-family: "Bebas Neue", Impact, sans-serif; font-size: 1.32rem; line-height: 1.02; letter-spacing: .02em; color: var(--blcs-text);
  overflow-wrap: anywhere;
}
.blcs-card-brand { font-size: .78rem; font-weight: 600; color: rgba(242,244,246,.78); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blcs-card-text {
  font-size: .8rem; line-height: 1.4; color: var(--blcs-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Empty state */
.blcs-empty { display: flex; flex-direction: column; align-items: center; gap: .7rem; text-align: center; padding: 1.6rem .8rem 1rem; color: var(--blcs-muted); font-size: .9rem; }
.blcs-empty[hidden] { display: none; }
.blcs-empty-title { font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; font-size: 1.7rem; letter-spacing: .03em; color: var(--blcs-text); }
.blcs-empty > span { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .45rem; }
.blcs-chip {
  background: rgba(224,122,46,.12); border: 1px solid rgba(224,122,46,.45); color: var(--blcs-text);
  border-radius: 999px; padding: .32rem .75rem; font: 600 .8rem/1 Inter, sans-serif; cursor: pointer;
}
.blcs-chip:hover { background: rgba(224,122,46,.24); }
.blcs-empty-cta { color: #111; background: var(--blcs-accent); border-radius: 999px; padding: .55rem 1.05rem; font-weight: 700; text-decoration: none; font-size: .86rem; }

/* Brand-card highlight when a brand result scrolls into view */
.blcs-flash { outline: 2px solid var(--accent, #E07A2E); outline-offset: 3px; transition: outline-color 1.4s ease; }

/* Phones: field goes full width under the nav; results become a sheet pinned below the field */
@media (max-width: 720px) {
  .blcs { flex: 1 1 100%; max-width: none; width: 100%; order: 3; }
  .blcs-field { height: 46px; }
  .blcs-kbd { display: none; }
  .blcs-panel {
    left: 8px; right: 8px; width: auto; margin-left: 0;
    max-height: calc(100dvh - var(--blcs-sheet-top, 120px) - 8px); padding: .75rem .7rem 1rem; border-radius: 14px;
  }
  .blcs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .blcs-card-title { font-size: 1.12rem; }
  .blcs-card-text { display: none; }
  .blcs-card-body { padding: .55rem .6rem .7rem; }
}
@media (max-width: 340px) { .blcs-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .blcs-panel, .blcs-card, .blcs-field, .blcs-flash { transition: none !important; }
  .blcs-panel { transform: none; }
  .blcs-card:hover, .blcs-card[aria-selected="true"] { transform: none; }
}


/* Compact contact CTA inside search no-results */
.blcs-empty .blc-need-help--search {
  width: 100%;
  max-width: 28rem;
  margin: .55rem 0 0;
  padding: 1rem .85rem 1.1rem;
  box-sizing: border-box;
  background: transparent;
  border: 1px solid rgba(224,122,46,.35);
  border-radius: 14px;
}
.blcs-empty .blc-need-help-title {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-weight: 400;
  font-size: 1.45rem;
  letter-spacing: .04em;
  line-height: 1.1;
  color: var(--blcs-text, #f2f4f6);
  margin: 0 0 .25rem;
}
.blcs-empty .blc-need-help-sub {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: .08em;
  color: #E07A2E;
  margin: 0 0 .45rem;
}
.blcs-empty .blc-need-help-copy {
  margin: 0 auto .8rem;
  color: var(--blcs-muted);
  font-size: .86rem;
  line-height: 1.45;
  max-width: 26rem;
}
.blcs-empty .blc-need-help-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
}
.blcs-empty .blc-need-help-actions .btn,
.blcs-empty .blc-need-help-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: .5rem .9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .84rem;
  text-decoration: none;
  box-shadow: none;
  max-width: 100%;
}
.blcs-empty .blc-need-help-actions .btn-primary {
  background: #E07A2E;
  color: #111;
  border: 1px solid #E07A2E;
}
.blcs-empty .blc-need-help-outline {
  background: transparent;
  color: #E07A2E;
  border: 1px solid #E07A2E;
}
.blcs-empty .blc-need-help-outline:hover {
  background: #E07A2E;
  color: #111;
}
@media (max-width: 560px) {
  .blcs-empty .blc-need-help-actions .btn,
  .blcs-empty .blc-need-help-outline { flex: 1 1 100%; width: 100%; }
}
html[data-theme="day"] .blcs-empty .blc-need-help-title { color: var(--text, #1a1d21); }
html[data-theme="day"] .blcs-empty .blc-need-help--search {
  background: #fff;
  border-color: var(--border, #d4cfc6);
}
html[data-theme="day"] .blcs-empty .blc-need-help-outline {
  background: #fff;
  color: var(--text, #1a1d21);
}
html[data-theme="day"] .blcs-empty .blc-need-help-outline:hover {
  background: #E07A2E;
  color: #1a120c;
}
