/* mod_finderplus – Smart Search module with multiple styles */

.finderplus {
  --fp-accent: #2563eb;
  --fp-accent-text: #fff;
  --fp-bg: #fff;
  --fp-surface: #f1f3f6;
  --fp-pop: #fff;
  --fp-text: #1c2230;
  --fp-muted: #667085;
  --fp-border: #d0d5dd;
  --fp-shadow: 0 12px 32px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
  --fp-radius: 6px;
  --fp-h: 42px;
  --fp-fs: 1rem;
  --fp-ring: color-mix(in srgb, var(--fp-accent) 28%, transparent);

  position: relative;
  top: var(--fp-offset-y, 0px);
  padding: var(--fp-padding, 0);
  margin: var(--fp-margin, 0);
  color: var(--fp-text);
  font-size: var(--fp-fs);
  line-height: 1.4;
}

.finderplus *,
.finderplus *::before,
.finderplus *::after {
  box-sizing: border-box;
}

/* ---------- colour schemes ---------- */

.finderplus--scheme-dark {
  --fp-bg: #161b26;
  --fp-surface: #222938;
  --fp-pop: #1b2130;
  --fp-text: #eef1f6;
  --fp-muted: #98a2b3;
  --fp-border: #344054;
  --fp-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}

@media (prefers-color-scheme: dark) {
  .finderplus--scheme-auto {
    --fp-bg: #161b26;
    --fp-surface: #222938;
    --fp-pop: #1b2130;
    --fp-text: #eef1f6;
    --fp-muted: #98a2b3;
    --fp-border: #344054;
    --fp-shadow: 0 12px 32px rgba(0, 0, 0, .5);
  }
}

/* ---------- sizes ---------- */

.finderplus--sm { --fp-h: 34px; --fp-fs: .875rem; }
.finderplus--md { --fp-h: 42px; --fp-fs: 1rem; }
.finderplus--lg { --fp-h: 54px; --fp-fs: 1.125rem; }

/* ---------- base ---------- */

.finderplus__sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.finderplus__form {
  margin: 0;
}

.finderplus__label {
  display: block;
  margin-bottom: .35em;
  font-weight: 600;
}

.finderplus__field {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--fp-h);
  background: var(--fp-bg);
  border: 1px solid var(--fp-border);
  border-radius: var(--fp-radius);
  transition: border-color .15s, box-shadow .15s, background-color .15s, width .25s ease;
}

.finderplus__field:focus-within {
  border-color: var(--fp-accent);
  box-shadow: 0 0 0 3px var(--fp-ring);
}

.finderplus__svg {
  display: block;
  width: var(--fp-icon-size, 1.15em);
  height: var(--fp-icon-size, 1.15em);
  flex: none;
}

.finderplus__lead {
  display: flex;
  padding-left: .8em;
  color: var(--fp-muted);
}

.finderplus__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 .85em;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.finderplus__input::placeholder {
  color: var(--fp-muted);
  opacity: 1;
}

.finderplus__lead + .finderplus__input {
  padding-left: .55em;
}

.finderplus__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  flex: none;
  height: calc(100% + 2px);
  min-width: var(--fp-h);
  margin: -1px -1px -1px 0;
  padding: 0 1em;
  border: 0;
  border-radius: 0 var(--fp-radius) var(--fp-radius) 0;
  background: var(--fp-accent);
  color: var(--fp-accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, background-color .15s, color .15s;
}

.finderplus--btn-icon .finderplus__submit {
  padding: 0;
}

.finderplus__submit:hover {
  filter: brightness(1.08);
}

.finderplus__submit:focus-visible,
.finderplus__trigger:focus-visible,
.finderplus__close:focus-visible {
  outline: 2px solid var(--fp-accent);
  outline-offset: 2px;
}

/* ---------- style: pill ---------- */

.finderplus--pill .finderplus__field {
  --fp-radius: 999px;
  padding-left: .35em;
}

.finderplus--pill .finderplus__submit {
  height: calc(100% - 8px);
  min-width: calc(var(--fp-h) - 8px);
  margin: 0 4px 0 0;
  border-radius: 999px;
}

/* ---------- style: minimal ---------- */

.finderplus--minimal .finderplus__field {
  border-width: 0 0 2px;
  border-radius: 0;
  background: transparent;
}

.finderplus--minimal .finderplus__field:focus-within {
  box-shadow: none;
}

