#cmd-configurator {
    position: relative;
    display: flex;
    gap: 0;
}

/* PANEL FILTRÓW */

.cmd-filter-panel {
    position: relative;
    width: 260px;
    min-width: 260px;
    background: #f7f7f9;
    border-right: 1px solid #ddd;
    padding: 16px;
    box-sizing: border-box;
    transform: translateX(-100%);
    transition: transform 0.35s ease;
    z-index: 20;
}

.cmd-filter-panel.cmd-panel-open {
    transform: translateX(0);
}

.cmd-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
}

.cmd-filter-close {
    background: none;
    border: none;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
}

.cmd-filter-section {
    margin-bottom: 16px;
}

.cmd-filter-section h4 {
    margin: 0 0 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
}

.cmd-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cmd-checkbox {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.cmd-checkbox input {
    margin-right: 8px;
}

.cmd-checkbox-label {
    line-height: 1.4;
}

.cmd-brand-row {
    margin-top: 8px;
}

.cmd-brand-checkbox {
    font-weight: 600;
}

.cmd-model-checkbox {
    font-weight: 400;
}

.cmd-indent {
    padding-left: 20px;
}

.cmd-filter-reset,
.cmd-filter-apply-mobile {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
}

.cmd-filter-reset:hover {
    background: #f0f0f0;
}

.cmd-filter-apply-mobile {
    display: none;
    background: #111;
    color: #fff;
    border-color: #111;
}

/* PRZYCISK FILTRUJ */

.cmd-filter-toggle {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 30;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #111;
    color: #fff;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.cmd-filter-icon {
    font-size: 16px;
}

.cmd-filter-toggle-animated {
    animation: cmd-pulse 2s infinite;
}

@keyframes cmd-pulse {
    0% { transform: scale(1); box-shadow: 0 4px 10px rgba(0,0,0,0.25); }
    50% { transform: scale(1.05); box-shadow: 0 6px 14px rgba(0,0,0,0.35); }
    100% { transform: scale(1); box-shadow: 0 4px 10px rgba(0,0,0,0.25); }
}

/* PRODUKTY */

.cmd-products-wrapper {
    flex: 1;
    padding: 16px;
    box-sizing: border-box;
}

.cmd-products-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.cmd-product-card {
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e2e2e2;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cmd-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.cmd-product-image img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.cmd-product-body {
    padding: 10px 12px 12px;
}

.cmd-product-title {
    font-size: 14px;
    margin: 0 0 6px;
}

.cmd-product-price {
    font-size: 13px;
    color: #444;
    margin-bottom: 8px;
}

.cmd-product-button {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    background: #111;
    color: #fff;
    text-decoration: none;
}

.cmd-product-button:hover {
    background: #333;
}

.cmd-no-results {
    font-size: 14px;
    color: #666;
}
  
#cmd-filter-panel {
    position: sticky;
    top: 0;
    align-self: flex-start;
}

#cmd-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#cmd-loader.active {
    opacity: 1;
    pointer-events: all;
}

.cmd-spinner {
    width: 50px;
    height: 50px;
    border: 6px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.cmd-loader-text {
    margin-top: 15px;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

/* Scroll panelu filtrów na desktopie */
#cmd-filter-panel {
    max-height: 100vh;      /* panel nie może być wyższy niż ekran */
    overflow-y: auto;       /* własny scroll */
    overscroll-behavior: contain; /* zapobiega przewijaniu strony */
}

/* RESPONSYWNOŚĆ */

@media (max-width: 1024px) {
    .cmd-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 768px) {
    #cmd-configurator {
        flex-direction: column;
    }
       #cmd-filter-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 100%;
        overflow-y: auto;
    }
 #cmd-filter-toggle {
        bottom: 5px; /* możesz zmienić np. na 140px, 160px itd. */
        left: 60px; 
        z-index: 9999; /* żeby był nad paskiem cookies */
    }


    .cmd-filter-panel {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 80%;
        max-width: 320px;
        transform: translateX(-100%);
        box-shadow: 4px 0 16px rgba(0,0,0,0.3);
        z-index: 50;
    }

    .cmd-filter-panel.cmd-panel-open {
        transform: translateX(0);
    }

    .cmd-filter-apply-mobile {
        display: inline-block;
        width: 100%;
        text-align: center;
        margin-top: 16px;
    }

    .cmd-filter-toggle {
        display: inline-flex;
    }

    .cmd-products-wrapper {
        padding: 12px;
    }

    .cmd-products-grid {
        grid-template-columns: 1fr;
    }
}


