/* ─────────────────────────────
   HEADER-SEARCH.CSS — Lo Castro header search
   wp-content/themes/twentytwentyfive-child/styles/header-search.css

   Everything search-related in one file: the desktop icon toggle, the
   expandable bar itself, and the live-suggestions results panel.
   Desktop results render as a tightly-packed 3-column grid (12 items,
   .lc-header-search-results); mobile results stay a single-column row
   list (.lc-mobile-menu-search-results) since that class only exists
   inside the drawer. Loaded site-wide (functions.php), same reasoning
   as mobile-menu.css.
   ───────────────────────────── */

/* ── Desktop icon + expandable bar ── */
.lc-header-search-toggle {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  /* Icon colour, not text: matches the other header icons, which are
     <img> SVGs and can't inherit the (brown) header text colour. */
  color: #111;
}

.lc-header-search-toggle svg {
  width: 20px;
  height: 20px;
}

.lc-header-search-bar {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  border-top: 1px solid transparent;
}

.lc-header-search-bar.is-open {
  max-height: 90vh;
  opacity: 1;
  border-top-color: rgba(0, 0, 0, 0.08);
}

.lc-header-search-form {
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--lc-border-default);
}

.lc-header-search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--lc-font-serif);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--lc-text);
}

.lc-header-search-submit {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--lc-text);
  opacity: 0.75;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.15s ease;
}

.lc-header-search-submit:hover {
  opacity: 1;
}

.lc-header-search-submit svg {
  width: 18px;
  height: 18px;
}

/* ── Shared row styling — base is the mobile-style stacked list (used
   as-is by .lc-mobile-menu-search-results, and overridden into a
   tightly-packed grid below for .lc-header-search-results) ── */

/* Toggled via JS adding/removing .is-visible, NOT the `hidden`
   attribute — something on this site was preventing [hidden] from
   reliably hiding this element even when the JS logic was correct.
   !important here + the matching inline style.display the JS also
   sets (see header-search.js) belt-and-suspenders this against any
   other rule on the site winning the specificity fight. */
.lc-search-results-empty {
  display: none !important;
  padding: 18px 4px;
  font-size: 13px;
  opacity: 0.6;
  font-family: var(--lc-font-serif);
}

.lc-search-results-empty.is-visible {
  display: block !important;
}

.lc-search-results-list {
  display: grid;
  gap: 2px;
}

.lc-search-results-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px;
  text-decoration: none;
  color: var(--lc-text);
  border-bottom: 1px solid var(--lc-border-subtle);
  transition: opacity 0.15s ease;
}

.lc-search-results-row:hover {
  opacity: 0.65;
}

.lc-search-results-row-media {
  flex: none;
  width: 52px;
  height: 52px;
  overflow: hidden;
  background: var(--lc-surface);
}

.lc-search-results-row-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lc-search-results-row-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lc-search-results-row-name {
  font-family: var(--lc-font-serif);
  font-size: 13px;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lc-search-results-row-price {
  font-family: var(--lc-font-serif);
  font-size: 12px;
  opacity: 0.65;
}

/* ── Desktop: 3-column grid, 12 items, tightly packed edge-to-edge
   (no gap between cells — a shared border creates the only
   separation), with larger 80px thumbnails. This selector only exists
   in the desktop expandable bar, so no media query is needed to keep
   it off mobile — .lc-mobile-menu-search-results is a separate class
   entirely. ── */
.lc-header-search-results {
  margin: 0 auto;
  padding: 0 20px 26px;
  max-height: 75vh;
  overflow-y: auto;
}

.lc-header-search-results[hidden] {
  display: none;
}

.lc-header-search-results .lc-search-results-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--lc-border-subtle);
  border-left: 1px solid var(--lc-border-subtle);
}

.lc-header-search-results .lc-search-results-row {
  border-bottom: 1px solid var(--lc-border-subtle);
  border-right: 1px solid var(--lc-border-subtle);
  padding: 14px;
}

.lc-header-search-results .lc-search-results-row-media {
  width: 80px;
  height: 80px;
}

.lc-header-search-results .lc-search-results-row-name {
  width: 100%;
}

/* ── Mobile: inline within the drawer, single-column list, no
   special positioning needed since the drawer itself already
   scrolls ── */
.lc-mobile-menu-search-results {
  padding: 14px 4px 20px;
}

.lc-mobile-menu-search-results[hidden] {
  display: none;
}