/* STX WooCommerce Live Search v1.2.0 */
:root {
  --stx-search-accent: #e60012;
  --stx-search-icon-active: #CF000E;
  --stx-search-font: "Haas Grot Disp", sans-serif;
  --stx-search-top: 70px; /* Automatically calculated from .header in JavaScript */
}

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

.stx-live-search,
.stx-search-overlay,
.stx-search-overlay * {
  box-sizing: border-box;
}

.stx-search-toggle,
.stx-search-close,
.stx-search-submit,
.stx-search-more {
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none !important;
  cursor: pointer;
  touch-action: manipulation;
  font-family: var(--stx-search-font) !important;
  text-transform: none !important;
}

/* Compact #333 search icon in the Elementor header */
.stx-live-search {
  display: flex;
  align-items: center;
  justify-content: center;
}
.stx-live-search .stx-search-toggle {
  display: inline-grid !important;
  place-items: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  margin: 0;
  padding: 3px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #333333 !important;
  transition: color .18s ease;
  line-height: 1;
}
.stx-search-toggle svg {
  display: block;
  width: 23px;
  height: 23px;
}
/* Hover, pressed, keyboard focus, and opened popup all use the requested red. */
.stx-live-search .stx-search-toggle:hover,
.stx-live-search .stx-search-toggle:active,
.stx-live-search .stx-search-toggle:focus-visible,
.stx-live-search .stx-search-toggle[aria-expanded="true"] {
  color: var(--stx-search-icon-active) !important;
  opacity: 1 !important;
}
.stx-search-toggle:focus-visible,
.stx-search-close:focus-visible,
.stx-search-result:focus-visible,
.stx-search-submit:focus-visible,
.stx-search-more:focus-visible {
  outline: 2px solid var(--stx-search-accent) !important;
  outline-offset: 3px;
}

/* The transparent backdrop begins below .header, so the menu remains visible. */
.stx-search-backdrop {
  position: fixed;
  z-index: 999997;
  inset: var(--stx-search-top) 0 0;
  background: rgba(0, 0, 0, .06);
}
.stx-search-backdrop[hidden],
.stx-search-overlay[hidden],
.stx-search-more[hidden] {
  display: none !important;
}

/* Full-viewport-width white dropdown, beginning immediately below .header. */
.stx-search-overlay {
  position: fixed;
  z-index: 999998;
  top: var(--stx-search-top);
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  width: 100vw !important;
  max-width: 100vw !important;
  min-width: 0;
  max-height: var(--stx-search-available-height, calc(100dvh - var(--stx-search-top)));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 1px solid #ededed;
  border-left: 0;
  border-right: 0;
  background: #fff;
  color: #737373;
  box-shadow: 0 15px 32px rgba(0, 0, 0, .10);
  font-family: var(--stx-search-font) !important;
}

.stx-search-close {
  position: absolute;
  top: 26px;
  right: 28px;
  z-index: 2;
  display: grid !important;
  place-items: center;
  width: 38px;
  height: 38px;
  min-width: 0;
  min-height: 0;
  padding: 3px;
  margin: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #4a4a4a !important;
}
.stx-search-close svg { width: 30px; height: 30px; }
.stx-search-close:hover { opacity: .65; }

.stx-search-content {
  width: min(930px, calc(100% - 48px));
  margin: 0 auto;
  padding: 74px 0 42px;
  font-family: var(--stx-search-font) !important;
}
.stx-search-form {
  display: flex;
  width: 100%;
  height: 60px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--stx-search-accent);
  background: #fff;
}
.stx-search-form .stx-search-input {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 58px !important;
  min-height: 0 !important;
  padding: 0 28px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: #fff !important;
  color: #333 !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  font-family: var(--stx-search-font) !important;
  line-height: normal !important;
}
.stx-search-form .stx-search-input::placeholder {
  color: #999;
  opacity: 1;
  font-family: var(--stx-search-font) !important;
  font-size: 14px !important;
  font-weight: 400;
}
.stx-search-input::-webkit-search-cancel-button { cursor: pointer; }
.stx-search-form .stx-search-submit {
  display: grid !important;
  flex: 0 0 107px;
  place-items: center;
  height: 58px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: #7d7a7a !important;
  color: #c6c6c6 !important;
}
.stx-search-submit svg { display: block; width: 30px; height: 30px; }
.stx-search-form .stx-search-submit:hover {
  background: #696666 !important;
  color: #fff !important;
}

