/* Box Cards Container */
.box-cards-container {
    display: grid;
    /* Use fixed-width tracks with auto-fit so incomplete last row can be centered */
    grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    justify-content: center; /* Center the grid when the row is not full */
}

/* Individual Box Card */
.box-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    /* Ensure the card stretches to the full height of its grid area */
    height: 100%;
}

.box-card:hover {
    border-color: #d0d0d0;
}

/* Box Card Image */
.box-card-image {
    width: 100%;
    background: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: 250px;
}

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

/* Box Card Content */
.box-card-content {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 15px;
    /* Make content grow to fill the card so we can stick the footer at the bottom */
    flex: 1 1 auto;
}

/* Bottom section that holds bottles count and price; anchored at the bottom */
.box-card-bottom {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto; /* Stick this section to the bottom of the card */
}

/* Box Card Title */
.box-card-title {
    font-family: 'Coming Soon', cursive;
    font-size: 24px;
    color: #951961;
    margin: 0;
    text-transform: uppercase;
    font-weight: 400;
    line-height: 1.3;
}

/* Box Card Description */
.box-card-description {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    color: #666;
}

/* Bottles count pill */
.box-card-bottom .bottles-count,
.bottles-count {
    display: inline-flex;
    align-items: center;
    background: #f0f0f0;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    width: fit-content;
}

.box-card-bottom .bottles-count::before,
.bottles-count::before {
    content: "🍷";
    margin-right: 6px;
}

/* Box Card Price */
.box-card-price {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-family: 'Roboto', sans-serif;
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.box-card-price .price-amount {
    font-size: 32px;
    font-weight: 700;
    color: #951961;
}

.box-card-price .price-currency {
    font-size: 24px;
    font-weight: 700;
    color: #951961;
}

.box-card-price .price-details {
    font-size: 14px;
    color: #666;
    margin-left: 5px;
}

/* Box Card Actions */
.box-card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.box-card-actions .btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-family: 'Coming Soon', cursive;
    font-size: 16px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.box-card-actions .btn-subscribe {
    background-color: #951961;
    color: #ffffff;
}

.box-card-actions .btn-subscribe:hover {
    background-color: #7a0f4c;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(149, 25, 97, 0.45);
}

.box-card-actions .btn-offrir {
    background-color: #66cccc;
    color: #ffffff;
}

.box-card-actions .btn-offrir:hover {
    background-color: #4db8b8;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(102, 204, 204, 0.45);
}

/* Responsive Design pour Tablettes */
@media (min-width: 768px) {
    /* Grid columns handled by auto-fit; no override needed to preserve centering */
    /*
    .box-card {
        flex-direction: row;
    }
    */

    /*
    .box-card-image {
        width: 300px;
        min-height: auto;
        flex-shrink: 0;
    }
    */

    .box-card-content {
        flex: 1;
        padding: 30px;
    }

    /*
    .box-card-actions {
        flex-direction: row;
    }
    */

    .box-card-actions .btn-action {
        flex: 1;
    }
}

/* Responsive Design pour Desktop */
@media (min-width: 992px) {
    /* Keep auto-fit to allow centering of the last row; max 3 columns naturally due to track width and container max-width */
    /*
    .box-card-image {
        width: 350px;
    }
    */

    .box-card-title {
        font-size: 28px;
    }

    .box-card-description {
        font-size: 18px;
    }

    .box-card-price .price-amount {
        font-size: 36px;
    }

    .box-card-actions .btn-action {
        font-size: 18px;
        padding: 14px 28px;
    }
}

/* Animation au chargement */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.box-card {
    animation: fadeInUp 0.5s ease-out;
}

.box-card:nth-child(1) { animation-delay: 0.1s; }
.box-card:nth-child(2) { animation-delay: 0.2s; }
.box-card:nth-child(3) { animation-delay: 0.3s; }
.box-card:nth-child(4) { animation-delay: 0.4s; }
