/* === CONTENEUR PRINCIPAL === */
.searchandfilter>div>ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    width: 90%;
}

.searchandfilter li p {
    width: 100%;
}

/* === ÉTAPES DU FORMULAIRE === */
.searchandfilter>div>ul>li {
    margin-bottom: 25px;
    padding: 25px;
    background: #ffffff;
    transition: all 0.3s ease-in-out;
    opacity: 0;
    transform: translateY(10px);
    will-change: opacity, transform;
    width: 100%;
}

.searchandfilter>div>ul>li[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

/* === TITRES === */
.searchandfilter h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

/* === LABELS COMMUNS === */
.searchandfilter label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    font-size: 15px;
    cursor: pointer;
    border: 1px solid rgb(223, 223, 228);
    padding: calc(2px + 0.5rem);
    border-radius: 0.25rem 4px;
    gap: 10px;
    transition: background-color 0.2s ease-in-out;
}

/* === Hover et sélection === */
.searchandfilter label:hover {
    background-color: #f9f9f9;
}

.searchandfilter label:has(input:checked) {
    background-color: #fef7e0;
    border-color: #FFCF56;
}

/* === CHECKBOX + RADIO SHARED STYLES === */
.searchandfilter label input[type="checkbox"],
.searchandfilter label input[type="radio"] {
    order: 2;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #5e5a59;
    background-color: white;
    cursor: pointer;
    position: relative;
    margin-left: 10px;
}

/* === CHECKBOX === */
.searchandfilter label input[type="checkbox"] {
    border-radius: 4px;
}

.searchandfilter label input[type="checkbox"]:checked {
    background-color: var(--e-global-color-primary, #ffcf56);
    border-color: var(--e-global-color-primary, #ffcf56);
}

.searchandfilter label:not(.checkbox-radio) input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    display: none;
}

.searchandfilter label:not(.checkbox-radio) input[type="checkbox"]:checked::before {
    display: block;
}

/* === RADIO === */
.searchandfilter label input[type="radio"] {
    border-radius: 50%;
}

.searchandfilter label input[type="radio"]:checked {
    background-color: #5e5a59;
    border-color: #5e5a59;
}

.searchandfilter label input[type="radio"]::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    display: none;
}

.searchandfilter label input[type="radio"]:checked::before {
    display: block;
}

/* === CHAMPS DE SAISIE === */
.searchandfilter input[type="text"],
.searchandfilter input[type="email"],
.searchandfilter input[type="number"],
.searchandfilter select,
.searchandfilter textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    background-color: #fff;
    transition: all 0.3s;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.searchandfilter select[multiple] {
    height: auto;
    min-height: 100px;
}

/* === BOUTONS NAVIGATION === */
.searchandfilter .next-btn
 {
    background-color: #ffcf56;
    color: white;
    padding: 12px 20px;
    border: none;
    /* border-radius: 6px; */
    margin-top: 15px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease-in-out;
    /* width: 100%; */
    font-weight: 600;
}

.searchandfilter .next-btn:hover {
    background-color: #edbf4a;
    transform: translateY(-1px);
}

/* === BOUTON SUBMIT === */
.searchandfilter input[type="submit"],
.searchandfilter button[type="submit"] {
    background-color: #ffcf56;
    color: white;
    padding: 0 30px;
    border: none;
    border-radius: 0;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: block;
    margin: 20px auto 0;
    font-weight: 600;
}

.searchandfilter input[type="submit"]:hover,
.searchandfilter button[type="submit"]:hover {
    background-color: #edbf4a;
    transform: translateY(-1px);
}

.searchandfilter .search-filter-submit {
    text-align: center;
}

/* === ANIMATIONS === */
.searchandfilter ul li {
    animation: fadeIn 0.5s ease-in-out forwards;
}

.searchandfilter ul {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === ERREURS === */
.searchandfilter .input-error {
    border: 1px solid red !important;
}

.error-message {
    color: red;
    font-size: 0.85em;
    margin-top: 4px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .searchandfilter>div>ul {
        padding: 0 15px;
    }
}

/* Style pour l'élément parent sélectionné */
.searchandfilter #form-step-0 li.cat-item:has(input[type="checkbox"]:checked) {
    border-left: 3px solid #aaaaaa13;
    margin-bottom: 5px;
}

/* Animation pour le bouton */
.searchandfilter .toggle-secteur-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Masquer les éléments de façon propre */
.searchandfilter #form-step-0 li.cat-item[style*="none"] {
    display: none !important;
}

/* === FLEX POUR LES LI === */
.searchandfilter ul.children {
    display: flex;
    flex-direction: column;
    padding-left: 40px;
}

/* Appliquer flex aux li des catégories */
.searchandfilter li.cat-item {
    display: flex;
    flex-direction: column;
}

/* Effet translate au hover */
.searchandfilter li.cat-item:hover {
    transform: translateX(2px);
    transition: transform 0.2s ease-in-out;
}

/* spinner */
#form-init-loading {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ffcf56;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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