/**
 * Styles pour la homepage générée par WooCommerce Shop Builder
 * 
 * @package WC_Shop_Builder
 */

/* ============================================
   HERO SECTION
   ============================================ */
.wcsb-hero-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.wcsb-hero-section .wp-block-cover__inner-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  z-index: 2;
}

.wcsb-hero-title {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  margin-bottom: 0;
}

.wcsb-hero-subtitle {
  color: #ffffff;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

/* Bouton primaire Hero (blanc sur fond sombre) */
.wcsb-hero-cta .wcsb-cta-primary .wp-block-button__link {
  background: #ffffff;
  color: #000000;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: none;
}

.wcsb-hero-cta .wcsb-cta-primary .wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  background: #f0f0f0;
}

/* ============================================
   SECTION TITLES
   ============================================ */
.wcsb-section-title {
  color: #1a1a1a;
  line-height: 1.2;
  margin-bottom: 60px;
}

/* ============================================
   CATEGORIES GRID
   ============================================ */
.wcsb-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 0;
}

.wcsb-category-card-wrapper {
  padding: 0;
}

.wcsb-category-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.wcsb-category-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* ============================================
   PAGE BOUTIQUE - Styles pour les catégories
   ============================================ */

/* Styliser le header WooCommerce de la page boutique */
.woocommerce-products-header {
  text-align: center;
  margin: 60px 0 30px 0; /* Réduit le margin-bottom pour plus d'espace avec le contenu */
}

/* H1 de la page boutique - Laisse le thème gérer le style par défaut */
.woocommerce-products-header__title.page-title {
  /* Suppression des !important - le H1 aura le même style que les pages catégories */
}

/* Conteneur du contenu de la page boutique (après le header) */
.woocommerce-shop-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 60px auto;
  padding: 0 30px; /* Augmenté de 20px à 30px pour éviter que les cards touchent les bords */
  box-sizing: border-box; /* Important pour éviter l'overflow */
}

/* Conteneur principal de la grille */
.wcsb-shop-categories-grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  width: 100%;
  margin: 0 0 60px 0; /* Ajout de margin-bottom pour espacer de la description */
  padding: 0;
}

/* Cards wrapper */
.wcsb-shop-category-card-wrapper {
  width: 100%;
  padding: 0;
  margin: 0;
  position: relative;
  box-sizing: border-box; /* Évite l'overflow sur les petits écrans */
}

/* Cards carrées avec image en background */
.wcsb-shop-category-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 250px; /* Réduit de 300px à 250px pour le responsive */
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background-size: cover;
  background-position: center;
}

.wcsb-shop-category-card-cover:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Image de la card (cachée mais nécessaire pour le SEO et fallback) */
.wcsb-shop-category-card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}

/* Overlay noir semi-transparent */
.wcsb-shop-category-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

/* Container du contenu (titre centré) */
.wcsb-shop-category-card-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center;
  width: 100%;
  padding: 20px;
}

/* Titre de la catégorie */
.wcsb-shop-category-title {
  color: #ffffff !important;
  font-size: clamp(20px, 3vw, 28px) !important;
  font-weight: 700 !important;
  margin: 0 !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Lien overlay sur toute la card */
.wcsb-shop-category-link-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  text-decoration: none;
  cursor: pointer;
}

/* ============================================
   PRODUCT COLLECTIONS
   ============================================ */
.wcsb-featured-products,
.wcsb-category-products {
  margin-top: 0;
}

