/* ===== WCPC WIDGET STYLES ===== */
/* Dopasowane do stylu konfiguratora */

/* CSS Variables matching configurator */
:root {
    --wcpc-primary: #dc2626;
    --wcpc-primary-dark: #b91c1c;
    --wcpc-primary-light: #ef4444;
    --wcpc-primary-bg: #fee2e2;
    --wcpc-gray-50: #f9fafb;
    --wcpc-gray-100: #f3f4f6;
    --wcpc-gray-200: #e5e7eb;
    --wcpc-gray-300: #d1d5db;
    --wcpc-gray-500: #6b7280;
    --wcpc-gray-700: #374151;
    --wcpc-gray-900: #111827;
    --wcpc-radius: 0.5rem;
    --wcpc-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Elementor widget containers */
.wcpc-elementor-color-filter,
.wcpc-elementor-price-filter,
.wcpc-elementor-dimension-filter,
.wcpc-elementor-product-filter {
    background: white;
    border-radius: var(--wcpc-radius);
    box-shadow: var(--wcpc-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wcpc-elementor-color-filter h3,
.wcpc-elementor-price-filter h3,
.wcpc-elementor-dimension-filter h3,
.wcpc-elementor-product-filter h3 {
    color: var(--wcpc-gray-900);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--wcpc-primary);
}

/* Widget containers */
.wcpc-widget-color-filter,
.wcpc-widget-price-filter,
.wcpc-widget-dimension-filter,
.wcpc-widget-material-filter,
.wcpc-widget-wire-filter {
    padding: 15px 0;
}

/* Color Filter Widget */
.wcpc-widget-color-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.wcpc-widget-color-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--wcpc-gray-300);
    border-radius: var(--wcpc-radius);
    background: var(--wcpc-gray-50);
    cursor: pointer;
    transition: all 0.2s ease;
}

.wcpc-widget-color-option:hover {
    background: var(--wcpc-primary-bg);
    border-color: var(--wcpc-primary-light);
    transform: translateY(-1px);
}

.wcpc-widget-color-option input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--wcpc-primary);
}

.wcpc-widget-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--wcpc-gray-300);
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.wcpc-widget-color-label {
    font-size: 0.875rem;
    color: var(--wcpc-gray-700);
    font-weight: 500;
}

/* Price Filter Widget */
.wcpc-price-input-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 5px;
}

.wcpc-price-input-group label {
    font-size: 12px;
    color: #666;
    min-width: 25px;
}

.wcpc-price-input-group input {
    width: 70px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
}

.wcpc-price-input-group span {
    font-size: 12px;
    color: #666;
}

.wcpc-price-range-slider {
    position: relative;
    margin: 15px 0 10px 0;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
}

.wcpc-range-slider {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    width: 100%;
    height: 6px;
    background: transparent;
    outline: none;
    pointer-events: none;
}

.wcpc-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--wcpc-primary, #007cba);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.wcpc-range-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--wcpc-primary, #007cba);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.wcpc-price-display {
    text-align: center;
    font-size: 12px;
    color: #666;
    background: #f8f9fa;
    padding: 5px;
    border-radius: 3px;
    margin-top: 10px;
}

/* Dimension Filter Widget */
.wcpc-dimension-group {
    margin-bottom: 1rem;
}

.wcpc-dimension-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--wcpc-gray-700);
    margin-bottom: 0.5rem;
}

.wcpc-dimension-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--wcpc-gray-300);
    border-radius: var(--wcpc-radius);
    font-size: 0.875rem;
    background: white;
    color: var(--wcpc-gray-700);
    transition: border-color 0.2s ease;
}

