/* CSS pour la section Offers */
.offers-section {
    position: relative;
    background-image: 
        linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.8)),
        url(../images/3.jpeg);
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    padding: 50px 20px;
    font-family: Arial, sans-serif;
    color: #fff;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.offers-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.offers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 5px;
    max-width: 1200px;
    width: 100%;
    height: 600px;
    position: relative;
    z-index: 2;
}

.offer-card {
    position: relative;
    border-radius: 10px;
    text-align: left;
    transition: transform 0.3s ease;
    perspective: 1000px;
    background-color: white;
}

.offer-card.tall {
    width: 300px; /* ou une autre valeur fixe */
    height: 300px;
    background: #fff;
    color: #000824;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.offer-card:not(.tall) {
    aspect-ratio: 1 / 1;
    background: none;
}

/* Conteneur pour l'effet de flip */
.offer-card:not(.tall) .card-front,
.offer-card:not(.tall) .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    transition: transform 0.6s ease;
}

/* Face avant (image) */
.offer-card:not(.tall) .card-front {
    background-size: cover;
    background-position: center;
    background-image: inherit; /* Hérite de l'image de fond du parent .offer-card */
}

/* Face arrière (texte) */
.offer-card:not(.tall) .card-back {
    background: #35aec177;
    color: #fff;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: rotateY(180deg);
}

/* Effet de flip au survol */
.offer-card:not(.tall):hover .card-front {
    transform: rotateY(180deg);
}

.offer-card:not(.tall):hover .card-back {
    transform: rotateY(0deg);
}

/* Styles pour le texte dans la carte */
.offer-card h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.offer-card p {
    font-size: 14px;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Responsive : Tablette (max-width: 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .offers-section {
      padding: 30px 15px;
      height: auto; /* Permet à la section de s'étendre selon le contenu */
      min-height: 100vh;
    }
  
    .offers-grid {
      grid-template-columns: repeat(2, 1fr); /* 2 colonnes pour tablette */
      grid-template-rows: auto; /* Lignes automatiques */
      gap: 10px;
      height: auto; /* Hauteur dynamique */
      max-width: 800px;
    }
  
    .offer-card {
      border-radius: 8px;
    }
  
    .offer-card.tall {
      width: 100%; /* Occupe toute la largeur de la colonne */
      height: 250px; /* Hauteur réduite pour tablette */
      padding: 15px;
    }
  
    .offer-card:not(.tall) {
      aspect-ratio: 1 / 1; /* Maintien du ratio carré */
      width: 100%;
      height: 200px; /* Hauteur fixe pour uniformité */
    }
  
    .offer-card h2 {
      font-size: 20px;
      margin-bottom: 8px;
    }
  
    .offer-card p {
      font-size: 13px;
      margin-bottom: 15px;
    }
  
    .offer-card:not(.tall) .card-back {
      padding: 15px;
    }
  
    /* Ajuster l'effet de flip pour tablette */
    .offer-card:not(.tall) .card-front,
    .offer-card:not(.tall) .card-back {
      border-radius: 8px;
    }
  }
  
  /* Responsive : Mobile (max-width: 768px) */
  @media (max-width: 768px) {
    .offers-section {
      padding: 20px 10px;
      height: auto;
      min-height: 100vh;
    }
  
    .offers-grid {
      grid-template-columns: repeat(2, 1fr); /* 1 colonne pour mobile */
      grid-template-rows: auto;
      gap: 15px;
      height: auto;
      max-width: 100%;
    }
  
    .offer-card {
      border-radius: 8px;
    }
  
    .offer-card.tall {
      width: 100%;
      height: auto; /* Hauteur dynamique selon contenu */
      padding: 15px;
      min-height: 200px;
    }

  
    .offer-card:not(.tall) {
      width: 100%;
      height: 250px; /* Hauteur fixe pour cohérence */
      aspect-ratio: unset; /* Supprime le ratio pour plus de flexibilité */
    }
  
    .offer-card h2 {
      background-color: #00082454;
      color: #ffffff;
      font-size: 22px;
      margin-bottom: 10px;
    }
  
    .offer-card p {
      font-size: 12px;
      margin-bottom: 10px;
    }
  
    .offer-card:not(.tall) .card-back {
      padding: 10px;

    }
  
    /* Simplifier l'effet de flip sur mobile : afficher la face arrière par défaut */
    .offer-card:not(.tall) .card-front {
      background-size: cover;
    }
  
    .offer-card:not(.tall) .card-back {
      transform: rotateY(0deg); /* Afficher la face arrière */
      position: relative;
      background: #35aec100; /* Légèrement plus opaque pour lisibilité */
    }
  
    /* Supprimer l'effet de flip au survol sur mobile */
    .offer-card:not(.tall):hover .card-front {
      transform: none;
    }
  
    .offer-card:not(.tall):hover .card-back {
      transform: none;
    }
  }

  