/* SEARCH OVERLAY — full-screen live search */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.search-overlay.is-open {
  pointer-events: auto;
  opacity: 1;
}

.search-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 45, 92, 0.85);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.search-overlay__panel {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  width: 100%;
  max-width: 100%;
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.search-overlay.is-open .search-overlay__panel {
  transform: translateY(0);
}

/* HEADER */
.search-overlay__header {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  padding: clamp(20px, 3vw, 36px) 0;
  position: relative;
  overflow: hidden;
}
.search-overlay__header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.search-overlay__header > .container { position: relative; z-index: 1; }

.search-overlay__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 16px 20px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.search-overlay__bar:focus-within {
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.12);
}

.search-overlay__icon {
  flex-shrink: 0;
  color: var(--color-accent);
}

.search-overlay__input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--font-heading);
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
  min-width: 0;
}
.search-overlay__input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.search-overlay__close {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  color: #fff;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.search-overlay__close:hover {
  background: var(--color-accent);
  color: var(--color-primary-dark);
}

.search-overlay__hint {
  margin: 14px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.02em;
}

/* BODY */
.search-overlay__body {
  flex: 1;
  overflow-y: auto;
  padding: clamp(28px, 4vw, 50px) 0 clamp(40px, 6vw, 80px);
  background: var(--color-bg, #f6f7f9);
}

/* LOADER */
.search-overlay__loader {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 40px 0;
}
.search-overlay__loader span {
  width: 12px;
  height: 12px;
  background: var(--color-primary);
  border-radius: 50%;
  animation: search-bounce 1.2s infinite ease-in-out;
}
.search-overlay__loader span:nth-child(2) { animation-delay: 0.15s; }
.search-overlay__loader span:nth-child(3) { animation-delay: 0.3s; }

@keyframes search-bounce {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* EMPTY */
.search-overlay__empty {
  text-align: center;
  padding: clamp(40px, 6vw, 80px) 20px;
  color: var(--color-text-muted);
}
.search-overlay__empty svg {
  color: var(--color-primary);
  opacity: 0.4;
  margin-bottom: var(--space-md);
}
.search-overlay__empty strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-primary-dark);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.search-overlay__empty p { margin: 4px 0; font-size: 14px; }

/* RESULTS */
.search-overlay__results {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.search-group {
  background: #fff;
  padding: var(--space-md);
  box-shadow: 0 12px 30px -22px rgba(15, 45, 92, 0.18);
}

.search-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-accent);
}
.search-group__title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary-dark);
  margin: 0;
}
.search-group__count {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--color-primary-dark);
  color: var(--color-accent);
  padding: 4px 10px;
}

.search-group__list {
  display: flex;
  flex-direction: column;
}

.search-result {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(15, 45, 92, 0.06);
  transition: background 0.2s ease, transform 0.2s ease;
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover {
  background: rgba(30, 91, 168, 0.04);
  transform: translateX(4px);
}
.search-result:hover .search-result__title { color: var(--color-primary); }
.search-result:hover .search-result__arrow { color: var(--color-primary-dark); transform: translateX(4px); }

.search-result__visual {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.search-result__visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 12px 12px;
}
.search-result__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}
.search-result__monogram {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  color: var(--color-accent);
  position: relative;
  z-index: 1;
}

.search-result__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.search-result__meta {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
}
.search-result__title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 0;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result__excerpt {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result__arrow {
  color: var(--color-text-muted);
  transition: color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .search-result {
    grid-template-columns: 50px 1fr;
    gap: 12px;
  }
  .search-result__visual { width: 50px; height: 50px; }
  .search-result__monogram { font-size: 22px; }
  .search-result__arrow { display: none; }
  .search-result__excerpt { display: none; }
}
