/* CARTO — Header search (loupe icon + expandable overlay) */

.hdr-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--mist, #f4f7f5);
  color: var(--midnight, #0f2a3d);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-right: 6px;
}
.hdr-search-btn:hover {
  background: var(--stone, #e4e8e6);
  color: var(--accent, #00c896);
}

.hdr-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 42, 61, 0.40);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 80px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: hdr-search-fade 0.15s ease;
}
@keyframes hdr-search-fade { from { opacity: 0; } to { opacity: 1; } }
.hdr-search-overlay[hidden] { display: none; }

.hdr-search-box {
  width: 100%;
  max-width: 700px;
  background: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 36px rgba(15, 42, 61, 0.28);
}
.hdr-search-ico {
  flex-shrink: 0;
  color: var(--grey, #5c6370);
}
.hdr-search-box input {
  flex: 1;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  border: 0;
  background: transparent;
  color: var(--midnight, #0f2a3d);
  outline: 0;
  padding: 8px 0;
  min-width: 0;
}
.hdr-search-box input::placeholder { color: var(--grey, #5c6370); }
.hdr-search-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: var(--mist, #f4f7f5);
  color: var(--midnight, #0f2a3d);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
}
.hdr-search-close:hover { background: var(--stone, #e4e8e6); transform: rotate(90deg); }

.hdr-search-results {
  width: 100%;
  max-width: 700px;
  background: #fff;
  border-radius: 14px;
  margin-top: 10px;
  padding: 10px 0;
  box-shadow: 0 12px 36px rgba(15, 42, 61, 0.20);
  max-height: 70vh;
  overflow-y: auto;
}
.hdr-search-results[hidden] { display: none; }

.hdr-search-group { padding: 8px 0; }
.hdr-search-group + .hdr-search-group { border-top: 1px solid var(--stone, #e4e8e6); }
.hdr-search-group-label {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey, #5c6370);
  padding: 4px 20px 8px;
}
.hdr-search-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 20px;
  color: var(--midnight, #0f2a3d);
  text-decoration: none;
  transition: background 0.1s;
  border-left: 3px solid transparent;
}
.hdr-search-item:hover {
  background: var(--mist, #f4f7f5);
  border-left-color: var(--accent, #00c896);
}
.hdr-search-item-t {
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--midnight, #0f2a3d);
}
.hdr-search-item-t mark {
  background: rgba(0, 200, 150, 0.22);
  color: var(--midnight, #0f2a3d);
  font-weight: 700;
  padding: 0 1px;
  border-radius: 2px;
}
.hdr-search-item-s {
  font-size: 12px;
  color: var(--grey, #5c6370);
}
.hdr-search-empty {
  padding: 18px 22px;
  font-size: 14px;
  color: var(--grey, #5c6370);
  line-height: 1.5;
}

body.hdr-search-open { overflow: hidden; }

@media (max-width: 700px) {
  .hdr-search-overlay { padding: 16px; }
  .hdr-search-box { padding: 10px 12px; }
  .hdr-search-box input { font-size: 16px; /* prevent iOS zoom */ }
  .hdr-search-results { max-height: calc(100vh - 100px); }
}
