/* ============================================================
   public/assets/css/cta-carte.css
   Bandeau flottant « Carte interactive Endemika ».
   Chargé par App/Views/partials/ctaCarte.php, sur les pages du gabarit
   comme sur les pages statiques.
   ============================================================ */

/* Bandeau marine : une portion de la carte de Madagascar sert de décor, le circuit Baobabs et Tsingy en sable */
#ekCtaCarte.ekcta {
    --ekcta-ease: cubic-bezier(.22, .7, .2, 1);
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 900000;
    display: block;
    width: min(1140px, calc(100% - 32px));
    margin: 0;
    padding: 0;
    transform: translate(-50%, calc(100% + 40px));
    opacity: 0;
    pointer-events: none;
    transition: transform .45s var(--ekcta-ease), opacity .3s ease;
    font-family: "Poppins", system-ui, -apple-system, sans-serif;
}
#ekCtaCarte.ekcta[hidden] { display: block; visibility: hidden; }
#ekCtaCarte.ekcta.is-on {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
#ekCtaCarte.ekcta *,
#ekCtaCarte.ekcta *::before,
#ekCtaCarte.ekcta *::after { box-sizing: border-box; }

#ekCtaCarte .ekcta__lien {
    position: relative;
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 118px;
    margin: 0;
    padding: 18px 22px 18px 28px;
    background-color: #073b4c;
    border-radius: 16px;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    /* Liseré clair + ombre : le bandeau se détache même posé sur une section marine */
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow: 0 0 0 1px rgba(7, 59, 76, .08), 0 16px 36px -12px rgba(5, 25, 33, .55);
    transition: transform .2s var(--ekcta-ease), box-shadow .2s ease;
}
#ekCtaCarte .ekcta__lien:hover {
    color: #fff;
    transform: translateY(-2px);
    border-color: rgba(227, 185, 143, .45);
    box-shadow: 0 0 0 1px rgba(7, 59, 76, .08), 0 22px 44px -14px rgba(5, 25, 33, .6);
}
#ekCtaCarte .ekcta__lien:focus-visible { outline: 2px solid #e3b98f; outline-offset: 4px; }

/* La carte : grande, recadrée sur le centre-ouest de l'île, derrière le texte.
   Image (île + circuits) et SVG (itinéraire) partagent le même cadre : ils restent alignés. */
#ekCtaCarte .ekcta__carte {
    position: absolute;
    right: 190px;
    top: -175px;
    height: 360px;
    aspect-ratio: 56 / 106;
    margin: 0;
    pointer-events: none;
    transition: transform .6s var(--ekcta-ease);
}
#ekCtaCarte .ekcta__carte img,
#ekCtaCarte .ekcta__carte svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    display: block;
}
#ekCtaCarte .ekcta__trace {
    fill: none;
    stroke: #e3b98f;
    stroke-width: 2.2;
    stroke-linejoin: round;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}
#ekCtaCarte .ekcta__pt { fill: #fff; stroke: #e3b98f; stroke-width: 1.1; }
#ekCtaCarte .ekcta__lien:hover .ekcta__carte { transform: translateY(-8px); }
/* Survol : l'itinéraire se redessine, le point d'arrivée apparaît à la fin */
#ekCtaCarte .ekcta__lien:hover .ekcta__trace { animation: ekctaTrace 1.3s cubic-bezier(.45, .05, .25, 1) both; }
#ekCtaCarte .ekcta__lien:hover .ekcta__pt--fin { animation: ekctaPoint 1.3s ease both; }
@keyframes ekctaTrace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ekctaPoint { 0%, 85% { opacity: 0; } 100% { opacity: 1; } }

