/* Container principal centré, pleine largeur écran */
.homepage-property-search-centered {
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin-bottom: 80px;
    background-color: transparent;
}

/* Retirer la limite de largeur du thème pour le design plein écran */
#main-wrap.wrap,
.home #main-wrap.wrap,
.home .wrap {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Titre hero */
.homepage-hero-title {
    text-align: left;
    margin-top: 140px;
    margin-bottom: 40px;
    /* Reduced from 56px to "stick" it more to the search block */
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    box-sizing: border-box;
}

.homepage-hero-title-line1,
.homepage-hero-title-line2 {
    margin: 0;
    padding: 0;
    font-family: 'Jost', sans-serif;
    font-size: 3.2rem;
    line-height: 1.1;
    color: #FFFFFF;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    letter-spacing: -0.03em;
}

.homepage-hero-title-line1 {
    margin-bottom: 4px;
    font-weight: 400;
}

.homepage-hero-title-line2 {
    font-weight: 700;
}

.homepage-search-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Onglets - Fusion avec le bloc blanc */
.homepage-search-tabs-wrapper {
    /* Hérite du padding de .homepage-search-wrapper (20px) */
    display: flex;
    justify-content: flex-start;
    padding: 0 !important;
    margin: 0;
}

.homepage-search-tabs-container {
    background: #cbd5e1;
    /* Even darker gray background (slate-300) */
    /* Gris plus marqué pour un contraste net avec l'onglet actif blanc */
    border: 10px solid rgba(255, 255, 255, 0.4);
    /* Liseré unique pour tout le groupe */
    border-bottom: none;
    background-clip: padding-box;
    backdrop-filter: blur(15px);
    border-radius: 24px 24px 0 0;
    padding: 0;
    display: inline-flex;
    gap: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 11;
    margin-bottom: -10px;
    /* Overlap the shell top border */
}

.homepage-search-tab {
    padding: 12px 32px 22px;
    /* Bottom padding increased to overlap shell */
    background: transparent;
    /* On enlève le blanc individuel */
    border: none;
    /* On enlève le liseré individuel */
    font-family: 'Jost', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    color: #1e293b;
    /* Darker text for inactive tabs (slate-800) */
    border-radius: 14px 14px 0 0;
    /* Un peu moins que 24 pour s'insérer proprement dans le container */
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: -10px;
    /* Overlap the shell border by default */
}

.homepage-search-tab:hover:not(.homepage-search-tab--active) {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #000000;
}

.homepage-search-tab--active {
    background: #ffffff !important;
    color: #111827 !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.02);
    /* Très légère ombre pour le détacher du fond gris */
    position: relative;
    z-index: 12;
    /* On crée un chevauchement pour fusionner l'onglet actif avec le corps */
    padding-bottom: 22px;
}

/* Shell de recherche - Bloc blanc avec style Verre (Fidelity 98:5766) */
.homepage-search-shell {
    background: #FFFFFF;
    border-radius: 0 24px 24px 24px;
    /* Top-left à 0 pour fusionner avec les onglets */
    /* Top-left à 0 pour fusionner avec l'onglet */
    /* Nouveau style Glassmorphism 10px border */
    border: 10px solid rgba(255, 255, 255, 0.4) !important;
    background-clip: padding-box;
    backdrop-filter: blur(15px);

    box-shadow: 0 4px 40px 0 rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 1400px;
    /* Retour à la largeur standard AIVB */
    margin: 0 auto;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
    overflow: hidden;
    /* Pour contenir les effets de bordure */
    opacity: 0;
    transition: opacity 0.4s ease-out;
}

/* Si un autre onglet est actif, on préserve la fusion avec le menu */
.homepage-search-shell[data-active-tab="louer"],
.homepage-search-shell[data-active-tab="estimer"] {
    border-radius: 0 24px 24px 24px;
}

/* --- STRUCTURE RECONSTRUITE (CLEAN SLATE) --- */

.rebuilt-clean-form {
    display: flex !important;
    flex-flow: row nowrap !important;
    gap: 24px !important;
    align-items: flex-end !important;
    /* Base commune pour inputs et bouton */
    width: 100% !important;
    justify-content: space-between !important;
    background: transparent !important;
    padding: 0 !important;
}

.rebuilt-field-block {
    display: flex !important;
    flex-direction: column !important;
    /* Labels au-dessus */
    gap: 6px !important;
    /* FIDELITE 73:2378 */
    position: relative;
    flex: 1 1 0% !important;
    /* Prend toute la place */
    max-width: 350px !important;
    background: transparent !important;
}

.rebuilt-action-block {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: flex-end !important;
}

.rebuilt-submit-block {
    display: flex !important;
    flex-direction: column !important;
    flex: 0 0 176px !important;
    align-items: center !important;
    justify-content: flex-end !important;
}

.rebuilt-action-header {
    height: 24px !important;
    display: flex !important;
    align-items: baseline !important;
    justify-content: flex-start !important;
    width: 100% !important;
    margin: 0 !important;
}

/* Forcer l'affichage des labels injectés et styliser */
/* Labels Fidelity */
.rebuilt-label {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-family: 'Jost', sans-serif !important;
    font-size: 16px !important;
    /* FIDELITE 73:25260 */
    font-weight: 400 !important;
    line-height: 24px !important;
    color: #080d16 !important;
    margin: 0 !important;
    text-transform: none !important;
    white-space: nowrap;
}

.required-star {
    color: #F87518;
    margin-left: 2px;
}

/* Masquer les labels natifs WP qui pourraient subsister */
.homepage-property-search-centered .property-search label:not(.search-field-label),
.property-search-price-max label:not(.search-field-label) {
    display: none !important;
}

.required-star {
    color: #F87518;
    margin-left: 2px;
}

/* Inputs et Selects Premium - HARMONIE MCP 40px - SYNCHRO V5 */
.rebuilt-clean-form select,
.rebuilt-clean-form input,
.rebuilt-clean-form .text {
    height: 40px !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 6px !important;
    padding: 0 40px 0 44px !important;
    font-family: 'Jost', sans-serif !important;
    font-size: 16px !important;
    color: #111827 !important;
    background-color: #FFFFFF !important;
    background-repeat: no-repeat !important;
    /* Empiète sur la répétition */
    background-position: 14px center !important;
    background-size: 20px 20px !important;
    appearance: none !important;
    width: 100% !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
}

/* Specific for select with dual icons */
.field-building select,
.field-pin select,
.field-sofa select {
    background-position: 14px center, right 14px center !important;
    background-size: 20px 20px, 12px 12px !important;
    background-repeat: no-repeat, no-repeat !important;
}

/* Placeholder styling */
.rebuilt-clean-form input::placeholder {
    color: #9CA3AF !important;
    opacity: 1 !important;
}

.rebuilt-clean-form select:focus,
.rebuilt-clean-form input:focus {
    border-color: #F87518 !important;
    box-shadow: 0 0 0 4px rgba(248, 117, 24, 0.08) !important;
    outline: none !important;
}

/* Suffixes (PIÈCES, €) - Alignement Figma */
.field-suffix {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    height: auto;
    display: flex;
    align-items: center;
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    pointer-events: none;
    z-index: 5;
}

/* Flèche Select Custom - ICONES MCP (Fidélité Totale) */
.field-building select {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 21H21M5 21V5C5 4.46957 5.21071 3.96086 5.58579 3.58579C5.96086 3.21071 6.46957 3 7 3H17C17.5304 3 18.0391 3.21071 18.4142 3.58579C18.7893 3.96086 19 4.46957 19 5V21M9 21V17H15V21M8 7H8.01M16 7H16.01M8 11H8.01M16 11H16.01' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-position: 14px center, right 14px center !important;
    background-size: 20px 20px, 12px 12px !important;
}

.field-pin select {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21 10C21 17 12 23 12 23C12 23 3 17 3 10C3 7.61305 3.94821 5.32387 5.63604 3.63604C7.32387 1.94821 9.61305 1 12 1C14.3869 1 16.6761 1.94821 18.364 3.63604C20.0518 5.32387 21 7.61305 21 10Z' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12 13C13.6569 13 15 11.6569 15 10C15 8.34315 13.6569 7 12 7C10.3431 7 9 8.34315 9 10C9 11.6569 10.3431 13 12 13Z' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-position: 14px center, right 14px center !important;
    background-size: 20px 20px, 12px 12px !important;
}

.field-sofa select {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 9V7C20 6.46957 19.7893 5.96086 19.4142 5.58579C19.0391 5.21071 18.5304 5 18 5H6C5.46957 5 4.96086 5.21071 4.58579 5.58579C4.21071 5.96086 4 6.46957 4 7V9' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M2 9V20C2 20.5304 2.21071 21.0391 2.58579 21.4142C2.96086 21.7893 3.46957 22 4 22H20C20.5304 22 21.0391 21.7893 21.4142 21.4142C21.7893 21.0391 22 20.5304 22 20V9H2Z' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M2 9H22' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M7 12V17' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M17 12V17' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9L12 15L18 9' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-position: 14px center, right 14px center !important;
    background-size: 20px 20px, 12px 12px !important;
}

.field-wallet .text {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 5H5C3.89543 5 3 5.89543 3 7V17C3 18.1046 3.89543 19 5 19H19C20.1046 19 21 18.1046 21 17V7C21 5.89543 20.1046 5 19 5Z' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M3 10H21' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12 14H18' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-position: 14px center !important;
}

/* --- BOUTON RECHERCHER --- */

.search-create-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    /* Plus grisé comme Figma */
    text-decoration: none;
    transition: color 0.15s;
}

