/* Base du modal */
.modal {
    display: none; /* caché par défaut */
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 999;
    justify-content: center;
    align-items: center;
    padding: 20px;
  }
  
  /* Contenu du modal */
  .modal-content {
    display: flex;
    flex-wrap: wrap;
    background-color: #ffffff;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    overflow: hidden;
    animation: fadeInScale 0.4s ease-in-out;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.3);
    position: relative;
  }
  
  /* Partie gauche (image principale + boutons) */
  .modal-left {
    flex: 1 1 50%;
    position: relative;
    background-color: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
.modal-main-image {
    max-width: 100%;
    max-height: 600px; /* Increased from 400px to 600px */
    border-radius: 8px;
    object-fit: cover;
  }
  
  /* Boutons de navigation */
  .modal-prev, .modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: #333;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: 0.3s;
  }
  .modal-prev:hover, .modal-next:hover {
    background: #333;
    color: #fff;
  }
  .modal-prev {
    left: 15px;
  }
  .modal-next {
    right: 15px;
  }
  
  /* Partie droite (thumbnails + description) */
  .modal-right {
    flex: 1 1 50%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .modal-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-bottom: 20px;
  }
  .modal-thumbnails img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.3s;
  }
  .modal-thumbnails img:hover {
    transform: scale(1.1);
  }
  
  .modal-description {
    font-size: 1rem;
    color: #444;
    line-height: 1.5;
  }
  
  /* Bouton de fermeture */
  .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    transition: 0.3s;
  }
  .close:hover {
    color: #111;
  }
  
  /* Animation */
  @keyframes fadeInScale {
    0% {
      opacity: 0;
      transform: scale(0.95);
    }
    100% {
      opacity: 1;
      transform: scale(1);
    }
  }
  
  /* Responsive */
  @media (max-width: 768px) {
    .modal-content {
      flex-direction: column;
    }
    .modal-left, .modal-right {
      flex: 1 1 100%;
    }
    .modal-main-image {
      max-height: 250px;
    }
  }

  /* Additional responsive for smaller devices */
  @media (max-width: 480px) {
    .modal-content {
      max-width: 100%;
      margin: 10px;
      border-radius: 10px;
    }
    .modal-left {
      padding: 10px;
    }
    .modal-main-image {
      max-height: 180px;
      width: 100%;
      object-fit: contain;
    }
    .modal-right {
      padding: 10px;
    }
    .modal-thumbnails {
      gap: 6px;
      margin-bottom: 15px;
    }
    .modal-thumbnails img {
      width: 45px;
      height: 45px;
    }
    .modal-description {
      font-size: 0.9rem;
    }
    .modal-prev, .modal-next {
      width: 30px;
      height: 30px;
      font-size: 1.5rem;
    }
    .close {
      top: 10px;
      right: 15px;
      font-size: 1.5rem;
    }
  }
