/* Déclaration de la font */
@font-face {
    font-family: "Gotham Medium";
    src: url("https://pomimmo.fr/wp-content/uploads/et-fonts/Gotham-Medium.otf") format("opentype");
    font-display: swap;
}

/* Container principal */
.fiftys-search-container {
    width: 100%;
}

.fiftys-search-form {
    width: 100%;
    background-color: #f8f4ed;
    padding: 20px;
}

/* Grille du formulaire */
.search-form-grid {
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 15px;
    width: 100%;
}

/* Première ligne */
.search-field-top {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
}

/* Deuxième ligne */
.search-field-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
}

/* Conteneur du bouton */
.search-field-button {
    display: flex;
    justify-content: flex-end;
    grid-column: 1 / -1;
    margin-top: 15px;
}

/* Styles communs pour les inputs et selects */
.search-input,
.search-select {
    width: 100%;
    height: 42px;
    padding: 8px 12px;
    border: 3px solid #010037;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    font-family: "Gotham Medium", sans-serif;
    color: #4E4E4E;
    box-sizing: border-box;
}

/* Surcharge des styles par défaut de WordPress */
.fiftys-search-form input.text,
.fiftys-search-form input[type="text"],
.fiftys-search-form input.search-input {
    border: 3px solid #010037;
    padding: 8px 12px;
    height: 42px;
    box-sizing: border-box;
}

/* Assurons-nous que ces styles ne sont pas écrasés */
.fiftys-search-form input.search-input:not(.custom-style) {
    border: 3px solid #010037 !important;
    padding: 8px 12px !important;
    height: 42px !important;
}

/* Focus states */
.search-input:focus,
.search-select:focus {
    outline: none;
    border-color: #010037;
}

/* Style spécifique pour les selects */
.search-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23173d42' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px;
}

/* Groupe d'input avec suffixe */
.search-input-group {
    position: relative;
    width: 100%;
}

.search-input-group .search-input {
    padding-right: 30px;
}

.search-input-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #4E4E4E;
    pointer-events: none;
    font-family: "Gotham Medium", sans-serif;
}

/* Bouton de recherche */
.search-button {
    height: 42px;
    padding: 0 20px;
    background-color: #010037;
    color: #f9f4ed;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-family: "Gotham Medium", sans-serif;
    justify-content: center;
    width: auto;
    min-width: 150px;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #f9f4ed;
    color: #010037;
    opacity: 1;
}

/* Fix pour les inputs numériques */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Placeholders */
::placeholder {
    color: #4E4E4E;
    font-family: "Gotham Medium", sans-serif;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .search-form-grid,
    .search-field-top,
    .search-field-bottom {
        grid-template-columns: 1fr;
    }
    
    /* Nouvelle mise en page pour mobile */
    .search-field-top {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Localisation et type de bien en pleine largeur */
    .search-field-top .search-field:nth-child(1),
    .search-field-top .search-field:nth-child(2) {
        width: 100%;
        flex: 0 0 100%;
    }

    /* Pièces et chambres sur la même ligne */
    .search-field-top .search-field:nth-child(3),
    .search-field-top .search-field:nth-child(4) {
        width: calc(50% - 5px);
        flex: 0 0 calc(50% - 5px);
    }

    /* Surface min/max sur la même ligne */
    .search-input-group:nth-child(1),
    .search-input-group:nth-child(2) {
        width: calc(50% - 5px);
        flex: 0 0 calc(50% - 5px);
    }

    /* Prix min/max sur la même ligne */
    .search-input-group:nth-child(3),
    .search-input-group:nth-child(4) {
        width: calc(50% - 5px);
        flex: 0 0 calc(50% - 5px);
    }

    .search-field-bottom {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .search-field-button {
        justify-content: center;
        width: 100%;
    }
    
    .search-button {
        width: 100%;
        max-width: none;
    }
}