/* search.css — House of Canopies header AI search panel.
   The .search row chrome lives in chrome.css; this adds the dropdown panel
   (typeahead suggestions, AI answer, product cards). Brand tokens, hairlines,
   sharp corners, green for action. */

/* the row becomes the positioning context for the dropdown */
[data-hoc-search] { position: relative; }
.hoc-search {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 14px;
  height: 54px;
}

/* panel ------------------------------------------------------------------ */
.hoc-search__panel {
  position: absolute;
  top: 100%;
  left: -8px;
  right: -8px;
  z-index: 120;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 2px solid var(--green);
  box-shadow: 0 18px 44px rgba(20, 32, 25, 0.14);
  max-height: min(72vh, 560px);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.hoc-search__panel.open { opacity: 1; transform: none; }
.hoc-search__panel[hidden] { display: none; }

/* hint / loading --------------------------------------------------------- */
.hoc-search__hint,
.hoc-search__loading {
  font-size: 12px;
  color: var(--ink-3);
  padding: 12px 16px;
  letter-spacing: 0.02em;
}
.hoc-search__hint[hidden],
.hoc-search__loading[hidden],
.hoc-search__suggest[hidden],
.hoc-search__answer[hidden],
.hoc-search__products[hidden] { display: none; }
.hoc-search__hint kbd {
  font: inherit;
  font-size: 11px;
  border: 1px solid var(--line);
  padding: 1px 6px;
  color: var(--ink-2);
}
.hoc-search__loading { display: flex; align-items: center; gap: 10px; }
.hoc-search__spin {
  width: 13px; height: 13px;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: hoc-spin 0.7s linear infinite;
}
@keyframes hoc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hoc-search__spin { animation: none; } }

/* suggestions ------------------------------------------------------------ */
.hoc-search__suggest { list-style: none; margin: 0; padding: 6px 0; }
.hoc-search__empty { font-size: 13px; color: var(--ink-3); padding: 12px 16px; }
.hoc-sugg {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  color: var(--ink);
}
.hoc-sugg:hover { background: var(--green-soft); }
.hoc-sugg__arrow { margin-left: auto; color: var(--ink-4); font-size: 14px; }
.hoc-sugg:hover .hoc-sugg__arrow { color: var(--green-text); }

/* shared thumb ----------------------------------------------------------- */
.hoc-search__thumb {
  flex: none;
  width: 40px; height: 40px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: block;
  position: relative;
  overflow: hidden;
}
.hoc-search__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hoc-sugg__body, .hoc-pcard__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hoc-sugg__title, .hoc-pcard__title {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hoc-sugg__meta, .hoc-pcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* chips (glaze/load/finish/warranty — colours from brand.css) ------------ */
.hoc-chip {
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 7px; background: var(--paper-2); color: var(--ink-2);
  border-left: 2px solid var(--ink-4);
}
.hoc-chip--glaze { border-left-color: var(--glaze); color: var(--glaze); }
.hoc-chip--load { border-left-color: var(--load); color: var(--load); }
.hoc-chip--finish { border-left-color: var(--finish); color: var(--finish); }
.hoc-chip--warranty { border-left-color: var(--warranty); color: var(--warranty); }
.hoc-search__price { font-size: 12px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.hoc-search__price small,
.hoc-search__vat { font-size: 10px; font-weight: 500; color: var(--ink-4); letter-spacing: 0.04em; }

/* AI answer -------------------------------------------------------------- */
.hoc-search__answer {
  padding: 16px 16px 14px;
  border-top: 1px solid var(--line);
  font-size: 14px; line-height: 1.6; color: var(--ink);
}
.hoc-search__answer:first-child { border-top: 0; }
.hoc-search__answer p { margin: 0 0 8px; }
.hoc-search__answer p:last-child { margin: 0; }
.hoc-search__answer strong { font-weight: 700; }

/* AI product cards ------------------------------------------------------- */
.hoc-search__products {
  padding: 6px 0 10px;
  border-top: 1px solid var(--line);
}
.hoc-pcard {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px; color: var(--ink);
}
.hoc-pcard:hover { background: var(--green-soft); }
.hoc-pcard__cta {
  margin-left: auto; flex: none;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--green-text);
}

/* dark mode: panel already uses tokens; nothing extra needed. */

@media (max-width: 900px) {
  .hoc-search__panel { left: -4px; right: -4px; }
}
