/**
 * Campo de busca inteligente (home + negócios)
 * — microfone, placeholders rotativos e sugestões.
 */

.home-search-q,
.negocios-search-field[data-busca-smart] {
    position: relative;
    z-index: 5;
}

.home-search-q input[data-busca-smart-input],
.home-search-q #q,
.negocios-search-field[data-busca-smart] input[data-busca-smart-input] {
    padding-right: 84px;
}

.home-search-q input[type="search"]::-webkit-search-cancel-button,
.negocios-search-field input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.busca-smart-actions {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.smart-search-voice-btn {
    position: static;
    transform: none;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #526071;
    font: inherit;
    line-height: 1;
    transition: color 0.16s ease, opacity 0.16s ease;
    background: transparent;
}

.busca-smart-clear-btn {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    color: #e11d48;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
    transition: color 0.16s ease, opacity 0.16s ease;
}

.busca-smart-clear-btn:hover {
    color: #be123c;
    background: transparent;
}

.busca-smart-clear-btn[hidden] {
    display: none !important;
}

.smart-search-voice-btn:hover {
    color: #334155;
    background: transparent;
}

.smart-search-voice-btn.is-recording {
    color: #e11d48;
    background: transparent;
    animation: home-search-voice-soft 1.4s ease-in-out infinite;
}

.smart-search-voice-btn[hidden] {
    display: none;
}

@keyframes home-search-voice-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.72; }
}

.home-search-q input.is-voice-listening,
.negocios-search-field input.is-voice-listening {
    color: #e11d48;
    animation: busca-voice-input-pulse 1.35s ease-in-out infinite;
}

.home-search-q input.is-voice-listening::placeholder,
.negocios-search-field input.is-voice-listening::placeholder {
    color: #e11d48;
    opacity: 1;
}

.home-search-q input.is-voice-error::placeholder,
.negocios-search-field input.is-voice-error::placeholder {
    color: #e11d48;
    opacity: 1;
    font-size: 0.86rem;
    letter-spacing: -0.01em;
}

@media (max-width: 900px) {
    .home-search-q input.is-voice-error::placeholder,
    .negocios-search-field input.is-voice-error::placeholder {
        font-size: 0.8rem;
    }
}

@media (max-width: 575px) {
    .home-search-q input.is-voice-error::placeholder,
    .negocios-search-field input.is-voice-error::placeholder {
        font-size: 0.72rem;
        letter-spacing: -0.02em;
    }
}

@keyframes busca-voice-input-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(225, 29, 72, 0);
        background-color: transparent;
    }
    50% {
        box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.14);
        background-color: rgba(225, 29, 72, 0.04);
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-search-q input.is-voice-listening,
    .negocios-search-field input.is-voice-listening,
    .smart-search-voice-btn.is-recording {
        animation: none;
    }
}

.home-search-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 100;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    max-height: min(280px, 45vh);
    overflow-y: auto;
    border: 1px solid #dce5ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
}

.home-search-suggest.is-portaled {
    position: fixed;
    right: auto;
    top: auto;
    z-index: 100060;
    box-sizing: border-box;
}

.home-search-suggest[hidden] {
    display: none;
}

.home-search-suggest__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 10px 14px;
    text-align: left;
    cursor: pointer;
    color: #172536;
    font: inherit;
    font-size: 0.95rem;
}

.home-search-suggest__item:hover,
.home-search-suggest__item.is-active {
    background: rgba(0, 162, 237, 0.08);
}

.home-search-suggest__icon {
    width: 16px;
    height: 16px;
    color: #64748b;
}

.home-search-suggest__logo-wrap,
.home-search-suggest__icon-wrap {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: grid;
    place-items: center;
}

.home-search-suggest__logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-search-suggest__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: inherit;
    line-height: 1.25;
}

.home-search-suggest__text {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.home-search-suggest__meta {
    display: block;
    max-width: 100%;
    font-size: 0.68rem;
    font-weight: 500;
    color: #94a3b8;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 575px) {
    .home-search-suggest__item {
        gap: 8px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .home-search-suggest__logo-wrap,
    .home-search-suggest__icon-wrap {
        width: 24px;
        height: 24px;
        border-radius: 6px;
    }

    .home-search-suggest__meta {
        font-size: 0.62rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

.home-search-suggest__label mark {
    background: transparent;
    color: inherit;
    font-weight: 800;
    padding: 0;
}

.negocios-search-field[data-busca-smart] {
    padding-right: 0.45rem;
}

.negocios-search-field[data-busca-smart] .busca-smart-actions {
    right: 6px;
}
