/* 
 * Fixes for external widgets compatibility with Cookies Banner
 * Specifically handles Medflex round booking button overlap
 */

/* Main fix for round booking button overlap */
@media (max-width: 768px) {
  /* When cookies banner is visible, move external widgets */
  body.cookies-banner-visible {
    /* Target all possible round widget selectors */
    & [id*="medflex"][id*="Round"],
    & [id*="medflex"][id*="round"],
    & [class*="medflex"][class*="round"],
    & [class*="round"][class*="widget"],
    & div[style*="position: fixed"][style*="bottom"],
    & div[style*="position: fixed"][style*="right"] {
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
      transform: translateY(-120px) !important;
    }
  }

  /* Ensure cookies banner is always on top */
  .cookies-banner {
    z-index: 999999 !important;
  }

  /* Additional safety for round widgets */
  [id*="RoundWidget"],
  [class*="round-widget"],
  [data-widget*="round"] {
    z-index: 999990 !important;
  }
}

/* For very small screens */
@media (max-width: 480px) {
  body.cookies-banner-visible {
    & [id*="medflex"][id*="Round"],
    & [id*="medflex"][id*="round"],
    & [class*="medflex"][class*="round"],
    & [class*="round"][class*="widget"],
    & div[style*="position: fixed"][style*="bottom"],
    & div[style*="position: fixed"][style*="right"] {
      transform: translateY(-140px) !important;
    }
  }
}

/* Alternative approach using margin instead of transform */
@media (max-width: 768px) {
  .cookies-banner.alternative-positioning {
    margin-bottom: 80px;
  }
}

/* Force higher z-index for cookies banner in all scenarios */
.cookies-banner {
  z-index: 999999 !important;
  position: fixed !important;
}

.cookies-banner-backdrop {
  z-index: 999998 !important;
  position: fixed !important;
}

/* Prevent any external widget from appearing above cookies banner */
body.cookies-banner-visible * {
  /* Reset any extremely high z-indexes */
  z-index: initial !important;
}

/* Restore cookies banner z-index after reset */
body.cookies-banner-visible .cookies-banner {
  z-index: 999999 !important;
}

body.cookies-banner-visible .cookies-banner-backdrop {
  z-index: 999998 !important;
}
