/* Nav Dropdowns */

.navContent ul li ul a {
    white-space: normal !important;
    overflow: visible !important;
}

@media only screen and (min-width: 768px) {
    .navContent ul li ul {
        min-width: 250px !important;
        right: auto !important; 
    }
}

/*Popup CSS*/
.mad-popup-wrap {
    position: fixed;
    display: none;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / 76%);
    z-index: 9999;
}

.mad-popup-wrap.show{
  display:block;
}

.mad-popup-content img {
    max-width: 100%;
    width: 100%;
}

.mad-popup-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    min-width: 500px;
    text-align: center;
}

.mad-popup-wrap .close {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 30px;
    cursor: pointer;
}

.mad-popup-text {
    padding: 15px;
}

.mad-popup-wrap p.popup-header {
    margin: 0;
    font-size: 30px;
    text-align: center;
}

.mad-popup-wrap p.popup-subheader {
    margin: 0;
    font-size: 25px;
    text-align: center;
}

@media screen and (max-width: 550px){
  .mad-popup-box {
        min-width: 90%;
        top: 12rem;
        transform: translate(-50%);
    }
}

/*uncomment to change color of the popup text*/
/*p.popup-header, p.popup-subheader {*/
/*    color: black;*/
/*}*/

/*uncomment to change close button to white*/
/*.close svg {*/
/*    filter: invert(1);*/
/*}*/
/* Popup fix: keep close (X) visible on all screens/zooms */
.mad-popup-box{
  max-width: 92vw !important;   /* never wider than viewport */
  width: 600px;                 /* reasonable desktop width */
  min-width: 0 !important;      /* removes the 500px lock */
  box-sizing: border-box !important;
}

/* Keep the close button visible and clickable */
.mad-popup-wrap .close{
  top: 10px !important;
  right: 10px !important;
  z-index: 100000 !important;
  width: 44px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: auto !important;
}

/* Make the X icon easier to tap/click */
.mad-popup-wrap .close svg{
  width: 28px !important;
  height: 28px !important;
}

/* If content is tall, allow scrolling inside the popup */
.mad-popup-box{
  max-height: 85vh !important;
  overflow: auto !important;
}

/* Smooth popup appearance (prevents subtle "glitch") */
.mad-popup-wrap {
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms ease, visibility 0s linear 250ms;
}

.mad-popup-wrap.show.popup-delay-ok {
  opacity: 1;
  visibility: visible;
  transition: opacity 250ms ease;
}

/* Keep it hidden before delay even if .show is added */
.mad-popup-wrap.show:not(.popup-delay-ok) {
  opacity: 0 !important;
  visibility: hidden !important;
}
/* Smooth delayed popup: do NOT use display as the gate */
.mad-popup-wrap {
  /* keep whatever background/z-index you already have */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 250ms ease, visibility 0s linear 250ms;
}

/* When M360 triggers .show, keep it hidden until our delay is satisfied */
.mad-popup-wrap.show {
  display: block !important;          /* ensure it can render */
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* After the delay, fade it in smoothly */
.mad-popup-wrap.show.popup-delay-ok {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transition: opacity 250ms ease;
}

/* Optional: reduce any box jitter */
.mad-popup-box { will-change: transform; }