.psm-smart-search {
  --psm-accent: #f97316;
  --psm-search-width: 700px;
  --psm-search-height: 58px;
  --psm-border-width: 2px;
  --psm-radius: 12px;
  --psm-button-width: 112px;
  --psm-mobile-width: 94%;
  --psm-mobile-height: 52px;
  position: relative;
  width: min(var(--psm-search-width), calc(100vw - 32px));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: inherit;
  color: #172033;
}

/* Elementor's Shortcode widget can inherit a square border from the theme. */
.elementor-widget-shortcode:has(.psm-smart-search[data-psm-search]),
.elementor-widget-shortcode:has(.psm-smart-search[data-psm-search]) > .elementor-widget-container,
.elementor-shortcode:has(.psm-smart-search[data-psm-search]),
.psm-search-clean-host {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.psm-search-form {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.psm-search-box {
  display: flex;
  align-items: center;
  height: var(--psm-search-height);
  min-height: var(--psm-search-height);
  box-sizing: border-box;
  background: #fff;
  border: var(--psm-border-width) solid #d7dce3;
  border-radius: var(--psm-radius);
  box-shadow: 0 4px 16px rgba(25, 38, 58, .09);
  transition: border-color .2s, box-shadow .2s;
}

.psm-search-box:focus-within {
  border-color: var(--psm-accent);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .16), 0 8px 22px rgba(25, 38, 58, .12);
}

.psm-search-icon {
  width: 23px;
  height: 23px;
  margin-left: 18px;
  flex: 0 0 23px;
  fill: none;
  stroke: #667085;
  stroke-width: 2;
  stroke-linecap: round;
}

.psm-search-input {
  flex: 1;
  min-width: 0;
  height: calc(var(--psm-search-height) - (2 * var(--psm-border-width)));
  padding: 0 14px !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 16px !important;
  color: #172033 !important;
}

.psm-search-input::placeholder {
  color: #7d8798;
}

.psm-search-button {
  align-self: stretch;
  width: var(--psm-button-width);
  min-width: var(--psm-button-width);
  margin: calc(-1 * var(--psm-border-width)) calc(-1 * var(--psm-border-width)) calc(-1 * var(--psm-border-width)) 0 !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-radius: 0 var(--psm-radius) var(--psm-radius) 0 !important;
  background: var(--psm-accent) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  cursor: pointer;
  transition: filter .2s;
}

.psm-search-button:hover {
  filter: brightness(.92);
}

.psm-search-hint {
  margin: 8px 4px 0;
  color: #667085;
  font-size: 12px;
  text-align: center;
}

.psm-search-panel {
  position: absolute;
  z-index: 99999;
  top: calc(var(--psm-search-height) + 10px);
  left: 0;
  right: 0;
  overflow: hidden;
  max-height: min(72vh, 670px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e1e5eb;
  border-radius: max(8px, var(--psm-radius));
  box-shadow: 0 18px 50px rgba(14, 30, 54, .2);
}

.psm-search-panel[hidden] {
  display: none !important;
}

.psm-search-panel.is-portaled {
  position: fixed !important;
  right: auto !important;
  margin: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  touch-action: pan-y;
  z-index: 2147483000 !important;
}

.psm-results-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  padding: 12px 18px;
  background: #f7f8fa;
  border-bottom: 1px solid #e7eaf0;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.psm-results-heading small {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #788396;
}

.psm-product-result {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid #edf0f4;
  color: inherit !important;
  text-decoration: none !important;
  transition: background .16s;
}

.psm-product-result:hover,
.psm-product-result[aria-selected=true] {
  background: #fff8f2;
}

.psm-product-result img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid #edf0f3;
  border-radius: 9px;
  background: #fff;
}

.psm-result-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.psm-result-main strong {
  overflow: hidden;
  color: #1c2738;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.psm-result-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #6b7585;
}

.psm-exact-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eaf8ef;
  color: #16733a;
  font-size: 10px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.psm-result-price {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  color: #172033;
  font-weight: 700;
  white-space: nowrap;
}

.psm-result-price small {
  margin-top: 5px;
  color: var(--psm-accent);
  font-size: 11px;
  font-weight: 700;
}

.psm-search-status,
.psm-no-results {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 94px;
  padding: 20px;
  color: #667085;
}

.psm-search-status.is-error {
  color: #a23b32;
}

.psm-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #dfe3e8;
  border-top-color: var(--psm-accent);
  border-radius: 50%;
  animation: psm-spin .7s linear infinite;
}

.psm-no-results {
  flex-direction: column;
  text-align: center;
}

.psm-no-results strong {
  color: #263244;
  font-size: 17px;
}

.psm-no-results span:last-child {
  font-size: 13px;
}

.psm-no-results-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #fff1e8;
  color: var(--psm-accent);
  font-size: 20px;
  font-weight: 800;
}

.psm-contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 14px;
  padding: 18px;
  border: 1px solid #ffd5b8;
  border-radius: 11px;
  background: linear-gradient(135deg, #fff9f5, #fff);
}

.psm-contact-card.is-compact {
  margin: 10px 14px;
  padding: 12px 14px;
}

.psm-contact-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.psm-contact-copy strong {
  color: #263244;
  font-size: 14px;
}

.psm-contact-copy span {
  color: #687386;
  font-size: 12px;
  line-height: 1.4;
}

.psm-contact-actions {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.psm-contact-actions a {
  color: #475467 !important;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none !important;
  white-space: nowrap;
}

.psm-contact-actions .psm-contact-primary {
  padding: 9px 13px;
  border-radius: 7px;
  background: var(--psm-accent);
  color: #fff !important;
}

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

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

@media (max-width: 640px) {
  .psm-smart-search {
    width: min(var(--psm-mobile-width), calc(100vw - 20px));
  }

  .psm-search-box {
    height: var(--psm-mobile-height);
    min-height: var(--psm-mobile-height);
  }

  .psm-search-input {
    height: calc(var(--psm-mobile-height) - (2 * var(--psm-border-width)));
  }

  .psm-search-button {
    width: min(var(--psm-button-width), 96px);
    min-width: min(var(--psm-button-width), 96px);
    padding: 0 14px !important;
  }

  .psm-search-hint {
    display: none;
  }

  .psm-search-panel {
    top: calc(var(--psm-mobile-height) + 8px);
    max-height: 75vh;
  }

  .psm-product-result {
    grid-template-columns: 58px minmax(0, 1fr);
    padding: 11px 12px;
  }

  .psm-product-result img {
    width: 58px;
    height: 58px;
  }

  .psm-result-price {
    grid-column: 2;
    align-items: flex-start;
    margin-top: -8px;
  }

  .psm-contact-card,
  .psm-contact-card.is-compact {
    align-items: flex-start;
    flex-direction: column;
  }

  .psm-contact-actions {
    justify-content: flex-start;
  }

  .psm-contact-copy span {
    display: none;
  }
}
