/* =====================================================
   LEH · Services Grid - CSS Premium
   4 styles : glassmorphism, gradient, minimal, border-glow
   2 modes : grille + carrousel
   ===================================================== */

.leh-services-wrapper {
    position: relative;
    --leh-glow-color: rgba(122,181,92,0.4);
    --leh-hover-y: -8px;
}

/* ---------- EN-TÊTE ---------- */
.leh-services-header {
    text-align: center;
    margin-bottom: 50px;
}

.leh-services-pretitle {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 13px;
    font-weight: 600;
    color: #4A7C3B;
    margin-bottom: 16px;
    position: relative;
    padding: 0 30px;
}

.leh-services-pretitle::before,
.leh-services-pretitle::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 20px;
    height: 1px;
    background: currentColor;
}
.leh-services-pretitle::before { left: 0; }
.leh-services-pretitle::after { right: 0; }

.leh-services-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    line-height: 1.2;
    color: #1B4D2E;
    margin: 0 0 16px 0;
}

.leh-services-subtitle {
    font-size: 16px;
    line-height: 1.6;
    color: #5A5A5A;
    max-width: 720px;
    margin: 0 auto;
}

/* ---------- GRILLE ---------- */
.leh-services-grid {
    display: grid;
    gap: 24px;
}

/* ---------- CARTE BASE ---------- */
.leh-service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    border-radius: 20px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.4s ease,
                border-color 0.4s ease;
    overflow: hidden;
    min-height: 340px;
    isolation: isolate;
}

/* Contenu textuel (toujours présent) */
.leh-service-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 28px;
}

.leh-service-card:hover {
    transform: translateY(var(--leh-hover-y, -8px));
}

.leh-service-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle at center, var(--leh-glow-color) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.leh-service-card:hover .leh-service-glow {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.leh-service-card > * {
    position: relative;
    z-index: 1;
}

/* === STYLE 1 : GLASSMORPHISM === */
.leh-service-card[data-style="glassmorphism"] {
    background-color: rgba(255,255,255,0.65);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.4);
}

.leh-service-card[data-style="glassmorphism"]:hover {
    border-color: rgba(122,181,92,0.5);
    background-color: rgba(255,255,255,0.8);
}

/* === STYLE 2 : GRADIENT PREMIUM === */
.leh-service-card[data-style="gradient"] {
    background: linear-gradient(135deg, #1B4D2E 0%, #4A7C3B 100%);
    border: 1px solid transparent;
}

.leh-service-card[data-style="gradient"]::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    z-index: 0;
}

.leh-service-card[data-style="gradient"]::after {
    content: "";
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(122,181,92,0.3) 0%, transparent 70%);
    z-index: 0;
    transition: transform 0.6s ease;
}

.leh-service-card[data-style="gradient"]:hover::after {
    transform: scale(1.3);
}

/* === STYLE 3 : MINIMAL MODERNE === */
.leh-service-card[data-style="minimal"] {
    background-color: #FFFFFF;
    border: 1px solid rgba(27,77,46,0.08);
}

.leh-service-card[data-style="minimal"]::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #1B4D2E 0%, #4A7C3B 50%, #7AB55C 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

.leh-service-card[data-style="minimal"]:hover::before {
    transform: scaleX(1);
}

.leh-service-card[data-style="minimal"]:hover {
    background-color: #1B4D2E;
}

.leh-service-card[data-style="minimal"]:hover .leh-service-icon-wrapper {
    background-color: rgba(255,255,255,0.15) !important;
}
.leh-service-card[data-style="minimal"]:hover .leh-service-icon {
    color: #FFFFFF !important;
}
.leh-service-card[data-style="minimal"]:hover .leh-service-icon svg {
    fill: #FFFFFF !important;
}

