/* ChromaPet - pasek filtrów WooCommerce */

#cpf-filterbar.cpf-filterbar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 24px;
    margin-bottom: 24px;
    width: auto;
    background: #f0e3d3; /* ciepły beż jak na zrzucie ekranu */
}

#cpf-filterbar .cpf-filters {
    display: flex !important;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: auto;
}

/* Przyciski-pigułki */
#cpf-filterbar .cpf-dropdown { position: relative; width: auto; }

#cpf-filterbar button.cpf-dropdown-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: auto !important;
    padding: 10px 18px;
    background: transparent !important;
    border: 1px solid rgba(26, 26, 26, 0.18) !important; /* delikatna obwódka jak na zrzucie ekranu */
    border-radius: 999px !important;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #1a1a1a !important;
    cursor: pointer;
    box-shadow: none !important;
    transition: background 0.15s ease, color 0.15s ease;
}


#cpf-filterbar button.cpf-dropdown-toggle:hover { background: rgba(0,0,0,0.05) !important; }

#cpf-filterbar button.cpf-dropdown-toggle.is-active {
    background: #1a1a1a !important;
    color: #fff !important;
}

.cpf-dropdown-toggle .cpf-chevron { transition: transform 0.2s ease; flex-shrink: 0; }

.cpf-dropdown.is-open .cpf-dropdown-toggle .cpf-chevron { transform: rotate(180deg); }

#cpf-filterbar .cpf-count {
    background: #e3462f;
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    padding: 3px 6px;
}

#cpf-filterbar button.cpf-reset-all {
    display: inline-block !important;
    width: auto !important;
    background: none !important;
    border: none !important;
    text-decoration: underline;
    font-size: 13px;
    color: #6b6459 !important;
    cursor: pointer;
    padding: 8px 6px;
    box-shadow: none !important;
}

/* Panel rozwijany - domyślnie ukryty, pokazuje się TYLKO z klasą is-open */
#cpf-filterbar .cpf-dropdown-panel {
    display: none !important;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 220px;
    width: max-content;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.14);
    padding: 12px;
    z-index: 9999;
}

#cpf-filterbar .cpf-dropdown.is-open .cpf-dropdown-panel { display: block !important; }

#cpf-filterbar .cpf-option {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 9px 8px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #1a1a1a;
    width: auto;
    margin: 0 !important;
}

#cpf-filterbar .cpf-option:hover { background: #f6f1e9; }

/* Niedostępna kombinacja (np. rozmiar nieistniejący w wybranym
   kolorze) - wyszarzona i zablokowana do kliknięcia. */
#cpf-filterbar .cpf-option.cpf-option-unavailable {
    opacity: 0.35;
    cursor: not-allowed;
}
#cpf-filterbar .cpf-option.cpf-option-unavailable:hover { background: none; }
#cpf-filterbar .cpf-option.cpf-option-unavailable .cpf-swatch { filter: grayscale(70%); }

.cpf-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cpf-checkbox-box {
    width: 16px;
    height: 16px;
    border: 1.5px solid #c9c2b4;
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    background: #fff;
}

.cpf-option input[type="checkbox"]:checked + .cpf-checkbox-box {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.cpf-option input[type="checkbox"]:checked + .cpf-checkbox-box::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cpf-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.cpf-option-label { flex: 1; }

.cpf-option-count { color: #a39c8e; font-size: 12px; }

.cpf-panel-actions {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid #efe9df;
    text-align: right;
}

#cpf-filterbar button.cpf-clear-group, #cpf-filterbar button.cpf-apply-price {
    display: inline-block !important;
    width: auto !important;
    background: none !important;
    border: none !important;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    color: #1a1a1a !important;
    padding: 6px 4px;
    box-shadow: none !important;
}

#cpf-filterbar button.cpf-apply-price {
    background: #1a1a1a !important;
    color: #fff !important;
    border-radius: 999px !important;
    padding: 8px 16px;
}

/* Panel ceny */
.cpf-price-panel { min-width: 240px; }
.cpf-price-inputs { display: flex; gap: 10px; }
.cpf-price-inputs label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #6b6459;
    flex: 1;
}
.cpf-price-inputs input[type="number"] {
    border: 1px solid #e3ddd0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    width: 100%;
}

/* Sortowanie */
#cpf-filterbar .cpf-sort {
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #6b6459;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    width: auto;
}

#cpf-filterbar .cpf-sort select {
    width: auto !important;
    border: none !important;
    border-radius: 999px !important;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    background: #fff !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    cursor: pointer;
}

.cpf-results-meta,
.woocommerce-result-count {
    padding: 12px 24px 4px;
    font-size: 12px;
    color: #a39c8e;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cpf-no-results {
    padding: 60px 20px;
    text-align: center;
    font-size: 15px;
    color: #6b6459;
    width: 100%;
}

#cpf-product-grid.cpf-loading { opacity: 0.4; pointer-events: none; transition: opacity 0.15s ease; }

@media (max-width: 782px) {
    .cpf-filterbar { padding: 14px 16px; }
    .cpf-filters { gap: 8px; }
    .cpf-dropdown-panel { left: 0; right: auto; }
}
