/* ======================================
   SECTION ATELIER - STYLES COMPLETS
   ====================================== */

/* Container principal de la section */
.atelier-section {
    text-align: center;
    max-width: 100vw;
    width: 100%;
    padding: var(--spacing-2xl) 0;
    overflow: hidden; /* NOUVEAU : Empêche le scroll horizontal */
    background: var(--color-blue-gradient);
}

/* Titre de la section */
.atelier-title {
    font-size: var(--font-size-5xl);
    color: var(--color-white);
    margin-bottom: var(--spacing-3xl);
    text-shadow: var(--text-shadow-md);
    font-weight: var(--font-weight-light);
    letter-spacing: var(--letter-spacing-wide);
}

/* Container des cartes */
.cards-container {
    position: relative;
    height: 80vh; /* Hauteur dynamique selon viewport */
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1500px;
    margin: 0 auto;
    overflow: hidden; /* NOUVEAU : Coupe les cartes qui dépassent */
}

/* ======================================
   CARTES - STYLES DE BASE
   ====================================== */

.card {
    position: absolute;
    width: 200px;
    height: 300px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    transition: all 0.4s var(--ease-out);
    transform-origin: bottom center;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 70%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-5xl);
    color: var(--color-white);
    text-shadow: var(--text-shadow-md);
}

.card-content {
    padding: var(--spacing-md);
    height: 30%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
}

.card-desc {
    font-size: var(--font-size-base);
}



.card-price {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-red-primary);
    margin-bottom: var(--spacing-sm);
}

.card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.chip {
    background: var(--color-blue-primary);
    color: var(--color-white);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

/* ======================================
   CONTRÔLES SLIDER (MOBILE)
   ====================================== */

.slider-controls {
    display: none;
}

.slider-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--color-gray-800);
    color: var(--color-white);
    border: none;
    font-size: var(--font-size-3xl);
    cursor: pointer;
    transition: var(--transition-all);
    box-shadow: var(--shadow-lg);
}

.slider-btn:hover {
    background: var(--color-blue-primary);
    transform: scale(1.1);
}

.slider-dots {
    display: flex;
    gap: var(--spacing-sm);
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-gray-600);
    cursor: pointer;
    transition: var(--transition-all);
}

.slider-dot.active {
    background: var(--color-blue-primary);
    transform: scale(1.3);
}

/* ======================================
   NODAL_CARD - Nouveau Design
   ====================================== */

.nodal_card {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
    overflow-y: auto;
}

