/* AtHomeGrower site-wide inventory search */

.ahg-global-search {
  position: relative;
  flex: 0 1 315px;
  min-width: 230px;
  order: 2;
}

.ahg-global-search__form {
  display: flex;
  align-items: center;
  width: 100%;
}

.ahg-global-search__input {
  width: 100%;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(47, 111, 78, 0.22);
  background: rgba(255, 255, 255, 0.94);
  color: #17351f;
  padding: 0.65rem 2.85rem 0.65rem 0.95rem;
  font-weight: 750;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.ahg-global-search__input:focus,
.ahg-search-large input:focus {
  border-color: rgba(47, 111, 78, 0.58);
  box-shadow: 0 0 0 4px rgba(47, 111, 78, 0.12);
}

.ahg-global-search__button {
  position: absolute;
  right: 0.25rem;
  top: 0.25rem;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #2f6f4e;
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}

.ahg-search-suggestions,
.ahg-global-search__suggestions {
  display: none;
  position: absolute;
  z-index: 100000;
  left: 0;
  right: 0;
  top: calc(100% + 0.5rem);
  background: #ffffff;
  border: 1px solid rgba(47, 111, 78, 0.18);
  border-radius: 1rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.ahg-search-suggestions[data-open="true"],
.ahg-global-search__suggestions[data-open="true"] {
  display: block;
}

.ahg-search-suggestion,
.ahg-global-search__suggestion {
  display: grid;
  gap: 0.12rem;
  padding: 0.75rem 0.9rem;
  text-decoration: none !important;
  color: #17351f;
  border-bottom: 1px solid rgba(47, 111, 78, 0.08);
}

.ahg-search-suggestion:hover,
.ahg-search-suggestion[aria-selected="true"],
.ahg-global-search__suggestion:hover,
.ahg-global-search__suggestion[aria-selected="true"] {
  background: #f0fdf4;
}

.ahg-search-suggestion strong,
.ahg-global-search__suggestion strong {
  font-size: 0.96rem;
}

.ahg-search-suggestion span,
.ahg-global-search__suggestion span {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 750;
}

.ahg-search-suggestion em,
.ahg-global-search__suggestion em {
  font-style: normal;
  width: fit-content;
  margin-top: 0.18rem;
  padding: 0.15rem 0.42rem;
  border-radius: 999px;
  background: #ecfccb;
  color: #365314;
  font-size: 0.72rem;
  font-weight: 950;
}

.ahg-search-page {
  background: #faf8f1;
  min-height: 100vh;
  color: #1f2937;
}

.ahg-search-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0;
}

.ahg-search-hero h1 {
  margin: 0;
  color: #17351f;
  font-size: clamp(2.2rem, 6vw, 4.65rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.ahg-search-hero p {
  color: #64748b;
  line-height: 1.65;
  font-size: 1.05rem;
}

.ahg-search-large-wrap {
  position: relative;
}

.ahg-search-large {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  margin-top: 1.25rem;
  background: #ffffff;
  border: 1px solid rgba(47, 111, 78, 0.18);
  border-radius: 1.35rem;
  padding: 0.75rem;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.ahg-search-large input {
  border: 1px solid transparent;
  outline: 0;
  min-height: 52px;
  font-size: 1.05rem;
  font-weight: 750;
  color: #17351f;
  padding: 0 0.85rem;
  border-radius: 0.85rem;
}

.ahg-search-large button {
  border: 0;
  border-radius: 999px;
  padding: 0 1.2rem;
  background: #2f6f4e;
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}

.ahg-search-status {
  color: #52675a;
  font-weight: 850;
  margin: 1.25rem 0 0.75rem;
}

.ahg-search-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.ahg-search-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(47, 111, 78, 0.16);
  border-radius: 999px;
  background: #fff;
  color: #24583d;
  font-weight: 850;
  font-size: 0.85rem;
  padding: 0.42rem 0.68rem;
  text-decoration: none !important;
}

.ahg-search-chip:hover {
  background: #f0fdf4;
}

.ahg-search-result {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 1rem;
  background: #ffffff;
  border: 1px solid rgba(47, 111, 78, 0.16);
  border-radius: 1.15rem;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.ahg-search-result img {
  width: 94px;
  height: 94px;
  object-fit: cover;
  border-radius: 1rem;
  background: #f8fafc;
}

.ahg-search-result__fallback {
  width: 94px;
  height: 94px;
  border-radius: 1rem;
  background: linear-gradient(135deg, #17351f, #2f6f4e);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 950;
  font-size: 1.35rem;
}

.ahg-search-result h2 {
  margin: 0;
  color: #17351f;
  font-size: 1.28rem;
}

.ahg-search-meta {
  color: #64748b;
  font-weight: 750;
  margin: 0.2rem 0 0.5rem;
}

.ahg-search-pages {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.ahg-search-page-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.62rem 0.75rem;
  border-radius: 0.85rem;
  background: #f8fafc;
  text-decoration: none !important;
  color: #17351f;
  border: 1px solid rgba(47, 111, 78, 0.10);
}

.ahg-search-page-link:hover {
  background: #f0fdf4;
}

.ahg-search-page-link strong {
  font-weight: 950;
}

.ahg-search-page-link span {
  color: #64748b;
  font-size: 0.88rem;
}

.ahg-search-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.22rem 0.52rem;
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
  font-size: 0.74rem;
  font-weight: 950;
}

.ahg-search-type {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.22rem 0.52rem;
  background: #ecfccb;
  color: #365314;
  border: 1px solid #bef264;
  font-size: 0.74rem;
  font-weight: 950;
}

@media (max-width: 1080px) {
  .ahg-global-search {
    order: 2;
    width: 100%;
    flex-basis: auto;
  }
}

@media (max-width: 760px) {
  .ahg-search-large {
    grid-template-columns: 1fr;
  }

  .ahg-search-large button {
    min-height: 48px;
  }

  .ahg-search-result {
    grid-template-columns: 1fr;
  }

  .ahg-search-result img,
  .ahg-search-result__fallback {
    width: 100%;
    height: 180px;
  }
}
