/*=========================================================
 A — VARIABLES CTA
 =========================================================*/

:root {
    --tw-cta_justify-content: center;
    --tw-cta_gap: .75rem;

    --tw-cta_min-width: 0;
    --tw-cta_padding-y: .7rem;
    --tw-cta_padding-x: 1rem;
    --tw-cta_radius: 10px;

    --tw-cta_font-size: .95rem;
    --tw-cta_font-weight: 500;
    --tw-cta_text-transform: none;
    --tw-cta_icon-size: 20px;

    /* Couleur CTA : fournie par la variante, le thème enfant ou l'admin. */
    --tw-cta_background-alpha: 1;
    --tw-cta_background-alpha-hover: 1;

    /* Apparence courante : surchargée par le réglage global ou le groupe. */
    --tw-cta-style_bg: transparent;
    --tw-cta-style_color: inherit;
    --tw-cta-style_border-color: currentColor;
    --tw-cta-style_border-width: 0 0 1px;
    --tw-cta-style_bg-hover: transparent;
    --tw-cta-style_color-hover: inherit;
    --tw-cta-style_border-color-hover: currentColor;
    --tw-cta-style_hover-opacity: .58;

    --tw-cta_shadow: none;
    --tw-cta_shadow-hover: none;

    /* Bandeau desktop. */
    --tw-cta-bandeau_bg: rgba(0, 0, 0, .18);
    --tw-cta-bandeau_border-color: rgba(255, 255, 255, .14);

    /* Barre basse mobile. */
    --tw-cta-mobile-bar_height: 58px;
    --tw-cta-mobile-bar_bg: rgba(255, 255, 255, .94);
    --tw-cta-mobile-bar_color: var(--tw-color_text, #222222);
    --tw-cta-mobile-bar_border-color: rgba(0, 0, 0, .12);
}

/*=========================================================
 B — APPARENCE GLOBALE
 =========================================================*/

/*---------------------------------------------------------
 B.1 — Style
 ---------------------------------------------------------*/

.tw-cta-style_discret,
.tw-cta-group_style-discret {
    --tw-cta-style_bg: transparent;
    --tw-cta-style_color: inherit;
    --tw-cta-style_border-color: currentColor;
    --tw-cta-style_border-width: 0 0 1px;
    --tw-cta-style_bg-hover: transparent;
    --tw-cta-style_color-hover: inherit;
    --tw-cta-style_border-color-hover: currentColor;
    --tw-cta-style_hover-opacity: .72;
}

.tw-cta-style_contour,
.tw-cta-group_style-contour {
    --tw-cta-style_bg: transparent;
    --tw-cta-style_color: inherit;
    --tw-cta-style_border-color: currentColor;
    --tw-cta-style_border-width: 1px;
    --tw-cta-style_bg-hover: transparent;
    --tw-cta-style_color-hover: inherit;
    --tw-cta-style_border-color-hover: currentColor;
    --tw-cta-style_hover-opacity: .75;
}

.tw-cta-style_plein,
.tw-cta-group_style-plein {
    --tw-cta-style_bg: rgba(var(--tw-cta_accent-rgb, 45, 47, 68), var(--tw-cta_background-alpha));
    --tw-cta-style_color: var(--tw-cta_contrast, #ffffff);
    --tw-cta-style_border-color: rgba(var(--tw-cta_accent-rgb, 45, 47, 68), var(--tw-cta_background-alpha));
    --tw-cta-style_border-width: 1px;
    --tw-cta-style_bg-hover: rgba(var(--tw-cta_accent-rgb, 45, 47, 68), var(--tw-cta_background-alpha-hover));
    --tw-cta-style_color-hover: var(--tw-cta_contrast, #ffffff);
    --tw-cta-style_border-color-hover: rgba(var(--tw-cta_accent-rgb, 45, 47, 68), var(--tw-cta_background-alpha-hover));
    --tw-cta-style_hover-opacity: 1;
}


/*---------------------------------------------------------
 B.1.1 — Couleur personnalisée des styles transparents
 ---------------------------------------------------------*/
.tw-cta-color_custom.tw-cta-style_discret,
.tw-cta-color_custom .tw-cta-group_style-discret,
.tw-cta-color_custom.tw-cta-style_contour,
.tw-cta-color_custom .tw-cta-group_style-contour {
    --tw-cta-style_color: var(--tw-cta_accent, #2d2f44);
    --tw-cta-style_border-color: var(--tw-cta_accent, #2d2f44);
    --tw-cta-style_color-hover: var(--tw-cta_accent, #2d2f44);
    --tw-cta-style_border-color-hover: var(--tw-cta_accent, #2d2f44);
}

/*---------------------------------------------------------
 B.1.2 — Transparence du fond Plein
 ---------------------------------------------------------*/

.tw-cta-transparency_none {
    --tw-cta_background-alpha: 1;
    --tw-cta_background-alpha-hover: 1;
}

.tw-cta-transparency_light {
    --tw-cta_background-alpha: .70;
    --tw-cta_background-alpha-hover: .85;
}

.tw-cta-transparency_medium {
    --tw-cta_background-alpha: .50;
    --tw-cta_background-alpha-hover: .70;
}

.tw-cta-transparency_strong {
    --tw-cta_background-alpha: .30;
    --tw-cta_background-alpha-hover: .50;
}

/*---------------------------------------------------------
 B.2 — Taille
 ---------------------------------------------------------*/

.tw-cta-size_compact {
    --tw-cta_padding-y: .5rem;
    --tw-cta_padding-x: .8rem;
    --tw-cta_font-size: .875rem;
}

.tw-cta-size_normal {
    --tw-cta_padding-y: .7rem;
    --tw-cta_padding-x: 1rem;
    --tw-cta_font-size: .95rem;
}

.tw-cta-size_large {
    --tw-cta_padding-y: .9rem;
    --tw-cta_padding-x: 1.25rem;
    --tw-cta_font-size: 1rem;
}

/*---------------------------------------------------------
 B.3 — Angles
 ---------------------------------------------------------*/

.tw-cta-radius_square {
    --tw-cta_radius: 0;
}

.tw-cta-radius_slight {
    --tw-cta_radius: 4px;
}

.tw-cta-radius_rounded {
    --tw-cta_radius: 10px;
}

/*---------------------------------------------------------
 B.4 — Graisse
 ---------------------------------------------------------*/

.tw-cta-weight_400 {
    --tw-cta_font-weight: 400;
}

.tw-cta-weight_500 {
    --tw-cta_font-weight: 500;
}

.tw-cta-weight_600 {
    --tw-cta_font-weight: 600;
}

/*---------------------------------------------------------
 B.5 — Casse
 ---------------------------------------------------------*/

.tw-cta-case_normal {
    --tw-cta_text-transform: none;
}

.tw-cta-case_lower {
    --tw-cta_text-transform: lowercase;
}

.tw-cta-case_upper {
    --tw-cta_text-transform: uppercase;
}

/*---------------------------------------------------------
 B.6 — Icônes
 ---------------------------------------------------------*/

.tw-cta-icons_hide .tw-cta-button_icon {
    display: none;
}

/*---------------------------------------------------------
 B.7 — Ombre
 ---------------------------------------------------------*/

.tw-cta-shadow_none {
    --tw-cta_shadow: none;
    --tw-cta_shadow-hover: none;
}

.tw-cta-shadow_light {
    --tw-cta_shadow: 0 2px 8px rgba(0, 0, 0, .05);
    --tw-cta_shadow-hover: 0 6px 18px rgba(0, 0, 0, .10);
}

/*=========================================================
 C — GROUPES CTA
 =========================================================*/

/*---------------------------------------------------------
 C.1 — Liste standard
 ---------------------------------------------------------*/

.tw-cta-group_list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--tw-cta_gap);
}

.tw-cta-group_mobile {
    display: none;
}

.tw-cta-group_sans-icone .tw-cta-button_icon,
.tw-cta-group_icons-hide .tw-cta-button_icon {
    display: none;
}

/* Un groupe réglé sur « Affichées » peut surcharger le masquage global. */
.tw-cta-icons_hide .tw-cta-group_icons-show .tw-cta-button_icon {
    display: flex;
}

/*---------------------------------------------------------
 C.2 — Bandeau desktop
 ---------------------------------------------------------*/

@media (min-width: 768px) {

    .tw-cta-group_bandeau .tw-cta-group_list {
        display: flex;
        flex-wrap: nowrap;
        gap: 0;
        width: 100%;
        overflow: hidden;
        background: var(--tw-cta-bandeau_bg);
        border-top: 1px solid var(--tw-cta-bandeau_border-color);
        border-bottom: 1px solid var(--tw-cta-bandeau_border-color);
    }

    .tw-cta-group_bandeau .tw-cta-button {
        flex: 1 1 0;
        min-width: 0;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .tw-cta-group_bandeau .tw-cta-button + .tw-cta-button {
        border-left: 1px solid var(--tw-cta-bandeau_border-color);
    }

    /* Dans le Hero, le bandeau occupe la largeur utile en pied de Hero. */
    .tw-hero_has-cta-bandeau .tw-hero_content {
        padding-bottom: clamp(5.5rem, 8vw, 7rem);
    }

    .tw-hero.tw-hero_main .tw-cta-group_bandeau,
    .tw-hero.tw-hero_home .tw-cta-group_bandeau {
        position: absolute;
        right: 0;
        bottom: 1.25rem;
        left: 0;
        z-index: 4;
        padding-inline: max(1rem, calc((100vw - var(--tw-container_width)) / 2));
    }
}

/*=========================================================
 D — BOUTON CTA
 =========================================================*/

/*---------------------------------------------------------
 D.1 — Structure
 ---------------------------------------------------------*/

.tw-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: var(--tw-cta_justify-content);
    gap: .5rem;

    min-width: var(--tw-cta_min-width);
    padding: var(--tw-cta_padding-y) var(--tw-cta_padding-x);

    border-style: solid;
    border-width: var(--tw-cta-style_border-width);
    border-color: var(--tw-cta-style_border-color);
    border-radius: var(--tw-cta_radius);
    background: var(--tw-cta-style_bg);
    color: var(--tw-cta-style_color);
    box-shadow: var(--tw-cta_shadow);

    font-size: var(--tw-cta_font-size);
    font-weight: var(--tw-cta_font-weight);
    line-height: 1.2;
    text-transform: var(--tw-cta_text-transform);
    text-decoration: none;

    transition:
        opacity .18s ease,
        transform .18s ease,
        box-shadow .18s ease,
        background-color .18s ease,
        border-color .18s ease,
        color .18s ease;
}

/*---------------------------------------------------------
 D.2 — Survol
 ---------------------------------------------------------*/

.tw-cta-button:hover,
.tw-cta-button:focus-visible {
    opacity: var(--tw-cta-style_hover-opacity);
    transform: translateY(-1px);
    border-color: var(--tw-cta-style_border-color-hover);
    background: var(--tw-cta-style_bg-hover);
    color: var(--tw-cta-style_color-hover);
    box-shadow: var(--tw-cta_shadow-hover);
    text-decoration: none;
}

/*---------------------------------------------------------
 D.3 — Icône
 ---------------------------------------------------------*/

.tw-cta-button_icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: var(--tw-cta_icon-size);
    height: var(--tw-cta_icon-size);
    color: currentColor;
    line-height: 1;
}

.tw-cta-button_icon svg {
    display: block;
    width: var(--tw-cta_icon-size);
    height: var(--tw-cta_icon-size);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tw-cta-button_icon svg * {
    fill: none;
    stroke: currentColor;
}

.tw-cta-button_icon svg circle[fill="currentColor"],
.tw-cta-button_icon svg path[fill="currentColor"] {
    fill: currentColor;
    stroke: none;
}

/* D.3.1 — WhatsApp conserve sa couleur d'identification. */
.tw-cta-button_icon .tw-icon-whatsapp,
.tw-cta-button_icon .tw-icon-whatsapp * {
    fill: #25d366;
    stroke: none;
}

/* D.3.2 — Material Symbols. */
.tw-cta-button_icon .material-symbols-outlined {
    font-size: var(--tw-cta_icon-size);
    line-height: 1;
    color: currentColor;
}

/*---------------------------------------------------------
 D.4 — Texte et visibilité
 ---------------------------------------------------------*/

.tw-cta-button_label {
    display: inline-block;
}

.tw-cta-button_mobile {
    display: none;
}

/*=========================================================
 E — RESPONSIVE MOBILE
 =========================================================*/

@media (max-width: 767px) {

    /*---------------------------------------------------------
     E.1 — Affichage conditionnel
     ---------------------------------------------------------*/

    .tw-cta-group_desktop,
    .tw-cta-button_desktop {
        display: none;
    }

    .tw-cta-group_mobile {
        display: block;
    }

    .tw-cta-button_mobile {
        display: inline-flex;
    }

    /*---------------------------------------------------------
     E.2 — Présentation empilée
     ---------------------------------------------------------*/

    .tw-cta-group_mobile-stack .tw-cta-group_list {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
    }

    .tw-cta-group_mobile-stack .tw-cta-button {
        width: 100%;
    }

    /* Un bandeau desktop redevient un groupe normal lorsqu'il n'est pas
     * explicitement transformé en barre basse sur mobile. */
    .tw-hero .tw-cta-group_bandeau:not(.tw-cta-group_mobile-bar) {
        position: static;
        width: auto;
        padding: 0 1.25rem 2rem;
    }

    /*---------------------------------------------------------
     E.3 — Barre basse de 1 à 4 boutons
     ---------------------------------------------------------*/

    .tw-cta-group_mobile-bar {
        width: 100%;
        margin: 0;
        color: var(--tw-cta-mobile-bar_color);
        background: var(--tw-cta-mobile-bar_bg);
        border-top: 1px solid var(--tw-cta-mobile-bar_border-color);
        border-radius: 0;
        box-shadow: none;
    }

    .tw-cta-group_mobile-bar .tw-cta-group_list {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        width: 100%;
    }

    .tw-cta-group_mobile-count-2 .tw-cta-group_list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tw-cta-group_mobile-count-3 .tw-cta-group_list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tw-cta-group_mobile-count-4 .tw-cta-group_list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .tw-cta-group_mobile-bar .tw-cta-button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .2rem;
        min-width: 0;
        width: 100%;
        min-height: var(--tw-cta-mobile-bar_height);
        margin: 0;
        padding: .65rem .3rem;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: inherit;
        box-shadow: none;
        text-align: center;
    }

    .tw-cta-group_mobile-bar .tw-cta-button + .tw-cta-button {
        border-left: 1px solid var(--tw-cta-mobile-bar_border-color);
    }

    .tw-cta-group_mobile-bar .tw-cta-button:hover,
    .tw-cta-group_mobile-bar .tw-cta-button:focus-visible {
        opacity: .72;
        transform: none;
        background: transparent;
        color: inherit;
        box-shadow: none;
    }

    .tw-cta-group_mobile-bar .tw-cta-button_icon {
        width: 1.35rem;
        height: 1.35rem;
    }

    .tw-cta-group_mobile-bar .tw-cta-button_icon svg,
    .tw-cta-group_mobile-bar .material-symbols-outlined {
        width: 1.35rem;
        height: 1.35rem;
        font-size: 1.35rem;
    }

    .tw-cta-group_mobile-bar .tw-cta-button_label {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .75rem;
        font-weight: 500;
        line-height: 1.1;
    }

    .tw-cta-group_mobile-count-4 .tw-cta-button_label {
        font-size: .68rem;
    }

    /*---------------------------------------------------------
     E.4 — Barre basse fixe
     ---------------------------------------------------------*/

    .tw-cta-group_mobile-bar.tw-cta-group_fixed {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 999;
        padding-bottom: env(safe-area-inset-bottom);
        backdrop-filter: blur(10px);
    }

    .tw-cta_fixed .site-content {
        padding-bottom: calc(
            var(--tw-cta-mobile-bar_height)
            + env(safe-area-inset-bottom)
        );
    }

    /* Le Hero ne réserve plus l'espace du bandeau desktop sur mobile. */
    .tw-hero_has-cta-bandeau .tw-hero_content {
        padding-bottom: 3rem;
    }
}