.nodal_card.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.nodal_card-content {
    display: grid;
    grid-template-columns: 32% 32% 32%;
    gap: 10px;
    background: var(--modal-bg-color, #f5f5f5);
    border-radius: 20px;
    overflow: hidden;
    max-width: 1400px;
    width: 100%;
    height: 90vh;
    position: relative;
    padding: 20px;
    animation: slideIn 0.4s var(--ease-bounce);
}

/* ========== COLONNE 1 ========== */
.nodal_card-col1 {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.nodal_card-slogan {
    height: 30%;
    background: linear-gradient(135deg, rgba(0,0,0,0.1), rgba(0,0,0,0.1)); 
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.nodal_card-carousel {
    height: 70%;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    background: #000;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    background-size: cover;
    background-position: center;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: white;
    padding: 30px 20px 20px;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ========== COLONNE 2 ========== */
.nodal_card-col2 {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.nodal_card-header {
    height: 10%;
    background: white;
    border-radius: 15px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.nodal_card-title {
    font-size: 1.8rem;
    color: var(--color-text-primary, #333);
    font-weight: 600;
    margin: 0;
}

.close-nodal_card {
    background: #ff4444;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-nodal_card:hover {
    background: #cc0000;
    transform: rotate(90deg);
}

.nodal_card-main-image {
    height: 70%;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.nodal_card-main-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: white;
    padding: 40px 20px 20px;
    font-size: 1rem;
    line-height: 1.5;
}

.nodal_card-bottom-block {
    height: 20%;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nodal_card-bottom-text {
    position: relative;
    z-index: 2;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    padding: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.nodal_card-bottom-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1;
}

/* ========== COLONNE 3 ========== */
.nodal_card-col3 {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.nodal_card-colored-block {
    height: 60%;
    background: var(--accent-color, #4a90e2);
    border-radius: 15px;
    padding: 20px;
    color: var(--color-text-primary);
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.nodal_card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nodal_card-chip {
    background: rgba(255,255,255,0.25);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border-width: 1px;
}

.nodal_card-explanation {
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
}

.nodal_card-footer-block {
    height: 40%;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    padding: 15px;
}

.nodal_card-footer-image {
    width: 100%;
    height: 70%;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    margin-bottom: 15px;
}

.nodal_card-contact-btn {
    background: #4a90e2;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74,144,226,0.3);
    display: inline-block;
}

.nodal_card-contact-btn:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74,144,226,0.4);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .nodal_card-content {
        grid-template-columns: 1fr;
        max-height: none;
        overflow-y: visible;
    }
    
    .nodal_card {
        align-items: flex-start;
    }
    
    .nodal_card-col1,
    .nodal_card-col2,
    .nodal_card-col3 {
        height: auto;
        min-height: 400px;
    }
    
    .nodal_card-slogan {
        height: 150px;
    }
    
    .nodal_card-carousel {
        height: 350px;
    }
    
    .nodal_card-header {
        height: auto;
        min-height: 60px;
    }
    
    .nodal_card-main-image {
        height: 400px;
    }
    
    .nodal_card-bottom-block {
        height: 120px;
    }
    
    .nodal_card-colored-block {
        height: auto;
        min-height: 300px;
    }
    
    .nodal_card-footer-block {
        height: auto;
        min-height: 250px;
    }
    
    .close-nodal_card {
        position: sticky;
        top: 10px;
        right: 10px;
        z-index: 100;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ======================================
   ANIMATIONS
   ====================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ======================================
   RESPONSIVE - MOBILE (max-width: 640px)
   ====================================== */

@media (max-width: 640px) {
    .atelier-title {
        font-size: var(--font-size-3xl);
        margin-bottom: var(--spacing-2xl);
    }

    .cards-container {
        height: 70vh; /* Garde la hauteur en vh aussi sur mobile */
        margin-bottom: var(--spacing-xl); /* Réduit l'espacement pour que les contrôles soient visibles */
        min-height: 300px; /* Hauteur minimum pour petits écrans */
    }

    /* Toutes les cartes cachées par défaut sur mobile */
    .card {
        width: 160px;
        height: 240px;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Carte active - centrée et surélevée */
    .card.active {
        opacity: 1;
        pointer-events: auto;
        transform: translate(-50%, -70%) rotate(0deg) scale(1.15);
        z-index: 20;
        box-shadow: var(--shadow-intense);
    }

    /* Carte suivante - visible à droite avec rotation */
    .card.next {
        opacity: 1;
        pointer-events: none;
        transform: translate(-10%, -50%) rotate(12deg) scale(0.85);
        z-index: 10;
    }

    /* Carte précédente - visible à gauche avec rotation */
    .card.prev {
        opacity: 1;
        pointer-events: none;
        transform: translate(-90%, -50%) rotate(-12deg) scale(0.85);
        z-index: 10;
    }

    /* Deuxième carte à droite - NOUVELLE POSITION AJUSTÉE */
    .card.next-2 {
        opacity: 0.7;
        pointer-events: none;
        transform: translate(30%, -45%) rotate(20deg) scale(0.75);
        z-index: 5;
    }

    /* Deuxième carte à gauche - NOUVELLE POSITION AJUSTÉE */
    .card.prev-2 {
        opacity: 0.7;
        pointer-events: none;
        transform: translate(-130%, -45%) rotate(-20deg) scale(0.75);
        z-index: 5;
    }

    /* SUPPRIMÉ : prev-3 et next-3 n'existent plus */

    /* Annuler les effets hover sur mobile */
    .card:hover {
        transform: translate(-50%, -50%);
    }

    .card.active:hover {
        transform: translate(-50%, -70%) rotate(0deg) scale(1.15);
    }

    /* Contrôles slider visibles sur mobile */
    .slider-controls {
        display: flex !important;
        justify-content: center;
        align-items: center;
        gap: var(--spacing-lg);
        margin-top: var(--spacing-xl); /* Espacement depuis le container */
        padding-bottom: var(--spacing-2xl); /* Espace en bas pour éviter qu'ils soient coupés */
        position: relative;
        z-index: 50;
    }

    .slider-btn {
        background: var(--color-white);
        color: var(--color-blue-primary);
        width: 50px;
        height: 50px;
        font-size: var(--font-size-2xl);
        font-weight: var(--font-weight-bold);
    }

    .slider-btn:active {
        transform: scale(0.9);
        background: var(--color-blue-primary);
        color: var(--color-white);
    }

    .slider-dot {
        width: 10px;
        height: 10px;
        background: rgba(255,255,255,0.4);
    }

    .slider-dot.active {
        background: var(--color-white);
        width: 30px;
        border-radius: var(--radius-sm);
    }

    /* Nodal_card mobile */
    .nodal_card-content {
        grid-template-columns: 1fr;
        grid-template-rows: 200px auto auto auto auto auto;
        grid-template-areas: 
            "card"
            "title"
            "price"
            "description"
            "images"
            "footer";
        max-width: 95%;
        gap: var(--spacing-md);
        overflow-y: auto;
    }

    .nodal_card-card {
        height: 200px;
    }

    .nodal_card-images {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        height: 200px;
    }
}

/* ======================================
   RESPONSIVE - TABLETTE (641px - 1023px)
   ====================================== */

@media (min-width: 641px) and (max-width: 1023px) {
    /* Les positions sont appliquées dynamiquement via JavaScript */
    /* Pas besoin de nth-child statiques ! */
    
    .nodal_card-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas: 
            "card"
            "title"
            "price"
            "description"
            "images"
            "footer";
        overflow-y: auto;
    }
}

/* ======================================
   RESPONSIVE - DESKTOP (1024px+)
   ====================================== */

@media (min-width: 1024px) {
    /* Les positions sont appliquées dynamiquement via JavaScript */
    /* Pas besoin de nth-child statiques ! */
}