/* Homepage vitamin aisle search — cache-bust with the <link> in index.html */

/* Let the suggestion list hang over the mosaic below the compact hero */
.hero.hero-compact {
  overflow: visible;
}

.home-vitamin-search {
  margin: 0 0 1.4rem;
  max-width: 44rem;
  width: 100%;
  position: relative;
  z-index: 6;
}
@media (min-width: 1100px) {
  .hero-copy .home-vitamin-search { max-width: none; }
}

.home-vitamin-search > label {
  display: block;
  margin: 0 0 .5rem;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--sand-2, #efe4d0);
}

.home-vitamin-search-row {
  display: flex;
  align-items: stretch;
  gap: .45rem;
  min-width: 0;
  position: relative;
}

.home-vitamin-qwrap {
  flex: 1 1 auto;
  min-width: 0;
}

#home-vitamin-q {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: .75rem 1.05rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink, #1a2428);
  font: inherit;
  font-size: 16px; /* 16px avoids iOS zoom on focus */
  line-height: 1.3;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

#home-vitamin-q::placeholder {
  color: #6a7a80;
}

#home-vitamin-q:focus {
  outline: 3px solid var(--water-lt, #4ea3b0);
  outline-offset: 2px;
}

.home-vitamin-search .btn {
  flex: 0 0 auto;
  min-height: 48px;
  min-width: 4.5rem;
  padding: .7rem 1.2rem;
}

#home-vitamin-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 7;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  color: var(--ink, #1a2428);
  border: 1px solid var(--sand-3, #e2d0b0);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(16, 42, 51, .22);
  max-height: min(50vh, 360px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

#home-vitamin-suggest[hidden] {
  display: none;
}

#home-vitamin-suggest li[role="option"] {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  min-height: 44px;
  padding: .65rem 1rem;
  cursor: pointer;
  font-size: 16px;
  line-height: 1.3;
}

#home-vitamin-suggest li[role="option"][aria-selected="true"],
#home-vitamin-suggest li[role="option"]:hover {
  background: #e8f1f6;
}

#home-vitamin-suggest .pn {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

#home-vitamin-suggest .pn .brand {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--teal, #1f5d6b);
  margin-bottom: .12rem;
}

#home-vitamin-suggest .meta {
  flex: 0 0 auto;
  max-width: 42%;
  color: #4d6270;
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: right;
  white-space: normal;
}

#home-vitamin-suggest li.hint,
#home-vitamin-suggest li.empty,
#home-vitamin-suggest li.error {
  min-height: 0;
  padding: .7rem 1rem;
  font-size: .9rem;
  color: #4d6270;
  cursor: default;
}

@media (max-width: 420px) {
  #home-vitamin-suggest li[role="option"] {
    flex-direction: column;
    gap: .2rem;
  }
  #home-vitamin-suggest .meta {
    max-width: none;
    text-align: left;
  }
}


@media (max-width: 420px) {
  .home-vitamin-search-row { flex-wrap: wrap; }
  .home-vitamin-qwrap { flex: 1 1 100%; }
  .home-vitamin-search .btn { width: 100%; }
}

/* Header compact search — shares the same JS as the hero form */
.header-search {
  position: relative;
  flex: 1 1 12rem;
  min-width: 0;
  max-width: 22rem;
  margin: 0 0 0 auto;
  z-index: 3;
}
.header-search-fields {
  position: relative;
  min-width: 0;
}
.header-search input[name="q"] {
  display: block;
  width: 100%;
  min-width: 0;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0 .9rem 0 2.1rem;
  border: 1.5px solid rgba(16, 42, 51, .28);
  border-radius: 999px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23102a33' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 L20 20'/%3E%3C/svg%3E") 0.7rem 50% / 1rem 1rem no-repeat;
  color: #102a33;
  font: inherit;
  font-size: 16px;
  line-height: 1.2;
}
.header-search input[name="q"]::placeholder { color: #5a6a6e; }
.header-search input[name="q"]:focus {
  outline: 3px solid #4ea3b0;
  outline-offset: 1px;
  border-color: #1f5d6b;
}
.header-search-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #102a33;
  cursor: pointer;
  border-radius: 8px;
}
.header-search-toggle svg { width: 22px; height: 22px; display: block; }
.header-search .vitamin-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 130;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  color: #1a2428;
  border: 1px solid #e2d0b0;
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(16, 42, 51, .22);
  max-height: min(60vh, 360px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.header-search .vitamin-suggest[hidden] { display: none; }
.header-search .vitamin-suggest li[role="option"] {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  min-height: 44px;
  padding: .6rem .9rem;
  cursor: pointer;
  font-size: 16px;
  line-height: 1.3;
}
.header-search .vitamin-suggest li[role="option"][aria-selected="true"],
.header-search .vitamin-suggest li[role="option"]:hover { background: #e8f1f6; }
.header-search .vitamin-suggest .pn { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.header-search .vitamin-suggest .pn .brand {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: #1f5d6b;
  margin-bottom: .1rem;
}
.header-search .vitamin-suggest .meta {
  flex: 0 0 auto;
  max-width: 42%;
  color: #4d6270;
  font-size: .75rem;
  font-weight: 650;
  text-align: right;
}
.header-search .vitamin-suggest li.hint,
.header-search .vitamin-suggest li.empty,
.header-search .vitamin-suggest li.error {
  min-height: 0;
  padding: .7rem 1rem;
  font-size: .9rem;
  color: #4d6270;
  cursor: default;
}

@media (max-width: 767px) {
  .header-search {
    flex: 0 0 auto;
    max-width: none;
    margin-left: auto;
  }
  .header-search-toggle { display: inline-flex; }
  .header-search-fields { display: none; }
  .header-search.is-open {
    position: absolute;
    left: .4rem;
    right: 3.25rem;
    top: 0;
    bottom: 0;
    max-width: none;
    display: flex;
    align-items: center;
    gap: .25rem;
    background: #fff8ee;
    z-index: 4;
    padding: 0 .15rem;
  }
  .header-search.is-open .header-search-fields {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
  }
  .header-search.is-open .header-search-toggle { display: inline-flex; }
}
