/* =============================================================================
   Search Component
   ============================================================================= */

/* The .search-wrapper border/radius is handled in header.css.
   This file covers the dropdown results panel and its items. */

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(0,0,0,.15);
  border: 1px solid #e5e5e5;
  overflow: hidden;
  z-index: 400;
  max-height: 480px;
  overflow-y: auto;
}

.search-dropdown__section {
  border-bottom: 1px solid #f0f0f0;
}
.search-dropdown__section:last-child {
  border-bottom: none;
}

.search-dropdown__heading {
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #606060;
  background: #f8f8f8;
}

.search-dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: #0f0f0f;
  text-decoration: none;
  transition: background var(--transition-fast);
}
.search-dropdown__item:hover {
  background: #f2f2f2;
  color: #0f0f0f;
}

.search-dropdown__item-img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: #e5e5e5;
}

.search-dropdown__item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.search-dropdown__item-title {
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-dropdown__item-sub {
  font-size: var(--font-size-xs);
  color: #606060;
}

.search-dropdown__view-all {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-xs);
  color: var(--color-highlight);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition-fast);
}
.search-dropdown__view-all:hover {
  background: #f2f2f2;
  color: var(--color-highlight);
}

.search-dropdown__message {
  padding: var(--space-5) var(--space-4);
  text-align: center;
  color: #606060;
  font-size: var(--font-size-sm);
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .search-dropdown {
    /* on small screens anchor to viewport edges */
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    max-height: 60vh;
  }
}

/* ── Trending / empty state ─────────────────────────────────────────────────── */
.search-dropdown__trending-section {
  padding: 8px 0 4px;
  border-bottom: 1px solid #f0f0f0;
}
.search-dropdown__trending-section:last-child {
  border-bottom: none;
}

.search-dropdown__trending-label {
  padding: 4px 16px 6px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #aaa;
  display: flex;
  align-items: center;
  gap: 5px;
}

.search-dropdown__category-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f2f2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  color: #888;
}

.search-dropdown__section-icon {
  font-size: 10px;
  margin-right: 3px;
  opacity: .65;
}

/* Highlight matched text */
.search-dropdown__item-title strong {
  color: var(--color-highlight, #e94560);
  font-weight: 700;
}
