/* ============================================================
   SITE SEARCH — Bhatti Chemicals Industry
   Full-screen overlay search with autocomplete suggestions
============================================================ */

/* ---- Search Trigger Button ---- */
.search-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 40px;
  min-width: 150px;
  gap: 8px;
  padding: 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.search-trigger svg {
  width: 18px;
  height: 18px;
}

.search-trigger-label {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
}

.search-trigger:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ---- Search Overlay (fullscreen backdrop) ---- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 15, 10, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(80px, 14vh, 160px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ---- Search Container (the card) ---- */
.search-container {
  width: 100%;
  max-width: 680px;
  margin: 0 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.35),
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(-16px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s ease;
  opacity: 0;
  overflow: hidden;
}

.search-overlay.active .search-container {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ---- Input Row ---- */
.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.search-input-row svg {
  width: 22px;
  height: 22px;
  color: var(--brand-jade, #007b5e);
  flex-shrink: 0;
  opacity: 0.9;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.08rem;
  font-weight: 500;
  color: #ffffff;
  caret-color: var(--brand-jade, #007b5e);
  letter-spacing: -0.01em;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 400;
}

.search-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  padding: 0;
  font-size: 0;
}

.search-close-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.search-close-btn svg {
  width: 16px;
  height: 16px;
}

/* ---- Keyboard Shortcut Badge ---- */
.search-shortcut-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  user-select: none;
}

.search-shortcut-badge kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
}

/* ---- Results Area ---- */
.search-results {
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.search-results::-webkit-scrollbar {
  width: 5px;
}

.search-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

/* ---- Category Group ---- */
.search-category {
  padding: 12px 22px 6px;
}

.search-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 6px;
}

.search-category-title svg {
  width: 13px;
  height: 13px;
  opacity: 0.5;
}

/* ---- Individual Result Item ---- */
.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
  position: relative;
}

.search-result-item:hover,
.search-result-item.active {
  background: rgba(0, 123, 94, 0.15);
  color: #ffffff;
}

.search-result-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: 0 3px 3px 0;
  background: var(--brand-jade, #007b5e);
}

.search-result-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.15s, border-color 0.15s;
}

.search-result-item:hover .search-result-icon,
.search-result-item.active .search-result-icon {
  background: rgba(0, 123, 94, 0.2);
  border-color: rgba(0, 123, 94, 0.3);
}

.search-result-icon svg {
  width: 18px;
  height: 18px;
  color: var(--brand-jade, #007b5e);
  opacity: 0.85;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-name mark {
  background: transparent;
  color: var(--brand-jade, #007b5e);
  font-weight: 700;
}

.search-result-desc {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.3;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
}

.search-result-badge.badge-product {
  background: rgba(0, 123, 94, 0.15);
  color: #3dd8a7;
  border: 1px solid rgba(0, 123, 94, 0.2);
}

.search-result-badge.badge-application {
  background: rgba(200, 146, 42, 0.15);
  color: #f4c85a;
  border: 1px solid rgba(200, 146, 42, 0.2);
}

.search-result-badge.badge-page {
  background: rgba(100, 140, 200, 0.15);
  color: #8bb4e8;
  border: 1px solid rgba(100, 140, 200, 0.2);
}

.search-result-badge.badge-contact {
  background: rgba(200, 80, 80, 0.15);
  color: #f08c8c;
  border: 1px solid rgba(200, 80, 80, 0.2);
}

/* ---- Arrow indicator on hover ---- */
.search-result-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.search-result-arrow svg {
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.3);
}

.search-result-item:hover .search-result-arrow,
.search-result-item.active .search-result-arrow {
  opacity: 1;
  transform: translateX(2px);
}

/* ---- Empty State ---- */
.search-empty {
  padding: 40px 22px;
  text-align: center;
}

.search-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.search-empty-icon svg {
  width: 26px;
  height: 26px;
  color: rgba(255, 255, 255, 0.2);
}

.search-empty-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
}

.search-empty-hint {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.3);
  line-height: 1.5;
}

/* ---- Footer Hints ---- */
.search-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.search-footer-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.22);
}

.search-footer-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
}

/* ---- Initial state (before typing) ---- */
.search-quick-links {
  padding: 14px 22px;
}

.search-quick-links-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.25);
  margin-bottom: 10px;
}

.search-quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.search-quick-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.search-quick-link:hover {
  background: rgba(0, 123, 94, 0.12);
  border-color: rgba(0, 123, 94, 0.2);
  color: #ffffff;
}

.search-quick-link svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  flex-shrink: 0;
}

/* ---- Loading shimmer (optional) ---- */
@keyframes searchShimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
  .search-trigger.desktop-only {
    display: none;
  }
}

@media (max-width: 640px) {
  .search-overlay {
    padding-top: 0;
    align-items: flex-start;
  }

  .search-container {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  .search-results {
    max-height: none;
    flex: 1;
  }

  .search-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  .search-shortcut-badge {
    display: none;
  }

  .search-quick-links-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-overlay,
  .search-container,
  .search-result-item,
  .search-result-arrow {
    transition: none;
  }
}