/* === STYLE 4 : BORDURE ANIMÉE === */
.leh-service-card[data-style="border-glow"] {
    background-color: #FFFFFF;
    border: 2px solid transparent;
    background-image:
        linear-gradient(#FFFFFF, #FFFFFF),
        linear-gradient(135deg, transparent, transparent);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.leh-service-card[data-style="border-glow"]:hover {
    background-image:
        linear-gradient(#1B4D2E, #1B4D2E),
        linear-gradient(135deg, #1B4D2E 0%, #4A7C3B 50%, #7AB55C 100%);
}

.leh-service-card[data-style="border-glow"]:hover .leh-service-icon-wrapper {
    background-color: rgba(255,255,255,0.15) !important;
}
.leh-service-card[data-style="border-glow"]:hover .leh-service-icon {
    color: #FFFFFF !important;
}
.leh-service-card[data-style="border-glow"]:hover .leh-service-icon svg {
    fill: #FFFFFF !important;
}

/* ---------- ICÔNE / IMAGE WRAPPER ---------- */
.leh-service-icon-wrapper,
.leh-service-image-wrapper {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    max-width: 80px;
    max-height: 80px;
    aspect-ratio: 1 / 1;
    flex: 0 0 80px;
    flex-shrink: 0;
    flex-grow: 0;
    align-self: flex-start;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    background-color: rgba(74,124,59,0.12);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.4s ease;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0;
}

.leh-service-card:hover .leh-service-icon-wrapper,
.leh-service-card:hover .leh-service-image-wrapper {
    transform: scale(1.1) rotate(-5deg);
}

.leh-service-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.leh-service-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4A7C3B;
    font-size: 36px;
    line-height: 1;
    transition: transform 0.4s ease, color 0.4s ease;
}

.leh-service-card:hover .leh-service-icon {
    transform: rotate(10deg) scale(1.05);
}

.leh-service-icon i { line-height: 1; }
.leh-service-icon svg {
    width: 36px;
    height: 36px;
    fill: currentColor;
}

/* ---------- TITRE & DESCRIPTION ---------- */
.leh-service-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: #1B4D2E;
    margin: 0 0 12px 0;
    transition: color 0.4s ease;
}

.leh-service-description {
    font-size: 15px;
    line-height: 1.6;
    color: #5A5A5A;
    margin: 0 0 20px 0;
    flex-grow: 1;
    transition: color 0.4s ease;
}

/* ---------- ACTIONS (boutons) ---------- */
.leh-service-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: auto;
}

.leh-service-devis-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #1B4D2E 0%, #4A7C3B 100%);
    color: #FFFFFF;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    transition: background 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.leh-service-devis-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.leh-service-devis-btn:hover::before {
    width: 400px;
    height: 400px;
}

.leh-service-devis-btn:hover {
    background: linear-gradient(135deg, #4A7C3B 0%, #7AB55C 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(27,77,46,0.25);
}

.leh-service-devis-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.leh-service-devis-btn:hover svg {
    transform: translateX(4px);
}

.leh-service-devis-btn span {
    position: relative;
    z-index: 1;
}

.leh-service-savoir-plus {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4A7C3B;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.4s ease, gap 0.3s ease;
    align-self: center;
}

.leh-service-savoir-plus svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.leh-service-savoir-plus:hover {
    gap: 10px;
}

.leh-service-savoir-plus:hover svg {
    transform: translateX(4px);
}

/* ---------- CARROUSEL ---------- */
.leh-services-carousel {
    position: relative;
    --leh-gap: 24px;
}

.leh-services-carousel-viewport {
    overflow: hidden;
    padding: 10px 4px;
    margin: -10px -4px;
}

.leh-services-carousel-track {
    display: flex;
    gap: var(--leh-gap, 24px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.leh-services-carousel .leh-service-card {
    flex: 0 0 auto;
    width: calc((100% - (var(--leh-slides-visible, 3) - 1) * var(--leh-gap, 24px)) / var(--leh-slides-visible, 3));
}

.leh-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background-color: #FFFFFF;
    color: #1B4D2E;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(27,77,46,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    z-index: 5;
}

.leh-carousel-arrow:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 25px rgba(27,77,46,0.25);
    background-color: #1B4D2E;
    color: #FFFFFF;
}

.leh-carousel-arrow:hover svg {
    fill: #FFFFFF;
}

.leh-carousel-arrow svg {
    width: 22px;
    height: 22px;
    transition: fill 0.3s ease;
}

.leh-carousel-arrow-prev { left: -24px; }
.leh-carousel-arrow-next { right: -24px; }

.leh-carousel-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.leh-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.leh-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(27,77,46,0.25);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, width 0.3s ease;
    padding: 0;
}

.leh-carousel-dot.is-active {
    background-color: #1B4D2E;
    width: 28px;
    border-radius: 5px;
}

.leh-carousel-dot:hover:not(.is-active) {
    background-color: rgba(27,77,46,0.5);
}

/* =====================================================
   LAYOUTS D'IMAGE
   ===================================================== */

/* ===== LAYOUT 1 : TOP-FULL (Grande image en haut) ===== */
.leh-service-image-top {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    flex-shrink: 0;
    z-index: 1;
}

