/* ═══ Search Overlay — GFP 2027 ═══ */

/* ── Backdrop ── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

/* ── Center box ── */
.search-overlay__box {
  width: 100%;
  max-width: 620px;
  padding: 0 20px;
  position: relative;
}

/* ── Form ── */
.search-overlay__form {
  position: relative;
}

/* ── Input ── */
.search-overlay__input {
  width: 100%;
  padding: 16px 20px 16px 52px;
  font-size: 16px;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  outline: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-overlay__input:focus {
  border-color: rgba(var(--blue-rgb),0.5);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(var(--blue-rgb),0.15);
}

.search-overlay__input::placeholder {
  color: var(--text-muted);
}

/* ── Search icon ── */
.search-overlay__icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Live search results dropdown ── */
.search-overlay__results {
  margin-top: 8px;
  border-radius: 14px;
  overflow: hidden;
}

.search-overlay__results:empty {
  display: none;
}

/* Dropdown from live-search.js */
.search-overlay__results .live-search-dropdown,
.search-overlay__form .live-search-dropdown {
  position: relative !important;
  width: 100% !important;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* ── Result items ── */
.ls-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ls-header svg {
  width: 12px;
  height: 12px;
  opacity: 0.5;
}

.ls-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  text-decoration: none;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ls-item:hover {
  background: rgba(var(--blue-rgb),0.08);
}

.ls-item__img {
  width: 44px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.ls-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.ls-item:hover .ls-item__img img {
  transform: scale(1.05);
}

.ls-item__info {
  flex: 1;
  min-width: 0;
}

.ls-item__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  transition: color 0.15s;
}

.ls-item:hover .ls-item__name {
  color: var(--blue);
}

.ls-item__name mark {
  background: rgba(var(--blue-rgb),0.25);
  color: #C4B5FD;
  border-radius: 2px;
  padding: 0 2px;
}

.ls-item__price {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

.ls-item__price--old {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 6px;
}

.ls-item__price--soon {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #60A5FA;
}

.ls-item__arrow {
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.ls-item:hover .ls-item__arrow {
  opacity: 1;
  color: var(--blue);
}

/* ── View all link ── */
.ls-viewall {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.ls-viewall:hover {
  background: rgba(var(--blue-rgb),0.08);
  color: #C4B5FD;
}

/* ── Loading ── */
.ls-loading {
  padding: 32px;
  text-align: center;
}

.ls-loading__spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(var(--blue-rgb),0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: ls-spin 0.6s linear infinite;
  margin: 0 auto 10px;
}

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

.ls-loading__text {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── No results ── */
.ls-empty {
  padding: 32px;
  text-align: center;
}

.ls-empty__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--text-muted);
}

.ls-empty__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.ls-empty__desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Scrollbar ── */
.live-search-dropdown::-webkit-scrollbar {
  width: 6px;
}

.live-search-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.live-search-dropdown::-webkit-scrollbar-thumb {
  background: rgba(var(--blue-rgb),0.3);
  border-radius: 3px;
}

.live-search-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--blue-rgb),0.5);
}

/* ── Keyboard navigation highlight ── */
.ls-item.is-active {
  background: rgba(var(--blue-rgb),0.12);
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .search-overlay {
    padding-top: 10vh;
  }

  .search-overlay__input {
    font-size: 15px;
    padding: 14px 16px 14px 46px;
    border-radius: 12px;
  }

  .ls-item__img {
    width: 36px;
    height: 50px;
  }
}
