.tceb-popup-open {
  overflow: hidden;
}

.tceb-popup[hidden] {
  display: none;
}

.tceb-popup {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 24px;
}

.tceb-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.tceb-popup__dialog {
  position: relative;
  width: min(
    var(--tceb-popup-max-width, 960px),
    calc(100vw - 48px),
    calc(177.7778dvh - 250px)
  );
  min-width: 0;
  max-width: 100%;
  max-height: calc(100dvh - 48px);
  box-sizing: border-box;
  background: transparent;
  box-shadow: none;
  overflow-x: hidden;
  overflow-y: auto;
}

.tceb-popup__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
}

.tceb-popup__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 30px;
  line-height: 30px;
  cursor: pointer;
}

.tceb-popup__actions {
  display: flex;
  justify-content: center;
  padding: 16px 24px 10px;
  background: transparent;
}

.tceb-popup__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: calc(100% - 48px);
  padding: min(var(--tceb-cta-py, 12px), 4vw) min(var(--tceb-cta-px, 24px), 8vw);
  border-radius: var(--tceb-cta-radius, 4px);
  background: var(--tceb-cta-bg, #0b5fff);
  color: var(--tceb-cta-color, #fff);
  font-family: var(--tceb-cta-family, inherit);
  font-size: clamp(12px, var(--tceb-cta-font, 18px), 32px);
  line-height: 1.25;
  font-weight: 700;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
}

@media (max-width: 640px) {
  .tceb-popup {
    padding: 14px;
  }

  .tceb-popup__dialog {
    width: min(
      var(--tceb-popup-max-width, 960px),
      calc(100vw - 28px),
      calc(177.7778dvh - 220px)
    );
    max-width: 100%;
    max-height: calc(100dvh - 28px);
  }

  .tceb-popup__close {
    width: 32px;
    height: 32px;
    font-size: 26px;
  }

  .tceb-popup__cta {
    min-height: 40px;
    max-width: calc(100% - 28px);
  }

  .tceb-popup__actions {
    padding: 12px 14px 8px;
  }
}
