/* HealThyRam Search — layer, completions, results page. Tokens from ht-tokens.css only. */
/* The theme sets html { font-size: 62.5% } (10 px), so the rem type tokens come out 37 % too small inside our UI.
   Re-express the same type scale in px for our scope only — token names unchanged, values = the design system's px. */
.hts-panel, .hts-overlay, .hts-results { --text-h1-size: 26px; --text-h2-size: 19px; --text-h3-size: 17px; --text-body-size: 16px; --text-small-size: 14px; --text-micro-size: 12px; }
/* 16 px in the box stops iOS/Chrome from auto-zooming the page when the search box is focused */
.hts-on form.hts-form input[name="s"] { font-size: 16px !important; }
.hts-panel { position: absolute; z-index: 10010; box-sizing: border-box; background: var(--surface-card); color: var(--text-body); border: 1px solid var(--border-default); border-radius: var(--radius-default); box-shadow: var(--shadow-card-hover); font-family: var(--font-body); font-size: var(--text-small-size); line-height: 1.4; max-height: min(72vh, 640px); display: flex; flex-direction: column; overflow: hidden; text-align: left; }
.hts-panel[hidden] { display: none; }
.hts-panel__bar { display: none; }
.hts-panel__body { overflow-y: auto; padding: var(--space-2) 0 var(--space-3); -webkit-overflow-scrolling: touch; }
.hts-panel__body > * { animation: hts-in var(--duration-entrance) var(--ease-default) both; }
@keyframes hts-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hts-panel__body > * { animation: none; } }

/* phone: fixed layer under the header's search box, page dimmed below the header */
.hts-overlay { position: fixed; left: 0; right: 0; bottom: 0; top: 0; background: rgba(26, 26, 46, .22); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 10009; } /* frosted: the page stays sensed, not readable */
.hts-overlay[hidden] { display: none; }
.hts-panel--fixed { position: fixed; max-height: none; border-radius: var(--radius-default); }
.hts-panel__top { display: none; }
.hts-panel--fixed .hts-panel__top { display: flex; justify-content: flex-end; padding: 0 var(--space-2); height: 32px; }
.hts-panel__close { border: 0; background: none; font: 500 var(--text-small-size)/1 var(--font-body); color: var(--text-muted); padding: 0 var(--space-2); height: 32px; cursor: pointer; white-space: nowrap; }
.hts-lock, .hts-lock body { overflow: hidden; }

/* completions (Amazon-style) */
.hts-sugg { padding: var(--space-1) var(--space-2) 0; border-bottom: 1px solid var(--border-default); margin-bottom: var(--space-1); }
.hts-sugg__row { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 40px; padding: 0 var(--space-2); border: 0; background: none; border-radius: var(--radius-sm); font: 400 var(--text-body-size)/1.3 var(--font-body); color: var(--text-body); text-align: left; cursor: pointer; }
.hts-sugg__row:hover { background: var(--surface-tint-green); }
.hts-sugg__row b { font-weight: 600; }
.hts-sugg__ico { flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--text-muted); position: relative; opacity: .7; }
.hts-sugg__ico::after { content: ''; position: absolute; width: 2px; height: 7px; background: var(--text-muted); right: -4px; bottom: -5px; transform: rotate(-45deg); }

/* rows */
.hts-row { padding: var(--space-2) var(--space-3) 0; }
.hts-row__h { display: flex; justify-content: space-between; align-items: baseline; margin: var(--space-3) var(--space-1) var(--space-1); font: 700 var(--text-micro-size)/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ht-orange); }
.hts-row__all { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--accent-primary); text-decoration: none; }
.hts-row__all:hover { color: var(--accent-primary-hover); text-decoration: underline; }
.hts-row--pinned { background: var(--surface-tint-orange); margin: var(--space-2) var(--space-3) 0; padding: var(--space-1) var(--space-2) var(--space-2); border-radius: var(--radius-default); }
.hts-row--best { background: var(--surface-tint-green); margin: var(--space-2) var(--space-3) 0; padding: var(--space-1) var(--space-2) var(--space-2); border-radius: var(--radius-default); }

