/* ========= Utility ========= */
.hidden {
  display: none !important;
}

/* ========= Popup Overlay ========= */
#search-popup {
  position: absolute;
}
#search-popup .popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.3);
  animation: fadeIn 200ms ease-out;
}

/* ========= Popup Container ========= */
#search-popup .search-pop {
  position: absolute;
  left: 50%;
  top: 20vh;
  transform: translateX(-50%);
  width: min(90vw, 50rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ========= Popup Overlay ========= */
#search-popup .popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.3);
  animation: fadeIn 200ms ease-out;
}

/* ========= Search Bar ========= */
#search-popup .search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 3rem;
  background: var(--color-white);
  border: 1.5px solid var(--color-light-1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#search-popup .search-bar svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--color-muted);
}

#popup-search-suggestions svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--color-muted);
}

#popup-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  color: var(--color-dark-1);
  outline: none;
}

#popup-search-input::placeholder {
  color: var(--color-muted);
}

/* ========= Submit Button ========= */
#popup-search-submit {
  background: var(--color-pink-2);
  color: var(--color-white);
  border: none;
  border-radius: 9999px;
  padding: 0.5rem 1.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease;
}

#popup-search-submit:hover {
  background: var(--color-pink-3);
}

/* ========= Suggestions ========= */
#popup-search-suggestions {
  background: var(--color-white);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-light-1);
}

.popup-search-suggestions:last-child {
  border-bottom: none;
}

.search-suggestion-link {
  color: var(--color-dark-1);
  font-size: 1.125rem;
  text-decoration: none;
  transition: color 150ms ease;
  font-weight: 500;
}

.search-suggestion-link:hover {
  color: var(--color-magenta);
}

.highlight {
  font-weight: bold;
}

/* ========= Responsiveness ========= */
@media (max-width: 768px) {
  #search-popup .search-pop {
    width: 92vw;
  }
  #popup-search-input {
    font-size: 1rem;
  }
  #popup-search-submit {
    padding: 0.4rem 1rem;
    font-size: 1rem;
  }
}

/* ========= RTL Support ========= */
html[lang="ar"] .search-bar {
  direction: rtl;
}
html[lang="ar"] #popup-search-input {
  text-align: right;
}

/* ========= Fade-in Animation ========= */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
