/* ===============================
   GLOBAL SEARCH STYLES
   Works both for header & standalone contexts
   =============================== */

.product-search,
.nav-search {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0.5rem;
  border: 1px solid black;
  background: #fff;
  border-radius: 4px;
}

@media (width < 1100px) {

  .product-search,
  .nav-search {
    width: 100%;
  }
}

input.search-input {
  background: white;
}

input:hover,
input:focus {
  background: none !important;
}

/* Search input */
.search-input {
  width: 100%;
  margin-bottom: 0px !important;
  padding: 0.3rem;
  font-size: 0.7rem !important;
  transition: width 0.3s ease, border-color 0.2s ease;
  border: none !important;
}

.search-input::placeholder {
  color: #000;
  opacity: 1;
}

div.product-search i {
  font-size: 0.7rem;
}

input.search-input {
  font-size: 0.9rem !important;
}

/* Search results dropdown */
.search-results {
  position: absolute;
  max-height: 400px;
  min-width: 100%;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.2s ease;
  padding: 0.5rem;
  float: left;
}

.search-results.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

/* Scrollbar styling */
.search-results::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* Each search result */
.search-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid #eee;
  transition: background 0.2s ease;
}

.search-result:last-child {
  border-bottom: none;
}

.search-result:hover {
  background: #fafafa;
}

/* Image thumbnail */
.search-result img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.search-results .amount {
  font-size: 0.8rem !important;
  display: inline-flex;
  font-weight: 700;
  flex-wrap: wrap;
}

/* Product info */
.product-name {
  font-size: 0.9rem;
  font-weight: 700;
}

.search-close {
  display: none;
}

.search-close.show {
  display: block;
  margin-right: 10px;
  font-size: 0.75rem;
  font-weight: 800 !important;
}

.search-result strong {
  font-size: 0.9rem;
  color: #333;
}

p.desc {
  font-size: 0.75rem !important;
  margin: 0.25rem 0 0;
  line-height: 1.5 !important;
}

a.view-product {
  font-size: 0.7rem;
  text-decoration: underline;
  font-weight: 700;
  color: inherit;
}

@media (width < 1100px) {
  .search-results {
    left: 0px;
    width: 100%;
  }
}