/* Christmas Open House pop-up modal */

/* Overlay */
#xmas-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.35s ease;
  box-sizing: border-box;
}

#xmas-popup-overlay.xmas-visible {
  opacity: 1;
}

#xmas-popup-overlay.xmas-hidden {
  display: none;
}

/* Dialog box */
#xmas-popup-dialog {
  position: relative;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
  transform: scale(0.92);
  transition: transform 0.35s ease, opacity 0.35s ease;
  opacity: 0;
  display: flex;
  flex-direction: column;
  /* On mobile keep the whole dialog visible without internal scrolling if possible */
  max-height: 85vh;
}

#xmas-popup-overlay.xmas-visible #xmas-popup-dialog {
  transform: scale(1);
  opacity: 1;
}

/* Flyer image */
#xmas-popup-dialog .xmas-flyer-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  overflow: hidden;
}

#xmas-popup-dialog .xmas-flyer-wrap img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(85vh - 90px); /* leave room for buttons */
  object-fit: contain;
  border-radius: 0;
}

/* Close button */
#xmas-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0,0,0,0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  color: #222;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: background 0.2s ease, transform 0.2s ease;
  font-family: Arial, sans-serif;
}

#xmas-popup-close:hover,
#xmas-popup-close:focus-visible {
  background: #f0f0f0;
  transform: scale(1.08);
  outline: 2px solid #8cefc5;
  outline-offset: 2px;
}

/* Action buttons row */
#xmas-popup-dialog .xmas-popup-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  justify-content: center;
  flex-wrap: wrap;
}

#xmas-popup-dialog .xmas-popup-actions .btn {
  /* inherits site .btn styles */
  min-width: 140px;
  text-align: center;
}

/* Mobile adjustments */
@media (max-width: 520px) {
  #xmas-popup-dialog {
    max-height: 85vh;
    border-radius: 12px;
  }

  #xmas-popup-dialog .xmas-flyer-wrap img {
    max-height: calc(85vh - 84px);
  }

  #xmas-popup-dialog .xmas-popup-actions {
    padding: 10px 12px;
    gap: 10px;
  }

  #xmas-popup-dialog .xmas-popup-actions .btn {
    min-width: 120px;
    padding: 12px 18px;
    font-size: 12px;
  }

  #xmas-popup-close {
    width: 40px;
    height: 40px;
    top: 8px;
    right: 8px;
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #xmas-popup-overlay,
  #xmas-popup-dialog {
    transition: none !important;
  }
}
