/* ================================================================
   THUS ESSENTIALS — search.css
   Global Real-Time Product Autocomplete & Live Search Dropdown
   ================================================================ */

.live-search-wrapper {
  position: relative !important;
  width: 100%;
}

.live-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  width: 100%;
  max-height: min(460px, 65vh);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(139, 115, 85, 0.22);
  border-radius: 16px;
  box-shadow: 0 24px 60px -12px rgba(28, 25, 23, 0.2),
              0 6px 18px rgba(0, 0, 0, 0.06),
              0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100050;
  display: flex;
  flex-direction: column;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.99);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.22s;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 115, 85, 0.3) transparent;
}

.live-search-dropdown::-webkit-scrollbar {
  width: 4px;
}

.live-search-dropdown::-webkit-scrollbar-thumb {
  background: rgba(139, 115, 85, 0.25);
  border-radius: 4px;
}

.live-search-dropdown.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Results Header / Meta */
.live-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px 6px;
  border-bottom: 1px solid rgba(139, 115, 85, 0.1);
  margin-bottom: 4px;
}

.live-search-header-title {
  font-family: var(--sans, "Inter", sans-serif);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8C8276;
}

.live-search-header-count {
  font-family: var(--sans, "Inter", sans-serif);
  font-size: 0.6rem;
  color: #8C8276;
}

/* Item List */
.live-search-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.live-search-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.live-search-item:hover,
.live-search-item.is-selected,
.live-search-item:focus-visible {
  background: rgba(243, 239, 233, 0.85);
  border-color: rgba(139, 115, 85, 0.25);
  transform: translateX(3px);
}

.live-search-thumb {
  width: 48px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  background: #EAE5DC;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.live-search-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.live-search-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-grow: 1;
  min-width: 0;
}

.live-search-category {
  font-family: var(--sans, "Inter", sans-serif);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8C8276;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-search-name {
  font-family: var(--serif, "Cormorant Garamond", Georgia, serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink, #1C1917);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-search-name mark,
.live-search-match {
  background: rgba(200, 169, 122, 0.32);
  color: #1C1917;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

.live-search-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-search-price {
  font-family: var(--sans, "Inter", sans-serif);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink, #1C1917);
}

.live-search-badge {
  font-family: var(--sans, "Inter", sans-serif);
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 100px;
  background: rgba(139, 115, 85, 0.12);
  color: #8B7355;
}

.live-search-badge--soldout {
  background: rgba(220, 38, 38, 0.1);
  color: #DC2626;
}

.live-search-arrow {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #8C8276;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s ease;
}

.live-search-item:hover .live-search-arrow,
.live-search-item.is-selected .live-search-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--ink, #1C1917);
}

/* Empty State */
.live-search-empty {
  padding: 28px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.live-search-empty-icon {
  width: 32px;
  height: 32px;
  color: #B8ADA0;
  stroke-width: 1.2;
}

.live-search-empty-text {
  font-family: var(--serif, "Cormorant Garamond", Georgia, serif);
  font-size: 1.15rem;
  font-style: italic;
  color: #5C554E;
  margin: 0;
}

.live-search-empty-sub {
  font-family: var(--sans, "Inter", sans-serif);
  font-size: 0.68rem;
  color: #8C8276;
  margin: 0;
}

.live-search-browse-btn {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--ink, #1C1917);
  color: #FAF8F4 !important;
  border-radius: 100px;
  font-family: var(--sans, "Inter", sans-serif);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s ease;
}

.live-search-browse-btn:hover {
  background: #8B7355;
  transform: translateY(-1px);
}

/* Loading State */
.live-search-loading {
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #8C8276;
  font-family: var(--sans, "Inter", sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-search-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(139, 115, 85, 0.2);
  border-top-color: #8B7355;
  border-radius: 50%;
  animation: live-search-spin 0.7s linear infinite;
}

@keyframes live-search-spin {
  to { transform: rotate(360deg); }
}

/* Footer / Keyboard hints */
.live-search-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px 4px;
  border-top: 1px solid rgba(139, 115, 85, 0.1);
  margin-top: 4px;
}

.live-search-hints {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans, "Inter", sans-serif);
  font-size: 0.58rem;
  color: #8C8276;
}

.live-search-key {
  display: inline-block;
  padding: 1px 5px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  font-size: 0.52rem;
  font-weight: 600;
  color: #4A443E;
}

.live-search-view-all {
  font-family: var(--sans, "Inter", sans-serif);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8B7355;
  text-decoration: none;
  transition: color 0.2s ease;
}

.live-search-view-all:hover {
  color: var(--ink, #1C1917);
  text-decoration: underline;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .live-search-dropdown {
    max-height: 55vh;
    padding: 6px;
  }
  
  .live-search-item {
    padding: 8px 10px;
    gap: 10px;
  }
  
  .live-search-thumb {
    width: 42px;
    height: 52px;
  }
  
  .live-search-name {
    font-size: 0.95rem;
  }

  .live-search-hints {
    display: none;
  }
}
