/* ============================================
   HEADER SEARCH — Phase 2 search (2026-05-02)
   Self-contained, ne dépend pas de components.css
   ============================================ */

.hsearch-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.hsearch-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  pointer-events: none;
}

#hsearch-input {
  width: 200px;
  padding: 6px 30px 6px 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

#hsearch-input:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.hsearch-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: 90vw;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  max-height: 60vh;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  color: #111;
}

.hsearch-close {
  display: none;
  position: absolute;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

.hsearch-trigger-mobile {
  display: none;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 6px;
  opacity: 0.85;
  align-items: center;
  justify-content: center;
}
.hsearch-trigger-mobile:hover { opacity: 1; }

@media (max-width: 767px) {
  .hsearch-wrap { display: none; }
  .hsearch-trigger-mobile { display: inline-flex; }

  body.hsearch-active { overflow: hidden; }

  body.hsearch-active .hsearch-wrap {
    display: flex !important;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    z-index: 9999;
    flex-direction: column;
    padding: 20px 16px;
    margin: 0;
  }

  body.hsearch-active .hsearch-icon {
    top: 36px;
    left: 28px;
    opacity: 0.5;
    color: #111;
    width: 18px;
    height: 18px;
  }

  body.hsearch-active #hsearch-input {
    width: 100%;
    height: 48px;
    padding: 10px 50px 10px 44px;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    color: #111;
    font-size: 16px;
    border-radius: 12px;
  }

  body.hsearch-active .hsearch-close {
    display: block;
    top: 28px;
    right: 20px;
    color: #111;
    font-size: 32px;
    opacity: 0.7;
  }
  body.hsearch-active .hsearch-close:hover { opacity: 1; }

  body.hsearch-active .hsearch-results {
    position: static;
    margin-top: 16px;
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 100px);
    border: none;
    box-shadow: none;
    background: transparent;
  }
}
