/* =====================================================
   LEH · Boutons Modernes - CSS
   8 styles prédéfinis + animations
   ===================================================== */

.leh-btn-wrap {
    --leh-btn-bg: #1B4D2E;
    --leh-btn-bg-2: #4A7C3B;
    --leh-btn-bg-hover: #4A7C3B;
    --leh-btn-bg-2-hover: #7AB55C;
    --leh-btn-border: #1B4D2E;
    --leh-btn-border-hover: #4A7C3B;
    --leh-btn-border-width: 2px;
    --leh-btn-gradient-dir: 135deg;

    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.leh-btn-wrap *,
.leh-btn-wrap *::before,
.leh-btn-wrap *::after {
    box-sizing: border-box;
}

/* ============================================================
   BOUTON DE BASE
   ============================================================ */
.leh-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border: var(--leh-btn-border-width) solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    background: var(--leh-btn-bg);
    color: #FFFFFF;
    white-space: nowrap;
    vertical-align: middle;
}

.leh-btn:focus { outline: none; }
.leh-btn:focus-visible {
    outline: 3px solid rgba(74,124,59,0.5);
    outline-offset: 3px;
}

.leh-btn__inner {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: inherit;
}

.leh-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.3s ease;
}

.leh-btn__icon svg { fill: currentColor; }
.leh-btn__icon i { line-height: 1; }

/* Icône au-dessus/en-dessous : passe en flex column */
.leh-btn--icon-top,
.leh-btn--icon-bottom { flex-direction: column; gap: 6px; }
.leh-btn--icon-bottom { flex-direction: column-reverse; }

/* Icône seule */
.leh-btn--icon-only {
    width: auto;
    aspect-ratio: 1;
    padding: 14px;
    min-width: 48px;
}

/* ============================================================
   TAILLES PRÉDÉFINIES
   ============================================================ */
.leh-btn--size-xs { padding: 6px 14px;  font-size: 12px; gap: 6px;  border-radius: 6px; }
.leh-btn--size-sm { padding: 10px 18px; font-size: 14px; gap: 8px;  border-radius: 8px; }
.leh-btn--size-md { padding: 14px 28px; font-size: 16px; gap: 10px; border-radius: 10px; }
.leh-btn--size-lg { padding: 18px 36px; font-size: 18px; gap: 12px; border-radius: 12px; }
.leh-btn--size-xl { padding: 22px 44px; font-size: 20px; gap: 14px; border-radius: 14px; }

/* ============================================================
   STYLE 1 : SOLID
   ============================================================ */
.leh-btn--preset-solid {
    background: var(--leh-btn-bg);
    color: #FFFFFF;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(27,77,46,0.2);
}
.leh-btn--preset-solid:hover {
    background: var(--leh-btn-bg-hover);
    box-shadow: 0 8px 20px rgba(27,77,46,0.3);
}

/* ============================================================
   STYLE 2 : GRADIENT
   ============================================================ */
.leh-btn--preset-gradient {
    background: linear-gradient(var(--leh-btn-gradient-dir), var(--leh-btn-bg) 0%, var(--leh-btn-bg-2) 100%);
    color: #FFFFFF;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(27,77,46,0.25);
}
.leh-btn--preset-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(var(--leh-btn-gradient-dir), var(--leh-btn-bg-hover) 0%, var(--leh-btn-bg-2-hover) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}
.leh-btn--preset-gradient:hover {
    box-shadow: 0 12px 30px rgba(27,77,46,0.35);
}
.leh-btn--preset-gradient:hover::before { opacity: 1; }

/* ============================================================
   STYLE 3 : OUTLINE
   ============================================================ */
.leh-btn--preset-outline {
    background: transparent;
    color: var(--leh-btn-bg);
    border-color: var(--leh-btn-border);
}
.leh-btn--preset-outline:hover {
    background: var(--leh-btn-bg);
    color: #FFFFFF;
    border-color: var(--leh-btn-bg);
}

/* ============================================================
   STYLE 4 : GHOST
   ============================================================ */
.leh-btn--preset-ghost {
    background: transparent;
    color: var(--leh-btn-bg);
    border-color: rgba(27,77,46,0.15);
}
.leh-btn--preset-ghost:hover {
    background: rgba(74,124,59,0.08);
    border-color: var(--leh-btn-border-hover);
    color: var(--leh-btn-border-hover);
}

/* ============================================================
   STYLE 5 : 3D
   ============================================================ */