.stx-search-status {
  min-height: 24px;
  margin: 39px 0 37px !important;
  color: #868686;
  font-family: var(--stx-search-font) !important;
  font-size: 18px;
  font-weight: 400;
  line-height: 24px;
}
.stx-search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(448px, max(140px, calc(var(--stx-search-available-height, 100dvh) - 290px)));
  min-height: 0;
  overflow-y: auto;
  padding-right: 14px;
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f4f4f4;
}
.stx-search-results::-webkit-scrollbar { width: 8px; }
.stx-search-results::-webkit-scrollbar-track { background: #f4f4f4; }
.stx-search-results::-webkit-scrollbar-thumb { background: #bdbdbd; border-radius: 7px; }
.stx-search-result {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 16px;
  min-height: 84px;
  padding: 12px 15px;
  border-radius: 4px;
  background: #f1f1f1;
  color: #747474 !important;
  text-decoration: none !important;
  transition: background-color .2s ease;
  font-family: var(--stx-search-font) !important;
}
.stx-search-result:hover,
.stx-search-result:focus-visible { background: #e7e7e7; }
.stx-search-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 60px;
  width: 60px;
  height: 54px;
  overflow: hidden;
  background: #ececec;
}
.stx-search-thumb img,
.stx-search-result-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: contain !important;
}
.stx-search-name {
  color: inherit;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--stx-search-font) !important;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}
.stx-search-empty { padding: 18px 0; color: #777; }
.stx-search-more {
  display: block;
  margin: 18px auto 0;
  padding: 10px 22px;
  border: 1px solid #bcbcbc !important;
  border-radius: 2px !important;
  background: transparent !important;
  color: #666 !important;
  font-size: 15px;
}
.stx-search-more:hover { border-color: #888 !important; }
.stx-search-more:disabled { opacity: .55; cursor: progress; }

/* Tablet: maintain generous side gutters while the background spans the browser. */
@media (max-width: 1024px) {
  .stx-search-content { width: calc(100% - 64px); max-width: 930px; }
}

@media (max-width: 767px) {
  /* Preserve the smaller search glyph, with a mobile-friendly tap target. */
  .stx-live-search .stx-search-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 9px;
  }
  .stx-search-toggle svg { width: 21px; height: 21px; }

  /* Mobile popup occupies the available space below the *visible* menu. */
  .stx-search-overlay {
    top: var(--stx-search-top);
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: var(--stx-search-available-height, calc(100dvh - var(--stx-search-top)));
    max-height: var(--stx-search-available-height, calc(100dvh - var(--stx-search-top)));
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: none;
  }
  .stx-search-close {
    top: 12px;
    right: max(12px, env(safe-area-inset-right));
    width: 40px;
    height: 40px;
  }
  .stx-search-close svg { width: 25px; height: 25px; }
  .stx-search-content {
    width: calc(100% - 32px);
    max-width: 930px;
    padding: 70px 0 max(25px, env(safe-area-inset-bottom));
  }
  .stx-search-form { height: 54px; }
  .stx-search-form .stx-search-input {
    height: 52px !important;
    padding: 0 15px !important;
    font-size: 16px !important; /* Prevents automatic zoom on iPhones. */
  }
  .stx-search-form .stx-search-input::placeholder { font-size: 13px !important; }
  .stx-search-form .stx-search-submit { flex-basis: 62px; height: 52px; }
  .stx-search-submit svg { width: 24px; height: 24px; }
  .stx-search-status { margin: 23px 0 18px !important; font-size: 14px; }
  .stx-search-results {
    max-height: max(120px, calc(var(--stx-search-available-height, 100dvh) - 230px));
    padding-right: 6px;
  }
  .stx-search-result { min-height: 74px; padding: 9px 10px; gap: 12px; }
  .stx-search-thumb { width: 52px; height: 51px; flex-basis: 52px; }
  .stx-search-name { font-size: 15px; }
  body.stx-search-is-open { overflow: hidden; }
}

/* Extremely narrow devices should still show the entire search field. */
@media (max-width: 359px) {
  .stx-search-content { width: calc(100% - 24px); }
  .stx-search-form .stx-search-input { padding: 0 10px !important; }
  .stx-search-form .stx-search-submit { flex-basis: 54px; }
}
