/**
 * Property Search Widget Styles
 *
 * Custom design for Max Invest
 * Clean, modern, responsive design
 *
 * @package    MaxInvest_Omnicasa
 * @since      1.0.0
 */

/* ===========================
   Container & Form Layout
   =========================== */

.maxinvest-property-search {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    background: transparent;
}

.property-search-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* ===========================
   Form Row & Fields
   =========================== */

.search-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-width: 0;
}

/* ===========================
   Input & Select Styles
   =========================== */

.search-field input[type="text"],
.search-field select {
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    color: #2A2A2A;
    background-color: #FFF;
    font-family: 'Fira Sans', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-field input[type="text"]:focus,
.search-field select:focus {
    box-shadow: 0 4px 12px rgba(121, 186, 76, 0.2);
}

.search-field input[type="text"]::placeholder {
    color: #999999;
}

/* Datalist indicator for city field */
.search-field-city input[type="text"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M4 0l4 4-4 4V6H0V2h4V0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.search-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%232A2A2A' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

/* ===========================
   Price Slider
   =========================== */

.search-field-price {
    flex: 1;
}

.price-slider-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-slider-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: #FFF;
    font-family: 'Fira Sans', sans-serif;
}

/* Couleur des prix pour le widget de filtrage */
.maxinvest-property-filter .price-slider-values {
    color: #2A2A2A;
}

.price-separator {
    color: #cccccc;
    font-weight: 400;
}

.price-slider-wrapper {
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
}

/* Slider Track */
.slider-track {
    position: absolute;
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

/* Active Range */
.slider-range {
    position: absolute;
    height: 6px;
    background: #79BA4C;
    border-radius: 3px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

/* Range Input Sliders */
.price-slider {
    position: absolute;
    width: 100%;
    height: 6px;
    background: transparent;
    pointer-events: none;
    appearance: none;
    z-index: 3;
    top: 50%;
    transform: translateY(-50%);
}

.price-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #79BA4C;
    border: 3px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.price-slider::-webkit-slider-thumb:hover {
    background: #6DAC42;
    transform: scale(1.1);
}

.price-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #79BA4C;
    border: 3px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.price-slider::-moz-range-thumb:hover {
    background: #6DAC42;
    transform: scale(1.1);
}

/* ===========================
   Submit Button
   =========================== */

.search-field-submit {
    display: flex;
    align-items: flex-end;
}

.search-submit-btn {
    width: 100% !important;
    padding: 15px 30px !important;
    background: #79BA4C !important;
    background-color: #79BA4C !important;
    color: #FFF !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    line-height: 1em !important;
    letter-spacing: 0px !important;
    box-shadow: 0 2px 8px rgba(121, 186, 76, 0.2) !important;
}

.search-submit-btn:hover {
    background: #6DAC42 !important;
    background-color: #6DAC42 !important;
    box-shadow: 0 2px 8px rgba(121, 186, 76, 0.2) !important;
    transform: none !important;
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 767px) {
    .property-search-form {
        grid-template-columns: 1fr;
    }

    .price-slider-values {
        font-size: 0.8rem;
    }

    .search-submit-btn {
        padding: 14px 24px;
        font-size: 0.85rem;
    }
}

/* ===========================
   Property Filter Widget (Listing Pages)
   =========================== */

@media (min-width: 768px) {
    /* Widget de filtrage : tout sur une seule ligne */
    .maxinvest-property-filter .property-search-form {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ===========================
   Elementor Editor Preview
   =========================== */

.elementor-editor-active .maxinvest-property-search {
    pointer-events: none;
    opacity: 0.7;
}

.elementor-panel-alert {
    padding: 15px;
    background: #e8f4fd;
    border-left: 4px solid #79BA4C;
    color: #2A2A2A;
    font-size: 14px;
    line-height: 1.6;
    font-family: 'Fira Sans', sans-serif;
}