.leh-btn--preset-3d {
    background: var(--leh-btn-bg);
    color: #FFFFFF;
    border-color: transparent;
    box-shadow:
        0 6px 0 var(--leh-btn-bg-2),
        0 8px 12px rgba(27,77,46,0.25);
    transform: translateY(-2px);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.leh-btn--preset-3d:hover {
    transform: translateY(-4px);
    box-shadow:
        0 8px 0 var(--leh-btn-bg-2),
        0 12px 18px rgba(27,77,46,0.35);
}
.leh-btn--preset-3d:active {
    transform: translateY(0);
    box-shadow:
        0 2px 0 var(--leh-btn-bg-2),
        0 2px 4px rgba(27,77,46,0.2);
}

/* ============================================================
   STYLE 6 : GLOW
   ============================================================ */
.leh-btn--preset-glow {
    background: var(--leh-btn-bg);
    color: #FFFFFF;
    border-color: transparent;
    box-shadow:
        0 0 16px rgba(74,124,59,0.4),
        0 0 32px rgba(74,124,59,0.25),
        0 4px 12px rgba(27,77,46,0.3);
    animation: leh-glow-pulse 2s ease-in-out infinite;
}
.leh-btn--preset-glow:hover {
    box-shadow:
        0 0 24px rgba(74,124,59,0.6),
        0 0 48px rgba(74,124,59,0.4),
        0 8px 20px rgba(27,77,46,0.4);
    animation: none;
}

@keyframes leh-glow-pulse {
    0%, 100% {
        box-shadow:
            0 0 16px rgba(74,124,59,0.4),
            0 0 32px rgba(74,124,59,0.25),
            0 4px 12px rgba(27,77,46,0.3);
    }
    50% {
        box-shadow:
            0 0 24px rgba(74,124,59,0.6),
            0 0 48px rgba(74,124,59,0.35),
            0 4px 12px rgba(27,77,46,0.3);
    }
}

/* ============================================================
   STYLE 7 : NEUMORPHIC
   ============================================================ */
.leh-btn--preset-neumorphic {
    background: #F0F2EE;
    color: var(--leh-btn-bg);
    border-color: transparent;
    box-shadow:
        6px 6px 12px rgba(27,77,46,0.12),
        -6px -6px 12px rgba(255,255,255,0.9);
}
.leh-btn--preset-neumorphic:hover {
    background: #E8ECE5;
    box-shadow:
        inset 4px 4px 8px rgba(27,77,46,0.1),
        inset -4px -4px 8px rgba(255,255,255,0.7);
    color: var(--leh-btn-border-hover);
}

/* ============================================================
   STYLE 8 : GLASSMORPHIC
   ============================================================ */
.leh-btn--preset-glassmorphic {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    color: #FFFFFF;
    border-color: rgba(255,255,255,0.3);
    box-shadow:
        0 8px 24px rgba(27,77,46,0.2),
        inset 0 1px 0 rgba(255,255,255,0.2);
}
.leh-btn--preset-glassmorphic:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    box-shadow:
        0 12px 32px rgba(27,77,46,0.3),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

/* ============================================================
   ANIMATIONS HOVER
   ============================================================ */
.leh-btn--hover-lift:hover    { transform: translateY(-3px); }
.leh-btn--hover-scale:hover   { transform: scale(1.04); }
.leh-btn--hover-slide-up:hover{ transform: translateY(-5px); }
.leh-btn--hover-expand:hover  { letter-spacing: 1.5px; }
.leh-btn--hover-bounce:hover  { animation: leh-bounce 0.5s; }

@keyframes leh-bounce {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* Cumul possible : preset-3d + hover-lift */
.leh-btn--preset-3d.leh-btn--hover-lift:hover { transform: translateY(-6px); }
.leh-btn--preset-3d.leh-btn--hover-scale:hover { transform: translateY(-3px) scale(1.04); }

/* ============================================================
   ANIMATIONS ICÔNE AU HOVER
   ============================================================ */
.leh-btn--icon-anim-slide-right:hover .leh-btn__icon { transform: translateX(4px); }
.leh-btn--icon-anim-slide-left:hover .leh-btn__icon { transform: translateX(-4px); }
.leh-btn--icon-anim-rotate:hover .leh-btn__icon { transform: rotate(360deg); }
.leh-btn--icon-anim-scale:hover .leh-btn__icon { transform: scale(1.25); }
.leh-btn--icon-anim-bounce:hover .leh-btn__icon { animation: leh-icon-bounce 0.5s; }
.leh-btn--icon-anim-shake:hover .leh-btn__icon { animation: leh-icon-shake 0.4s; }

@keyframes leh-icon-bounce {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
    60% { transform: translateY(-3px); }
}

@keyframes leh-icon-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ============================================================
   EFFET SHINE (brillance au survol)
   ============================================================ */
.leh-btn__shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg,
        transparent 0%,
        rgba(255,255,255,0.4) 50%,
        transparent 100%);
    transform: skewX(-20deg);
    transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    pointer-events: none;
}