/* Cards produits - style identique aux cards catégories */
.wcsb-featured-products .wc-block-grid__product,
.wcsb-category-products .wc-block-grid__product,
.wcsb-featured-products li.wc-block-product,
.wcsb-category-products li.wc-block-product {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 0;
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.wcsb-featured-products .wc-block-grid__product:hover,
.wcsb-category-products .wc-block-grid__product:hover,
.wcsb-featured-products li.wc-block-product:hover,
.wcsb-category-products li.wc-block-product:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Images produits */
.wcsb-featured-products .wc-block-components-product-image,
.wcsb-category-products .wc-block-components-product-image {
  width: 100%;
  margin: 0;
  padding: 0;
  display: block;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.wcsb-featured-products .wc-block-components-product-image a,
.wcsb-category-products .wc-block-components-product-image a {
  display: block;
  width: 100%;
  line-height: 0;
}

.wcsb-featured-products .wc-block-components-product-image img,
.wcsb-category-products .wc-block-components-product-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
  margin: 0;
}

.wcsb-featured-products
  .wc-block-grid__product:hover
  .wc-block-components-product-image
  img,
.wcsb-category-products
  .wc-block-grid__product:hover
  .wc-block-components-product-image
  img,
.wcsb-featured-products
  li.wc-block-product:hover
  .wc-block-components-product-image
  img,
.wcsb-category-products
  li.wc-block-product:hover
  .wc-block-components-product-image
  img {
  transform: scale(1.05);
}

/* Titre produit */
.wcsb-featured-products .wp-block-post-title,
.wcsb-category-products .wp-block-post-title {
  margin: 15px 15px 10px 15px;
  text-align: center;
}

.wcsb-featured-products .wp-block-post-title a,
.wcsb-category-products .wp-block-post-title a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.wcsb-featured-products .wp-block-post-title a:hover,
.wcsb-category-products .wp-block-post-title a:hover {
  color: #0073aa;
}

/* Prix produit */
.wcsb-featured-products .wc-block-components-product-price,
.wcsb-category-products .wc-block-components-product-price {
  margin: 0 15px 15px 15px;
  text-align: center;
}

/* Boutons produits */
.wcsb-featured-products .wc-block-components-product-button,
.wcsb-category-products .wc-block-components-product-button {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 15px 15px 15px;
  padding: 0;
  width: auto;
}

.wcsb-featured-products .wc-block-components-product-button__button,
.wcsb-category-products .wc-block-components-product-button__button,
.wcsb-featured-products .wp-block-button__link,
.wcsb-category-products .wp-block-button__link {
  min-width: 160px;
  width: auto;
  display: inline-block;
  text-align: center;
  padding: 12px 24px;
  white-space: nowrap;
  margin: 0 auto;
  border-radius: 6px;
  transition: all 0.3s ease;
}

/* ============================================
   BUTTONS CTA
   ============================================ */
.wcsb-view-all-link {
  margin-top: 30px;
}

/* Bouton secondaire */
.wcsb-cta-secondary .wp-block-button__link {
  background-color: var(--wcsb-button-secondary-bg);
  color: var(--wcsb-button-secondary-text, #ffffff);
  transition: all 0.3s ease;
  border: none;
}

.wcsb-cta-secondary .wp-block-button__link:hover {
  background-color: var(--wcsb-button-secondary-hover-bg);
  color: var(--wcsb-button-secondary-hover-text, #ffffff);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px
    color-mix(in srgb, var(--wcsb-button-secondary-bg) 40%, transparent);
}

/* Bouton Cover */
.wcsb-cta-cover .wp-block-button__link {
  background-color: var(--wcsb-button-primary-bg);
  color: var(--wcsb-button-primary-text, #ffffff);
  transition: all 0.3s ease;
  border: none;
}

.wcsb-cta-cover .wp-block-button__link:hover {
  background-color: var(--wcsb-button-primary-hover-bg);
  color: var(--wcsb-button-primary-hover-text, #ffffff);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px
    color-mix(in srgb, var(--wcsb-button-primary-bg) 40%, transparent);
}

/* Bouton Card */
.wcsb-cta-card .wp-block-button__link {
  background-color: var(--wcsb-button-primary-bg);
  color: var(--wcsb-button-primary-text, #ffffff);
  transition: all 0.3s ease;
  border: none;
}

.wcsb-cta-card .wp-block-button__link:hover {
  background-color: var(--wcsb-button-primary-hover-bg);
  color: var(--wcsb-button-primary-hover-text, #ffffff);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px
    color-mix(in srgb, var(--wcsb-button-primary-bg) 40%, transparent);
}

/* Fallback pour navigateurs sans color-mix */
@supports not (color-mix(in srgb, black, white)) {
  .wcsb-cta-secondary .wp-block-button__link:hover,
  .wcsb-cta-cover .wp-block-button__link:hover,
  .wcsb-cta-card .wp-block-button__link:hover {
    background-color: var(
      --wcsb-button-primary-hover-bg,
      var(--wcsb-primary-hover, #0578b8)
    );
  }
}

/* ============================================
   REASSURANCE SECTION
   ============================================ */
.wcsb-reassurance-section {
  background: #f9f9f9;
}

.wcsb-reassurance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-top: 0;
  align-items: stretch;
}

.wcsb-reassurance-item {
  text-align: center;
  padding: 20px;
  background: #ffffff;
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 200px;
  justify-content: center;
}

.wcsb-reassurance-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.wcsb-reassurance-icon {
  margin: 0;
  font-size: 56px;
  line-height: 1;
  flex-shrink: 0;
}

.wcsb-reassurance-title {
  margin: 0;
  color: #1a1a1a;
  flex-shrink: 0;
}

.wcsb-reassurance-desc {
  margin: 0;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   TEMPLATE PATTERNS
   ============================================ */

/* Cover catégorie "Découvrir" - Structure avec titre mobile + colonnes */
.wcsb-category-cover-wrapper {
  max-width: 1200px;
  margin: 60px auto;
}

.wcsb-category-cover {
  display: grid;
  gap: 24px;
  background: #ffffff;
  border-radius: 16px;
  padding: 40px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.3s ease, opacity 0.6s ease-out,
    transform 0.6s ease-out;
  opacity: 0;
  transform: translateY(20px);
}

.wcsb-category-cover-wrapper .wcsb-category-cover.wcsb-fade-in {
  opacity: 1;
  transform: translateY(0);
}

.wcsb-category-cover:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Mobile : ordre naturel du DOM (1 colonne) */
@media (max-width: 768px) {
  .wcsb-category-cover {
    grid-template-columns: 1fr;
  }
  
  .wcsb-category-cover-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }
  
  .wcsb-category-cover-content {
    padding: 0;
  }
}

/* Desktop : 2 colonnes avec grid-template-areas */
@media (min-width: 769px) {
  .wcsb-category-cover {
    grid-template-columns: 40% 60%;
    grid-template-areas:
      "image title"
      "image content";
    align-items: start;
    gap: 24px;
    row-gap: 12px; /* Réduire l'espace vertical entre title et content */
}

  .wcsb-category-cover-title {
    grid-area: title;
    margin: 0 0 8px; /* Réduire la marge bottom pour rapprocher du content */
  color: #1a1a1a;
    align-self: end; /* Colle le titre en bas de sa cellule grid */
}

.wcsb-category-cover-image {
    grid-area: image;
  display: flex;
  align-items: center;
  justify-content: center;
    min-width: 0; /* Évite l'overflow */
    max-width: 100%; /* Force la largeur max */
    width: 100%; /* Force la largeur à 100% de la cellule grid */
  }
  
  /* Forcer le figure Gutenberg à respecter la largeur */
  .wcsb-category-cover-image figure,
  .wcsb-category-cover-image figure.wp-block-image,
  .wcsb-category-cover-image figure.size-large {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  
  /* Annuler les styles Gutenberg qui interfèrent */
  .wcsb-category-cover-image figure.has-global-padding,
  .wcsb-category-cover-image figure.is-layout-constrained {
    padding: 0 !important;
    max-width: 100% !important;
}

.wcsb-category-cover-image img {
  width: 100%;
    max-width: 100%; /* Force la largeur max */
  height: auto;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
}

.wcsb-category-cover-image:hover img {
  transform: scale(1.03);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

  .wcsb-category-cover-content {
    grid-area: content;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 20px;
  }
  
  /* Inversion : image à droite */
  .wcsb-category-cover.is-reversed {
    grid-template-columns: 60% 40%; /* ⭐ Inverser les colonnes : 60% pour title/content, 40% pour image */
    grid-template-areas:
      "title image"
      "content image";
  }
}

/* Image + Texte - Structure avec grid */
.wcsb-image-text-block-wrapper {
  max-width: 1200px;
  margin: 60px auto;
}

.wcsb-image-text-block {
  display: grid;
  gap: 24px;
  align-items: stretch;
}

/* Mobile : ordre naturel du DOM (1 colonne) */
@media (max-width: 768px) {
  .wcsb-image-text-block {
    grid-template-columns: 1fr;
}

  .wcsb-image-text-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.wcsb-image-text-content {
    padding: 0;
  }
}

/* Desktop : 2 colonnes avec grid-template-areas */
@media (min-width: 769px) {
  .wcsb-image-text-block {
    grid-template-columns: 40% 60%;
    grid-template-areas:
      "image title"
      "image content";
    align-items: start;
    gap: 24px;
    row-gap: 12px; /* Réduire l'espace vertical entre title et content */
  }
  
  .wcsb-image-text-title {
    grid-area: title;
    margin: 0 0 8px; /* Réduire la marge bottom pour rapprocher du content */
    align-self: end; /* Colle le titre en bas de sa cellule grid */
  }
  
  .wcsb-image-text-image {
    grid-area: image;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0; /* Évite l'overflow */
    max-width: 100%; /* Force la largeur max */
    width: 100%; /* Force la largeur à 100% de la cellule grid */
  }
  
  /* Forcer le figure Gutenberg à respecter la largeur */
  .wcsb-image-text-image figure,
  .wcsb-image-text-image figure.wp-block-image,
  .wcsb-image-text-image figure.size-large {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  
  /* Annuler les styles Gutenberg qui interfèrent */
  .wcsb-image-text-image figure.has-global-padding,
  .wcsb-image-text-image figure.is-layout-constrained {
    padding: 0 !important;
    max-width: 100% !important;
}

.wcsb-image-text-image img {
  width: 100%;
    max-width: 100%; /* Force la largeur max */
  height: auto;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.wcsb-image-text-image:hover img {
  transform: scale(1.03);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

  .wcsb-image-text-content {
    grid-area: content;
    padding: 0 20px;
  }
  
  /* Inversion : image à droite */
  .wcsb-image-text-block.is-reversed {
    grid-template-columns: 60% 40%; /* ⭐ Inverser les colonnes : 60% pour title/content, 40% pour image */
    grid-template-areas:
      "title image"
      "content image";
  }
}

/* Texte + Images collage - Structure avec grid */
.wcsb-text-images-block-wrapper {
  max-width: 1200px;
  margin: 60px auto;
}

.wcsb-text-images-block {
  display: grid;
  gap: 24px;
  background: #ffffff;
  border-radius: 16px;
  padding: 40px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out,
    box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

.wcsb-text-images-block-wrapper .wcsb-text-images-block.wcsb-fade-in {
  opacity: 1;
  transform: translateY(0);
}

.wcsb-text-images-block:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Mobile : ordre naturel du DOM (1 colonne) */
@media (max-width: 768px) {
  .wcsb-text-images-block {
    grid-template-columns: 1fr;
}

  .wcsb-text-images-images {
    width: 100%;
}

.wcsb-text-images-content {
    padding: 0;
  }
}

/* Desktop : 2 colonnes avec grid-template-areas */
@media (min-width: 769px) {
  .wcsb-text-images-block {
    grid-template-columns: 50% 50%;
    grid-template-areas:
      "title images"
      "content images";
    align-items: start;
  }
  
  .wcsb-text-images-title {
    grid-area: title;
    margin: 0 0 0; /* Pas de margin-bottom */
  }
  
  .wcsb-text-images-images {
    grid-area: images;
    display: flex;
    align-items: center; /* Centrer verticalement les images */
    justify-content: center;
    align-self: center; /* Centrer verticalement dans sa zone grid */
  }
  
  .wcsb-text-images-content {
    grid-area: content;
  padding: 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  /* Inversion : images à gauche */
  .wcsb-text-images-block.is-reversed {
    grid-template-areas:
      "images title"
      "images content";
  }
  
  /* Les images restent centrées même inversé */
  .wcsb-text-images-block.is-reversed .wcsb-text-images-images {
    align-self: center;
  }
}

.wcsb-image-collage {
  position: relative;
  display: flex;
  gap: 0;
  align-items: flex-start;
  justify-content: center;
}

.wcsb-image-overlap-1 {
  position: relative;
  z-index: 2;
  flex: 0 0 50%; /* Réduit de 60% à 50% pour des images plus petites */
  transform: translateX(20px); /* Augmenté de 15px à 20px pour plus de chevauchement */
}

.wcsb-image-overlap-2 {
  position: relative;
  z-index: 1;
  flex: 0 0 50%; /* Réduit de 60% à 50% pour des images plus petites */
  margin-left: -45%; /* Augmenté de -40% à -45% pour plus de chevauchement */
  margin-top: 40px;
  transform: translateX(-20px); /* Augmenté de -15px à -20px pour plus de chevauchement */
}

.wcsb-image-overlap-1 img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
  border-radius: 12px;
  aspect-ratio: 4/3;
}

.wcsb-image-overlap-2 img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  aspect-ratio: 4/3;
}

.wcsb-image-collage:hover .wcsb-image-overlap-1 img,
.wcsb-image-collage:hover .wcsb-image-overlap-2 img {
  transform: scale(1.03);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* 4 Cards catégories */
.wcsb-category-cards-4 {
  margin: 60px 0;
}

.wcsb-category-card-4 {
  position: relative;
}

.wcsb-category-card-cover {
  min-height: 300px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wcsb-category-card-cover:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.wcsb-category-card-cover h2 {
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================
   INTRO TEXT
   ============================================ */
.wcsb-intro-text {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.wcsb-intro-title {
  margin-bottom: 20px;
}

.wcsb-intro-content {
  text-align: center;
  font-size: clamp(14px, 1.5vw, 18px);
  line-height: 1.5;
  padding-left: 5%;
  padding-right: 5%;
}

.wcsb-intro-content p {
  margin-bottom: 15px;
  font-size: clamp(14px, 1.5vw, 18px);
  line-height: 1.5;
}

.wcsb-intro-content p:last-child {
  margin-bottom: 0;
}

/* ============================================
   FINAL CTA
   ============================================ */
.wcsb-final-cta {
  margin: 80px 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.wcsb-final-cta.wcsb-fade-in {
  opacity: 1;
  transform: translateY(0);
}

.wcsb-final-cta h2,
.wcsb-final-cta h3,
.wcsb-final-cta p {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ============================================
   ANIMATIONS FADE-IN
   ============================================ */
.wcsb-section-title,
.wcsb-image-text-block,
.wcsb-category-cards-4 {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.wcsb-section-title.wcsb-fade-in,
.wcsb-image-text-block.wcsb-fade-in,
.wcsb-category-cards-4.wcsb-fade-in {
  opacity: 1;
  transform: translateY(0);
}

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

/* Mobile & Tablette - Scroll horizontal produits */
@media (max-width: 992px) {
  /* Scroll horizontal pour tous les produits */
  ul.products,
  .wcsb-featured-products .wc-block-grid,
  .wcsb-category-products .wc-block-grid,
  .wcsb-featured-products ul.products,
  .wcsb-category-products ul.products {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding: 10px 15px 20px 15px;
    margin: 0;
  }

  /* Scrollbar styling */
  ul.products::-webkit-scrollbar,
  .wcsb-featured-products .wc-block-grid::-webkit-scrollbar,
  .wcsb-category-products .wc-block-grid::-webkit-scrollbar,
  .wcsb-featured-products ul.products::-webkit-scrollbar,
  .wcsb-category-products ul.products::-webkit-scrollbar {
    height: 4px;
  }

  ul.products::-webkit-scrollbar-track,
  .wcsb-featured-products .wc-block-grid::-webkit-scrollbar-track,
  .wcsb-category-products .wc-block-grid::-webkit-scrollbar-track,
  .wcsb-featured-products ul.products::-webkit-scrollbar-track,
  .wcsb-category-products ul.products::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 2px;
  }

  ul.products::-webkit-scrollbar-thumb,
  .wcsb-featured-products .wc-block-grid::-webkit-scrollbar-thumb,
  .wcsb-category-products .wc-block-grid::-webkit-scrollbar-thumb,
  .wcsb-featured-products ul.products::-webkit-scrollbar-thumb,
  .wcsb-category-products ul.products::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
  }

  /* Largeur fixe produits pour scroll */
  ul.products li.product,
  .wcsb-featured-products .wc-block-grid__product,
  .wcsb-category-products .wc-block-grid__product,
  .wcsb-featured-products li.wc-block-product,
  .wcsb-category-products li.wc-block-product {
    flex: 0 0 280px;
    max-width: 280px;
    scroll-snap-align: start;
  }

  .wcsb-featured-products,
  .wcsb-category-products {
    overflow: hidden;
  }

  /* Scroll horizontal pour les catégories (4 cards) - PAS pour la page boutique */
  .wcsb-categories-grid,
  .wcsb-category-cards-4,
  .wcsb-category-cards-4.is-layout-flex,
  .wcsb-category-cards-4.wp-block-columns {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding: 10px 15px 20px 15px;
    margin: 0;
  }

  /* Page boutique : responsive - 2 colonnes sur tablette et mobile */
  .wcsb-shop-categories-grid-container {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
    padding: 0 15px !important;
  }

  /* Cards carrées en mobile aussi */
  .wcsb-shop-category-card-cover {
    min-height: 200px !important;
    aspect-ratio: 1 / 1 !important;
  }

  /* Cards wrapper - Prend toute la largeur de sa cellule */
  .wcsb-shop-category-card-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* Scrollbar styling pour catégories */
  .wcsb-categories-grid::-webkit-scrollbar,
  .wcsb-category-cards-4::-webkit-scrollbar {
    height: 4px;
  }

  .wcsb-categories-grid::-webkit-scrollbar-track,
  .wcsb-category-cards-4::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 2px;
  }

  .wcsb-categories-grid::-webkit-scrollbar-thumb,
  .wcsb-category-cards-4::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
  }

  /* Largeur fixe catégories pour scroll (pas pour page boutique) */
  .wcsb-categories-grid .wcsb-category-card-wrapper,
  .wcsb-category-cards-4 .wcsb-category-card-4,
  .wcsb-category-cards-4 .wp-block-column.wcsb-category-card-4,
  .wcsb-category-cards-4 .wcsb-category-card-4.is-layout-flow {
    flex: 0 0 280px !important;
    max-width: 280px !important;
    min-width: 280px !important;
    width: 280px !important;
    scroll-snap-align: start;
    flex-shrink: 0 !important;
    align-self: stretch;
  }

  /* Page boutique : responsive normal */
  .wcsb-shop-categories-grid-container .wcsb-shop-category-card-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  /* Scroll horizontal pour le blog */
  .wcsb-posts-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding: 10px 15px 20px 15px;
    margin: 0;
    grid-template-columns: none !important;
  }

  /* Scrollbar styling pour blog */
  .wcsb-posts-grid::-webkit-scrollbar {
    height: 4px;
  }

  .wcsb-posts-grid::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 2px;
  }

  .wcsb-posts-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
  }

  /* Largeur fixe articles blog pour scroll */
  .wcsb-posts-grid .wcsb-post-item {
    flex: 0 0 280px;
    max-width: 280px;
    scroll-snap-align: start;
  }
}

/* Tablette - Shop page (2 colonnes) */
@media (min-width: 769px) and (max-width: 992px) {
  .wcsb-shop-categories-grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    padding: 0 20px;
  }
}

/* Tablette uniquement */
@media (min-width: 769px) and (max-width: 992px) {
  ul.products li.product,
  .wcsb-featured-products .wc-block-grid__product,
  .wcsb-category-products .wc-block-grid__product,
  .wcsb-featured-products li.wc-block-product,
  .wcsb-category-products li.wc-block-product {
    flex: 0 0 260px;
    max-width: 260px;
  }

  .wcsb-image-overlap-2 {
    margin-left: -30px;
    margin-top: 20px;
  }
}

/* Mobile uniquement */
@media (max-width: 768px) {
  /* Hero */
  .wcsb-hero-section {
    min-height: 400px;
    padding-top: 60px;
    padding-bottom: 60px;
  }

  .wcsb-hero-title {
    font-size: 32px;
  }

  .wcsb-hero-subtitle {
    font-size: 18px;
  }

  .wcsb-section-title {
    font-size: 28px;
    margin-top: 60px;
    margin-bottom: 30px;
  }

  /* Categories Grid - Scroll horizontal (déjà géré dans @media (max-width: 992px)) */

  /* Reassurance */
  .wcsb-reassurance-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }

  /* Les règles mobile sont maintenant dans les media queries de chaque bloc */

  /* Images collage - chevauchement décalé mobile */
  .wcsb-image-collage {
    flex-direction: row;
    gap: 0;
    align-items: flex-start;
    justify-content: center;
  }

  .wcsb-image-overlap-1 {
    position: relative;
    z-index: 2;
    flex: 0 0 55%; /* Réduit de 65% à 55% pour mobile */
    transform: translateX(15px); /* Augmenté de 10px à 15px pour plus de chevauchement */
    margin-left: 0;
    margin-top: 0;
  }

  .wcsb-image-overlap-2 {
    position: relative;
    z-index: 1;
    flex: 0 0 55%; /* Réduit de 65% à 55% pour mobile */
    margin-left: -40%; /* Augmenté de -35% à -40% pour plus de chevauchement */
    margin-top: 30px;
    transform: translateX(-15px); /* Augmenté de -10px à -15px pour plus de chevauchement */
  }

  .wcsb-image-overlap-1 img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    aspect-ratio: 4/3;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  }

  .wcsb-image-overlap-2 img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    aspect-ratio: 4/3;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  }

  /* Category Cards */
  /* .wcsb-category-cards-4 - scroll horizontal déjà géré dans @media (max-width: 992px) */

  .wcsb-category-card-cover {
    min-height: 250px;
  }

  .wcsb-category-description {
    padding-left: 5%;
    padding-right: 5%;
  }

  /* Produits - largeur mobile */
  ul.products li.product,
  .wcsb-featured-products .wc-block-grid__product,
  .wcsb-category-products .wc-block-grid__product,
  .wcsb-featured-products li.wc-block-product,
  .wcsb-category-products li.wc-block-product {
    flex: 0 0 240px;
    max-width: 240px;
  }
}

/* Mobile très petit */
@media (max-width: 400px) {
  .wcsb-shop-categories-grid-container {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
    padding: 0 15px !important;
  }

  .wcsb-categories-grid {
    grid-template-columns: 1fr;
  }

  .wcsb-reassurance-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* Desktop - Categories Grid (landing page) */
@media (min-width: 768px) {
  .wcsb-categories-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Tablette moyenne - Shop page (3 colonnes) */
@media (min-width: 993px) and (max-width: 1200px) {
  .wcsb-shop-categories-grid-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }
}

/* Desktop large - Shop page (4 colonnes) */
@media (min-width: 1201px) {
  .wcsb-shop-categories-grid-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
  }
}

/* ============================================
   RESPONSIVE AMÉLIORÉ - PAGE BOUTIQUE
   Évite les débordements et optimise pour tous les écrans
   ============================================ */

/* Desktop moyen (993px à 1200px) - 3 colonnes avec padding ajusté */
@media (min-width: 993px) and (max-width: 1200px) {
  .woocommerce-shop-content {
    padding: 0 30px;
  }
  
  .wcsb-shop-categories-grid-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }
}

/* Tablette (769px à 992px) - 3 colonnes */
@media (min-width: 769px) and (max-width: 992px) {
  .wcsb-shop-categories-grid-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }
  
  .woocommerce-shop-content {
    padding: 0 25px;
  }
  
  .wcsb-shop-category-card-cover {
    min-height: 220px;
  }
}

/* Mobile et tablette petite (jusqu'à 768px) - 2 colonnes */
@media (max-width: 768px) {
  .wcsb-shop-categories-grid-container {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
  }
  
  .woocommerce-shop-content {
    padding: 0 15px;
  }
  
  .wcsb-shop-category-card-cover {
    min-height: 180px;
  }
  
  .woocommerce-products-header {
    margin: 50px 0 25px 0;
  }
}

/* Mobile (jusqu'à 480px) - 2 colonnes */
@media (max-width: 400px) {
  .wcsb-shop-categories-grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .woocommerce-shop-content {
    padding: 0 15px;
    margin: 0 auto 40px auto;
  }
  
  .woocommerce-products-header {
    margin: 40px 0 20px 0;
  }
  
  .wcsb-shop-category-card-cover {
    min-height: 250px; /* Un peu plus haut sur mobile pour un meilleur rendu */
  }
}

