/* ==========================================================================
   Huble Product Filters v1.3.1
   Apenas estilos da barra de filtros — cards usam CSS do WooCommerce/Elementor
   ========================================================================== */

:root {
    --huble-primary: #1a1a2e;
    --huble-accent: #e94560;
    --huble-bg: #ffffff;
    --huble-border: #e0e0e0;
    --huble-text: #333333;
    --huble-text-light: #777777;
    --huble-radius: 8px;
    --huble-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --huble-transition: 0.2s ease;
}

/* Container */
.huble-filters {
    margin-bottom: 24px;
    font-family: inherit;
}

/* Barra de filtros */
.huble-filters__bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 16px 20px;
    background: var(--huble-bg);
    border: 1px solid var(--huble-border);
    border-radius: var(--huble-radius);
    box-shadow: var(--huble-shadow);
}

.huble-filters__group {
    flex: 1 1 180px;
    min-width: 160px;
    max-width: 240px;
}

.huble-filters__group--price {
    flex: 1 1 260px;
    max-width: 320px;
}

.huble-filters__group--sort {
    flex: 0 1 180px;
    margin-left: auto;
}

/* Selects */
.huble-filters__select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    font-size: 14px;
    color: var(--huble-text);
    background-color: var(--huble-bg);
    border: 1px solid var(--huble-border);
    border-radius: 6px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23777'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color var(--huble-transition), box-shadow var(--huble-transition);
    line-height: 1.4;
}

.huble-filters__select:hover { border-color: #bbb; }

.huble-filters__select:focus {
    outline: none;
    border-color: var(--huble-accent);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.huble-filters__select.huble-filters--active {
    border-color: var(--huble-accent);
    color: var(--huble-primary);
    font-weight: 500;
}

/* Slider de preço */
.huble-filters__price-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.huble-filters__price-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--huble-text-light);
    white-space: nowrap;
}

.huble-filters__price-display {
    font-size: 14px;
    font-weight: 600;
    color: var(--huble-primary);
}

.huble-filters__price-sliders {
    position: relative;
    height: 28px;
}

.huble-filters__range {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 28px;
    margin: 0; padding: 0;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.huble-filters__range::-webkit-slider-runnable-track {
    height: 4px;
    background: var(--huble-border);
    border-radius: 2px;
}

.huble-filters__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    background: var(--huble-accent);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    pointer-events: all;
    margin-top: -8px;
    transition: transform 0.15s ease;
}

.huble-filters__range::-webkit-slider-thumb:hover { transform: scale(1.15); }

.huble-filters__range::-moz-range-track {
    height: 4px;
    background: var(--huble-border);
    border-radius: 2px;
    border: none;
}

.huble-filters__range::-moz-range-thumb {
    width: 18px; height: 18px;
    background: var(--huble-accent);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    pointer-events: all;
}

/* Botão Limpar */
.huble-filters__clear {
    flex: 0 0 auto;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--huble-accent);
    background: transparent;
    border: 1px solid var(--huble-accent);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--huble-transition);
}

.huble-filters__clear:hover {
    background: var(--huble-accent);
    color: #fff;
}

/* Status */
.huble-filters__status {
    padding: 10px 20px;
    font-size: 13px;
    color: var(--huble-text-light);
}

/* Loading overlay */
.huble-filters__loading {
    position: relative;
    min-height: 200px;
}

.huble-filters__loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

.huble-filters__loading::before {
    content: '';
    position: absolute;
    top: 120px; left: 50%;
    width: 32px; height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid var(--huble-border);
    border-top-color: var(--huble-accent);
    border-radius: 50%;
    z-index: 11;
    animation: huble-spin 0.6s linear infinite;
}

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

/* Sem resultados */
.huble-filters__no-results {
    text-align: center;
    padding: 48px 20px;
    color: var(--huble-text-light);
    font-size: 15px;
}

.huble-filters__no-results-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

/* Paginação AJAX */
.huble-filters__pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.huble-filters__page-btn {
    padding: 8px 14px;
    font-size: 14px;
    color: var(--huble-text);
    background: var(--huble-bg);
    border: 1px solid var(--huble-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--huble-transition);
}

.huble-filters__page-btn:hover {
    border-color: var(--huble-accent);
    color: var(--huble-accent);
}

.huble-filters__page-btn.active {
    background: var(--huble-accent);
    border-color: var(--huble-accent);
    color: #fff;
}

/* ==========================================================================
   Garantir que a grid AJAX herde os estilos do Elementor WooCommerce
   ========================================================================== */

#huble-ajax-results .products {
    padding: 0;
    margin: 0;
}

#huble-ajax-results .products .product {
    list-style: none;
}

/* Responsivo */
@media (max-width: 768px) {
    .huble-filters__bar {
        flex-direction: column;
        gap: 10px;
        padding: 14px 16px;
    }
    .huble-filters__group,
    .huble-filters__group--price,
    .huble-filters__group--sort {
        flex: 1 1 100%;
        max-width: 100%;
        min-width: 100%;
        margin-left: 0;
    }
    .huble-filters__clear {
        width: 100%;
        text-align: center;
    }
}
