/* ==========================================================================
   1. WRAPPER GLOBAL ET APLAT (MÉCANIQUE BOOMERANG)
   ========================================================================== */

.glameeto-section-cards-wrapper {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 260px 0;
    min-height: 500px;
    transition: background-color 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
}

/* L'APLAT H3 ABSOLU */
.boomerang-section-title-aplat {
    position: absolute;
    top: 0;
    width: 480px;
    height: 50%;
    background: #1e1e1e;
    padding: 80px 45px;
    box-sizing: border-box;
    z-index: 2;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.context-align-left .boomerang-section-title-aplat { left: 100px; }
.context-align-right .boomerang-section-title-aplat { right: 100px; }

.boomerang-section-title-aplat.scroll-visible {
    transform: translateY(0);
    opacity: 1;
}

.boomerang-section-title-aplat .section-main-title {
    font-size: 34px;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.2;
    text-transform: uppercase;
    margin: 0 0 15px 0;
}

.boomerang-section-title-aplat .section-subtitle {
    color: #ffffff;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* Conteneur centré intérieur */
.glameeto-cards-section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 5;
}

/* Gestion de l'alignement flexbox pour pousser le slider à droite ou gauche */
.context-align-left .cards-stack-layout { flex-direction: row; }
.context-align-right .cards-stack-layout { flex-direction: row-reverse; }

.cards-stack-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Cet élément remplace ton ancienne "cards-stack-intro" pour laisser la place à l'aplat au-dessus */
.cards-stack-spacer {
    flex: 0 0 400px;
    width: 400px;
}


/* ==========================================================================
   2. GLAMEETO - CARDS STACK COMPONENT (ORIGINAL EXACTEMENT PRÉSERVÉ)
   ========================================================================== */

/* Container de la pile */
.cards-stack-container {
    width: 500px;
    position: relative;
    height: 450px;
}

/* LE REPERTOIRE DE LA PILE : Configuration 3D identique au CodePen */
.cards-articles {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    height: 400px; 
    perspective: 1000px;
    perspective-origin: 50% -50%;
}

/* Les Cartes */
.stack-li {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    margin: auto;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.5s ease;
    opacity: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Animation de sortie (go-away) au clic sur Suivant */
.stack-li.go-away {
    opacity: 0;
    top: 600px;
    transform: rotateX(10deg) !important;
    pointer-events: none;
}

/* Image de la carte */
.card-image {
    width: 100%;
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f4f4f4;
}

.card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Contenu textuel de la carte */
.card-content {
    height: 50%;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    position: relative;
    background: #fff;
    transition: all 0.5s ease;
}

.stack-li.open .card-content {
    height: 100%;
    top: 0;
}

.eyebrow-title {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8em;
    margin-bottom: 5px;
}

.card-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.25em;
}

/* NAVIGATION VERTICALE COLLÉE ET PLACÉE COMME SUR CODEPEN */
.stack-navigation {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.context-align-right .stack-navigation {
    right: auto;
    left: -25px;
}   

.stack-navigation button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    transform: rotate(90deg); 
}

.stack-navigation button:hover:not(:disabled) {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.stack-navigation button:disabled {
    background: #f5f5f5;
    border-color: #eee;
    color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==========================================================================
   VERSION MOBILE (EFFACEMENT DE L'APLAT ET MAXIMISATION DE L'ESPACE)
   ========================================================================== */

@media (max-width: 991px) {
    .glameeto-section-cards-wrapper {
        padding: 40px 0 !important;
        min-height: auto;
    }

    /* Masquage complet de l'aplat et de ses textes */
    .glameeto-section-cards-wrapper .boomerang-section-title-aplat {
        display: none !important;
    }

    .glameeto-cards-section-inner {
        margin-top:30px;
    }

    .cards-stack-layout {
        flex-direction: column !important;
        gap: 0;
    }

    /* Suppression de l'espace réservé à l'aplat */
    .cards-stack-spacer {
        display: none !important;
    }

    /* Changement de la largeur fixe à 90% pour le format mobile + padding top 30px */
    .cards-stack-container {
        width: 90% !important;
        max-width: 500px;
        margin: 0 auto;
        padding-top: 30px !important;
    }

    /* Rapprochement des flèches sur mobile */
    .stack-navigation {
        right: 0px !important;
    }
    .context-align-right .stack-navigation {
    right: auto;
    left: 0px !important;
    }   
}