/* CSS para Pollo Busca - Shoptimizer Integration */

.pollo-busca-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.pollo-busca-wrapper input[type="search"],
.pollo-busca-wrapper input[type="text"] {
    width: 100%;
    /* Deixar de intervir agressivamente, herdar height, borders e typography do Shoptimizer */
    padding-right: 40px !important; 
}

/* Shoptimizer-like Dropdown Container */
.pollo-busca-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    /* Usa a paleta de cores global do theme para BG e borda, se disponível, com fallback */
    background-color: var(--cg-background-color, #ffffff);
    border: 1px solid var(--cg-border-color, #eaeaea);
    /* Shoptimizer dropshadows tipicamente são leves */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    /* Herda o radius do tema, muito usado no "commerceGurus" framework (Shoptimizer) */
    border-radius: var(--cg-border-radius, 4px);
    z-index: 999999;
    max-height: 480px;
    overflow-y: auto;
    display: none;
    /* Herda fonte global e cores globais */
    font-family: inherit;
    color: var(--cg-text-color, #505050);
}

.pollo-busca-dropdown.is-open {
    display: block;
    animation: polloBuscaFadeIn 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Base de item do Shoptimizer Product List */
.pollo-busca-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit; /* respeitar cor pai */
    border-bottom: 1px solid var(--cg-border-color, #eaeaea);
    transition: background-color 0.2s ease, padding-left 0.2s ease;
}

.pollo-busca-item:last-child {
    border-bottom: none;
}

/* Hover effect padrão de interatividade Shoptimizer (bg levemente dark, sutil move) */
.pollo-busca-item.is-active,
.pollo-busca-item:hover,
.pollo-busca-item:focus {
    background-color: rgba(0,0,0,0.02);
    outline: none;
}

.pollo-busca-thumb-wrap {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    margin-right: 15px;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pollo-busca-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* No Shoptimizer imgs tipicamente não tem borda arredondada nos widgets de busca, mas se a var estiver setada, aplicamos */
    border-radius: var(--cg-border-radius, 0);
}

.pollo-busca-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    justify-content: center;
}

/* Utiliza cor de links padrão do tema */
.pollo-busca-title {
    font-size: 14px;
    line-height: 1.35;
    font-weight: 500;
    color: var(--cg-heading-color, #1a1a1a);
    transition: color 0.2s;
}

.pollo-busca-item:hover .pollo-busca-title,
.pollo-busca-item.is-active .pollo-busca-title {
    color: var(--cg-primary-color, #e06e38); /* Usa a cor primária (Primary Color) do tema no hover */
}

/* Highlight com a primary color transparente do Shoptimizer */
.pollo-busca-title mark {
    background: transparent;
    color: var(--cg-primary-color, #e06e38);
    font-weight: 700;
    padding: 0;
    text-decoration: underline;
    text-decoration-color: rgba(224, 110, 56, 0.4);
}

.pollo-busca-item.is-outofstock .pollo-busca-title {
    opacity: 0.5;
}

/* SKU Subtext */
.pollo-busca-sku {
    font-size: 11px;
    color: var(--cg-text-color, #777);
    margin-top: 2px;
    opacity: 0.8;
}

.pollo-busca-sku mark {
    background: transparent;
    color: var(--cg-primary-color, #e06e38);
    font-weight: 700;
    padding: 0;
}

/* Badge estilo WooCommerce Shoptimizer native */
.pollo-busca-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
    background-color: var(--cg-sale-color, #d32d39); /* Shoptimizer usa mt badge vermelho na tag de Outofstock/Sale */
    display: inline-block;
    padding: 3px 6px;
    border-radius: 2px;
    margin-top: 6px;
    line-height: 1;
    width: max-content;
}

.pollo-busca-empty {
    padding: 30px 15px;
    text-align: center;
    color: var(--cg-text-color, #888);
    font-size: 14px;
}

/* Spinner compatível com themes leves */
.pollo-busca-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    display: none;
    pointer-events: none;
}

.pollo-busca-spinner.is-active {
    display: block;
}

.pollo-busca-spinner i {
    display: block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,0.1);
    /* Usar a Primary Color para o spinner rodando */
    border-top-color: var(--cg-primary-color, #e06e38);
    border-radius: 50%;
    animation: polloBuscaSpin 0.7s linear infinite;
}

/* Custom Scrollbar Shoptimizer-like */
.pollo-busca-dropdown::-webkit-scrollbar {
    width: 5px;
}
.pollo-busca-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.pollo-busca-dropdown::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
}
.pollo-busca-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.3);
}

@keyframes polloBuscaSpin {
    to { transform: rotate(360deg); }
}

@keyframes polloBuscaFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
