/* TechOut Search Page
   Standalone search experience — pages/search.html */

/* ============================================
   SEARCH PAGE LAYOUT
   ============================================ */
.search-page {
  padding: var(--space-6) var(--container-padding);
}

@media (min-width: 768px) {
  .search-page {
    padding: var(--space-8) var(--container-padding-desktop);
    max-width: var(--container-lg);
    margin: 0 auto;
  }
}

.search-page__inner {
  width: 100%;
}

/* ============================================
   SEARCH INPUT
   ============================================ */
.search-page__input-wrapper {
  position: relative;
  margin-bottom: var(--space-8);
}

@media (max-width: 767px) {
  .search-page__input-wrapper {
    margin-bottom: var(--space-6);
  }
}

.search-page__input {
  width: 100%;
  padding: 14px 48px 14px 0;
  font-size: var(--text-lg);
  font-family: var(--font);
  font-weight: var(--weight-light);
  background: none;
  border: none;
  border-bottom: 2px solid var(--black);
  outline: none;
  color: var(--black);
  line-height: 1.4;
  transition: border-color 0.3s var(--ease);
}

@media (min-width: 768px) {
  .search-page__input {
    font-size: var(--text-xl);
    padding: 16px 48px 16px 0;
  }
}

.search-page__input::placeholder {
  color: var(--gray-400);
}

.search-page__input:focus {
  border-bottom-color: var(--black);
}

.search-page__clear {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--gray-100);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--gray-500);
  flex-shrink: 0;
  transition: background 0.2s var(--ease);
}

.search-page__input:not(:placeholder-shown) ~ .search-page__clear {
  display: flex;
}

.search-page__clear:hover {
  background: var(--gray-200);
}

.search-page__clear svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

/* ============================================
   SEARCH PREVIEW (default state)
   ============================================ */
.search-preview {
  display: block;
}

.search-preview.hidden {
  display: none;
}

/* ============================================
   SEARCH SECTIONS
   ============================================ */
.search-section {
  margin-bottom: var(--space-8);
}

@media (max-width: 767px) {
  .search-section {
    margin-bottom: var(--space-6);
  }
}

.search-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.search-section__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--black);
}

.search-section__action {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.search-section__action:hover {
  color: var(--black);
}

/* ============================================
   RECENT SEARCHES
   ============================================ */
.recent-searches__list {
  display: flex;
  flex-direction: column;
}

.recent-searches__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: opacity 0.2s var(--ease);
}

.recent-searches__item:last-child {
  border-bottom: none;
}

.recent-searches__item:hover {
  opacity: 0.6;
}

.recent-searches__icon {
  width: 18px;
  height: 18px;
  color: var(--gray-400);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recent-searches__icon svg {
  width: 100%;
  height: 100%;
}

.recent-searches__text {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-primary);
  min-width: 0;
}

.recent-searches__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.2s var(--ease), color 0.2s var(--ease);
}

.recent-searches__item:hover .recent-searches__remove {
  opacity: 1;
}

.recent-searches__remove:hover {
  color: var(--black);
}

.recent-searches__remove svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   TRENDING SEARCHES
   ============================================ */
.trending-searches__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.trending-searches__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-chip);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.trending-searches__tag:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.trending-searches__tag svg {
  width: 12px;
  height: 12px;
}

/* ============================================
   SUGGESTED PRODUCTS GRID
   ============================================ */
.suggested-products__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gutter);
}

@media (min-width: 768px) {
  .suggested-products__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
  }
}

/* ============================================
   SEARCH RESULTS
   ============================================ */
.search-results {
  display: none;
}

.search-results.active {
  display: block;
}

.search-results__header {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.search-results__count {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--black);
}

.search-results__term {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.search-results__term strong {
  color: var(--black);
  font-weight: var(--weight-medium);
}

.search-results__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gutter);
}

@media (min-width: 768px) {
  .search-results__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }
}

@media (min-width: 1024px) {
  .search-results__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
  }
}

/* ============================================
   NO RESULTS STATE
   ============================================ */
.no-results {
  display: none;
  text-align: center;
  padding: var(--space-16) var(--container-padding);
}

.no-results.active {
  display: block;
}

.no-results__illustration {
  width: 120px;
  height: 120px;
  margin: 0 auto var(--space-6);
  background: var(--gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.no-results__illustration svg {
  width: 48px;
  height: 48px;
  color: var(--gray-300);
}

.no-results__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--black);
  margin-bottom: var(--space-3);
}

.no-results__message {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 360px;
  margin: 0 auto var(--space-8);
}

.no-results__suggestions {
  margin-bottom: var(--space-8);
}

.no-results__suggestions-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.no-results__suggestions-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.no-results__suggestion-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-chip);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-decoration: none;
}

.no-results__suggestion-tag:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.no-results__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 28px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: var(--radius-chip);
  cursor: pointer;
  transition: opacity 0.3s var(--ease);
  text-decoration: none;
}

.no-results__cta:hover {
  opacity: 0.8;
}

.no-results__cta svg {
  width: 16px;
  height: 16px;
}
