/* ===== SEARCH OVERLAY ===== */
.search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: #FFFFFF;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  padding: 0;
}

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

.search-overlay__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 27px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-overlay__input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'Heebo', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #333;
  padding: 12px 0;
  background: transparent;
}

.search-overlay__input::placeholder {
  color: #999;
}

.search-overlay__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: color 0.2s ease;
}

.search-overlay__close:hover {
  color: #2AAAEC;
}

.search-overlay__close svg {
  width: 24px;
  height: 24px;
}

/* Search icon in header */
.search-overlay__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-overlay__icon svg {
  width: 20px;
  height: 20px;
  stroke: #999;
}

/* ===== SEARCH RESULTS ===== */
.search-results {
  display: none;
  position: fixed;
  top: 88px;
  left: 0;
  right: 0;
  z-index: 9997;
  background: #FFFFFF;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  max-height: calc(100vh - 88px);
  overflow-y: auto;
}

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

.search-results__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 27px;
}

.search-results__item {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid #F0F0F0;
  text-decoration: none;
  transition: background-color 0.15s ease;
  cursor: pointer;
}

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

.search-results__item:hover {
  background-color: #F8FBFF;
}

.search-results__item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.search-results__item-title {
  font-family: 'Heebo', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #00538C;
  line-height: 1.3;
}

.search-results__item-category {
  font-family: 'Heebo', sans-serif;
  font-size: 12px;
  font-weight: 300;
  color: #666;
  flex-shrink: 0;
}

.search-results__item-desc {
  font-family: 'Heebo', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #333;
  line-height: 1.5;
}

.search-results__empty {
  padding: 32px 0;
  text-align: center;
  font-family: 'Heebo', sans-serif;
  font-size: 16px;
  color: #999;
}

/* ===== SEARCH BACKDROP ===== */
.search-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9996;
  background: rgba(0, 0, 0, 0.3);
}

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

/* ===== MOBILE SEARCH ===== */

/* Hide the header bar search icon on mobile — use hamburger menu button instead */
.header__search-mobile {
  display: none !important;
}

/* Search button inside hamburger menu (created by main.js) */
.nav__search-mobile {
  display: none;
}

@media (max-width: 768px) {
  .nav__search-mobile {
    display: block;
    width: 100%;
    background: #FFFFFF;
    color: #2AAAEC;
    border: 1px solid #2AAAEC;
    text-align: center;
    border-radius: 71px;
    padding: 12px;
    margin-top: 20px;
    font-family: 'Heebo', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
  }

  .nav__search-mobile:hover {
    background: #EBF7FD;
  }

  /* Full-screen overlay on mobile */
  .search-overlay {
    top: 0;
    bottom: 0;
    height: 100vh;
    z-index: 9998;
    overflow-y: auto;
  }

  .search-overlay__inner {
    padding: 16px;
    flex-wrap: wrap;
  }

  .search-overlay__input {
    font-size: 16px;
    padding: 10px 0;
  }

  .search-results {
    position: static;
    box-shadow: none;
    max-height: none;
    overflow-y: visible;
  }

  /* On mobile, results are inside the overlay */
  .search-overlay--active .search-results {
    display: block;
  }

  .search-results__inner {
    padding: 0 16px;
  }

  .search-backdrop {
    display: none !important;
  }
}
