/* =========================================================================
   Terrains Treesition — Carte front + modale
   Couleurs du site : navy #1d2a3f, orange #f48038
   ========================================================================= */

.tt-map-wrap {
    --ttf-navy:   #1d2a3f;
    --ttf-orange: #f48038;
    --ttf-border: #e3e8ef;
    --ttf-muted:  #6b7688;
    position: relative;
    width: 100%;
    font-family: inherit;
}

.tt-map {
    width: 100%;
    min-height: 320px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(29,42,63,.12);
    background: #dfe6ee;
}
.tt-map-empty {
    display: flex; align-items: center; justify-content: center;
    height: 100%; min-height: 320px;
    color: var(--ttf-muted); font-size: 15px;
}

/* =========================================================================
   Modale (reproduction de la maquette)
   ========================================================================= */
.tt-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    --ttf-navy:   #1d2a3f;
    --ttf-navy2:  #24334c;
    --ttf-orange: #f48038;
    --ttf-border: #e3e8ef;
    --ttf-muted:  #6b7688;
}
.tt-modal.is-open { display: flex; }

.tt-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(15,23,36,.62);
    backdrop-filter: blur(2px);
}

.tt-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1402px;   /* container : 501 (bloc 1) + 175 (espace) + 710 (bloc 2) + marges */
    max-height: 92vh;
    overflow: auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(15,23,36,.45);
    animation: tt-modal-in .22s ease;
    padding-bottom: 8px;
}
@keyframes tt-modal-in {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

.tt-modal-close {
    position: absolute;
    top: 16px; right: 18px;
    z-index: 3;
    width: 34px; height: 34px;
    border: none; border-radius: 50%;
    background: var(--ttf-orange);
    color: #fff; font-size: 22px; line-height: 1;
    cursor: pointer; transition: transform .15s ease, background .15s ease;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(244,128,56,.5);
}
.tt-modal-close:hover { background: #d9700f; transform: scale(1.06); }

/* --- Médias : image principale + galerie 2×3 --- */
.tt-modal-media {
    display: flex;
    gap: 10px;
    padding: 24px 16px 0;
}
/* L'image principale s'élargit jusqu'à la galerie (petit écart, comme la maquette). */
.tt-modal-cover-wrap { flex: 1 1 auto; min-width: 0; }
.tt-modal-cover {
    width: 100% !important;
    height: 300px;
    object-fit: cover;
    display: block;
    background: #dfe6ee;
    border-radius: 14px !important;
    max-width: 100% !important;
}
.tt-modal-gallery {
    flex: 0 1 710px;
    max-width: 710px;
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* ajusté en JS selon le nombre d'images */
    grid-auto-rows: 1fr;                    /* lignes égales pour remplir la hauteur */
    gap: 10px;
    min-width: 0;
    height: 300px;                          /* = hauteur de l'image principale */
}
.tt-modal-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 10px !important;
    max-width: 100% !important;
    display: block;
    min-height: 0;
}

/* --- Corps : 2 colonnes --- */
.tt-modal-body {
    display: flex;
    gap: 175px;
    padding: 24px 16px 34px;
}
.tt-modal-main  { flex: 0 1 501px; max-width: 501px; min-width: 0; }
.tt-modal-aside { flex: 0 1 710px; max-width: 710px; min-width: 0; }

.tt-modal-title {
    margin: 0 0 4px;
    font-size: 48px; line-height: 1.05;
    font-weight: 600; color: var(--ttf-navy);
}
.tt-modal-subtitle {
    font-size: 22px; color: var(--ttf-navy); font-style: italic; font-weight: 400;
    margin-bottom: 18px;
}

/* Ligne de méta : localisation · taille · type d'arbre */
.tt-modal-meta {
    display: flex; flex-wrap: wrap; gap: 18px;
    margin-bottom: 18px;
}
.tt-meta {
    display: none;
    align-items: center; gap: 7px;
    font-size: 16px; font-weight: 500; color: var(--ttf-navy);
}
.tt-meta.is-shown { display: inline-flex; }
.tt-meta::before {
    content: "";
    width: 18px; height: 18px; flex: 0 0 18px;
    background: no-repeat center / contain;
}
.tt-meta-loc::before  { background-image: url("../img/localisation.png"); }
.tt-meta-size::before { background-image: url("../img/superficie.png"); }
.tt-meta-tree::before { background-image: url("../img/arbre.png"); }

/* Pastille statut + bouton Investir (empilés comme la maquette) */
.tt-modal-cta {
    display: flex; flex-direction: column; gap: 12px;
    max-width: 499px;
    margin-bottom: 24px;
}
.tt-modal-status {
    display: none;
    align-items: center; justify-content: center;
    font-size: 20px; font-weight: 400; font-style: italic; color: var(--ttf-navy);
    background: #fff; border: 1px solid var(--ttf-border);
    padding: 12px 22px; border-radius: 8px;
    text-align: center;
}
.tt-modal-status.is-shown { display: flex; }
.tt-modal-invest {
    display: none;
    align-items: center; justify-content: center;
    background: var(--ttf-orange); color: #fff !important;
    font-size: 20px; font-weight: 400; text-decoration: none;
    height: 56px; padding: 0 22px; border-radius: 24px;
    box-shadow: 0 3px 10px rgba(244,128,56,.4);
    transition: background .15s ease, transform .15s ease;
}
.tt-modal-invest.is-shown { display: flex; }
.tt-modal-invest:hover { background: #d9700f; transform: translateY(-1px); color: #fff !important; }
/* CTA de la popup en chargement : spinner blanc, clic neutralisé */
.tt-modal-invest.is-loading { pointer-events: none; }
.tt-modal-invest.is-loading .tt-tc-spinner { border-color: rgba(255,255,255,.45); border-top-color: #fff; }

.tt-modal-desc {
    font-size: 20px; font-weight: 400; line-height: 1.6; color: #3a4658;
}
.tt-modal-desc p { margin: 0 0 16px; }

/* --- Colonne droite : chiffres, témoignage, newsletter --- */
.tt-modal-stats {
    display: none;
    justify-content: flex-end; gap: 6px;
    font-size: 18px; font-weight: 400; color: var(--ttf-navy);
    text-align: right; margin-bottom: 16px;
}
.tt-modal-stats.is-shown { display: block; }

.tt-modal-temoignage {
    background: linear-gradient(160deg, var(--ttf-navy) 0%, var(--ttf-navy2) 100%);
    color: #eaf0f8;
    border-radius: 14px;
    padding: 22px;
}
.tt-temoignage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tt-temoignage-photo {
    width: 46px; height: 46px; flex: 0 0 46px;
    border-radius: 50% !important; object-fit: cover;
    max-width: 100% !important;
    background: rgba(255,255,255,.1);
}
.tt-temoignage-photo[src=""] { display: none; }
.tt-temoignage-badge {
    font-size: 26px; font-style: italic; font-weight: 400; color: #fff;
    display: inline-flex; align-items: center;
}
.tt-temoignage-text {
    font-size: 20px; font-weight: 400; line-height: 1.55; margin: 0 0 16px; color: #fff;
}
.tt-temoignage-author {
    font-size: 16px; font-weight: 400; color: #fff;
}

.tt-modal-newsletter {
    background: #fff;
    border: 1px solid var(--ttf-border);
    border-radius: 14px;
    padding: 20px 22px;
    margin-top: 16px;
}
.tt-modal-newsletter h4 {
    margin: 0 0 10px; font-size: 26px; font-style: italic; font-weight: 400; color: var(--ttf-navy);
}
.tt-modal-newsletter p { margin: 0 0 16px; font-size: 16px; font-weight: 400; color: var(--ttf-muted); line-height: 1.2; }
/* Formulaire newsletter = Contact Form 7 (id fedb3ad), stylé façon pilule maison */
.tt-modal-newsletter .wpcf7 { margin: 0; }
.tt-modal-newsletter .wpcf7-form {
    display: flex; flex-wrap: wrap; align-items: stretch;
    border: 1px solid var(--ttf-border); border-radius: 10px; overflow: hidden;
}
.tt-modal-newsletter .hidden-fields-container { display: none; }
.tt-modal-newsletter .wpcf7-form > p { margin: 0; display: flex; align-items: stretch; }
.tt-modal-newsletter .wpcf7-form > p:nth-of-type(1) { flex: 1 1 0; min-width: 0; }     /* email (base 0 → bouton jamais renvoyé à la ligne) */
.tt-modal-newsletter .wpcf7-form > p:nth-of-type(2) { flex: 0 0 auto; }                /* bouton */
.tt-modal-newsletter .wpcf7-form-control-wrap { flex: 1; display: block; min-width: 0; }
.tt-modal-newsletter input.wpcf7-email {
    width: 100%; min-width: 0; box-sizing: border-box; border: none; outline: none;
    padding: 12px 14px; font-size: 14px; color: var(--ttf-navy); background: transparent;
}
.tt-modal-newsletter input.wpcf7-submit {
    border: none; cursor: pointer;
    background: var(--ttf-orange); color: #fff;
    padding: 0 20px; font-size: 14px; font-weight: 600;
    transition: background .15s ease;
}
.tt-modal-newsletter input.wpcf7-submit:hover { background: #d9700f; }
.tt-modal-newsletter .wpcf7-spinner { display: none; margin: 0 10px; align-self: center; }
.tt-modal-newsletter .wpcf7-form.submitting .wpcf7-spinner { display: block; }
.tt-modal-newsletter .wpcf7-response-output {
    flex-basis: 100%; width: 100%;
    margin: 8px 2px 0; padding: 0; border: none;
    font-size: 12.5px; line-height: 1.3;
}
/* Le thème force color:#fff (blanc sur blanc) — on rétablit une couleur lisible */
.tt-modal-newsletter .wpcf7 form .wpcf7-response-output { color: var(--ttf-navy); }
.tt-modal-newsletter .wpcf7 form.sent .wpcf7-response-output { color: var(--ttf-navy); }
.tt-modal-newsletter .wpcf7 form.invalid .wpcf7-response-output,
.tt-modal-newsletter .wpcf7 form.unaccepted .wpcf7-response-output,
.tt-modal-newsletter .wpcf7 form.payment-required .wpcf7-response-output { color: #d63638; }

/* --- Autres terrains (slider, 3 max par vue) --- */
.tt-modal-others { padding: 6px 16px 34px; }
.tt-modal-others-title {
    font-size: 24px; font-weight: 600; color: var(--ttf-navy);
    margin: 0 0 40px !important;   /* !important : bat les styles h3 du thème */
}

/* Carousel home */
.tt-carousel { margin-top: 50px; }
/* Carousel home (fond sombre) : titre centré, majuscules, BLANC */
.tt-carousel-title {
    text-align: center; text-transform: uppercase;
    font-size: 40px; font-weight: 700; color: #fff;
    margin: 0 0 34px !important;
}
/* CTA bas de carousel : pilule outillée BLANCHE transparente, aligné à gauche (maquette) */
.tt-carousel-foot { margin-top: 24px; display: flex; justify-content: flex-start; }
.tt-carousel-link {
    display: inline-flex; align-items: center;
    text-decoration: none; white-space: nowrap;
    font-size: 14px; font-weight: 500; color: #fff !important;
    background: transparent; border: 1px solid #fff; border-radius: 24px;
    padding: 9px 22px; transition: background .15s ease, color .15s ease;
}
.tt-carousel-link:hover { background: #fff; color: var(--ttf-navy) !important; }

/* Slider : flèches sur les côtés (blanche à gauche, orange à droite) */
.tt-others-slider { display: flex; align-items: center; justify-content: center; gap: 18px; }
.tt-others-prev, .tt-others-next {
    flex: 0 0 auto;
    width: 52px; height: 52px; border-radius: 50%;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; line-height: 1; padding: 0;
    box-shadow: 0 4px 14px rgba(29,42,63,.18);
    transition: transform .15s ease, background .15s ease, opacity .15s ease;
}
.tt-others-prev, .tt-others-next { background: #fff; color: var(--ttf-navy); }
.tt-others-prev:hover, .tt-others-next:hover { background: var(--ttf-orange); color: #fff; }
.tt-others-prev:disabled, .tt-others-next:disabled { opacity: .35; cursor: default; transform: none; background: #fff; color: var(--ttf-navy); }

/* Points de pagination */
.tt-others-dots { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 20px; }
.tt-others-dots button {
    width: 9px; height: 9px; padding: 0; border: none; border-radius: 50%;
    background: #d5dbe4; cursor: pointer; transition: all .2s ease;
}
.tt-others-dots button:hover { background: #b9c2ce; }
.tt-others-dots button.is-active { background: var(--ttf-orange); width: 26px; border-radius: 6px; }

.tt-modal-others-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 293px;                       /* taille fixe des cartes (maquette) */
    gap: 22px;
    width: 923px;                                   /* 3×293 + 2×22 = fenêtre de 3 cartes */
    max-width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;                          /* Firefox */
    padding-bottom: 4px;
}
.tt-modal-others-grid::-webkit-scrollbar { display: none; }

.tt-terrain-card {
    position: relative;
    scroll-snap-align: start;
    border: 1px solid var(--ttf-border); border-radius: 14px; overflow: hidden;
    background: #fff; display: flex; flex-direction: column; cursor: pointer;
    transition: box-shadow .15s ease, transform .15s ease;
}
.tt-terrain-card:hover { box-shadow: 0 12px 26px rgba(29,42,63,.14); transform: translateY(-2px); }
.tt-tc-flag {
    position: absolute; top: 14px; right: 14px; z-index: 2;
    background: var(--ttf-orange); color: #fff;
    font-size: 12.5px; font-weight: 500; line-height: 1;
    border-radius: 8px; padding: 7px 14px;
    box-shadow: 0 2px 8px rgba(29,42,63,.18);
}
.tt-tc-flag[hidden] { display: none; }
.tt-tc-img {
    width: 100%; height: 150px; object-fit: cover; display: block;
    border-radius: 0 !important; max-width: 100% !important;
}
.tt-tc-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.tt-tc-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tt-tc-country { font-size: 12.5px; font-weight: 400; color: #fff; background: var(--ttf-navy); border-radius: 8px; padding: 6px 13px; }
.tt-tc-status  { font-size: 12.5px; font-weight: 400; color: var(--ttf-orange); border: 1px solid var(--ttf-orange); border-radius: 8px; padding: 5px 12px; }
.tt-tc-status.tt-tc-loading { display: inline-flex; align-items: center; justify-content: center; min-width: 84px; }
.tt-tc-status.is-soon, .tt-tc-status.is-soldout { color: var(--ttf-muted); border-color: var(--ttf-border); }
.tt-tc-spinner { width: 14px; height: 14px; border: 2px solid rgba(244,128,56,.3); border-top-color: var(--ttf-orange); border-radius: 50%; animation: tt-spin .7s linear infinite; }
@keyframes tt-spin { to { transform: rotate(360deg); } }
.tt-tc-name { font-size: 20px; font-weight: 700; color: var(--ttf-navy); line-height: 1.15; }
.tt-tc-meta { display: flex; flex-direction: column; gap: 11px; }
.tt-tc-metarow { display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 500; color: var(--ttf-navy); }
.tt-tc-metarow::before { content: ""; width: 20px; height: 20px; flex: 0 0 20px; background: no-repeat center / contain; }
.tt-tc-loc::before  { background-image: url("../img/localisation.png"); }
.tt-tc-size::before { background-image: url("../img/superficie.png"); }
.tt-tc-tree::before { background-image: url("../img/arbre.png"); }
.tt-tc-owner::before {
    background: var(--ttf-navy);
    -webkit-mask: no-repeat center / contain; mask: no-repeat center / contain;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
}
.tt-tc-invest {
    margin-top: auto; text-align: center; text-decoration: none;
    background: var(--ttf-orange); color: #fff !important; font-size: 16px; font-weight: 600;
    border-radius: 24px; padding: 12px; transition: background .15s ease;
}
.tt-tc-invest:hover { background: #d9700f; color: #fff !important; }
/* CTA « Découvrir » (carte sans stock) : bouton outillé */
.tt-tc-invest.is-discover { background: #fff; color: var(--ttf-navy) !important; border: 1px solid var(--ttf-navy); }
.tt-tc-invest.is-discover:hover { background: var(--ttf-navy); color: #fff !important; }

/* --- Réinitialise le border-radius global du thème (.container-page img) --- */
.tt-map img,
.tt-map .gm-style img {
    border-radius: 0 !important;
    max-width: none !important;
    box-shadow: none !important;
}

/* --- Responsive --- */
@media (max-width: 820px) {
    .tt-modal { padding: 12px; }
    .tt-modal-close { left: 14px; right: auto; } /* drapeau de marché à droite */
    .tt-modal-media { flex-direction: column; gap: 0; padding: 18px 16px 0; }
    .tt-modal-cover { height: 220px; }
    .tt-modal-gallery { display: none !important; } /* galerie masquée en mobile */
    .tt-modal-body { flex-direction: column; gap: 22px; padding: 20px 16px 20px; }
    .tt-modal-cover-wrap, .tt-modal-main, .tt-modal-aside { flex-basis: auto; max-width: none; }
    .tt-modal-cta { max-width: none; }
    .tt-modal-stats { justify-content: flex-start; text-align: left; }

    /* Typo réduite en mobile */
    .tt-modal-title       { font-size: 30px; }
    .tt-modal-subtitle    { font-size: 18px; }
    .tt-meta              { font-size: 14px; }
    .tt-modal-status      { font-size: 18px; }
    .tt-modal-invest      { font-size: 17px; }
    .tt-modal-desc        { font-size: 16px; }
    .tt-modal-stats       { font-size: 16px; }
    .tt-temoignage-badge  { font-size: 24px; }
    .tt-temoignage-text,
    .tt-temoignage-author { font-size: 16px; }
    .tt-modal-newsletter h4 { font-size: 24px; }
    .tt-modal-newsletter p  { font-size: 16px; }
    .tt-modal-others-title  { font-size: 20px; }
    .tt-carousel-title      { font-size: 26px; margin-bottom: 22px !important; padding: 0 16px; }
    /* Cartes bord à bord en mobile : plus de padding latéral sur la section */
    .tt-modal-others { padding-left: 0; padding-right: 0; }
    .tt-modal .tt-modal-others-title { padding-left: 16px; }  /* le titre garde un retrait (cartes bord à bord) */
    .tt-carousel-foot { padding: 0 16px; justify-content: center; }
    .tt-modal-others-grid { width: 100%; grid-auto-columns: 100%; }  /* 1 carte complète par vue */
    .tt-others-slider { gap: 8px; }
    .tt-others-prev, .tt-others-next { width: 42px; height: 42px; font-size: 22px; }
}