.leh-service-image-top img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Zoom au survol (data-attr) */
.leh-service-card[data-zoom-hover="yes"]:hover .leh-service-image-top img {
    transform: scale(1.08);
}

/* Léger dégradé en bas de l'image pour mieux marquer la transition vers le contenu */
.leh-service-image-top::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 60px;
    background: linear-gradient(to top, rgba(0,0,0,0.12), transparent);
    pointer-events: none;
    z-index: 1;
}

/* ===== LAYOUT 2 : TOP-BADGE (Image en haut + icône badge superposé) ===== */
.leh-service-icon-badge {
    position: absolute;
    bottom: -28px;
    left: 28px;
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    background: linear-gradient(135deg, #1B4D2E 0%, #4A7C3B 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(27,77,46,0.25);
    z-index: 3;
    border: 4px solid #FFFFFF;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.leh-service-card[data-image-layout="top-badge"]:hover .leh-service-icon-badge {
    transform: rotate(-8deg) scale(1.1);
}

.leh-service-icon-badge .leh-service-icon {
    color: #FFFFFF;
    font-size: 24px;
}

.leh-service-icon-badge .leh-service-icon svg {
    width: 24px;
    height: 24px;
    fill: #FFFFFF;
}

/* Quand layout top-badge : ajoute du padding-top au content pour laisser place au badge */
.leh-service-card[data-image-layout="top-badge"] .leh-service-content {
    padding-top: 44px;
}

/* ===== LAYOUT 3 : BACKGROUND (Image en fond, texte par-dessus) ===== */
.leh-service-bg-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.leh-service-card[data-zoom-hover="yes"][data-image-layout="background"]:hover .leh-service-bg-image {
    transform: scale(1.08);
}

.leh-service-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(27,77,46,0.3) 0%, rgba(27,77,46,0.85) 70%, rgba(27,77,46,0.95) 100%);
    z-index: 1;
    transition: opacity 0.4s ease;
}

.leh-service-card[data-image-layout="background"]:hover .leh-service-bg-overlay {
    background: linear-gradient(180deg, rgba(27,77,46,0.4) 0%, rgba(27,77,46,0.9) 60%, rgba(27,77,46,0.98) 100%);
}

/* En mode background, le contenu se positionne en bas et le texte est blanc */
.leh-service-card[data-image-layout="background"] {
    min-height: 380px;
}

.leh-service-card[data-image-layout="background"] .leh-service-content {
    justify-content: flex-end;
}

.leh-service-card[data-image-layout="background"] .leh-service-title {
    color: #FFFFFF;
}

.leh-service-card[data-image-layout="background"] .leh-service-description {
    color: rgba(255,255,255,0.9);
}

.leh-service-card[data-image-layout="background"] .leh-service-savoir-plus {
    color: #FFFFFF;
}

/* ===== LAYOUT 4 : TOP-ICON (Image en haut + icône à part en dessous) ===== */
.leh-service-card[data-image-layout="top-icon"] .leh-service-icon-wrapper {
    margin-top: -40px;
    z-index: 3;
    background-color: #FFFFFF;
    box-shadow: 0 8px 20px rgba(27,77,46,0.15);
    border: 4px solid #FFFFFF;
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    max-width: 80px;
    max-height: 80px;
    margin-bottom: 16px;
}

.leh-service-card[data-image-layout="top-icon"] .leh-service-content {
    padding-top: 0;
}

/* ===== LAYOUT 5 : ICON-ONLY (Icône circulaire uniquement, layout d'origine) ===== */
/* Les styles existants .leh-service-icon-wrapper s'appliquent déjà */

/* === Quand layout = icon-only OU pas d'image, garder un padding-top sur le contenu === */
.leh-service-card[data-image-layout="icon-only"] .leh-service-content {
    padding-top: 32px;
}

