/* =====================================================
   Craft Filtre Produit — Frontend CSS
   Author: Regon Craft
   ===================================================== */

/* === Desktop Filter — hidden on mobile === */
.cfp-desktop-filter {
    padding: 20px;
    margin-bottom: 24px;
}
.cfp-filter-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid currentColor;
    opacity: 0.7;
}
.cfp-filter-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.cfp-filter-section {
    margin-bottom: 20px;
}
.cfp-filter-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid;
    opacity: 0.7;
}
.cfp-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.cfp-filter-group input[type="checkbox"],
.cfp-filter-group input[type="radio"] {
    display: none;
}
.cfp-filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 0;
    width: 100%;
}
.cfp-filter-group label::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 3px;
    opacity: 0.5;
    flex-shrink: 0;
    transition: all 0.2s;
}
.cfp-sort-option label::before {
    border-radius: 50%;
}
.cfp-filter-group input[type="checkbox"]:checked + label::before,
.cfp-filter-group input[type="radio"]:checked + label::before {
    opacity: 1;
    border-color: transparent;
}
.cfp-filter-group input[type="radio"]:checked + label::before {
    box-shadow: inset 0 0 0 3px white;
}

/* Price inputs */
.cfp-price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.cfp-price-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-size: 13px;
    width: 80px;
    background: transparent;
    color: inherit;
    opacity: 0.8;
}
.cfp-price-sep {
    opacity: 0.5;
}

/* Range slider */
.cfp-price-range-slider {
    position: relative;
    height: 20px;
}
.cfp-price-range-slider input[type="range"] {
    position: absolute;
    width: 100%;
    height: 4px;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
}
.cfp-price-range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: currentColor;
    pointer-events: all;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Country select */
.cfp-sort-select, .cfp-country-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid;
    border-radius: 4px;
    font-size: 14px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

/* Search in filter */
.cfp-search-in-filter {
    position: relative;
    margin-bottom: 8px;
}
.cfp-search-filter-input {
    width: 100%;
    padding: 7px 32px 7px 10px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-size: 13px;
    background: transparent;
    color: inherit;
    opacity: 0.7;
    box-sizing: border-box;
}
.cfp-search-in-filter svg {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}
.cfp-filter-options {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}
.cfp-filter-options::-webkit-scrollbar {
    width: 4px;
}
.cfp-filter-options::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 2px;
}

/* Actions */
.cfp-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.cfp-btn-apply, .cfp-btn-reset {
    flex: 1;
    padding: 10px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.2s, transform 0.1s;
}
.cfp-btn-apply:hover, .cfp-btn-reset:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}
.cfp-btn-reset {
    background: transparent;
    border: 2px solid;
}

/* === Mobile Toggle Button === */
.cfp-mobile-filter-toggle {
    display: none;
}
.cfp-mobile-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}
.cfp-active-count {
    display: inline-block;
    margin-left: 4px;
}

/* === Mobile Overlay === */
.cfp-mobile-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}

/* === Mobile Panel === */
.cfp-mobile-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 380px;
    height: 100%;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 20px rgba(0,0,0,0.3);
}
.cfp-mobile-panel.cfp-panel-open {
    right: 0;
}
.cfp-mobile-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
}
.cfp-mobile-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}
.cfp-mobile-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.cfp-mobile-form {
    padding: 0 0 80px;
}
.cfp-mobile-form .cfp-filter-section {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0;
}
.cfp-mobile-form .cfp-filter-group label {
    padding: 6px 0;
}
.cfp-mobile-panel-footer {
    position: sticky;
    bottom: 0;
    padding: 16px 20px;
    background: inherit;
    border-top: 1px solid rgba(255,255,255,0.2);
    display: flex;
    gap: 10px;
}
.cfp-mobile-apply-btn {
    flex: 1;
    padding: 14px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    border-radius: 6px;
}
.cfp-mobile-reset-btn {
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.4);
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
}

/* === Responsive Breakpoints === */
@media (max-width: 768px) {
    .cfp-desktop-filter {
        display: none !important;
    }
    .cfp-mobile-filter-toggle {
        display: block;
    }
}
@media (min-width: 769px) {
    .cfp-mobile-filter-toggle,
    .cfp-mobile-panel,
    .cfp-mobile-overlay {
        display: none !important;
    }
}
