/* ============================================================
   GLOBAL SEARCH – Pesquisa no header do portal
   ============================================================ */

/* --- Container --- */
.global-search {
    position: relative;
    flex: 1 1 auto;
    max-width: 380px;
    display: flex;
    align-items: center;
    z-index: 101;
}

/* --- Toggle (mobile) --- */
.global-search__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}
.global-search__toggle:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* --- Campo de pesquisa --- */
.global-search__field {
    display: flex;
    align-items: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 6px 14px;
    gap: 8px;
    transition: background 0.2s, border-color 0.2s;
}
.global-search__field:focus-within {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.45);
}

/* --- Icone dentro do campo --- */
.global-search__icon {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.7);
}

/* --- Input --- */
.global-search__input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 500;
    font-family: inherit;
    min-width: 0;
}
.global-search__input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}
.global-search__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

/* --- Dropdown de resultados --- */
.global-search__results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    max-height: 380px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 102;
}
.global-search__results[hidden] {
    display: none;
}

/* --- Item de resultado --- */
.global-search__item {
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.12s;
    text-decoration: none;
    color: #222;
    gap: 2px;
    border: none;
    background: none;
}
.global-search__item:hover,
.global-search__item[aria-selected="true"] {
    background: #f3f4f6;
}
.global-search__item-category {
    font-size: 0.72rem;
    font-weight: 700;
    color: #b3001b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.global-search__item-title {
    font-weight: 600;
    font-size: 0.93rem;
    color: #111;
}
.global-search__item-desc {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.3;
}

/* --- Nenhum resultado --- */
.global-search__no-results {
    padding: 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.88rem;
}

/* ============================================================
   MOBILE (<= 900px)
   ============================================================ */
@media (max-width: 900px) {
    .global-search {
        flex: 0 0 auto;
        max-width: none;
    }
    .global-search__toggle {
        display: flex;
    }
    .global-search__field {
        display: none;
    }

    /* Campo expandido */
    .global-search.is-open .global-search__field {
        display: flex;
        position: fixed;
        top: 10px;
        left: 12px;
        right: 12px;
        z-index: 103;
        background: rgba(140, 0, 20, 0.96);
        border-color: rgba(255, 255, 255, 0.35);
        padding: 10px 16px;
    }
    .global-search.is-open .global-search__toggle {
        background: rgba(255, 255, 255, 0.25);
    }

    /* Resultados no mobile */
    .global-search.is-open .global-search__results {
        position: fixed;
        top: 56px;
        left: 12px;
        right: 12px;
        z-index: 103;
    }
}
