/* ---------- Bouton loupe sur les cartes ---------- */
.carte__loupe {
  position: absolute;
  top: 12.5%;
  right: 6%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: max(11cqw, 22px);
  height: max(11cqw, 22px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  font-size: max(6.5cqw, 12px);
  line-height: 1;
  cursor: zoom-in;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.carte:hover .carte__loupe,
.carte__loupe:focus-visible {
  opacity: 1;
}

.carte__loupe:hover {
  transform: scale(1.18);
}

/* Sur écran tactile il n'y a pas de survol : la loupe reste visible */
@media (hover: none) {
  .carte__loupe {
    opacity: 0.9;
  }
}

/* Catalogue : léger zoom au survol */
.milieu__cartes .carte {
  transition: transform 0.15s;
}

.milieu__cartes .carte:hover {
  transform: scale(1.08);
  z-index: 5;
}

/* ---------- Aperçu en grand ---------- */
.apercu {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(5, 15, 10, 0.85);
  backdrop-filter: blur(4px);
  animation: apercu-entree 0.2s ease-out;
}

.apercu__contenu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  max-width: 96vw;
  max-height: 100dvh;
  padding: 1rem;
}

.apercu__carte.carte {
  width: min(86vw, calc(88dvh * 2 / 3));
  transform: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border-radius: 5cqw;
}

.apercu__infos {
  max-width: 22rem;
  color: #f4f1e8;
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 1.1rem;
  line-height: 1.5;
}

.apercu__infos h2 {
  margin: 0 0 0.6rem;
  font-size: 1.8rem;
}

.apercu__infos p {
  margin: 0.3rem 0;
}

.apercu__fermer {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 50%;
  background: #f1dc8a;
  color: #2b2a14;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
}

@keyframes apercu-entree {
  from { opacity: 0; }
  to   { opacity: 1; }
}
