.search-overlay {
  position: fixed; inset: 0;
  background: rgba(10,18,36,.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  visibility: hidden; opacity: 0;
  transform: none !important;
  transition: opacity .24s ease, visibility .24s ease;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: clamp(60px, 10vh, 120px);
  padding-left: 16px; padding-right: 16px;
}
.search-overlay.active { visibility: visible; opacity: 1; transform: none !important; }
.search-overlay.active .srch-panel { transform: translateY(0); opacity: 1; }

/* Reset des styles legacy de style.css */
.search-overlay .search-overlay__inner {
  width: auto; height: auto;
  background: transparent;
  display: block;
  align-items: unset; justify-content: unset;
  overflow-y: visible;
  transition: none;
}

/* ── Panel ── */
.srch-panel {
  width: 100%; max-width: 860px;
  max-height: calc(100dvh - 140px);
  background: #fff;
  border-radius: 18px;
  border: 1.5px solid rgba(37,99,235,.22);
  box-shadow:
    0 0 0 5px rgba(37,99,235,.06),
    0 32px 80px rgba(10,18,36,.28),
    0 4px 16px rgba(10,18,36,.12);
  overflow-y: auto;
  transform: translateY(-14px); opacity: 0;
  transition: transform .24s cubic-bezier(.22,1,.36,1), opacity .24s ease;
}

/* ── Header ── */
.srch-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f4ff 40%, #fff 100%);
  border-bottom: 1.5px solid #dbeafe;
  transition: border-color .2s;
}
.srch-head:focus-within { border-bottom-color: #93c5fd; }
.srch-icon-loupe {
  font-size: 17px; flex-shrink: 0;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.srch-input {
  flex: 1; border: 0; outline: none;
  font-size: 1rem; font-weight: 500; color: #0f172a;
  background: transparent; line-height: 1.4;
}
.srch-input::placeholder { color: #94a3b8; font-weight: 400; }
.srch-close {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex-shrink: 0;
  background: #dbeafe; border: 0; border-radius: 8px;
  cursor: pointer; color: #2563eb;
  transition: background .15s, color .15s, transform .15s;
}
.srch-close:hover { background: #bfdbfe; color: #1d4ed8; transform: scale(1.08); }
.srch-close i { font-size: 11px; }

/* ── Results list ── */
.srch-results { overflow: visible; }

/* ── Empty / idle state ── */
.srch-empty, .srch-loading {
  padding: 36px 20px; text-align: center;
  font-size: .88rem;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.srch-idle-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #eff6ff, #eef2ff);
  border: 1.5px solid #dbeafe;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.srch-empty--idle .srch-empty-bubble {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
  border: 1.5px solid #dbeafe;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px;
}
.srch-empty--idle .srch-empty-bubble i { font-size: 22px; color: #3b82f6; }
.srch-empty--idle span { color: #64748b; }

.srch-empty--noresult .srch-empty-bubble {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #fff1f2 0%, #fef3c7 100%);
  border: 1.5px solid #fecaca;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px;
}
.srch-empty--noresult .srch-empty-bubble i { font-size: 22px; color: #f87171; }
.srch-empty--noresult span { color: #64748b; }
.srch-empty--noresult strong { color: #dc2626; }

/* ── Loading ── */
.srch-loading .srch-empty-bubble {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #eff6ff, #eef2ff);
  border: 1.5px solid #dbeafe;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px;
}
.srch-loading .srch-empty-bubble i { font-size: 20px; color: #3b82f6; }
.srch-loading span { color: #64748b; }
.srch-spin { animation: srch-rotate .7s linear infinite; }
@keyframes srch-rotate { to { transform: rotate(360deg); } }

/* ── Items ── */
.srch-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 18px;
  text-decoration: none;
  transition: background .12s;
  border-bottom: 1px solid #f1f5f9;
}
.srch-item:last-child { border-bottom: 0; }
.srch-item:hover, .srch-item.is-focused {
  background: #eff6ff;
  border-left: 3px solid #2563eb;
  padding-left: 15px;
}
.srch-item { border-left: 3px solid transparent; }
.srch-item__icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px; font-size: 13px;
  transition: transform .15s; margin-top: 1px;
}
.srch-item:hover .srch-item__icon, .srch-item.is-focused .srch-item__icon { transform: scale(1.1); }

/* ── Palette par thème ── */
.srch-item__icon--blue   { background: #eff6ff; color: #2563eb; }
.srch-item__icon--mint   { background: #f0fdf4; color: #16a34a; }
.srch-item__icon--sky    { background: #f0f9ff; color: #0284c7; }
.srch-item__icon--peach  { background: #fff7ed; color: #ea580c; }
.srch-item__icon--lilac  { background: #faf5ff; color: #9333ea; }
.srch-item__icon--slate  { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }
.srch-item__icon--cyan   { background: #ecfeff; color: #0891b2; }
.srch-item__icon--amber  { background: #fffbeb; color: #d97706; }
.srch-item__icon--rose   { background: #fff1f2; color: #e11d48; }
.srch-item__icon--navy   { background: #eef2ff; color: #4338ca; }

.srch-item__body { flex: 1; min-width: 0; }
.srch-item__title {
  font-size: .875rem; font-weight: 600; color: #0f172a;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.35;
}
.srch-item__url { display: none; }

@keyframes srch-item-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.srch-item--animate {
  opacity: 0;
  animation: srch-item-in .18s ease forwards;
}
.srch-item__excerpt {
  font-size: .72rem; color: #475569; margin-top: 4px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.srch-item__cat {
  flex-shrink: 0; align-self: center;
  font-size: .67rem; font-weight: 700; color: #94a3b8;
  white-space: nowrap; text-align: right; max-width: 110px;
  overflow: hidden; text-overflow: ellipsis; line-height: 1.2;
  padding: 0 8px 0 4px;
}
.srch-item:hover .srch-item__cat, .srch-item.is-focused .srch-item__cat { color: #64748b; }
.srch-item__arrow {
  color: #dbeafe; font-size: 10px; flex-shrink: 0;
  transition: color .15s, transform .15s;
}
.srch-item:hover .srch-item__arrow, .srch-item.is-focused .srch-item__arrow {
  color: #2563eb; transform: translateX(2px);
}

/* ── Footer ── */
.srch-footer {
  padding: 10px 18px;
  background: linear-gradient(135deg, #f8fbff 0%, #fff 100%);
  border-top: 1.5px solid #dbeafe;
  display: flex; align-items: center; justify-content: space-between;
}
.srch-footer__hint { font-size: .7rem; color: #94a3b8; display: flex; align-items: center; gap: 10px; }
.srch-footer__hint span { display: flex; align-items: center; gap: 4px; }
.srch-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #dbeafe; border-radius: 5px;
  padding: 1px 5px; font-size: .65rem; color: #3b82f6;
  background: #eff6ff; font-family: inherit; line-height: 1.5;
}
.srch-footer__count {
  font-size: .72rem; font-weight: 700;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
  transition: opacity .15s;
}
.srch-footer__count:hover { opacity: .75; }

/* ── État pont (transition vers page résultats) ── */
.srch-bridge-state {
  padding: 48px 20px;
  animation: srch-bridge-pulse 1.2s ease-in-out infinite;
}
@keyframes srch-bridge-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .6; }
}

@media (max-width: 575px) {
  .srch-panel { border-radius: 16px; max-height: calc(100dvh - 80px); }
  .srch-input { font-size: .95rem; }
  .search-overlay { padding-top: 40px; }
}
