/**
 * Styles pour le widget recherche de logements (hero / page d'accueil)
 * Reprend le design system du widget logement-filters.
 */

.logement-search-container {
    width: 100%;
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logement-search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0px, 1fr));
    gap: 20px;
    padding: 14px 0;
}

.search-field {
    display: flex;
    flex-direction: column;
    position: relative;
    justify-content: center;
    margin-top: auto;
    margin-bottom: auto;
    padding-right: 20px;
    height: 100%;
}

.search-field::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    border-right: 1px dashed #04060833;
}

.search-field:nth-last-child(-n+2)::after {
    display: none;
}

.search-field:last-child {
    padding-right: 0;
}

/* Dropdown Toggle Button */
.logement-search-container .filter-dropdown-toggle {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    gap: 8px;
}

.logement-search-container .filter-dropdown-toggle .filter-label-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logement-search-container .filter-label {
    font-weight: 500;
    margin-top: auto;
    margin-bottom: auto;
}

.logement-search-container .filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background-color: #603C21;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 10px;
    line-height: 1;
}

.logement-search-container .filter-arrow {
    transition: transform 0.3s ease;
    color: #666;
}

.logement-search-container .filter-dropdown.active .filter-arrow {
    transform: rotate(180deg);
}

/* Input Number Field */
.logement-search-container .filter-input-label {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-top: auto;
    margin-bottom: auto;
}

.logement-search-container .filter-input-number {
    width: 30px;
    height: 40px;
    text-align: center;
    font-size: 14px;
    color: #603C21;
    background-color: #fff;
    border: 2px solid #D9E2E3;
    border-radius: 4px;
    transition: all 0.3s ease;
    outline: none;
    font-family: "Gabarito", sans-serif;
    font-weight: 800;
    line-height: normal;
    letter-spacing: 0.42px;
    text-transform: uppercase;
    margin-top: auto;
    margin-bottom: auto;
    -moz-appearance: textfield;
    appearance: textfield;
}

.logement-search-container .filter-input-number::placeholder {
    color: #603C21;
    font-family: "Gabarito", sans-serif;
    font-weight: 800;
    letter-spacing: 0.42px;
    text-transform: uppercase;
}

.logement-search-container .filter-input-number::-webkit-outer-spin-button,
.logement-search-container .filter-input-number::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.logement-search-container .filter-input-number:hover {
    border-color: #603C21;
}

.logement-search-container .filter-input-number:focus {
    border-color: #603C21;
    box-shadow: 0 0 0 3px rgba(1, 60, 68, 0.1);
}

/* Dropdown Content — caché par défaut, affiché via .active */
.logement-search-container .filter-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.logement-search-container .filter-dropdown.active .filter-dropdown-content {
    display: block;
}

/* Checkbox Labels */
.logement-search-container .filter-checkbox-label {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin: 0;
    font-weight: normal;
}

.logement-search-container .filter-checkbox-label:hover {
    background-color: #f8f9fa;
}

.logement-search-container .filter-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.logement-search-container .checkbox-custom {
    position: relative;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 3px;
    margin-right: 10px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.logement-search-container .filter-checkbox-label:hover .checkbox-custom {
    border-color: #603C21;
}

.logement-search-container .filter-checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom {
    background-color: #603C21;
    border-color: #603C21;
}

.logement-search-container .filter-checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.logement-search-container .checkbox-text {
    font-size: 14px;
    color: #333;
}

/* Date range input (invisible, trigger uniquement) */
.logement-search-container .filter-date-range {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.logement-search-container .filter-date-badge {
    display: inline-block;
    padding: 2px 8px;
    background-color: #603C21;
    color: white;
    font-size: 11px;
    font-weight: 500;
    border-radius: 12px;
    white-space: nowrap;
}

.search-submit-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: calc(100% + 28px);
    margin-top: -14px;
}

.search-submit-wrapper .search-submit {
    margin-top: auto;
}

.search-submit {
    height: 100%;
    font-size: 14px;
    font-weight: 600;
    border: none;
    outline: none;
    color: #fff;
    white-space: nowrap;
    cursor: pointer;
}

.search-submit:hover {
    background-color: #025561;
}

.search-nombre-personnes {
    flex-direction: row;
    gap: 20px;
}

.search-quand .filter-input-label {
    cursor: pointer;
}

.search-quand .filter-label-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-quand.has-dates .filter-input-label svg circle:first-child {
    fill: #603C21;
}

.search-quand.has-dates .filter-input-label svg path {
    stroke: white;
}

/* Responsive */
@media (max-width: 768px) {
    .logement-search-container {
        padding: 20px;
    }

    .search-grid {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .search-submit {
        width: 100%;
        justify-content: center;
    }

    .search-nombre-personnes {
        justify-content: left;
        padding: 12px 16px;
    }

    .search-quand {
        padding: 12px 16px;
    }

    .search-submit-wrapper {
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .logement-search-container {
        padding: 16px;
    }

    .search-submit {
        padding: 10px 24px;
        font-size: 13px;
    }
}
