/* Busca no header – overlay CCHLA */

.cchla-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-left: 0.25rem;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.cchla-search-toggle:hover,
.cchla-search-toggle:focus-visible {
    color: #bfdbfe;
    background-color: rgba(255, 255, 255, 0.1);
    outline: none;
}

.cchla-search-toggle i {
    font-size: 1.125rem;
}

.cchla-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5.5rem 1rem 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cchla-search-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

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

.cchla-search-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 32, 71, 0.88);
    backdrop-filter: blur(4px);
}

.cchla-search-overlay__panel {
    position: relative;
    width: 100%;
    max-width: 42rem;
    padding: 1.5rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.cchla-search-overlay__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.cchla-search-overlay__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
}

.cchla-search-overlay__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cchla-search-overlay__close:hover,
.cchla-search-overlay__close:focus-visible {
    background: rgba(255, 255, 255, 0.28);
    outline: none;
}

.cchla-search-overlay__form {
    display: flex;
    gap: 0.5rem;
}

.cchla-search-overlay__input-wrap {
    position: relative;
    flex: 1;
}

.cchla-search-overlay__input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.92);
    color: #002047;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cchla-search-overlay__input::placeholder {
    color: rgba(0, 32, 71, 0.55);
}

.cchla-search-overlay__input:focus {
    outline: none;
    border-color: #004499;
    box-shadow: 0 0 0 3px rgba(0, 68, 153, 0.25);
}

.cchla-search-overlay__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
    border: none;
    border-radius: 0.5rem;
    background: linear-gradient(to right, #002047, #004499);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.cchla-search-overlay__submit:hover,
.cchla-search-overlay__submit:focus-visible {
    opacity: 0.9;
    outline: none;
}

.cchla-search-overlay__results {
    margin-top: 1rem;
    max-height: min(50vh, 24rem);
    overflow-y: auto;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    display: none;
}

.cchla-search-overlay__results.is-visible {
    display: block;
}

.cchla-search-overlay__results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cchla-search-overlay__result-link {
    display: block;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(0, 32, 71, 0.08);
    text-decoration: none;
    color: #002047;
    transition: background-color 0.15s ease;
}

.cchla-search-overlay__result-link:hover,
.cchla-search-overlay__result-link:focus-visible {
    background: rgba(0, 68, 153, 0.08);
    outline: none;
}

.cchla-search-overlay__result-type {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #004499;
    margin-bottom: 0.15rem;
}

.cchla-search-overlay__result-title {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
}

.cchla-search-overlay__result-title mark {
    background: rgba(255, 235, 59, 0.45);
    color: inherit;
    padding: 0 0.1em;
    border-radius: 2px;
}

.cchla-search-overlay__status,
.cchla-search-overlay__view-all {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: rgba(0, 32, 71, 0.7);
}

.cchla-search-overlay__view-all a {
    display: block;
    font-weight: 600;
    color: #004499;
    text-decoration: none;
}

.cchla-search-overlay__view-all a:hover {
    text-decoration: underline;
}

.cchla-search-overlay__loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    border: 2px solid rgba(0, 32, 71, 0.2);
    border-top-color: #004499;
    border-radius: 50%;
    animation: cchla-search-spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes cchla-search-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 639px) {
    .cchla-search-overlay__form {
        flex-direction: column;
    }

    .cchla-search-overlay__submit {
        width: 100%;
        padding: 0.875rem 1rem;
    }
}
