/* Search UI styles */
.search-overlay[hidden] {
    display: none !important;
}
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 72px 16px 24px;
    z-index: 10050;
}
.search-panel {
    background: #ffffff;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    position: relative;
    font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
}
.search-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #334155;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}
.search-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.search-title {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}
.search-input-wrap {
    position: relative;
    margin-bottom: 12px;
}
.search-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.95rem;
    pointer-events: none;
}
.search-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
    padding: 11px 14px 11px 40px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.search-input:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.search-results {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}
.search-group-heading {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    padding: 10px 8px 4px;
    border-bottom: 1px solid #f1f5f9;
}
.search-result-item {
    border-bottom: 1px solid #f1f5f9;
    border-radius: 8px;
}
.search-result-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 10px;
    text-decoration: none;
    color: #0f172a;
}
.search-result-item:hover,
.search-result-item[aria-selected="true"] {
    background: #eff6ff;
}
.sr-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: #0f172a;
}
.sr-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.sr-region {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #e2e8f0;
    color: #334155;
    padding: 2px 7px;
    border-radius: 999px;
}
.sr-url {
    font-size: 0.74rem;
    color: #64748b;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-empty,
.search-no-result {
    margin-top: 8px;
    color: #475569;
    font-size: 0.9rem;
}
.search-popular {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.search-popular-link {
    display: inline-block;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    color: #1e293b;
    transition: background 0.15s ease, color 0.15s ease;
}
.search-popular-link:hover {
    background: #2563eb;
    color: #ffffff;
}

/* Search icon button in main nav */
.nav-item--search {
    display: flex;
    align-items: center;
}
.btn-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 0.92rem;
    cursor: pointer;
    padding: 0;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn-search:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}
.btn-search--mobile {
    display: none;
}

@media (max-width: 1024px) {
    .btn-search--mobile {
        display: inline-flex;
        margin-right: 10px;
    }
    .mobile-header-actions {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
    .search-overlay {
        padding: 16px 10px;
    }
    .search-panel {
        max-height: calc(100vh - 32px);
        padding: 16px;
    }
    .sr-url {
        display: none;
    }
}
