/* ==========================================================================
   1. CORE STRUCTURE & ROUNDED CORNERS
   ========================================================================== */
.hotspot-viewport {
  position: relative;
  width: 100%;
  background-color: transparent !important;
  overflow: hidden;
}

.hotspot-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border-radius: 0;
  transition: border-radius 0.3s ease;
}

.has-rounded-corners .hotspot-container,
.has-rounded-corners .hotspot-base-image {
  border-radius: 20px;
  overflow: hidden;
}

.hotspot-base-image {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* ==========================================================================
   2. HOTSPOT BUTTONS & ANIMATIONS
   ========================================================================== */
.hotspot-point {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  cursor: pointer;
}

.hotspot-point:hover,
.hotspot-point:focus-within,
.hotspot-point.is-active {
  z-index: 50;
}

.hotspot-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--hotspot-blue);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 30px;
  position: relative;
  white-space: nowrap;
}

.hotspot-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: block;
}

.animation-wave::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 30px;
  background-color: var(--hotspot-blue);
  z-index: -1;
  animation: pulse-wave 2s infinite;
}

@keyframes pulse-wave {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* ==========================================================================
   3. DESKTOP TOOLTIP STYLING (FLOATING)
   ========================================================================== */
.hotspot-tooltip {
  position: absolute;
  bottom: calc(100% + 15px);
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--tooltip-background);
  color: #333;
  padding: 15px;
  border-radius: 4px;
  width: 320px;
  max-width: 90vw;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tooltip-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background-color: var(--tooltip-background);
}

.hotspot-point.is-active .hotspot-tooltip {
  opacity: 1;
  visibility: visible;
}

@media (hover: hover) {
  .hotspot-point:hover .hotspot-tooltip {
    opacity: 1;
    visibility: visible;
  }
}

.hotspot-point.tooltip-down .hotspot-tooltip {
  bottom: auto;
  top: 120%;
}
.hotspot-point.tooltip-down .tooltip-arrow {
  bottom: auto;
  top: -10px;
  transform: rotate(180deg);
}

.mobile-tooltip-close, .mobile-panel-title { display: none; }

/* Add to global/desktop styles to hide the mobile wrapper by default */
.mobile-tooltips-wrapper { display: none; }
.desktop-tooltip { display: block; }

//* Default state for the mobile wrappers */
.mobile-tooltips-wrapper { display: none; margin: 0; padding: 0; line-height: 0; }

/* Default state for the mobile wrappers */
.mobile-tooltips-wrapper { display: none; margin: 0; padding: 0; line-height: 0; font-size: 0; }

/* ==========================================================================
   4. MOBILE STATIC LAYOUT (DRAWER VERSION)
   ========================================================================== */
@media (max-width: 767px) {
  
  /* 1. AGGRESSIVELY HIDE DESKTOP TOOLTIPS */
  html body .hotspot-viewport .desktop-tooltip,
  html body .hotspot-viewport .hotspot-point.is-active .desktop-tooltip {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* 2. Show the Mobile Wrapper flush against the image */
  .mobile-tooltips-wrapper { 
    display: block !important; 
    width: 100%; 
    line-height: normal; 
  }

  .mobile-static-viewport {
    display: block !important;
    position: relative;
    width: 100%;
  }

  .mobile-static-viewport .hotspot-container {
    position: relative !important;
    width: 100% !important;
    display: block !important;
    margin-bottom: 0 !important; 
    padding-bottom: 0 !important;
    line-height: 0 !important; /* Kills phantom image spacing */
    font-size: 0 !important;   /* Kills phantom image spacing */
  }

  .mobile-static-viewport .hotspot-point {
    position: absolute !important;
    z-index: 10;
  }

  .mobile-static-viewport .hotspot-button {
    position: absolute !important;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    font-size: 16px; /* Restores font size for the label */
  }

  /* 3. The Mobile Panel Styling */
  .mobile-tooltip-panel {
    display: none; 
    position: relative;
    width: 100%;
    background-color: var(--tooltip-background) !important;
    color: var(--panel-text) !important; 
    padding: 30px 20px;
    border-top: 4px solid var(--hotspot-blue);
    box-sizing: border-box;
    margin-top: 0 !important;
    line-height: 1.5; /* Restores normal text line height */
    font-size: 16px;  /* Restores normal text size */
  }

  .mobile-tooltip-panel.is-active {
    display: block !important;
  }

  /* FIX: Prevents text from overlapping the Close button */
  .mobile-tooltip-panel .tooltip-content {
    padding-right: 45px !important; 
  }

  /* 4. Title and Close Button styling */
  .mobile-panel-title {
    margin-top: 0; 
    margin-bottom: 10px;
    font-weight: bold; 
    font-size: 1.2rem;
    color: var(--panel-text) !important; 
  }

  .mobile-tooltip-close {
    position: absolute;
    top: 25px; /* Pushed down slightly to align with the Title */
    right: 15px;
    background: transparent;
    color: var(--close-btn) !important; /* Pulls from Editor variable */
    width: 32px; 
    height: 32px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    border: 2px solid var(--close-btn); /* Creates outline ring from Editor variable */
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.2s;
    padding: 0;
  }
  
  .mobile-tooltip-close:active {
    opacity: 0.5;
  }

  .mobile-static-viewport .js-hotspot-hint {
    display: none !important;
  }
  
  /* Ensure the wrapper has a height for the image to fill */
.hotspot-container {
  position: relative;
  width: 100%;
  /* Adjust this height or add a 'Height' field to your module UI */
  min-height: 500px; 
  overflow: hidden;
}

.hotspot-base-image {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}