/* =========================================================
   Header Search Bar (compact + expanded) — shared across
   non-homepage pages. Submitting redirects to homepage.
   ========================================================= */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 300px;
  height: 38px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 0 12px;
  transition: all 0.25s ease;
  margin-left: auto;
  margin-right: 16px;
}
.header-search-icon {
  flex-shrink: 0;
  color: rgba(255,255,255,0.7);
  margin-right: 8px;
}
.header-search-input {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  min-width: 0;
}
.header-search-input::placeholder {
  color: rgba(255,255,255,0.55);
}
.header-search-clear,
.header-search-cancel,
.header-search-submit {
  display: none;
}

/* --- Expanded search state (popup dropdown) --- */
.header-search.expanded {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  z-index: 2000;
  flex: none;
  width: 720px;
  max-width: calc(100vw - 64px);
  height: 52px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 0 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.header-search.expanded .header-search-icon {
  color: #999;
}
.header-search.expanded .header-search-input {
  color: #1a1a1a;
  font-size: 18px;
  font-weight: 500;
}
.header-search.expanded .header-search-input::placeholder {
  color: #999;
}
.header-search.expanded .header-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: none; background: rgba(0,0,0,0.08);
  border-radius: 50%;
  color: #666; font-size: 18px; font-weight: 600;
  cursor: pointer; flex-shrink: 0;
  line-height: 1; padding: 0;
  margin-right: 8px;
  transition: background 0.15s ease;
}
.header-search.expanded .header-search-clear:hover {
  background: rgba(0,0,0,0.15);
}
.header-search.expanded .header-search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: none;
  background: #072908;
  border-radius: 8px;
  color: #fff;
  cursor: pointer; flex-shrink: 0;
  margin-right: 12px;
  transition: background 0.15s ease;
}
.header-search.expanded .header-search-submit:hover {
  background: #0b4f2d;
}
.header-search.expanded .header-search-cancel {
  display: flex;
  align-items: center;
  background: none; border: none;
  color: #1a1a1a;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer; flex-shrink: 0;
  padding: 4px 0;
  white-space: nowrap;
}
.header-search.expanded .header-search-cancel:hover {
  color: #072908;
}

/* Flatten search bar bottom corners when suggestions are visible */
.brand-header.search-active .header-search.expanded {
  border-radius: 12px 12px 0 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}

/* Elevate header above overlay when search is expanded */
.brand-header.search-active {
  z-index: 2000;
}

/* --- Search overlay --- */
.search-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.45);
  z-index: 1500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.search-overlay.active {
  opacity: 1; pointer-events: auto;
}

/* --- Autocomplete suggestions --- */
.search-suggestions {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 2001;
  padding: 16px 0;
  max-height: 400px;
  overflow-y: auto;
  border-radius: 0 0 12px 12px;
}
.search-suggestions.visible {
  display: block;
}
.suggestions-heading {
  font-size: 12px; font-weight: 800;
  letter-spacing: 0.8px; color: #1a1a1a;
  padding: 0 24px 12px;
}
.suggestion-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
  font-size: 15px; color: #1a1a1a;
  cursor: pointer;
  transition: background 0.1s ease;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover {
  background: rgba(0,0,0,0.04);
}
.suggestion-icon {
  flex-shrink: 0;
  color: #999;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .header-search {
    flex: 0 1 220px;
    margin-right: 10px;
  }
}
@media (max-width: 640px) {
  .header-search {
    order: 3;
    flex: 1 1 100%;
    max-width: calc(100vw - 24px);
    height: 36px;
    padding: 0 10px;
    margin: 8px 0 0;
    margin-left: 0;
    margin-right: 0;
    border-radius: 8px;
  }
  .header-search-input {
    font-size: 14px;
  }
  .header-search.expanded {
    width: calc(100vw - 32px);
    left: 50%;
    transform: translateX(-50%);
    height: 48px;
    padding: 0 12px;
    top: 12px;
    border-radius: 12px 12px 0 0;
  }
  .header-search.expanded .header-search-input {
    font-size: 16px;
  }
  .suggestion-item {
    padding: 10px 16px;
    font-size: 14px;
  }
  .suggestions-heading {
    padding: 0 16px 10px;
  }
  .search-suggestions { max-height: calc(100vh - 200px); }
}
