.modal-wrapper {
  position: fixed !important;   /* force it to stick to viewport */
  inset: 0;                     /* shorthand: top:0; right:0; bottom:0; left:0 */
  width: 100vw !important;      /* full viewport width */
  height: 100vh !important;     /* full viewport height */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-wrapper.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: fixed !important;   /* fixed so it covers everything */
  inset: 0;                     /* fill viewport */
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.7);
  z-index: 9998;
}

.modal-content {
  position: relative;
 
  color: #000;
  padding: 0rem;
  border-radius: 8px;
  z-index: 9999;
  max-height: 90vh;             /* prevent overflow on tall content */
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.modal-wrapper.open .modal-content {
  opacity: 1;
  transform: translateY(0);
}

.with-fade .modal-overlay,
.with-fade .modal-content {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.with-fade.open .modal-overlay,
.with-fade.open .modal-content {
  opacity: 1;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: #333;
  z-index: 10000;
  transition: color 0.2s ease;
}

.close-modal:hover {
  color: #000;
}

.modal-trigger.aligncenter {
  display: flex;
  justify-content: center;
}
.modal-trigger.alignright {
  display: flex;
  justify-content: flex-end;
}
.modal-trigger.alignleft {
  display: flex;
  justify-content: flex-start;
}