/* === Forcer styles cards spéciaux à respecter le contenu === */
.leh-service-card[data-style="glassmorphism"][data-image-layout="background"] {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.leh-service-card[data-style="gradient"][data-image-layout="background"] {
    background: none;
}

.leh-service-card[data-style="gradient"][data-image-layout="background"]::before,
.leh-service-card[data-style="gradient"][data-image-layout="background"]::after {
    display: none;
}

/* Border-glow + background : on garde le contour gradient mais pas le fond blanc */
.leh-service-card[data-style="border-glow"][data-image-layout="background"] {
    background-image: none;
}

.leh-service-card[data-style="border-glow"][data-image-layout="background"]:hover {
    background-image: none;
}


@media (max-width: 1024px) {
    .leh-carousel-arrow-prev { left: -12px; }
    .leh-carousel-arrow-next { right: -12px; }
}

@media (max-width: 767px) {
    /* En-tête mobile compact */
    html body .leh-services-wrapper .leh-services-header {
        margin-bottom: 32px !important;
    }
    html body .leh-services-wrapper .leh-services-pretitle {
        font-size: 11px !important;
        letter-spacing: 2px !important;
        padding: 0 24px !important;
    }
    html body .leh-services-wrapper .leh-services-pretitle::before,
    html body .leh-services-wrapper .leh-services-pretitle::after {
        width: 16px !important;
    }
    html body .leh-services-wrapper .leh-services-title {
        font-size: clamp(24px, 6vw, 32px) !important;
    }
    html body .leh-services-wrapper .leh-services-subtitle {
        font-size: 14px !important;
    }

    /* Grille mobile */
    html body .leh-services-wrapper .leh-services-grid {
        gap: 16px !important;
    }

    /* Cards mobile - le padding va sur .leh-service-content, pas sur .leh-service-card */
    html body .leh-services-wrapper .leh-service-card {
        min-height: auto !important;
    }
    html body .leh-services-wrapper .leh-service-content {
        padding: 24px 22px !important;
    }
    html body .leh-services-wrapper .leh-service-card[data-image-layout="top-badge"] .leh-service-content {
        padding-top: 40px !important;
    }
    html body .leh-services-wrapper .leh-service-card[data-image-layout="icon-only"] .leh-service-content {
        padding-top: 28px !important;
    }

    /* Image en haut : hauteur réduite sur mobile */
    html body .leh-services-wrapper .leh-service-image-top {
        height: 180px !important;
    }
    /* Mode background : un peu plus haute pour conserver l'effet immersif */
    html body .leh-services-wrapper .leh-service-card[data-image-layout="background"] {
        min-height: 320px !important;
    }

    /* Icône wrapper (mode icon-only et top-icon) */
    html body .leh-services-wrapper .leh-service-icon-wrapper,
    html body .leh-services-wrapper .leh-service-image-wrapper {
        width: 64px !important;
        height: 64px !important;
        min-width: 64px !important;
        min-height: 64px !important;
        max-width: 64px !important;
        max-height: 64px !important;
        flex: 0 0 64px !important;
        margin-bottom: 18px !important;
    }
    /* Sauf top-icon qui garde son chevauchement */
    html body .leh-services-wrapper .leh-service-card[data-image-layout="top-icon"] .leh-service-icon-wrapper {
        margin-top: -32px !important;
        width: 64px !important;
        height: 64px !important;
        min-width: 64px !important;
        min-height: 64px !important;
        max-width: 64px !important;
        max-height: 64px !important;
    }
    /* Badge icône sur mobile */
    html body .leh-services-wrapper .leh-service-icon-badge {
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        min-height: 52px !important;
        bottom: -22px !important;
        left: 22px !important;
    }
    html body .leh-services-wrapper .leh-service-icon-badge .leh-service-icon {
        font-size: 20px !important;
    }
    html body .leh-services-wrapper .leh-service-icon-badge .leh-service-icon svg {
        width: 20px !important;
        height: 20px !important;
    }

    html body .leh-services-wrapper .leh-service-icon {
        font-size: 28px !important;
    }
    html body .leh-services-wrapper .leh-service-icon svg {
        width: 28px !important;
        height: 28px !important;
    }

    html body .leh-services-wrapper .leh-service-title {
        font-size: 19px !important;
    }
    html body .leh-services-wrapper .leh-service-description {
        font-size: 14px !important;
    }

    /* Carrousel mobile : flèches masquées, swipe à la place */
    html body .leh-services-wrapper .leh-carousel-arrow {
        display: none !important;
    }

    html body .leh-services-wrapper .leh-services-carousel {
        --leh-gap: 16px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Grille mobile : aussi du padding latéral pour ne pas coller aux bords */
    html body .leh-services-wrapper .leh-services-grid {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* ---------- ACCESSIBILITÉ ---------- */
@media (prefers-reduced-motion: reduce) {
    .leh-service-card,
    .leh-service-icon-wrapper,
    .leh-service-image-wrapper,
    .leh-service-icon,
    .leh-service-glow,
    .leh-services-carousel-track,
    .leh-carousel-arrow,
    .leh-carousel-dot,
    .leh-service-devis-btn,
    .leh-service-savoir-plus {
        transition: none !important;
        animation: none !important;
    }
    .leh-service-card:hover {
        transform: none !important;
    }
}
