/* FH Search. Colours are variables so each store's theme can set its own:
   .fhs { --fhs-accent: #057A4C; --fhs-sale: #B8321F; } */
.fhs {
  --fhs-accent: #057A4C;
  --fhs-accent-ink: #fff;
  --fhs-sale: #B8321F;
  --fhs-best: #F14A35;
  --fhs-ink: #1f2328;
  --fhs-muted: #5f6670;
  --fhs-line: #d9dde2;
  --fhs-bg: #fff;
  --fhs-hover: #f2f6f4;
  --fhs-mark: #fff2b3;
  --fhs-radius: 8px;
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  color: var(--fhs-ink);
}
.fhs * { box-sizing: border-box; }
.fhs-box {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--fhs-bg);
  border: 2px solid var(--fhs-line);
  border-radius: var(--fhs-radius);
  padding: 0 4px 0 10px;
  transition: border-color .15s;
}
.fhs-box:focus-within { border-color: var(--fhs-accent); }
.fhs-ico { width: 18px; height: 18px; fill: var(--fhs-muted); flex: none; }
.fhs .fhs-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 10px 6px !important;
  margin: 0 !important;
  font: inherit;
  color: inherit;
  height: auto;
  -webkit-appearance: none;
  appearance: none;
}
.fhs .fhs-input::-webkit-search-cancel-button { display: none; }
.fhs-busy .fhs-ico { animation: fhs-pulse .8s ease-in-out infinite alternate; }
@keyframes fhs-pulse { to { opacity: .3; } }
.fhs .fhs-clear, .fhs .fhs-close {
  border: 0; background: none; color: var(--fhs-muted); cursor: pointer;
  font-size: 22px; line-height: 1; padding: 4px 8px; margin: 0; min-height: 0;
}
.fhs .fhs-close { display: none; order: -1; font-size: 20px; padding-left: 0; }
.fhs .fhs-go {
  flex: none;
  border: 0;
  border-radius: calc(var(--fhs-radius) - 3px);
  background: var(--fhs-accent);
  color: var(--fhs-accent-ink);
  font: inherit;
  font-weight: 600;
  padding: 7px 14px;
  margin: 4px 0;
  cursor: pointer;
  min-height: 0;
  line-height: 1.2;
}
.fhs .fhs-go:hover { filter: brightness(1.08); }

