/* CSS pour le masonry dynamique */
.needs-masonry {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 160px;
    gap: 20px;
    margin: 20px 0;
}

/* Different card sizes for masonry effect */
.need-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.need-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Hero card - takes 2x2 space */
.need-card.hero {
    grid-column: span 2;
    grid-row: span 2;
}

/* Wide card - takes 2x1 space */
.need-card.wide {
    grid-column: span 2;
    grid-row: span 1;
}

/* Tall card - takes 1x2 space */
.need-card.tall {
    grid-column: span 1;
    grid-row: span 2;
}

/* Regular card - takes 1x1 space */
.need-card.regular {
    grid-column: span 1;
    grid-row: span 1;
}

/* Visual overlay for better text readability */
.need-card-visual {
    position: relative;
    flex: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 120px;
}

.need-card-visual::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.4) 100%);
    z-index: 1;
}

.need-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    color: white;
    z-index: 2;
}

.need-card.hero .need-card-content {
    padding: 30px;
}

.need-card-title {
    font-size: 1.2em;
    margin-bottom: 8px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    line-height: 1.1;
    color: var(--black)
}

.need-card.hero .need-card-title {
    font-size: 1.6em;
    margin-bottom: 12px;
}

.need-card-description {
    font-size: 0.9em;
    line-height: 1.4;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    color: var(--black)
}

.need-card.hero .need-card-description {
    font-size: 1em;
    line-height: 1.5;
}

.need-card.regular .need-card-description {
    display: none;
}

.need-card-footer {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2;
}

.need-solutions-badge {
    background-color: rgba(255,255,255,0.9);
    color: #333;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* Cartes featured - Effet subtil et élégant */
.need-card.featured {
    /* Ombre plus prononcée pour "flotter" au-dessus des autres */
    box-shadow:
            0 8px 25px rgba(0,0,0,0.15),
            0 3px 10px rgba(0,0,0,0.1),
            0 0 0 1px rgba(123, 179, 66, 0.1); /* Bordure verte très subtile */

    /* Légère élévation permanente */
    transform: translateY(-4px);

    /* Priorité d'affichage pour passer au-dessus au hover */
    z-index: 2;

    /* Transition plus fluide */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.need-card.featured:hover {
    /* Ombre encore plus prononcée au hover */
    box-shadow:
            0 15px 40px rgba(0,0,0,0.2),
            0 6px 15px rgba(0,0,0,0.1),
            0 0 0 2px rgba(123, 179, 66, 0.2);

    /* Plus d'élévation au hover */
    transform: translateY(-12px);

    /* Z-index plus élevé au hover */
    z-index: 10;
}

/* Badge "En vedette" discret */
.need-card.featured::before {
    content: "★";
    position: absolute;
    top: 12px;           /* Position par rapport à la carte, pas au footer */
    left: 12px;          /* En haut à gauche */
    background: linear-gradient(135deg, #7CB342, #8BC34A);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 1px solid white;
}

/* Animation pulse très subtile pour attirer l'œil */
.need-card.featured {
    animation: featured-glow 4s ease-in-out infinite;
}

@keyframes featured-glow {
    0%, 100% {
        box-shadow:
                0 8px 25px rgba(0,0,0,0.15),
                0 3px 10px rgba(0,0,0,0.1),
                0 0 0 1px rgba(123, 179, 66, 0.1);
    }
    50% {
        box-shadow:
                0 8px 25px rgba(0,0,0,0.15),
                0 3px 10px rgba(0,0,0,0.1),
                0 0 0 1px rgba(123, 179, 66, 0.25),
                0 0 20px rgba(123, 179, 66, 0.1);
    }
}

/* Arrêter l'animation au hover */
.need-card.featured:hover {
    animation: none;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .needs-masonry {
        grid-template-columns: repeat(3, 1fr);
    }

    .need-card.hero {
        grid-column: span 2;
        grid-row: span 2;
    }
}

@media (max-width: 768px) {
    .needs-masonry {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 140px;
    }

    .need-card.hero,
    .need-card.wide,
    .need-card.tall {
        grid-column: span 2;
        grid-row: span 1;
    }

    .need-card.featured {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
    }

    .need-card.featured:hover {
        transform: translateY(-6px);
        box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    }

    .need-card.featured {
        animation: none; /* Pas d'animation sur mobile */
    }
}

@media (max-width: 480px) {
    .needs-masonry {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .need-card {
        grid-column: span 1;
        grid-row: span 1;
    }
}


.formule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    padding: 0.5rem;
}

.formuleItemBox {
    border: 1px solid #DDDDDD;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
}

.formule-title {
    font-size: 1rem;
    padding: 0.75rem;
    margin: 0;
    line-height: 1.2;
    font-weight: normal;
    text-align: center;
}

.formule-item-footer{
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 1rem;
}

.formule-select-button {
    background: #697386FF;
    width: 100%;
    padding: 0.5rem;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
    font-weight: bold;
}

.formule-unit{
    font-size: 0.75rem;
}