.leh-btn--shine:hover .leh-btn__shine {
    left: 150%;
}

/* ============================================================
   EFFET RIPPLE (cercle au clic, ajouté en JS)
   ============================================================ */
.leh-btn--ripple { overflow: hidden; }

.leh-btn__ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transform: scale(0);
    animation: leh-ripple-anim 0.6s ease-out;
    pointer-events: none;
    z-index: 2;
}

.leh-btn--preset-outline .leh-btn__ripple,
.leh-btn--preset-ghost .leh-btn__ripple,
.leh-btn--preset-neumorphic .leh-btn__ripple {
    background: rgba(74,124,59,0.3);
}

@keyframes leh-ripple-anim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================================
   EFFET PULSE CONTINU
   ============================================================ */
.leh-btn--pulse {
    animation: leh-pulse-cta 2s ease-in-out infinite;
}

@keyframes leh-pulse-cta {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.leh-btn--pulse.leh-btn--hover-lift:hover {
    animation: none;
    transform: translateY(-3px);
}

/* ============================================================
   BADGE
   ============================================================ */
.leh-btn__badge {
    position: absolute;
    background: #dc3545;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 100px;
    letter-spacing: 0.5px;
    z-index: 4;
    line-height: 1;
    white-space: nowrap;
    text-transform: uppercase;
}

.leh-btn__badge--top-right    { top: -8px;    right: -8px; }
.leh-btn__badge--top-left     { top: -8px;    left: -8px; }
.leh-btn__badge--bottom-right { bottom: -8px; right: -8px; }
.leh-btn__badge--bottom-left  { bottom: -8px; left: -8px; }

.leh-btn__badge-anim-pulse {
    animation: leh-badge-pulse 1.5s ease-in-out infinite;
}
.leh-btn__badge-anim-bounce {
    animation: leh-badge-bounce 1.5s ease-in-out infinite;
}
.leh-btn__badge-anim-wiggle {
    animation: leh-badge-wiggle 2s ease-in-out infinite;
}

@keyframes leh-badge-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220,53,69,0.5); }
    50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(220,53,69,0); }
}

@keyframes leh-badge-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes leh-badge-wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-6deg); }
    75% { transform: rotate(6deg); }
}

/* ============================================================
   ANIMATIONS D'APPARITION (au scroll)
   ============================================================ */
.leh-btn-wrap--entrance {
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--entrance-delay, 0ms);
    will-change: opacity, transform;
}

.leh-btn-wrap--entrance-fade-in   { opacity: 0; }
.leh-btn-wrap--entrance-fade-up   { opacity: 0; transform: translateY(30px); }
.leh-btn-wrap--entrance-fade-down { opacity: 0; transform: translateY(-30px); }
.leh-btn-wrap--entrance-zoom-in   { opacity: 0; transform: scale(0.85); }
.leh-btn-wrap--entrance-slide-in-left  { opacity: 0; transform: translateX(-40px); }
.leh-btn-wrap--entrance-slide-in-right { opacity: 0; transform: translateX(40px); }

.leh-btn-wrap--entrance.is-visible {
    opacity: 1;
    transform: none;
}

/* ============================================================
   ALIGNEMENT WRAPPER
   ============================================================ */
.leh-btn-wrap[data-align="left"]    { justify-content: flex-start; }
.leh-btn-wrap[data-align="center"]  { justify-content: center; }
.leh-btn-wrap[data-align="right"]   { justify-content: flex-end; }
.leh-btn-wrap[data-align="stretch"] { display: block; }
.leh-btn-wrap[data-align="stretch"] .leh-btn { width: 100%; }

/* ============================================================
   VISIBILITÉ RESPONSIVE - Breakpoints Elementor natifs
   FRONTEND : vraiment masqué (display: none)
   ÉDITEUR ELEMENTOR : grisé + visible (pour pouvoir l'éditer)
   ============================================================ */

/* === FRONTEND : masquage réel === */
body:not(.elementor-editor-active) {
    /* Widescreen : >2400px */
    @media (min-width: 2400px) {
        & .leh-btn-wrap.leh-hide-widescreen { display: none !important; }
    }
    /* Desktop : 1025-2400px */
    @media (min-width: 1025px) and (max-width: 2399.98px) {
        & .leh-btn-wrap.leh-hide-desktop { display: none !important; }
    }
    /* Laptop */
    @media (min-width: 1025px) and (max-width: 1366.98px) {
        & .leh-btn-wrap.leh-hide-laptop { display: none !important; }
    }
    /* Tablet Extra */
    @media (min-width: 881px) and (max-width: 1024.98px) {
        & .leh-btn-wrap.leh-hide-tablet-extra { display: none !important; }
    }
    /* Tablet */
    @media (min-width: 768px) and (max-width: 1024.98px) {
        & .leh-btn-wrap.leh-hide-tablet { display: none !important; }
    }
    /* Mobile Extra */
    @media (min-width: 481px) and (max-width: 767.98px) {
        & .leh-btn-wrap.leh-hide-mobile-extra { display: none !important; }
    }
    /* Mobile */
    @media (max-width: 767px) {
        & .leh-btn-wrap.leh-hide-mobile { display: none !important; }
    }
}