.wcpc-dimension-group select:focus {
    outline: none;
    border-color: var(--wcpc-primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.wcpc-dimension-group h5 {
    margin: 0 0 5px 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.wcpc-dimension-inputs {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wcpc-dimension-inputs input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

.wcpc-dimension-inputs span {
    font-size: 12px;
    color: #666;
}

/* Material Filter Widget */
.wcpc-widget-material-option,
.wcpc-widget-wire-option {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    cursor: pointer;
    padding: 3px 0;
    transition: background-color 0.2s ease;
}

.wcpc-widget-material-option:hover,
.wcpc-widget-wire-option:hover {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding-left: 4px;
    padding-right: 4px;
}

.wcpc-widget-material-option input[type="checkbox"],
.wcpc-widget-wire-option input[type="checkbox"] {
    margin-right: 8px;
}

.wcpc-widget-material-label,
.wcpc-widget-wire-label {
    font-size: 14px;
    color: #333;
}

/* Widget Apply Button */
.wcpc-widget-apply-filters {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--wcpc-primary);
    color: white;
    border: none;
    border-radius: var(--wcpc-radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1rem;
}

.wcpc-widget-apply-filters:hover {
    background: var(--wcpc-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.wcpc-widget-apply-filters:active {
    transform: translateY(0);
}

/* Widget Loading State */
.wcpc-widget-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wcpc-widget-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid var(--wcpc-primary, #007cba);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: wcpc-widget-spin 1s linear infinite;
}

@keyframes wcpc-widget-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Widget Active State */
.wcpc-widget-filter-input:checked + .wcpc-widget-color-swatch {
    border-color: var(--wcpc-primary, #007cba);
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.wcpc-widget-filter-input:checked + .wcpc-widget-color-label,
.wcpc-widget-filter-input:checked + * + .wcpc-widget-material-label,
.wcpc-widget-filter-input:checked + * + .wcpc-widget-wire-label {
    color: var(--wcpc-primary, #007cba);
    font-weight: 600;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .wcpc-elementor-color-filter,
    .wcpc-elementor-price-filter,
    .wcpc-elementor-dimension-filter,
    .wcpc-elementor-product-filter {
        padding: 1.25rem;
    }
    
    .wcpc-widget-color-filter {
        gap: 0.5rem;
    }
    
    .wcpc-widget-color-option {
        padding: 0.375rem 0.5rem;
    }
}

@media (max-width: 768px) {
    .wcpc-elementor-color-filter,
    .wcpc-elementor-price-filter,
    .wcpc-elementor-dimension-filter,
    .wcpc-elementor-product-filter {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .wcpc-elementor-color-filter h3,
    .wcpc-elementor-price-filter h3,
    .wcpc-elementor-dimension-filter h3,
    .wcpc-elementor-product-filter h3 {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }
    
    /* Color filter responsive */
    .wcpc-widget-color-filter {
        gap: 0.5rem;
    }
    
    .wcpc-widget-color-option {
        padding: 0.375rem 0.5rem;
        border-radius: 0.375rem;
    }
    
    .wcpc-widget-color-swatch {
        width: 18px;
        height: 18px;
    }
    
    .wcpc-widget-color-label {
        font-size: 0.8125rem;
    }
    
    /* Price filter responsive */
    .wcpc-price-range-inputs {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .wcpc-price-input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    
    .wcpc-price-input-group label {
        font-size: 0.8125rem;
        min-width: auto;
        text-align: left;
    }
    
    .wcpc-price-input-group input[type="number"] {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .wcpc-price-display {
        font-size: 0.8125rem;
        padding: 0.5rem;
    }
    
    /* Dimension filter responsive */
    .wcpc-dimension-group select {
        padding: 0.625rem;
        font-size: 0.875rem;
    }
    
    .wcpc-dimension-group label {
        font-size: 0.8125rem;
    }
    
    /* Button responsive */
    .wcpc-widget-apply-filters {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
        margin-top: 0.75rem;
    }
}

@media (max-width: 480px) {
    .wcpc-elementor-color-filter,
    .wcpc-elementor-price-filter,
    .wcpc-elementor-dimension-filter,
    .wcpc-elementor-product-filter {
        padding: 0.75rem;
        border-radius: 0.375rem;
    }
    
    .wcpc-elementor-color-filter h3,
    .wcpc-elementor-price-filter h3,
    .wcpc-elementor-dimension-filter h3,
    .wcpc-elementor-product-filter h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.375rem;
    }
    
    /* Color filter mobile */
    .wcpc-widget-color-filter {
        gap: 0.375rem;
    }
    
    .wcpc-widget-color-option {
        padding: 0.25rem 0.375rem;
        font-size: 0.75rem;
    }
    
    .wcpc-widget-color-swatch {
        width: 16px;
        height: 16px;
    }
    
    .wcpc-widget-color-label {
        font-size: 0.75rem;
    }
    
    /* Price filter mobile */
    .wcpc-price-input-group input[type="number"] {
        padding: 0.375rem;
        font-size: 0.8125rem;
    }
    
    .wcpc-price-display {
        font-size: 0.75rem;
        padding: 0.375rem;
    }
    
    /* Dimension filter mobile */
    .wcpc-dimension-group select {
        padding: 0.5rem;
        font-size: 0.8125rem;
    }
    
    .wcpc-dimension-group label {
        font-size: 0.75rem;
        margin-bottom: 0.375rem;
    }
    
    /* Button mobile */
    .wcpc-widget-apply-filters {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
        margin-top: 0.5rem;
    }
}

/* ===== ENHANCED INTERACTIONS ===== */
.wcpc-widget-color-option:focus-within {
    outline: 2px solid var(--wcpc-primary);
    outline-offset: 2px;
}

.wcpc-widget-color-option input[type="checkbox"]:checked + .wcpc-widget-color-swatch {
    border-color: var(--wcpc-primary);
    border-width: 2px;
    box-shadow: 0 0 0 2px var(--wcpc-primary-bg);
}

.wcpc-widget-color-option input[type="checkbox"]:checked ~ .wcpc-widget-color-label {
    color: var(--wcpc-primary);
    font-weight: 600;
}

/* ===== LOADING STATES ===== */
.wcpc-widget-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.wcpc-widget-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--wcpc-primary);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: wcpc-spin 1s linear infinite;
}

@keyframes wcpc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== GRID LAYOUT FOR COLORS ===== */
.wcpc-widget-color-filter {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .wcpc-widget-color-filter {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .wcpc-widget-color-filter {
        grid-template-columns: 1fr;
        gap: 0.375rem;
    }
}

/* ===== PRICE RANGE ENHANCEMENTS ===== */
.wcpc-price-range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .wcpc-price-range-inputs {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

.wcpc-price-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.wcpc-price-input-group label {
    font-weight: 600;
    color: var(--wcpc-gray-700);
}

.wcpc-price-input-group input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--wcpc-gray-300);
    border-radius: var(--wcpc-radius);
    font-size: 0.875rem;
    background: white;
    transition: all 0.2s ease;
}

.wcpc-price-input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--wcpc-primary);
    box-shadow: 0 0 0 3px var(--wcpc-primary-bg);
}

/* ===== LEGACY RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .wcpc-price-input-group input,
    .wcpc-dimension-inputs input {
        width: 55px;
        font-size: 12px;
    }
    
    .wcpc-widget-material-label,
    .wcpc-widget-wire-label {
        font-size: 13px;
    }
}

/* Widget in sidebar */
.widget .wcpc-widget-color-filter,
.widget .wcpc-widget-price-filter,
.widget .wcpc-widget-dimension-filter,
.widget .wcpc-widget-material-filter,
.widget .wcpc-widget-wire-filter {
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.widget .widget-title {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

/* Count badges */
.wcpc-widget-color-label small,
.wcpc-widget-material-label small,
.wcpc-widget-wire-label small {
    color: #999;
    font-size: 11px;
}

/* Clear filters link */
.wcpc-widget-clear-filters {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.wcpc-widget-clear-filters:hover {
    color: #333;
    border-color: #999;
    text-decoration: none;
}