/* items */
.hts-item { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-2) var(--space-2); border-radius: var(--radius-sm); color: var(--text-body); text-decoration: none; transition: background var(--duration-fast) var(--ease-default); }
.hts-item:hover, .hts-item.is-active { background: var(--surface-tint-green); color: var(--text-body); }
.hts-item--card { align-items: flex-start; padding: var(--space-2); }
.hts-item__img { flex: 0 0 56px; width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-page); border: 1px solid var(--border-default); }
.hts-item--card .hts-item__img { flex-basis: 72px; width: 72px; height: 72px; }
.hts-item__img--icon { object-fit: contain; padding: 6px; background: var(--surface-card); }
.hts-item__img--test { background: var(--surface-tint-green); }
.hts-item__img--consult { background: var(--surface-tint-orange); }
.hts-item__img--post, .hts-item__img--page { background: var(--surface-page); }
.hts-item__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hts-item__title { font-weight: 500; font-size: var(--text-small-size); color: var(--text-body); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hts-item--card .hts-item__title { font-size: var(--text-body-size); }
.hts-item__desc { color: var(--text-muted); font-size: var(--text-micro-size); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hts-item__meta { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.hts-item__price { font-weight: 600; color: var(--ht-green-dark); }
.hts-item__cta { flex: 0 0 auto; align-self: center; }
.hts-badge { display: inline-block; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--surface-tint-green); color: var(--ht-green-dark); font-size: var(--text-micro-size); font-weight: 500; }
.hts-badge--muted { background: var(--surface-page); color: var(--text-muted); border: 1px solid var(--border-default); }

/* buttons & chips (design-system Button primary/outline, Chip) */
.hts-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 var(--space-4); border-radius: var(--radius-sm); background: var(--accent-primary); color: var(--text-on-brand) !important; font: 600 var(--text-small-size)/1 var(--font-body); text-decoration: none !important; box-shadow: var(--shadow-btn); transition: background var(--duration-fast) var(--ease-default), box-shadow var(--duration-fast) var(--ease-default); white-space: nowrap; }
.hts-btn:hover { background: var(--accent-primary-hover); box-shadow: var(--shadow-btn-hover); }
.hts-btn--outline { background: transparent; color: var(--accent-primary) !important; border: 1px solid var(--accent-primary); box-shadow: none; }
.hts-btn--outline:hover { background: var(--accent-primary); color: var(--text-on-brand) !important; }
.hts-btn--wa { margin: var(--space-3) var(--space-3) 0; }
.hts-chips, .hts-concern { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: var(--space-2) var(--space-4); }
.hts-chips__label, .hts-concern__label { width: 100%; font-size: var(--text-micro-size); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.hts-concern { background: var(--surface-tint-orange); margin: var(--space-2) var(--space-3) 0; border-radius: var(--radius-default); }
.hts-concern__label { text-transform: none; letter-spacing: 0; font-size: var(--text-small-size); color: var(--text-body); }
.hts-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--border-default); background: var(--surface-tint-green); color: var(--ht-green-dark); font: 500 var(--text-small-size)/1 var(--font-body); cursor: pointer; transition: background var(--duration-fast) var(--ease-default); }
.hts-chip:hover { background: var(--accent-primary); color: var(--text-on-brand); border-color: var(--accent-primary); }

/* empty state */
.hts-empty { padding: var(--space-3) 0 var(--space-2); }
.hts-empty__title { margin: 0 var(--space-4) var(--space-1); font: 600 var(--text-body-size)/1.3 var(--font-body); color: var(--text-body); }
.hts-empty__hint, .hts-empty__sug { margin: 0 var(--space-4) var(--space-2); color: var(--text-muted); }

