/* ═══════════════════════════════════════════
   Global Search — Universal search bar
   Sommplicity · Desktop + Mobile
════════════════════════════════════════════ */

/* ── Desktop search ──────────────────────── */
.gs-wrap {
  position: relative;
  margin: 0 16px;
  flex-shrink: 1;
}
.gs-input {
  width: 360px;
  height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--border-light, #E8E0D4);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink, #2C1810);
  background: var(--white, #fff);
  outline: none;
  transition: width 0.3s ease, border-color 0.2s;
}
.gs-input:focus {
  width: 480px;
  border-color: var(--maroon, #722F37);
}
.gs-input::placeholder {
  color: var(--ink-xlight, #6B6B6B);
  font-size: 0.95rem;
}

/* Transparent header adjustment */
.topnav--transparent .gs-input {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  color: #FAF7F2;
}
.topnav--transparent .gs-input::placeholder { color: rgba(255,255,255,0.5); }
.topnav--transparent .gs-input:focus {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}

/* Dropdown */
.gs-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--white, #fff);
  border: 1px solid var(--border-light, #E8E0D4);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
}

/* Categories */
.gs-category {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light, #E8E0D4);
}
.gs-category:last-child { border-bottom: none; }
.gs-category-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-xlight, #A0917F);
  padding: 4px 14px;
}

/* Result items */
.gs-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 44px;
}
.gs-result-item:hover,
.gs-result-item.gs-active {
  background: var(--bg-warm, #F5F0E8);
}
.gs-result-type {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--maroon, #722F37);
  flex-shrink: 0;
  width: 60px;
}
.gs-result-name {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink, #2C1810);
  flex-shrink: 0;
}
.gs-result-name mark {
  background: rgba(184,148,62,0.2);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.gs-result-desc {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink-light, #5C4A3A);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* No results */
.gs-no-results {
  padding: 24px 14px;
  text-align: center;
}
.gs-no-results-text {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-light, #5C4A3A);
  margin-bottom: 12px;
}
.gs-no-results-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.gs-quick-link {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--maroon, #722F37);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 8px;
}

/* Best match card */
.gs-best-match {
  border-bottom: 1px solid var(--border-light, #E8E0D4);
  padding-bottom: 4px;
  margin-bottom: 4px;
}
.gs-best-match-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold, #B8943E);
  padding: 8px 14px 2px;
}
.gs-best-match-item {
  background: rgba(184,148,62,0.06);
}

/* Result note (synonym / association info) */
.gs-result-note {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-style: italic;
  color: var(--gold, #B8943E);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* See all link */
.gs-see-all {
  display: block;
  padding: 6px 14px 8px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--maroon, #722F37);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.gs-see-all:hover {
  background: var(--bg-warm, #F5F0E8);
}

/* Pocket Somm link in empty results */
.gs-pocket-somm-link {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--maroon, #722F37);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 10px 14px;
  min-height: 44px;
  justify-content: center;
}

/* ── Mobile search icon ──────────────────── */
.gs-mobile-icon {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--ink, #2C1810);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.gs-mobile-icon svg {
  width: 20px;
  height: 20px;
}
.topnav--transparent .gs-mobile-icon { color: #FAF7F2; }

/* ── Mobile overlay ──────────────────────── */
.gs-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg, #FAF7F2);
  display: none;
  flex-direction: column;
}
.gs-mobile-overlay.gs-mobile-open { display: flex; }
.gs-mobile-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light, #E8E0D4);
}
.gs-mobile-input {
  flex: 1;
  height: 56px;
  padding: 12px 16px;
  border: 1px solid var(--border-light, #E8E0D4);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink, #2C1810);
  background: var(--white, #fff);
  outline: none;
}
.gs-mobile-input:focus { border-color: var(--maroon, #722F37); }
.gs-mobile-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--ink-light, #5C4A3A);
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gs-mobile-results {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .gs-wrap { display: none; }
  .gs-mobile-icon { display: flex; }
}
