.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  max-width: 900px;
  width: 90%;
  max-height: 80vh;

  background: var(--white);
  border-radius: 14px;
  padding: 2rem;

  z-index: 1;
  animation: modalIn 0.25s ease-out;
}

/* botón cerrar */
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-gallery {
  margin-top: 1.5rem;

  display: flex;
  gap: 1.2rem;

  overflow-x: auto;
  padding-bottom: 0.5rem;

  scroll-behavior: auto;
  cursor: grab;

  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal-gallery::-webkit-scrollbar {
  display: none;
}

.modal-gallery.dragging {
  cursor: grabbing;
}

.modal-gallery.dragging a:hover {
  transform: none !important;
  box-shadow: none !important;
}

.modal-gallery a {
  flex-shrink: 0;
  user-select: none;
  -webkit-user-drag: none;
}

/* imágenes */
.modal-gallery img {
  width: 300px;
  height: 260px;
  object-fit: cover;

  border-radius: 10px;

  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.pdf-thumb {
  width: 180px;
  height: 120px;

  border-radius: 12px;
  border: 2px dashed #e11d48;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;

  font-weight: 700;
  color: #e11d48;
  background: #fff1f2;

  user-select: none;
  pointer-events: none;

  transition: transform .2s ease, box-shadow .2s ease;
}

.modal-gallery:not(.dragging) a:hover .pdf-thumb {
  transform: scale(1.05);
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
}

@keyframes modalIn {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}