/* results page */
.hts-results { padding: var(--space-6) var(--space-4) var(--space-12); font-family: var(--font-body); }
.hts-results__title { font: 400 var(--text-h1-size)/1.3 var(--font-display); margin: 0 0 var(--space-4); color: var(--text-body); }
.hts-results__title::before { content: '“'; } .hts-results__title::after { content: '”'; }
.hts-results__bar { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.hts-tabs { display: flex; flex-wrap: wrap; gap: var(--space-1); background: var(--surface-tint-green); padding: var(--space-1); border-radius: var(--radius-default); }
.hts-tab { border: 0; background: transparent; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font: 500 var(--text-small-size)/1 var(--font-body); color: var(--ht-green-dark); cursor: pointer; min-height: 36px; }
.hts-tab.is-on { background: var(--surface-card); box-shadow: var(--shadow-card); color: var(--text-body); }
.hts-sort__sel { min-height: 36px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: 0 var(--space-2); font: inherit; background: var(--surface-card); }
.hts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-3); }
.hts-grid .hts-item { border: 1px solid var(--border-default); background: var(--surface-card); box-shadow: var(--shadow-card); flex-wrap: wrap; }
.hts-grid .hts-item:hover { box-shadow: var(--shadow-card-hover); }
.hts-grid .hts-item__cta { width: 100%; display: flex; justify-content: flex-end; }
.hts-more { text-align: center; margin: var(--space-6) 0 0; }
.hts-results .hts-empty { max-width: 640px; }
@media (max-width: 767px) { .hts-grid { grid-template-columns: 1fr; } .hts-results { padding-left: 16px; padding-right: 16px; } }

/* 0.2: spelling correction line, text-link button */
.hts-corrected { margin: var(--space-2) var(--space-4) 0; font-size: var(--text-small-size); color: var(--text-muted); }
.hts-corrected strong { color: var(--text-body); }
.hts-link { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-primary); cursor: pointer; text-decoration: underline; }
.hts-link:hover { color: var(--accent-primary-hover); }

/* 0.4: results page = the theme's own product grid; only the bar, headings and article cards are ours */
.hts-results__loading { min-height: 240px; }
.hts-results__grid ul.products { margin-top: var(--space-2); }
.hts-results__h { font: 400 var(--text-h2-size)/1.3 var(--font-display); margin: var(--space-8) 0 var(--space-3); color: var(--text-body); }
.hts-sort { display: inline-flex; align-items: center; gap: var(--space-2); }
.hts-sort__label { font-size: var(--text-small-size); color: var(--text-muted); }
.hts-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.hts-post { background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-default); overflow: hidden; box-shadow: var(--shadow-card); display: flex; flex-direction: column; }
.hts-post__thumb img { display: block; width: 100%; height: 180px; object-fit: cover; }
.hts-post__title { font: 500 var(--text-h3-size)/1.3 var(--font-body); margin: var(--space-3) var(--space-4) var(--space-1); }
.hts-post__title a { color: var(--text-body); text-decoration: none; }
.hts-post__title a:hover { color: var(--accent-primary); }
.hts-post__excerpt { margin: 0 var(--space-4); color: var(--text-muted); font-size: var(--text-small-size); flex: 1; }
.hts-post__date { display: block; margin: var(--space-2) var(--space-4) var(--space-4); font-size: var(--text-micro-size); color: var(--text-muted); }
@media (max-width: 767px) { .hts-posts { grid-template-columns: 1fr; } }

/* /search/ page: the theme's own page title + breadcrumb would sit above our heading — hide them (our h1 carries the query) */
.hts-results-page .page-header, .hts-results-page .site-content > .container > .page-header, .hts-results-page h1.entry-title, .hts-results-page .entry-header { display: none; }
.hts-results-page .hts-results { padding-top: var(--space-4); }

/* results page: Top picks block above the theme grid */
.hts-results__pinned { margin: 0 0 var(--space-6); }
.hts-results__h--pinned { margin-top: var(--space-2); color: var(--ht-orange); font: 700 var(--text-micro-size)/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; }
.hts-results__pinned .hts-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* Top picks cards: one row — thumbnail, text, button (the generic grid card wraps the button onto its own line) */
.hts-results__pinned .hts-grid .hts-item { flex-wrap: nowrap; align-items: center; }
.hts-results__pinned .hts-grid .hts-item__cta { width: auto; flex: 0 0 auto; }
.hts-results__pinned .hts-grid .hts-item__img { flex-basis: 72px; width: 72px; height: 72px; }

/* card with a button: the clickable part is an inner link */
.hts-item__link { display: flex; gap: var(--space-3); align-items: flex-start; flex: 1 1 auto; min-width: 0; color: var(--text-body); text-decoration: none; }
.hts-item--card { gap: var(--space-3); }
.hts-grid .hts-item--card { flex-wrap: wrap; }
.hts-results__pinned .hts-grid .hts-item--card { flex-wrap: nowrap; }