.finderplus--minimal .finderplus__input {
  padding-left: .15em;
}

.finderplus--minimal .finderplus__lead {
  padding-left: 0;
}

.finderplus--minimal .finderplus__submit {
  height: 100%;
  margin: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fp-muted);
}

.finderplus--minimal .finderplus__submit:hover {
  color: var(--fp-accent);
  filter: none;
}

/* ---------- style: filled ---------- */

.finderplus--filled .finderplus__field {
  --fp-radius: 12px;
  border-color: transparent;
  background: var(--fp-surface);
}

.finderplus--filled .finderplus__field:focus-within {
  background: var(--fp-bg);
}

.finderplus--filled .finderplus__submit {
  height: 100%;
  margin: 0;
  background: transparent;
  color: var(--fp-accent);
}

.finderplus--filled.finderplus--btn-text .finderplus__submit,
.finderplus--filled.finderplus--btn-both .finderplus__submit {
  height: calc(100% - 8px);
  margin-right: 4px;
  border-radius: 8px;
  background: var(--fp-accent);
  color: var(--fp-accent-text);
}

/* ---------- style: glass ---------- */

.finderplus--glass .finderplus__field {
  --fp-radius: 14px;
  border-color: color-mix(in srgb, var(--fp-border) 55%, transparent);
  background: color-mix(in srgb, var(--fp-bg) 62%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 6px 24px rgba(16, 24, 40, .12);
}

.finderplus--glass .finderplus__field:focus-within {
  box-shadow: 0 0 0 3px var(--fp-ring), 0 6px 24px rgba(16, 24, 40, .12);
}

.finderplus--glass .finderplus__submit {
  height: calc(100% - 10px);
  min-width: calc(var(--fp-h) - 10px);
  margin: 0 5px 0 0;
  border-radius: 10px;
}

/* ---------- style: expand ---------- */

.finderplus--expand,
.finderplus--overlay {
  display: inline-block;
  vertical-align: middle;
}

.finderplus--expand .finderplus__field {
  --fp-radius: 999px;
  width: var(--fp-h);
  margin-left: auto;
  overflow: visible;
}

.finderplus--expand .finderplus__input {
  width: 0;
  padding: 0;
  opacity: 0;
  transition: opacity .2s;
}

.finderplus--expand .finderplus__submit {
  order: -1;
  height: 100%;
  min-width: calc(var(--fp-h) - 2px);
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--fp-text);
}

.finderplus--expand .finderplus__submit-text {
  display: none;
}

.finderplus--expand.is-open .finderplus__field {
  width: min(320px, 80vw);
}

.finderplus--expand.is-open .finderplus__input {
  padding: 0 1em 0 0;
  opacity: 1;
}

.finderplus--expand:not(.is-open) .finderplus__field {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.finderplus--expand .finderplus__dropdown {
  right: auto;
  min-width: min(360px, 90vw);
}

/* ---------- style: overlay ---------- */

.finderplus__trigger,
.finderplus__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--fp-h);
  height: var(--fp-h);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.finderplus__trigger:hover,
.finderplus__close:hover {
  background: var(--fp-surface);
}

.finderplus__overlay {
  position: fixed;
  inset: 0;
  margin: 0;
  /* above sticky headers and mobile menus (Maximenu CK uses 100000) */
  z-index: 2147483000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 14vh 16px 16px;
  background: rgba(10, 14, 22, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: finderplus-fade .18s ease-out;
}

.finderplus__overlay[hidden] {
  display: none;
}

.finderplus__overlay-inner {
  position: relative;
  width: 100%;
  max-width: 720px;
  padding: 20px;
  border-radius: 18px;
  background: var(--fp-pop);
  box-shadow: var(--fp-shadow);
  animation: finderplus-rise .22s ease-out;
}

.finderplus__overlay .finderplus__close {
  position: absolute;
  top: -52px;
  right: 0;
  color: #fff;
}

.finderplus__overlay .finderplus__close:hover {
  background: rgba(255, 255, 255, .15);
}

.finderplus--overlay .finderplus__field {
  --fp-h: 56px;
  --fp-radius: 12px;
  font-size: 1.15rem;
}

.finderplus--overlay .finderplus__dropdown {
  top: calc(100% + 10px);
  max-height: 55vh;
}

html.finderplus-locked {
  overflow: hidden;
}

@keyframes finderplus-fade {
  from { opacity: 0; }
}

@keyframes finderplus-rise {
  from { opacity: 0; transform: translateY(12px); }
}

/* ---------- dropdown ---------- */

.finderplus__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1000;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--fp-border);
  border-radius: 12px;
  background: var(--fp-pop);
  color: var(--fp-text);
  box-shadow: var(--fp-shadow);
  font-size: .95em;
  text-align: left;
}

