/* SEARCH PAGE MODERN UI */

#search-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 80vh;
}

/* HEADER SECTION */
.search-header {
  margin-bottom: 60px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.search-header h1 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 30px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* SEARCH BOX CONTAINER */
.search-box {
  width: 100%;
  max-width: 600px;
  position: relative;
}

#search-input {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.1rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-sizing: border-box;
}

#search-input:focus {
  outline: none;
  background: #fff;
  border-color: rgba(0, 0, 0, 0.05);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

#search-input::placeholder {
  color: var(--text-light);
  font-weight: 300;
}

/* SUGGESTIONS DROPDOWN */
.search-suggestions {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

/* Show suggestions when active (js can toggle a class, or just relying on display) 
   Note: The JS likely just appends visible items. If it adds a class, we can animate. 
   For now, assuming it just inserts HTML, we'll style the container's contents. */
.search-suggestions:not(:empty) {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  padding: 8px 0;
}

.suggestion-item {
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.suggestion-item:hover {
  background-color: var(--surface-dark);
  color: var(--text-primary);
  padding-left: 28px;
  /* subtle slide */
}

/* RESULTS GRID */
.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 40px 24px;
  width: 100%;
}

/* No Results Message */
.search-grid p {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-top: 40px;
  font-weight: 300;
}

/* PRODUCT CARD */
.search_card {
  background: var(--surface);
  position: relative;
  padding: 4px;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
}

.search_card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.search_card img {
  width: 100%;
  height: auto;
  aspect-ratio: 3/4;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  background-color: var(--surface-dark);
}

.search_card_buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 12px;
  /* Increased vertical padding for significantly more height */
  font-size: 0.95rem;
  flex: 1;
}

.search_card_buttons p {
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
}

.search_card_buttons span {
  width: 40px;
  /* Bolder button */
  height: 40px;
  border-radius: 50%;
  background-color: var(--surface-dark);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.3s ease;
  flex-shrink: 0;
  padding: 0;
  cursor: pointer;
}

.search_card_buttons span:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  transform: rotate(90deg);
}

/* SCROLLBAR FOR SUGGESTIONS */
.search-suggestions::-webkit-scrollbar {
  width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
  background: transparent;
}

.search-suggestions::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 20px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  #search-page {
    padding: 30px 16px;
  }

  .search-header h1 {
    font-size: 2rem;
  }

  .search-grid {
    gap: 12px 20px;
  }

  .search_card_buttons {
    padding: 16px 8px;
  }

  .search_card_buttons p {
    font-size: 0.85rem;
  }

  .search_card_buttons span {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .search-header h1 {
    font-size: 1.75rem;
  }

  #search-input {
    padding: 14px 20px;
    font-size: 1rem;
  }

  .search-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 16px;
  }
}