/**
 * OG Smart Search — shared combobox + results page styles.
 */

.og-smart-search {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.og-smart-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 10px 0 14px;
  border: 1px solid #d5deea;
  border-radius: 14px;
  background: #fff;
  box-sizing: border-box;
}

.og-smart-search.is-open .og-smart-search-field,
.og-smart-search-field:focus-within {
  border-color: #1467d8;
  box-shadow: 0 0 0 3px rgba(20, 103, 216, 0.12);
}

.og-smart-search-icon {
  flex: 0 0 auto;
  color: #6b7c93;
  font-size: 16px;
  line-height: 1;
}

.og-smart-search-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  color: #07142b;
  font-size: 16px;
  line-height: 1.3;
  -webkit-appearance: none;
  appearance: none;
}

.og-smart-search-input:hover,
.og-smart-search-input:focus,
.og-smart-search-input:focus-visible,
.og-smart-search-input:active {
  border: 0;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
}

.og-smart-search-submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: #1467d8;
  color: #fff;
  cursor: pointer;
}

.og-smart-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 80;
  max-height: min(70vh, 420px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #d5deea;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(7, 20, 43, 0.12);
  box-sizing: border-box;
}

.og-smart-search-option,
.og-smart-search-view-all {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  box-sizing: border-box;
}

.og-smart-search-option:hover,
.og-smart-search-option.is-active,
.og-smart-search-view-all:hover,
.og-smart-search-view-all.is-active {
  background: #f3f7fd;
}

.og-smart-search-option-media {
  flex: 0 0 auto;
}

.og-smart-search-thumb {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: #eef3f9;
}

.og-smart-search-thumb--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1467d8;
  font-weight: 700;
}

.og-smart-search-option-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.og-smart-search-option-title {
  color: #07142b;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.og-smart-search-option-meta {
  color: #5b6b80;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.og-smart-search-option-price {
  flex: 0 0 auto;
  color: #1467d8;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.og-smart-search-option-price.is-quote {
  color: #5b6b80;
  font-weight: 600;
}

.og-smart-search-view-all {
  margin-top: 2px;
  border-top: 1px solid #e6edf5;
  border-radius: 0 0 10px 10px;
  color: #1467d8;
  font-size: 14px;
  font-weight: 700;
}

/* Results page (desktop listing; inputs remain Mobile App–only) */
.og-smart-search-results-page {
  padding: 32px 0 64px;
}

.og-smart-search-results-head {
  margin: 0 0 24px;
}

.og-smart-search-results-head h1 {
  margin: 0 0 8px;
  color: #07142b;
  font-size: clamp(1.75rem, 2vw, 2.25rem);
  line-height: 1.15;
}

.og-smart-search-results-sub {
  margin: 0 0 20px;
  color: #5b6b80;
  font-size: 1.05rem;
}

.og-smart-search-results-toolbar {
  margin-bottom: 28px;
  max-width: 640px;
}

.og-smart-search-empty {
  padding: 28px 0;
}

.og-smart-search-empty h2 {
  margin: 0 0 10px;
  color: #07142b;
  font-size: 1.35rem;
}

.og-smart-search-empty p {
  margin: 0 0 18px;
  color: #5b6b80;
}

.og-smart-search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

@media (max-width: 820px) {
  .og-smart-search-dropdown {
    z-index: 120;
    max-height: min(55vh, 360px);
  }

  /* Keep suggestions above sticky bottom nav */
  body.og-mobile-app-ready .og-smart-search-dropdown {
    max-height: min(48vh, 320px);
  }

  /*
   * Mobile Smart Search — one unified shell.
   * Neutralize legacy Home/Shop/Search input "inner pill" focus boxes
   * (.og-mobile-home-search-input:focus box-shadow, shop input outline, etc.).
   * Accessible focus stays on .og-smart-search-field via :focus-within.
   */
  body.og-mobile-app-ready .og-smart-search-input,
  body.og-mobile-app-ready .og-smart-search-input.og-mobile-home-search-input,
  body.og-mobile-app-ready .og-smart-search-input.og-mobile-shop-search-input,
  body.og-mobile-app-ready .og-smart-search-input.og-mobile-search-field,
  body.og-mobile-app-ready .og-smart-search-input:hover,
  body.og-mobile-app-ready .og-smart-search-input:focus,
  body.og-mobile-app-ready .og-smart-search-input:focus-visible,
  body.og-mobile-app-ready .og-smart-search-input:active,
  body.og-mobile-app-ready .og-smart-search-input.og-mobile-home-search-input:focus,
  body.og-mobile-app-ready .og-smart-search-input.og-mobile-shop-search-input:focus-visible,
  body.og-mobile-app-ready .og-smart-search-input.og-mobile-search-field:focus {
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }

  body.og-mobile-app-ready .og-smart-search-input:-webkit-autofill,
  body.og-mobile-app-ready .og-smart-search-input:-webkit-autofill:hover,
  body.og-mobile-app-ready .og-smart-search-input:-webkit-autofill:focus,
  body.og-mobile-app-ready .og-smart-search-input:-webkit-autofill:active {
    -webkit-text-fill-color: #07142b !important;
    caret-color: #07142b;
    border-radius: 0 !important;
    transition: background-color 99999s ease-out 0s;
    box-shadow: 0 0 0 1000px transparent inset !important;
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
  }

  body.og-mobile-app-ready .og-smart-search-field {
    border: 1px solid #d5deea;
    border-radius: 14px;
    background: #fff;
    box-shadow: none;
  }

  body.og-mobile-app-ready .og-smart-search-field:focus-within,
  body.og-mobile-app-ready .og-smart-search.is-open .og-smart-search-field {
    border-color: #1467d8 !important;
    box-shadow: 0 0 0 3px rgba(20, 103, 216, 0.12) !important;
  }

  /* Flatten legacy Home/Shop wrappers so they are not a second shell. */
  body.og-mobile-app-ready .og-mobile-home-search .og-smart-search-field,
  body.og-mobile-app-ready .og-mobile-shop-search .og-smart-search-field,
  body.og-mobile-app-ready .og-mobile-search-form.og-smart-search .og-smart-search-field {
    min-height: 52px;
  }

  body.og-mobile-app-ready .og-mobile-shop-search {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .og-smart-search-results-page {
    padding: 20px 0 96px;
  }

  .og-search-desktop-root {
    display: none;
  }
}

@media (min-width: 821px) {
  .og-search-page .og-mobile-app-search,
  .og-search-page [data-og-mobile-search] {
    display: none;
  }
}