.search-create-alert:hover {
    color: #F87518;
}

.search-create-alert svg {
    color: #6B7280;
}

/* SEARCH BUTTON - Updated to match .header-contact-btn */
/* FIDELITY: Color/Primary/Higher => Now using Anthracite #343A40 */
.homepage-property-search-centered .rebuilt-clean-form .property-search-submit,
.homepage-property-search-centered .property-search .property-search-submit.btn,
.homepage-property-search-centered .property-search .property-search-submit.btn-primary {
    background-color: #222222 !important;
    background-image: none !important;
    /* Prevent gradient or image from btn-primary */
    color: #ffffff !important;
    height: 40px !important;
    /* FIDELITE 73:2377 */
    width: 176px !important;
    padding: 0 20px !important;
    border-radius: 6px !important;
    font-family: 'Jost', sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    justify-content: center !important;
}

.homepage-property-search-centered .property-search .property-search-submit.btn:hover {
    background-color: #000000 !important;
    /* Hover matching "Contactez-nous" button */
}

.homepage-property-search-centered .property-search-submit.btn svg {
    stroke-width: 2.5px;
    width: 18px;
    height: 18px;
}

/* --- WP ELEMENT HIDING --- */
.property-search-status,
.property-search-price label,
.property-search-advanced-button,
.property-search-buttons,
.property-search-advanced {
    display: none !important;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.homepage-search-wrapper {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}


/* Responsive Rebuilt */
@media (max-width: 1400px) {
    .search-rebuilt-container {
        gap: 16px !important;
    }
}

@media (max-width: 1023px) {
    .search-rebuilt-container {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .rebuilt-field-block {
        flex: 1 1 calc(50% - 20px) !important;
        max-width: none !important;
    }
}

@media (max-width: 640px) {
    .rebuilt-field-block {
        flex: 1 1 100% !important;
    }

    .homepage-property-search-centered .property-search .property-search-submit.btn {
        width: 100% !important;
    }
}



/* Responsive adjustments for search title and shell */
@media (max-width: 1023px) {

    /* Force vertical stack for search fields */
    /* Force vertical stack and center all elements */
    .rebuilt-clean-form {
        flex-direction: column !important;
        align-items: stretch !important;
        /* Force all children to take full available width */
        gap: 20px !important;
        width: 100% !important;
    }

    .rebuilt-field-block {
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: none !important;
        align-self: stretch !important;
    }

    .rebuilt-action-block {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        max-width: none !important;
        flex: 1 1 auto !important;
        align-self: stretch !important;
        margin-bottom: 20px !important;
        /* Reduced as requested */
    }

    .rebuilt-submit-block {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        max-width: none !important;
        flex: 1 1 auto !important;
        align-self: stretch !important;
    }

    .rebuilt-action-header {
        display: flex !important;
        justify-content: center !important;
        margin: 0 !important;
        height: auto !important;
        width: 100% !important;
        text-align: center !important;
    }

    /* Force button to perfectly match input width */
    .homepage-property-search-centered .rebuilt-clean-form .property-search-submit,
    .homepage-property-search-centered .property-search .property-search-submit.btn {
        width: 100% !important;
        max-width: none !important;
        align-self: stretch !important;
        margin: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        border-radius: 6px !important;
        height: 52px !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        gap: 12px !important;
    }

    .homepage-hero-title-line1,
    .homepage-hero-title-line2 {
        font-size: 2.2rem !important;
        text-align: center;
        padding: 0 16px;
    }

    /* Override global boxed margin but keep visual side padding */
    .boxed {
        margin: 0 !important;
    }

    .homepage-hero-title {
        margin-top: 100px;
        margin-bottom: 24px;
        padding: 0;
    }

    /* Restore Card Style: Add margin/padding wrapper */
    .homepage-search-wrapper {
        padding: 0 16px !important;
        /* Standard mobile gutter */
    }

    .homepage-search-shell {
        padding: 24px 20px !important;
        /* Comfortable internal padding */
        border: 10px solid rgba(255, 255, 255, 0.4) !important;
        /* Restore Glass Border */
        border-radius: 0 24px 24px 24px !important;
        /* Restore Corners */
        background: #FFFFFF !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        overflow: visible !important;
        /* Ensure content isn't clipped */
    }

    .homepage-search-tabs-container {
        width: 100%;
        overflow: visible;
        border: 10px solid rgba(255, 255, 255, 0.4) !important;
        border-bottom: none !important;
        background: #cbd5e1 !important;
        border-radius: 24px 24px 0 0 !important;
        margin-left: 0;
        padding: 0;
        display: block;
        /* Wrapper is block */
    }

    .homepage-search-tabs {
        display: flex;
        /* Inner is flex */
        width: 100%;
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    .homepage-search-tab {
        flex: 1;
        text-align: center;
        padding: 12px 4px 22px;
        font-size: 15px;
        border-right: none !important;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }
}