/* Blocs promotionnels */
.wcpb-promo-block {
    position: relative;
    text-align: center;
    height: 100%;
}

/* Bloc carré (1 emplacement) */
.wcpb-square-block {
    /* S'adapte automatiquement à la grille WooCommerce */
}

/* Bloc rectangle (2 emplacements) */
.wcpb-rectangle-block {
    grid-column: span 2;
    display: flex;
    flex-direction: row;
    text-align: left;
}

/* Conteneur de l'image */
.wcpb-promo-block .wcpb-image-container {
    position: relative;
    background: #f2f2f2;
    overflow: hidden;
}

/* Images pour bloc carré */
.wcpb-square-block .wcpb-image-container {
    width: 100%;
    padding-bottom: 100%; /* Ratio 1:1 */
}

.wcpb-square-block .wcpb-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Images pour bloc rectangle */
.wcpb-rectangle-block .wcpb-image-container {
    flex: 1.5;
    background: #f2f2f2;
    min-height: 250px;
}

.wcpb-rectangle-block .wcpb-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Texte du bloc */
.wcpb-promo-block .wcpb-block-title {
    font-size: inherit !important;
    margin: 0.5em 0 !important;
    line-height: 1.4 !important;
    /* Imite le style des titres de produits WooCommerce */
}

/* Bloc rectangle - zone de texte */
.wcpb-rectangle-block .wcpb-block-title {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    text-align: center;
}

/* Lien du bloc */
.wcpb-promo-block .wcpb-block-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.wcpb-promo-block .wcpb-block-link:hover .wcpb-block-title {
    color: #0073aa;
}

/* Effet hover sur l'image */
.wcpb-promo-block .wcpb-image-container:hover img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Cacher les blocs rectangles sur mobile */
@media (max-width: 768px) {
    .wcpb-hide-mobile {
        display: none !important;
    }
}

/* Intégration avec les grilles WooCommerce */
.woocommerce ul.products {
    display: grid;
    grid-gap: 20px;
}

.woocommerce ul.products.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.woocommerce ul.products.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.woocommerce ul.products.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.woocommerce ul.products.columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Responsive pour tablettes */
@media (max-width: 992px) {
    .woocommerce ul.products.columns-5,
    .woocommerce ul.products.columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .woocommerce ul.products.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Responsive pour mobile */
@media (max-width: 576px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 10px;
    }
    
    /* S'assurer que les blocs rectangles sont cachés */
    .wcpb-rectangle-block {
        display: none !important;
    }
}

/* Style cohérent avec WooCommerce */
.wcpb-promo-block {
    background: transparent;
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

/* Ajustements pour Storefront et autres thèmes populaires */
.storefront-full-width-content .wcpb-promo-block .wcpb-block-title {
    font-family: inherit;
}

/* Animation d'apparition */
.wcpb-promo-block {
    animation: wcpbFadeIn 0.5s ease-out;
}

@keyframes wcpbFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}