/* =============================================================
   M2S – Fiche projet (extension)
   Éléments ajoutés à la fiche bien ImmoWP. Le reste du style de la
   fiche est dans Personnaliser > CSS additionnel.
   ============================================================= */

.iwp__property {
    --m2s-red: #c8341a;
    --m2s-red-hover: #a72a15;
    --m2s-slate: #3d5159;
    --m2s-text: #2b2b2b;
    --m2s-muted: #6b6b6b;
    --m2s-line: #e3e3e3;
    --m2s-sand: #f3f1ee;
}

.m2s-icon {
    display: block;
    flex: none;
}

/* ---------- 1. Chiffres clés ---------- */
/* Bandeau vide (aucune donnée chiffrée sur le bien) : masqué. */
.iwp__property .iwp__block-overview:not(:has(.m2s-keyfacts)) {
    display: none !important;
}

.iwp__property .m2s-keyfacts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.iwp__property .m2s-keyfacts__item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    margin: 0 !important;
    padding: 16px 18px !important;
    border-left: 1px solid var(--m2s-line);
    list-style: none !important;
}

.iwp__property .m2s-keyfacts__item:first-child {
    border-left: 0;
}

.iwp__property .m2s-keyfacts__icon {
    display: flex;
    align-items: center;
    height: 28px;
    margin-bottom: 8px;
    color: var(--m2s-red);
}

.iwp__property .m2s-keyfacts__icon .m2s-icon {
    width: 24px;
    height: 24px;
}

.iwp__property .m2s-keyfacts__value {
    color: var(--m2s-text);
    font-family: "Prompt", sans-serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    white-space: nowrap;
}

.iwp__property .m2s-keyfacts__label {
    color: var(--m2s-muted);
    font-size: 14px;
    line-height: 1.3;
}

.iwp__property .m2s-dpe-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

/* ---------- 2. Description : Afficher plus + note ---------- */
.iwp__property .m2s-desc.is-collapsible .m2s-desc__inner {
    position: relative;
    max-height: 290px;
    overflow: hidden;
    transition: max-height .35s ease;
}

.iwp__property .m2s-desc.is-collapsible.has-more:not(.is-open) .m2s-desc__inner::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 90px;
    background: linear-gradient(rgba(255, 255, 255, 0), #fff);
    pointer-events: none;
}

.iwp__property .m2s-desc.is-open .m2s-desc__inner {
    max-height: none;
}

.iwp__property .m2s-desc__toggle {
    display: inline-block;
    margin: 14px 0 0 !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--m2s-text) !important;
    font-size: 13px !important;
    font-weight: 500;
    text-decoration: underline;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
}

.iwp__property .m2s-desc__toggle[hidden] {
    display: none;
}

.iwp__property .m2s-desc__toggle:hover {
    color: var(--m2s-red) !important;
}

.iwp__property .m2s-desc__note,
.iwp__property[data-iwp-view-post] .iwp__block-description .iwp__card-body p.m2s-desc__note {
    margin: 18px 0 0 !important;
    color: var(--m2s-muted) !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
}

/* ---------- 3. Localisation : adresse ---------- */
.iwp__property .m2s-location__address {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px !important;
    padding: 0 !important;
    color: var(--m2s-text);
    font-size: 15px;
    line-height: 1.4;
}

.iwp__property .m2s-location__address .m2s-icon {
    width: 17px;
    height: 17px;
    color: var(--m2s-red);
}

/* ---------- 4. Encadré prix : mention + caractéristiques ---------- */
.iwp__property .m2s-price {
    margin-top: 6px;
}

.iwp__property .m2s-price__mention {
    margin: 0 0 14px !important;
    padding: 0 0 14px !important;
    border-bottom: 1px solid var(--m2s-line);
    color: var(--m2s-muted) !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
}

.iwp__property .m2s-price__specs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    color: var(--m2s-text);
    font-size: 14px;
    line-height: 1.5;
}

/* ---------- 5. Réassurance + téléphone ---------- */
.iwp__property .m2s-contact__reassure {
    margin: 12px 0 14px !important;
    color: var(--m2s-muted) !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    text-align: center;
}

.iwp__property .m2s-contact__phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    margin: 0 0 14px;
    padding: 10px 14px;
    border: 1px solid var(--m2s-slate);
    color: var(--m2s-slate) !important;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none !important;
    transition: background-color .2s ease, color .2s ease;
}

.iwp__property .m2s-contact__phone .m2s-icon {
    width: 17px;
    height: 17px;
}

.iwp__property .m2s-contact__phone:hover,
.iwp__property .m2s-contact__phone:focus-visible {
    background: var(--m2s-slate);
    color: #fff !important;
}

/* ---------- 6. Simulateur ---------- */
.iwp__property .m2s-simu {
    margin: 0 0 40px;
    padding: 28px 30px 24px;
    background: var(--m2s-sand);
}

.iwp__property .m2s-simu .iwp__card-header {
    margin-bottom: 20px !important;
}