/* === FALLBACK FRONTEND si selectors imbriqués non supportés === */
@media (min-width: 2400px) {
    body:not(.elementor-editor-active) .leh-btn-wrap.leh-hide-widescreen { display: none !important; }
}
@media (min-width: 1025px) and (max-width: 2399.98px) {
    body:not(.elementor-editor-active) .leh-btn-wrap.leh-hide-desktop { display: none !important; }
}
@media (min-width: 1025px) and (max-width: 1366.98px) {
    body:not(.elementor-editor-active) .leh-btn-wrap.leh-hide-laptop { display: none !important; }
}
@media (min-width: 881px) and (max-width: 1024.98px) {
    body:not(.elementor-editor-active) .leh-btn-wrap.leh-hide-tablet-extra { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1024.98px) {
    body:not(.elementor-editor-active) .leh-btn-wrap.leh-hide-tablet { display: none !important; }
}
@media (min-width: 481px) and (max-width: 767.98px) {
    body:not(.elementor-editor-active) .leh-btn-wrap.leh-hide-mobile-extra { display: none !important; }
}
@media (max-width: 767px) {
    body:not(.elementor-editor-active) .leh-btn-wrap.leh-hide-mobile { display: none !important; }

    .leh-btn {
        max-width: 100%;
        white-space: normal;
    }

    .leh-btn--size-xl { padding: 18px 32px; font-size: 17px; }
    .leh-btn--size-lg { padding: 16px 28px; font-size: 16px; }
}

/* ============================================================
   ÉDITEUR ELEMENTOR : grisé mais VISIBLE (peut éditer)
   Surchage le display: none possible du thème
   ============================================================ */
body.elementor-editor-active .leh-btn-wrap.leh-hide-widescreen,
body.elementor-editor-active .leh-btn-wrap.leh-hide-desktop,
body.elementor-editor-active .leh-btn-wrap.leh-hide-laptop,
body.elementor-editor-active .leh-btn-wrap.leh-hide-tablet-extra,
body.elementor-editor-active .leh-btn-wrap.leh-hide-tablet,
body.elementor-editor-active .leh-btn-wrap.leh-hide-mobile-extra,
body.elementor-editor-active .leh-btn-wrap.leh-hide-mobile {
    display: flex !important;
    opacity: 0.4 !important;
    filter: grayscale(60%) !important;
    position: relative !important;
    outline: 2px dashed #f59e0b !important;
    outline-offset: 4px !important;
    transition: opacity 0.2s ease !important;
}

/* Effet hover dans l'éditeur : on remonte l'opacité pour bien voir */
body.elementor-editor-active .leh-btn-wrap[class*="leh-hide-"]:hover {
    opacity: 0.85 !important;
    filter: grayscale(20%) !important;
}

/* Badge "masqué" pour indiquer visuellement le statut */
body.elementor-editor-active .leh-btn-wrap[class*="leh-hide-"]::before {
    content: "👁️ Masqué";
    position: absolute;
    top: -22px;
    right: 0;
    background: #f59e0b;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

/* Si masqué partout : badge rouge "Tous écrans" */
body.elementor-editor-active .leh-btn-wrap.leh-hide-widescreen.leh-hide-desktop.leh-hide-tablet.leh-hide-mobile::before {
    content: "🚫 Masqué (tous écrans)";
    background: #dc3545;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

/* Edge case : iframe Elementor preview qui n'a pas la classe body */
.elementor-editor-active .leh-btn-wrap[class*="leh-hide-"],
[data-elementor-type] .leh-btn-wrap[class*="leh-hide-"] {
    display: flex !important;
}

/* ============================================================
   ACCESSIBILITÉ
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .leh-btn,
    .leh-btn::before,
    .leh-btn__icon,
    .leh-btn__shine,
    .leh-btn-wrap--entrance {
        transition: none !important;
        animation: none !important;
    }

    .leh-btn--preset-glow,
    .leh-btn--pulse,
    .leh-btn__badge-anim-pulse,
    .leh-btn__badge-anim-bounce,
    .leh-btn__badge-anim-wiggle {
        animation: none !important;
    }
}