.finderplus__dropdown[hidden] {
  display: none;
}

.finderplus__heading {
  padding: .45em .75em .3em;
  color: var(--fp-muted);
  font-size: .78em;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.finderplus__option {
  display: flex;
  align-items: center;
  gap: .8em;
  padding: .6em .75em;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.finderplus__option:hover,
.finderplus__option[aria-selected="true"] {
  background: var(--fp-surface);
  color: inherit;
  text-decoration: none;
}

.finderplus__option[aria-selected="true"] {
  box-shadow: inset 3px 0 0 var(--fp-accent);
}

.finderplus__thumb {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--fp-surface);
}

.finderplus__option-icon {
  flex: none;
  color: var(--fp-muted);
}

.finderplus__body {
  min-width: 0;
  flex: 1;
}

.finderplus__title {
  display: block;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finderplus__desc {
  display: -webkit-box;
  margin-top: .15em;
  overflow: hidden;
  color: var(--fp-muted);
  font-size: .88em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.finderplus__type {
  flex: none;
  align-self: flex-start;
  padding: .15em .55em;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fp-accent) 12%, transparent);
  color: var(--fp-accent);
  font-size: .72em;
  font-weight: 600;
  white-space: nowrap;
}

.finderplus__dropdown mark {
  padding: 0;
  background: color-mix(in srgb, var(--fp-accent) 22%, transparent);
  color: inherit;
  border-radius: 2px;
}

.finderplus__message {
  padding: .9em .75em;
  color: var(--fp-muted);
}

.finderplus__all {
  display: block;
  margin-top: 4px;
  padding: .7em .75em;
  border-top: 1px solid var(--fp-border);
  color: var(--fp-accent);
  font-weight: 600;
  text-decoration: none;
}

.finderplus__all:hover,
.finderplus__all[aria-selected="true"] {
  border-radius: 0 0 8px 8px;
  background: var(--fp-surface);
  text-decoration: none;
}

.finderplus__spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: .5em;
  vertical-align: -.15em;
  border: 2px solid var(--fp-border);
  border-top-color: var(--fp-accent);
  border-radius: 50%;
  animation: finderplus-spin .7s linear infinite;
}

