/* ------------------------- Modal Overlay ------------------------- */
.modal {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
}

main, .section-container, .product-card {
  transform: translateZ(0);
  will-change: transform;
}
body.modal-open {
  overflow: hidden;
  padding-right: var(--scrollbar-compensation, 0px);
}
/* Scope all rules to modal body to prevent leaking to main page */
#signup-modal-body, #signup-modal-body * {
  box-sizing: border-box;
}


/* Modal overlay isolation */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}


/* ------------------------- Modal Content ------------------------- */


/* When showing modal — pop-in animation */
.modal-overlay.show .modal-content {
  animation: popupAppear 0.35s ease forwards;
}

/* When hiding modal — smooth disappear animation */
.modal-overlay.hide .modal-content {
  animation: popupDisappear 0.25s ease forwards;
}

/* Keyframes for pop-in / disappear */
@keyframes popupAppear {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes popupDisappear {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(0, 30px, 0) scale(0.95);
  }
}


body.modal-open {
  overflow: hidden;
}

/* ------------------------- Iframe Inside Modal ------------------------- */
.modal-content iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 20px;
  transform: none;
  scale: 1;
  object-fit: cover;
  overflow: visible !important;
  pointer-events: auto;
}