.iwp__property .m2s-simu__fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.iwp__property .m2s-simu__field label {
    display: block;
    margin: 0 0 6px;
    color: var(--m2s-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
}

.iwp__property .m2s-simu__field input {
    width: 100% !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    box-sizing: border-box;
    background: #fff !important;
    border: 1px solid #c9c9c9 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--m2s-text) !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
}

.iwp__property .m2s-simu__field input:focus {
    border-color: var(--m2s-red) !important;
    box-shadow: 0 0 0 3px rgba(200, 52, 26, .12) !important;
    outline: none !important;
}

.iwp__property .m2s-simu__field input::placeholder {
    color: #8a8a8a;
    opacity: 1;
}

.iwp__property .m2s-simu__durees {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-bottom: 18px;
    border-bottom: 1px solid #ddd8d1;
}

.iwp__property .m2s-simu__durees-label {
    margin-right: 6px;
    color: var(--m2s-muted);
    font-size: 13px;
}

.iwp__property .m2s-simu__duree {
    min-width: 76px;
    margin: 0 !important;
    padding: 9px 16px !important;
    background: #fff !important;
    border: 1px solid #c9c9c9 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--m2s-text) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.iwp__property .m2s-simu__duree:hover {
    border-color: var(--m2s-slate) !important;
}

.iwp__property .m2s-simu__duree[aria-pressed="true"] {
    background: var(--m2s-slate) !important;
    border-color: var(--m2s-slate) !important;
    color: #fff !important;
}

.iwp__property .m2s-simu__result {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 16px;
}

.iwp__property .m2s-simu__result-label {
    color: var(--m2s-muted);
    font-size: 13px;
}

.iwp__property .m2s-simu__result-value {
    color: var(--m2s-text);
    font-family: "Prompt", sans-serif;
    font-size: 26px;
    font-weight: 400;
    line-height: 1.25;
}

.iwp__property .m2s-simu__note {
    margin: 14px 0 0 !important;
    color: var(--m2s-muted) !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
}

/* ---------- 7. Pourquoi Maisons des 2 Savoie ---------- */
.iwp__property .m2s-why {
    margin: 0 0 40px;
    padding: 34px 32px 32px;
    background: var(--m2s-slate);
    color: #fff;
}

.iwp__property .m2s-why__title {
    margin: 0 0 6px !important;
    padding: 0 !important;
    color: #fff !important;
    font-family: "Prompt", sans-serif !important;
    font-size: 22px !important;
    font-weight: 300 !important;
    line-height: 1.35 !important;
    letter-spacing: .06em !important;
    text-transform: uppercase !important;
}

.iwp__property .m2s-why__sub {
    margin: 0 0 26px !important;
    color: rgba(255, 255, 255, .78) !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

.iwp__property .m2s-why__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.iwp__property .m2s-why__item .m2s-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 14px;
    color: #fff;
}

.iwp__property .m2s-why__item h3 {
    margin: 0 0 10px !important;
    padding: 0 !important;
    color: #fff !important;
    font-family: "Prompt", sans-serif !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.iwp__property .m2s-why__item p {
    margin: 0 !important;
    color: rgba(255, 255, 255, .82) !important;
    font-size: 15px !important;
    line-height: 1.65 !important;
}

.iwp__property .m2s-why__link {
    display: inline-block;
    margin-top: 26px;
    color: #fff !important;
    font-size: 15px;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

.iwp__property .m2s-why__link:hover {
    color: rgba(255, 255, 255, .8) !important;
}

/* ---------- 8. Tablette et mobile ---------- */
@media (max-width: 1024px) and (min-width: 768px) {
    .iwp__property .m2s-keyfacts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .iwp__property .m2s-keyfacts__item:nth-child(3n + 1) {
        border-left: 0;
    }

    .iwp__property .m2s-keyfacts__item:nth-child(n + 4) {
        border-top: 1px solid var(--m2s-line);
    }
}

@media (max-width: 767px) {
    .iwp__property .m2s-keyfacts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .iwp__property .m2s-keyfacts__item:nth-child(odd) {
        border-left: 0;
    }

    .iwp__property .m2s-keyfacts__item:nth-child(n + 3) {
        border-top: 1px solid var(--m2s-line);
    }

    .iwp__property .m2s-simu,
    .iwp__property .m2s-why {
        padding: 24px 20px;
    }

    .iwp__property .m2s-simu__fields,
    .iwp__property .m2s-why__grid {
        grid-template-columns: 1fr;
    }

    .iwp__property .m2s-why__grid {
        gap: 24px;
    }
}

/* ---------- 9. Colonne de droite qui suit le défilement (ordinateur) ---------- */
@media (min-width: 1025px) {
    /* Le thème met overflow:hidden sur body, ce qui bloque position:sticky.
       clip coupe toujours les débordements horizontaux sans créer de zone de défilement. */
    body.single-iwp_gestion_immo {
        overflow: visible !important;
        overflow-x: clip !important;
    }

    .iwp__property[data-iwp-view-post] .iwp__property-container {
        align-items: stretch !important;
    }

    .iwp__property[data-iwp-view-post] .iwp__sidebar-region {
        align-self: stretch !important;
    }

    .iwp__property[data-iwp-view-post] .iwp__property-sidebar {
        position: sticky !important;
        top: var(--m2s-sticky-top, 120px) !important;
        transition: top .15s linear;
    }
}

/* ---------- 10. Bouton de retour en fin de fiche ---------- */
.m2s-back {
    box-sizing: border-box;
    width: 100%;
    max-width: 1296px;
    margin: 0 auto;
    padding: 10px 0 70px;
    text-align: center;
}

.m2s-back .m2s-back__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border: 1px solid #3d5159;
    color: #3d5159 !important;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none !important;
    transition: background-color .2s ease, color .2s ease;
}

.m2s-back .m2s-back__btn:hover,
.m2s-back .m2s-back__btn:focus-visible {
    background: #3d5159;
    color: #fff !important;
}

/* ---------- 11. Icônes des cartes « Autres terrains et maisons » en rouge ---------- */
.iwp__similar-section .iwp__item-overview svg,
.iwp__similar-section .iwp__item-overview svg path {
    fill: #c8341a !important;
    color: #c8341a !important;
}