/* dropdown */
.fhs-drop {
  position: absolute;
  z-index: 99990;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 300px;
  max-height: min(75vh, 640px);
  overflow-y: auto;
  background: var(--fhs-bg);
  border: 1px solid var(--fhs-line);
  border-radius: var(--fhs-radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.14);
  padding: 6px 0;
}
.fhs-drop[hidden] { display: none; }
.fhs-drop ul { list-style: none; margin: 0; padding: 0; }
.fhs-head {
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--fhs-muted); padding: 8px 14px 4px;
}
.fhs-meant { padding: 6px 14px; color: var(--fhs-muted); font-size: 14px; }
.fhs-drop a { color: inherit; text-decoration: none; }
.fhs-cats a { display: block; padding: 7px 14px; }
.fhs-path { color: var(--fhs-muted); }
.fhs-n { color: var(--fhs-muted); font-size: 13px; }
.fhs-item { display: flex; align-items: center; gap: 6px; padding-right: 10px; }
.fhs-item > a { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 4px 6px 14px; }
.fhs-img { flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.fhs-img img { max-width: 48px; max-height: 48px; width: auto; height: auto; object-fit: contain; }
.fhs-txt { flex: 1 1 auto; min-width: 0; }
.fhs-t { display: block; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fhs-drop mark { background: var(--fhs-mark); color: inherit; padding: 0; border-radius: 2px; }
.fhs-badge {
  display: inline-block; margin-top: 2px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; color: var(--fhs-sale);
}
.fhs-badge.is-best { color: #fff; background: var(--fhs-best); border-radius: 3px; padding: 1px 6px; }
.fhs-price { flex: none; text-align: right; font-weight: 700; white-space: nowrap; }
.fhs-price del { display: block; font-weight: 400; font-size: 12px; color: var(--fhs-muted); }
.fhs-price ins { text-decoration: none; color: var(--fhs-sale); }
.fhs .fhs-add {
  flex: none;
  border: 1.5px solid var(--fhs-accent);
  background: var(--fhs-bg);
  color: var(--fhs-accent);
  border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 700;
  padding: 5px 12px; margin: 0; min-height: 0; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
}
.fhs .fhs-add:hover, .fhs .fhs-add.is-added { background: var(--fhs-accent); color: var(--fhs-accent-ink); }
.fhs .fhs-add.is-loading { opacity: .6; cursor: progress; }
.fhs-oos { flex: none; font-size: 12px; color: var(--fhs-muted); }
.fhs-item.is-oos .fhs-img, .fhs-item.is-oos .fhs-t { opacity: .55; }
.fhs-all { display: block; text-align: center; padding: 10px 14px 6px; font-weight: 700; color: var(--fhs-accent) !important; border-top: 1px solid var(--fhs-line); margin-top: 6px; }
.fhs-none { padding: 14px; color: var(--fhs-muted); }
.fhs-drop [data-opt]:hover, .fhs-drop .fhs-active { background: var(--fhs-hover); }
.fhs-drop .fhs-active { outline: 2px solid var(--fhs-accent); outline-offset: -2px; }
.fhs-meant strong { color: var(--fhs-ink); }
p.fhs-meant { padding: 0; margin: 0 0 1em; }

/* phones: the search opens full screen */
@media (max-width: 639px) {
  .fhs { font-size: 16px; }   /* 16px stops iOS zooming into the box */
  .fhs .fhs-go { padding: 7px 10px; }
  .fhs.fhs-full {
    position: fixed; z-index: 99999; inset: 0; max-width: none;
    background: var(--fhs-bg); padding: 8px; display: flex; flex-direction: column;
  }
  .fhs.fhs-full .fhs-close { display: block; }
  .fhs.fhs-full .fhs-ico { display: none; }
  .fhs.fhs-full .fhs-drop {
    position: static; flex: 1 1 auto; max-height: none; min-width: 0;
    border: 0; box-shadow: none; border-radius: 0; margin-top: 6px;
  }
  .fhs-price del { display: inline; }
  .fhs-item > a { padding-left: 8px; }
  .fhs.fhs-full .fhs-item { padding-right: 6px; }
  .fhs.fhs-full .fhs-box { margin-right: 2px; }
}
html.fhs-lock, html.fhs-lock body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .fhs-busy .fhs-ico { animation: none; } }

/* automatic header placement */
.fhs-header-row { display: flex; justify-content: center; padding: 10px 16px; box-sizing: border-box; width: 100%; }
.fhs-header-row .fhs { max-width: 720px; }
.fhs-header-bar { background: #fff; border-bottom: 1px solid #e6e6e6; position: relative; z-index: 50; }
.site-search .fhs { max-width: none; }   /* Storefront header slot */

/* side panel (wide screens) */
.fhs-drop.fhs-wide {
  width: min(940px, calc(100vw - 16px));
  right: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  padding: 0;
  overflow: hidden;
}
.fhs-drop.fhs-wide[hidden] { display: none; }
.fhs-wide .fhs-list { overflow-y: auto; max-height: min(75vh, 640px); padding: 6px 0; }
.fhs-panel {
  border-left: 1px solid var(--fhs-line);
  padding: 16px;
  overflow-y: auto;
  max-height: min(75vh, 640px);
  background: var(--fhs-bg);
}
.fhs-panel a { color: inherit; text-decoration: none; }
.fhs-p-img { display: flex; align-items: center; justify-content: center; height: 220px; margin-bottom: 12px; }
.fhs-p-img img { max-width: 100%; max-height: 220px; object-fit: contain; }
.fhs-p-title { display: block; font-size: 17px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.fhs-p-title:hover { text-decoration: underline; }
.fhs-p-code { font-size: 12px; color: var(--fhs-muted); margin-bottom: 8px; }
.fhs-p-price { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.fhs-p-price del { font-size: 14px; font-weight: 400; color: var(--fhs-muted); }
.fhs-p-price ins { text-decoration: none; color: var(--fhs-sale); }
.fhs-p-price .fhs-badge { vertical-align: middle; }
.fhs-p-rules { list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; color: var(--fhs-sale); }
.fhs-p-rules li { margin: 2px 0; }
.fhs-p-stock { font-size: 13px; color: var(--fhs-accent); margin-bottom: 12px; }
.fhs-p-stock.is-oos { color: var(--fhs-muted); }
.fhs-p-buy { display: flex; gap: 8px; }
.fhs .fhs-qty { width: 64px; padding: 8px; border: 1px solid var(--fhs-line); border-radius: 6px; font: inherit; margin: 0; }
.fhs .fhs-p-add {
  flex: 1; border: 0; border-radius: 6px; background: var(--fhs-accent); color: var(--fhs-accent-ink) !important;
  font: inherit; font-weight: 700; padding: 9px 12px; cursor: pointer; text-align: center; margin: 0; min-height: 0;
}
.fhs .fhs-p-add:hover { filter: brightness(1.08); }
.fhs .fhs-p-add.is-loading { opacity: .6; }
.fhs-t-head { font-size: 14px; margin-bottom: 10px; color: var(--fhs-muted); }
.fhs-t-head strong { color: var(--fhs-ink); }
.fhs-t-items { list-style: none; margin: 0; padding: 0; }
.fhs-t-items a { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--fhs-line); }
.fhs-t-items .fhs-txt { display: flex; flex-direction: column; gap: 2px; }
.fhs-t-items .fhs-price { text-align: left; font-size: 14px; }
.fhs-t-items a:hover .fhs-t { text-decoration: underline; }
.fhs-t-all { display: block; text-align: center; margin-top: 12px; font-weight: 700; color: var(--fhs-accent) !important; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.fhs-t-loading { height: 200px; background: linear-gradient(90deg, #f2f2f2 25%, #e9e9e9 50%, #f2f2f2 75%); background-size: 200% 100%; animation: fhs-shim 1s linear infinite; border-radius: 6px; }
@keyframes fhs-shim { to { background-position: -200% 0; } }
.fhs-logo { width: 28px; height: 20px; object-fit: contain; vertical-align: middle; margin-right: 8px; }

/* brand index page [fh_brands] */
.fhs-brands { --fhs-accent: #057A4C; --fhs-line: #d9dde2; --fhs-muted: #5f6670; margin: 0 0 40px; }
.fhs-brands-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.fhs-brands .fhs-brands-filter { flex: 1 1 280px; max-width: 420px; padding: 10px 12px; border: 2px solid var(--fhs-line); border-radius: 8px; font: inherit; }
.fhs-brands .fhs-brands-filter:focus { border-color: var(--fhs-accent); outline: 0; }
.fhs-brands-count { color: var(--fhs-muted); }
.fhs-az { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 24px; position: sticky; top: 0; background: #fff; padding: 8px 0; z-index: 5; }
.fhs-az a, .fhs-az span { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; border-radius: 6px; font-weight: 700; text-decoration: none; }
.fhs-az a { color: var(--fhs-accent); border: 1px solid var(--fhs-line); }
.fhs-az a:hover { background: var(--fhs-accent); color: #fff; }
.fhs-az span { color: #c3c7cc; }
.fhs-brands h2 { font-size: 22px; margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--fhs-line); scroll-margin-top: 60px; }
.fhs-brands ul { list-style: none; margin: 0; padding: 0; }
.fhs-brands-group ul { columns: 4 200px; column-gap: 24px; }
.fhs-brands-group li { break-inside: avoid; padding: 4px 0; }
.fhs-brands-group a { text-decoration: none; }
.fhs-brands-group a:hover { text-decoration: underline; }
.fhs-brands small { color: var(--fhs-muted); }
.fhs-brands-top ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.fhs-brands-top li { display: flex; }
.fhs-brands-top a { flex: 1; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--fhs-line); border-radius: 8px; text-decoration: none; }
.fhs-brands-top a:hover { border-color: var(--fhs-accent); }
.fhs-brands-top img { width: 36px; height: 28px; object-fit: contain; }
.fhs-brands-top span { flex: 1; font-weight: 600; }

.fhs-brands [hidden] { display: none !important; }

/* [fh_brands layout="logos"] - logo cards */
.fhs-brands-grid .fhs-brands-group ul { columns: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.fhs-brands-grid .fhs-brands-group li { padding: 0; }
.fhs-brands-grid .fhs-brands-group a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; box-sizing: border-box;
  padding: 14px 10px 12px; border: 1px solid var(--fhs-line); border-radius: 10px; background: #fff;
  text-align: center; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s;
}
.fhs-brands-grid .fhs-brands-group a:hover { border-color: var(--fhs-accent); box-shadow: 0 4px 14px rgba(0,0,0,.08); text-decoration: none; }
.fhs-bl { display: flex; align-items: center; justify-content: center; width: 100%; height: 90px; }
.fhs-bl img { max-width: 100%; max-height: 90px; object-fit: contain; }
.fhs-bl-text { font-weight: 800; font-size: 17px; line-height: 1.15; color: var(--fhs-muted); text-transform: uppercase; letter-spacing: .02em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fhs-bn { font-weight: 600; font-size: 14px; line-height: 1.25; }
.fhs-brands-grid .fhs-brands-group small { font-size: 12px; }
@media (max-width: 480px) { .fhs-brands-grid .fhs-brands-group ul { grid-template-columns: repeat(2, 1fr); gap: 10px; } .fhs-bl { height: 70px; } .fhs-bl img { max-height: 70px; } }

/* WooCommerce price HTML (signed-in customers) */
.fhs-ph del { display: block; font-weight: 400; font-size: 12px; color: var(--fhs-muted); }
.fhs-ph ins { text-decoration: none; color: var(--fhs-sale); }
.fhs-ph .woocommerce-Price-amount { font-weight: 700; }
.fhs-ph small, .fhs-ph .wholesale_price_title { display: block; font-size: 11px; font-weight: 400; color: var(--fhs-muted); }
.fhs-p-price .fhs-ph del { display: inline; font-size: 14px; }

/* [fh_search align="right|center|left"] */
.fhs.fhs-align-right { margin-left: auto; margin-right: 0; }
.fhs.fhs-align-center { margin-left: auto; margin-right: auto; }
.fhs.fhs-align-right .fhs-drop.fhs-wide { left: auto; right: 0; }
