.popup-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

/* Desktop View: SVG container */

.popup-desktop-view {
  display: flex;
  /* Show by default on larger screens */
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 80rem;
  /* Increased max-width for better content display */
  max-height: 95vh;
  align-items: center;
  justify-content: center;
}

.popup-desktop-view .popup-svg {
  width: 100%;
  height: 100%;
  max-height: 95vh;
}

/* Mobile View: Simple div container */

.popup-mobile-view {
  display: none;
  /* Hidden by default on larger screens */
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  background-color: #FDFBF3;
  position: relative;
  /* Needed for absolute positioning of close button */
  overflow: hidden;
  /* Prevent overflow on mobile popup itself */
}

.popup-mobile-view .popup-content-inner {
  width: 100%;
  height: 100%;
  padding: 1rem;
  box-sizing: border-box;
  /* Include padding in element's total width and height */
  display: flex;
  flex-direction: column;
}

/* Close button positioning */

.close-button {
  position: absolute;
  font-size: 5rem;
  font-weight: bold;
  z-index: 10;
  cursor: pointer;
  top: -32px;
  right: 12px;
}

/* Desktop close button position (relative to SVG's foreignObject) */

.popup-desktop-view .close-button {
  top: -15px;
  right: 4px;
}

/* Media query to control visibility based on screen size */

@media (max-width: 767px) {
  .popup-desktop-view {
    display: none;
  }

  .popup-mobile-view {
    display: block;
  }

  .popup-overlay {
    overflow-y: auto;
  }
}

@media (min-width: 768px) {
  .popup-desktop-view {
    display: flex;
  }

  .popup-mobile-view {
    display: none;
  }
}