@keyframes finderplus-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .finderplus *,
  .finderplus__overlay,
  .finderplus__overlay-inner {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- optional magnifier colour (setting "Icon colour") ---------- */

.finderplus__submit .finderplus__svg,
.finderplus__lead .finderplus__svg,
.finderplus__trigger .finderplus__svg,
.finderplus__option-icon .finderplus__svg {
  color: var(--fp-icon, currentColor);
}

/* ---------- icon field while the search is open ----------
   expand: field expanded · overlay: overlay visible · others: input focused */

.finderplus--has-open-bg.finderplus--expand.is-open .finderplus__submit,
.finderplus--has-open-bg.finderplus--overlay .finderplus__submit,
.finderplus--has-open-bg:not(.finderplus--expand):not(.finderplus--overlay) .finderplus__field:focus-within .finderplus__submit {
  background: var(--fp-open-bg);
  filter: none;
}

.finderplus--has-open-icon.finderplus--expand.is-open .finderplus__submit .finderplus__svg,
.finderplus--has-open-icon.finderplus--overlay .finderplus__submit .finderplus__svg,
.finderplus--has-open-icon:not(.finderplus--expand):not(.finderplus--overlay) .finderplus__field:focus-within .finderplus__submit .finderplus__svg {
  color: var(--fp-open-icon);
}

.finderplus--has-open-icon.finderplus--expand.is-open .finderplus__submit,
.finderplus--has-open-icon.finderplus--overlay .finderplus__submit,
.finderplus--has-open-icon:not(.finderplus--expand):not(.finderplus--overlay) .finderplus__field:focus-within .finderplus__submit {
  color: var(--fp-open-icon);
}
/* ---------- custom horizontal padding of the magnifier button ---------- */

.finderplus--btn-pad .finderplus__submit,
.finderplus--btn-pad .finderplus__trigger {
  width: auto;
  min-width: 0;
  padding-left: var(--fp-btn-px);
  padding-right: var(--fp-btn-px);
}

.finderplus--btn-pad.finderplus--expand:not(.is-open) .finderplus__field {
  width: auto;
}
/* ---------- shield the input from template styles ----------
   Templates often style input[type=search] / :focus with borders and outlines
   that win over a single class and draw a square box inside the rounded field. */

.finderplus .finderplus__input,
.finderplus .finderplus__input:hover,
.finderplus .finderplus__input:focus,
.finderplus .finderplus__input:focus-visible {
  width: auto;
  max-width: none;
  min-height: 0;
  margin: 0;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.finderplus .finderplus__input::-webkit-search-decoration,
.finderplus .finderplus__input::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

/* ---------- custom corner radius (setting "Corner radius") ---------- */

.finderplus.finderplus--custom-radius .finderplus__field {
  --fp-radius: var(--fp-radius-custom);
}

/* buttons sitting inside the field with a small gap follow the outer radius */
.finderplus.finderplus--custom-radius.finderplus--pill .finderplus__submit,
.finderplus.finderplus--custom-radius.finderplus--glass .finderplus__submit,
.finderplus.finderplus--custom-radius.finderplus--filled .finderplus__submit {
  border-radius: max(0px, calc(var(--fp-radius-custom) - 4px));
}

.finderplus.finderplus--custom-radius.finderplus--expand .finderplus__submit,
.finderplus.finderplus--custom-radius .finderplus__trigger {
  border-radius: var(--fp-radius-custom);
}
/* ---------- magnifier colour on hover (setting "Search icon on hover") ----------
   !important so it also wins over the "open" colour while hovering */

.finderplus--has-hover-icon .finderplus__submit:hover .finderplus__svg,
.finderplus--has-hover-icon .finderplus__submit:focus-visible .finderplus__svg,
.finderplus--has-hover-icon .finderplus__trigger:hover .finderplus__svg,
.finderplus--has-hover-icon .finderplus__trigger:focus-visible .finderplus__svg {
  color: var(--fp-hover-icon) !important;
}

.finderplus--has-hover-icon .finderplus__submit:hover .finderplus__svg,
.finderplus--has-hover-icon .finderplus__trigger:hover .finderplus__svg {
  transition: color .15s;
}
/* ---------- gap between magnifier and typed text (setting "Gap icon - text") ---------- */

.finderplus.finderplus--has-gap.finderplus--expand.is-open .finderplus__input,
.finderplus.finderplus--has-gap .finderplus__lead + .finderplus__input {
  padding-left: var(--fp-icon-gap);
}

.finderplus.finderplus--has-gap:not(.finderplus--expand) .finderplus__input {
  padding-right: var(--fp-icon-gap);
}
/* ---------- mobile display (setting "Mobile display") ---------- */

.finderplus--m-hide.fp-is-mobile,
.finderplus--m-bottom.fp-is-mobile {
  display: none !important;
}

.finderplus.finderplus-bottombar {
  position: fixed;
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 99990;
  display: block;
  margin: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--fp-pop);
  box-shadow: 0 -4px 18px rgba(16, 24, 40, .14);
}

.finderplus-bottombar .finderplus__field {
  width: 100%;
}

.finderplus-bottombar .finderplus__dropdown {
  top: auto;
  bottom: calc(100% + 8px);
  max-height: 60vh;
}

/* keep the end of the page reachable above the bar */
html.finderplus-has-bottombar body {
  padding-bottom: calc(var(--fp-bar-space, 72px) + env(safe-area-inset-bottom, 0px));
}
/* the bottom bar is a permanently "open" search: use the open colours if set */
.finderplus.finderplus-bottombar.finderplus--has-open-bg .finderplus__submit {
  background: var(--fp-open-bg);
  filter: none;
}

.finderplus.finderplus-bottombar.finderplus--has-open-icon .finderplus__submit,
.finderplus.finderplus-bottombar.finderplus--has-open-icon .finderplus__submit .finderplus__svg {
  color: var(--fp-open-icon);
}
/* while the bottom bar is shown, menu copies of the module (e.g. in Maximenu's
   mobile menu) would be a second, redundant search: hide them */
html.finderplus-has-bottombar .finderplus--m-bottom:not(.finderplus-bottombar) {
  display: none !important;
}