/* Barra de busca. As cores saem das variáveis do tema quando existirem. */
.lbusca {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    width: 100%;
    max-width: var(--lbusca-max, 820px);
    height: var(--lbusca-height, 56px);
    margin: 0 0 0 auto;
    background: var(--ds-field, #1c1c1c);
    border: 1px solid var(--ds-header-line, #262626);
    border-radius: 12px;
    transition: border-color .15s;
}

.lbusca:focus-within {
    border-color: #3d3d3d;
}

.lbusca-icon {
    position: relative;
    display: flex;
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0 4px 0 18px;
    color: #7a7a7a;
}

/* Enquanto busca, a lupa dá lugar a um spinner no mesmo espaço. */
.lbusca.is-loading .lbusca-icon svg {
    opacity: 0;
}

.lbusca.is-loading .lbusca-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: lbusca-spin .7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .lbusca.is-loading .lbusca-icon::after {
        animation-duration: 2s;
    }
}

.lbusca-icon svg,
.lbusca-submit svg {
    width: 22px;
    height: 22px;
}

.lbusca-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: 15px;
    padding: 0 14px;
}

.lbusca-input::placeholder {
    color: #8a8a8a;
}

.lbusca-input::-webkit-search-cancel-button {
    filter: invert(1);
    opacity: .4;
}

.lbusca-cat {
    flex: none;
    max-width: 180px;
    height: 32px;
    border: 0;
    border-left: 1px solid var(--ds-header-line, #262626);
    background: transparent;
    color: #fff;
    padding: 0 12px;
    outline: 0;
    cursor: pointer;
}

.lbusca-cat option {
    color: #111;
    background: #fff;
}

.lbusca-submit {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 18px;
    border: 0;
    border-left: 1px solid var(--ds-header-line, #262626);
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.lbusca-submit:hover {
    color: var(--ds-green, #b4f22e);
}

/* Painel de sugestões */
.lbusca-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    max-height: min(70vh, 460px);
    overflow-y: auto;
    background: #fff;
    color: #111;
    border: 1px solid #e7e7e7;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
    padding: 8px;
    z-index: 40;
    text-align: left;
}

.lbusca-results[hidden] {
    display: none;
}

.lbusca-group-title {
    display: block;
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #9a9a9a;
}

.lbusca-item,
.lbusca-cat-item,
.lbusca-more {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #111;
    text-decoration: none;
    font-size: 14px;
}

.lbusca-item:hover,
.lbusca-cat-item:hover,
.lbusca-more:hover,
.is-active {
    background: #f7f7f5;
}

.lbusca-item img {
    width: 46px;
    height: 46px;
    flex: none;
    object-fit: cover;
    border-radius: 8px;
    background: #f3f3f1;
}

.lbusca-item-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lbusca-item-title {
    font-weight: 600;
}

.lbusca-item-price {
    font-size: 13px;
    color: #70757a;
}

.lbusca-item-price del {
    margin-right: 5px;
    opacity: .7;
}

.lbusca-item-price ins {
    text-decoration: none;
    font-weight: 700;
    color: #111;
}

.lbusca-results mark {
    background: transparent;
    color: inherit;
    font-weight: 700;
}

.lbusca-more {
    justify-content: center;
    margin-top: 4px;
    border-top: 1px solid #e7e7e7;
    border-radius: 0 0 8px 8px;
    font-size: 13px;
    font-weight: 700;
}

.lbusca-empty {
    margin: 0;
    padding: 16px 12px;
    font-size: 13px;
    color: #70757a;
}

@media (max-width: 900px) {
    .lbusca {
        height: 50px;
    }

    .lbusca-cat {
        display: none;
    }
}
