.category-promo-grid,
.subcategory-promo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.category-promo-grid > h2,
.subcategory-promo-grid > h2 {
  flex: 0 0 100%;
}
/* Items desktop (2 per line) */
.category-item {
  flex: 0 0 calc(50% - .5rem);
  display: flex;
  margin-bottom: 1rem;
}

.category-item-link {
    display: contents;
    text-decoration: none;
    color: inherit;
    flex: 0 0 calc(50% - .5rem);
    margin-bottom: 1rem;
}

/* Alternance desktop */
.category-item:nth-child(4n+2),
.category-item:nth-child(4n+3) {
  flex-direction: row;
}
.category-item:nth-child(4n+4),
.category-item:nth-child(4n+5) {
  flex-direction: row-reverse; /* right alignment */
}

.category-content h4 {
    margin-top: 0px !important;
    margin-bottom: 5px !important;
}

.category-desc {
    font-size: .8em;
    line-height: 1em;
}

.category-image-container {
  flex: 0 0 33%;
}
.category-image {
  width: 100%;
  height: auto;
  aspect-ratio: 9/16;
  object-fit: cover;
  border-radius: 4px;
}

/* Text content */
.category-content {
  flex: 1;
  padding: 0 .5rem;
}

/* Mobile version (1 item per line) */
@media (max-width: 768px) {
  .category-item-link {
        flex: 0 0 100%;
    }
    
  .category-item {
    flex: 0 0 100%;
    flex-direction: row !important; /* Force l'affichage en ligne */
    margin-bottom: 0rem;
  }

  /* Alternance Mobile */
  .category-item:nth-child(even) {
    flex-direction: row !important; /* Image à gauche */
  }
  .category-item:nth-child(odd) {
    flex-direction: row-reverse !important; /* Image à droite */
  }

  .category-image-container {
    flex: 0 0 15% !important;
  }

  .category-image {
    width: 100%;
    height: auto;
    aspect-ratio: 9/16;
    object-fit: cover;
  }

  .category-content {
    flex: 1;
    gap: .5rem;
  }
}

.category-item-link:hover .category-image,
.category-item-link:hover .category-content {
    color: rgba(0,0,0,0.75);
    opacity: 0.65;
    transition: opacity 0.3s ease;
}

.category-image, .category-content {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.category-content a {
    position: relative;
    z-index: 2;
}