#ekCtaCarte .ekcta__texte {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 540px;
    display: block;
}
#ekCtaCarte .ekcta__k {
    display: block;
    margin: 0 0 3px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1.3;
    color: #e3b98f;
}
/* Deux textes : seul celui tiré au hasard s'affiche ; titre court sur mobile */
#ekCtaCarte [data-variante][hidden] { display: none !important; }
#ekCtaCarte .ekcta__v { display: block; }
#ekCtaCarte .ekcta__t.ekcta__t--m { display: none; }
#ekCtaCarte .ekcta__t {
    display: block;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.25;
    color: #fff;
}
#ekCtaCarte .ekcta__s {
    display: block;
    margin: 5px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: #b9cdd3;
}

#ekCtaCarte .ekcta__bouton {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    background-color: #f5f0ea;
    color: #073b4c;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .18s ease;
}
#ekCtaCarte .ekcta__lien:hover .ekcta__bouton { background-color: #fff; }
#ekCtaCarte .ekcta__bouton-ico { flex: 0 0 auto; transition: transform .2s var(--ekcta-ease); }
#ekCtaCarte .ekcta__lien:hover .ekcta__bouton-ico { transform: translateX(3px); }

#ekCtaCarte .ekcta__x {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background-color: #0e4d61;
    border: 1px solid #2b6a7c;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background-color .15s ease;
}
#ekCtaCarte .ekcta__x:hover { background-color: #145d74; }
#ekCtaCarte .ekcta__x:focus-visible { outline: 2px solid #e3b98f; outline-offset: 2px; }

/* Ordinateur : le bouton WhatsApp remonte au-dessus du bandeau tant qu'il est affiché */
html.ekcta-on .ws-trigger-container {
    transform: translateY(calc(-1 * var(--ekcta-h, 0px)));
    transition: transform .45s cubic-bezier(.22, .7, .2, 1);
}

/* Mobile : bandeau et bouton WhatsApp s'affichent à tour de rôle.
   Pendant que le bandeau est visible, WhatsApp s'efface ; il revient dès que le bandeau disparaît. */
@media (max-width: 767px) {
    #ekCtaCarte.ekcta {
        left: 12px;
        right: 12px;
        bottom: 14px;
        width: auto;
        transform: translateY(calc(100% + 30px));
    }
    #ekCtaCarte.ekcta.is-on { transform: none; }
    #ekCtaCarte .ekcta__lien {
        min-height: 84px;
        gap: 12px;
        padding: 12px 12px 12px 16px;
        border-radius: 14px;
    }
    #ekCtaCarte .ekcta__carte { right: 40px; top: -110px; height: 240px; opacity: .35; }
    #ekCtaCarte .ekcta__k { font-size: 10.5px; margin-bottom: 2px; }
    #ekCtaCarte .ekcta__t { font-size: 14.5px; display: none; }
    #ekCtaCarte .ekcta__t.ekcta__t--m { display: block; }
    #ekCtaCarte .ekcta__s,
    #ekCtaCarte .ekcta__bouton-txt { display: none; }
    #ekCtaCarte .ekcta__x { top: -8px; right: -6px; width: 24px; height: 24px; background-color: #fff; border-color: #e2d8c7; color: #465760; box-shadow: 0 2px 6px rgba(15, 35, 44, .12); }
    #ekCtaCarte .ekcta__bouton { width: 44px; height: 44px; padding: 0; }
    .ws-trigger-container { transition: opacity .3s ease, transform .35s cubic-bezier(.22, .7, .2, 1); }
    html.ekcta-on .ws-trigger-container {
        transform: translateY(20px);
        opacity: 0;
        pointer-events: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    #ekCtaCarte.ekcta,
    #ekCtaCarte .ekcta__lien,
    #ekCtaCarte .ekcta__carte,
    #ekCtaCarte .ekcta__bouton-ico,
    .ws-trigger-container,
    html.ekcta-on .ws-trigger-container { transition: none; }
}
@media (prefers-reduced-motion: reduce) {
    #ekCtaCarte .ekcta__lien:hover .ekcta__trace,
    #ekCtaCarte .ekcta__lien:hover .ekcta__pt--fin { animation: none; }
}
@media print { #ekCtaCarte.ekcta { display: none; } }