/* Blocs promotionnels - S'adapte aux grilles existantes */
.wcpb-promo-block {
    position: relative;
    text-align: center;
    list-style: none !important;
    /* Hérite des styles de .product du thème */
}

/* Bloc carré (1 emplacement) - même taille qu'un produit */
.wcpb-square-block {
    /* S'adapte automatiquement à la taille des produits */
}

/* Conteneur de l'image */
.wcpb-promo-block .wcpb-image-container {
    position: relative;
    background: #f2f2f2;
    overflow: hidden;
    border-radius: 0.4em;
}

/* Images pour bloc carré - ratio 1:1 comme les produits */
.wcpb-square-block .wcpb-image-container {
    width: 100%;
    padding-bottom: 100%; /* Ratio 1:1 */
    position: relative;
}

.wcpb-square-block .wcpb-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Texte du bloc - imite les titres de produits */
.wcpb-promo-block .wcpb-block-title {
    font-size: 1em !important;
    margin: -1em -9em 0em 0em !important;
    line-height: 1.5em !important;
    font-family: arial !important;
    background-color: transparent !important;
}

/* Lien du bloc */
.wcpb-promo-block .wcpb-block-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.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;
}

/* 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);
    }
}

/* ======================================
   BLOCS RECTANGLES (2 colonnes)
   ====================================== */

/* Bloc rectangle paysage */
.wcpb-rectangle-block {
    display: flex;
    flex-direction: row;
    text-align: left;
}

/* Sur les grandes résolutions où les produits font 19% ou 24% */
@media (min-width: 1281px) {
    .wcpb-rectangle-block {
        /* 2 colonnes = 2 * 24% + margin */
        width: 49% !important;
    }
}

/* Sur les résolutions moyennes où les produits font 32% */
@media (min-width: 1025px) and (max-width: 1280px) {
    .wcpb-rectangle-block {
        /* 2 colonnes = 2 * 32% + margin */
        width: 66% !important;
    }
}

/* Images pour bloc rectangle */
.wcpb-rectangle-block .wcpb-image-container {
    flex: 1.5;
    background: #f2f2f2;
    min-height: 250px;
    position: relative;
}

.wcpb-rectangle-block .wcpb-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* Sans texte : l'image occupe tout le bloc */
.wcpb-rectangle-block.wcpb-no-text .wcpb-image-container {
    flex: 1;
}

/* Zone de texte du rectangle */
.wcpb-rectangle-block .wcpb-block-title {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    text-align: center;
}

/* ======================================
   RESPONSIVE
   ====================================== */

/* Tablettes et moins - cacher les rectangles */
@media (max-width: 1024px) {
    .wcpb-hide-mobile,
    .wcpb-rectangle-block {
        display: none !important;
    }
}

/* Mobile petit écran */
@media (max-width: 640px) {
    .wcpb-promo-block {
        /* Sur mobile en 1 colonne, le bloc prend toute la largeur */
        width: 95% !important;
    }
}