/* Search — Knuspr style */

.header__search {
  position: relative;
}

.header__search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: var(--c-primary, #1f8b4c);
  border: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s;
  z-index: 2;
}
.header__search-btn:hover { background: var(--c-primary-dark, #156635); }
.header__search-btn svg { color: #fff; }

#searchInput {
  padding-right: 48px !important;
}

/* Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  max-height: 420px;
  overflow-y: auto;
  display: none;
  z-index: 9000;
}
.search-dropdown.open { display: block; }

.search-dropdown__empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: #888;
  font-size: .9rem;
}

.search-dropdown__heading {
  padding: .6rem 1rem .3rem;
  font-size: .7rem;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.search-dropdown__item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem 1rem;
  text-decoration: none;
  color: #1a1d1b;
  transition: background .1s;
  cursor: pointer;
}
.search-dropdown__item:hover,
.search-dropdown__item.active {
  background: #f5f5f3;
}

.search-dropdown__item-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0f0f0;
  flex-shrink: 0;
}
.search-dropdown__item-img--placeholder {
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f0f0f0;
  flex-shrink: 0;
}

.search-dropdown__item-info {
  flex: 1;
  min-width: 0;
}

.search-dropdown__item-name {
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-dropdown__item-name mark {
  background: rgba(255,107,0,.15);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.search-dropdown__item-supplier {
  font-size: .7rem;
  color: #888;
}

.search-dropdown__item-price {
  font-size: .85rem;
  font-weight: 700;
  color: #1a1d1b;
  flex-shrink: 0;
}

.search-dropdown__viewall {
  display: block;
  text-align: center;
  padding: .75rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  color: #ff6b00;
  border-top: 1px solid #eee;
  text-decoration: none;
  transition: background .1s;
}
.search-dropdown__viewall:hover { background: #fff8f0; }

/* Full results view (replaces product rows when searching) */
.search-results {
  padding: 1rem 0;
}

.search-results__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 1rem;
}

.search-results__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1d1b;
}
.search-results__title span { color: #888; font-weight: 400; }

.search-results__clear {
  background: none;
  border: none;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: #ff6b00;
  cursor: pointer;
}
.search-results__clear:hover { text-decoration: underline; }

.search-results__grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

@media (min-width: 600px) {
  .search-results__grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

.search-results__none {
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
  font-size: 1rem;
}
.search-results__none strong { color: #1a1d1b; }

/* Homepage Knuspr — botão pesquisa verde */
body.home-knuspr .header__search-btn {
  background: #0a8f3c;
}
body.home-knuspr .header__search-btn:hover {
  background: #067d32;
}
