.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 800px;
  margin: 40px auto;
  padding: 10px;
}

.gallery img {
  width: 100%;
  aspect-ratio: 3 / 5;
  object-fit: cover;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery img:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
/* Responsive móvil */
@media (max-width: 600px) {
  .gallery{
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 16px auto;  /* menos margen vertical */
    padding: 8px;
  }

  .gallery img{
    aspect-ratio: 3 / 4;   /* menos alto que 3/5 para que no “tape” */
    border-radius: 12px;
  }
}

/* MODAL */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  inset: 0; 
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  z-index: 20000; 
  padding: 0;
  
  touch-action: manipulation;          /* ✅ bloquea pinch/pan dentro del modal */
  overscroll-behavior: contain;
}

.modal-img {
  max-width: 92vw;             /* ✅ no uses 100vw */
  max-height: 85vh;            /* ✅ no uses 100vh */
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;

  touch-action: manipulation;        /* ✅ evita zoom sobre la imagen */
}
@media (max-width: 768px) {
  .modal-img {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
    border-radius: 0;
  }
}
.close {
  position: fixed;
  top: 16px;
  right: 18px;
  font-size: 40px;
  color: white;
  cursor: pointer;
  z-index: 20001;
  touch-action: manipulation;  /* ✅ mejor tap en móvil */
}


/* Flechas navegación modal (SIN círculos) */
.modal-nav{
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;     /* ✅ sin fondo */
  border-radius: 0;            /* ✅ sin círculo */
  width: auto;                 /* ✅ sin “botón” circular */
  height: auto;
  padding: 10px 12px;          /* ✅ área de click cómoda */
  color: #fff;
  font-size: 44px;
  line-height: 1;
  cursor: pointer;
  z-index: 20001;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7); /* ✅ se ve bien sin fondo */
  backdrop-filter: none;       /* ✅ quita blur del círculo */
}

.modal-prev{ left: 10px; }
.modal-next{ right: 10px; }

@media (max-width: 768px){
  .modal-nav{
    font-size: 40px;
    padding: 12px 12px;
  }
}