.block-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.block-tooltip--absolute {
  position: absolute;
  z-index: 10;
}

.block-tooltip--position-top-left {
  top: 16px;
  left: 16px;
  inset: 16px auto auto 16px;
}

.block-tooltip--position-top-right {
  top: 16px;
  right: 16px;
  inset: 16px 16px auto auto;
}

.block-tooltip--position-bottom-left {
  bottom: 16px;
  left: 16px;
  inset: auto auto 16px 16px;
}

.block-tooltip--position-bottom-right {
  bottom: 16px;
  right: 16px;
  inset: auto 16px 16px auto;
}

.block-tooltip__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgb(var(--color-background));
  color: rgb(var(--color-text));
}

.block-tooltip__icon svg {
  width: 20px;
  height: 20px;
  color: inherit;
}

.block-tooltip__content {
  position: absolute;
  top: 50%;
  z-index: 10;
  width: max-content;
  min-width: 150px;
  max-width: 380px;
  padding: 10px 14px;
  background: rgb(var(--color-background));
  color: rgb(var(--color-text));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 11px;
  line-height: 1.4;
}

.block-tooltip__content-wrapper {
  white-space: normal;
  word-break: break-word;
}

/* Icon on the left -> content reveals to the right (left-to-right) */
.block-tooltip--icon-left .block-tooltip__content {
  left: calc(100% + 8px);
  transform: translateY(-50%) translateX(-8px);
}

.block-tooltip--icon-left.is-active .block-tooltip__content {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}

/* Icon on the right -> content reveals to the left (right-to-left) */
.block-tooltip--icon-right .block-tooltip__content {
  right: calc(100% + 8px);
  transform: translateY(-50%) translateX(8px);
}

.block-tooltip--icon-right.is-active .block-tooltip__content {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}

@media (max-width: 959px) {
  .block-tooltip__content {
    min-width: 120px;
    max-width: 200px;
  }

  /* Mobile icon position left -> content opens right */
  .block-tooltip--mobile-icon-left .block-tooltip__content {
    left: calc(100% + 8px);
    right: auto;
    transform: translateY(-50%) translateX(-8px);
  }

  .block-tooltip--mobile-icon-left.is-active .block-tooltip__content {
    transform: translateY(-50%) translateX(0);
  }

  /* Mobile icon position right -> content opens left */
  .block-tooltip--mobile-icon-right .block-tooltip__content {
    right: calc(100% + 8px);
    left: auto;
    transform: translateY(-50%) translateX(8px);
  }

  .block-tooltip--mobile-icon-right.is-active .block-tooltip__content {
    transform: translateY(-50%) translateX(0);
  }

  .block-tooltip--mobile-position-top-left {
    top: 16px;
    left: 16px;
    inset: 16px auto auto 16px;
  }

  .block-tooltip--mobile-position-top-right {
    top: 16px;
    right: 16px;
    inset: 16px 16px auto auto;
  }

  .block-tooltip--mobile-position-bottom-left {
    bottom: 16px;
    left: 16px;
    inset: auto auto 16px 16px;
  }

  .block-tooltip--mobile-position-bottom-right {
    bottom: 16px;
    right: 16px;
    inset: auto 16px 16px auto;
  }
}


/* USWING hero camera: anchor to the video section, independent of rendered section IDs. */
.custom-section > .block-group.uswing-hero-camera-layer {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  overflow: visible !important;
  pointer-events: none;
  z-index: 10;
}
.block-group.uswing-hero-camera-layer > theme-tooltip.block-tooltip {
  position: absolute !important;
  inset: 24px 24px auto auto !important;
  width: 44px !important;
  height: 44px !important;
  margin: 0 !important;
  transform: none !important;
  pointer-events: auto;
}
.uswing-hero-camera-layer .block-tooltip__content {
  box-sizing: border-box;
  top: calc(100% + 12px) !important;
  bottom: auto !important;
  right: 0 !important;
  left: auto !important;
  transform: none !important;
  width: 560px;
  min-width: 0;
  max-width: calc(100vw - 48px);
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 20px 24px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1.5;
}
.uswing-hero-camera-layer .block-tooltip__content-wrapper,
.uswing-hero-camera-layer .block-tooltip__content-wrapper p {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  white-space: normal !important;
  -webkit-line-clamp: unset !important;
  text-overflow: clip !important;
  overflow-wrap: break-word;
}
@media (max-width: 959px) {
  .block-group.uswing-hero-camera-layer > theme-tooltip.block-tooltip {
    inset: 16px 16px auto auto !important;
  }
  .uswing-hero-camera-layer .block-tooltip__content {
    max-width: calc(100vw - 32px);
    padding: 16px 18px;
  }
}

/* Match the signature camera and caption to the homepage hero. */
#shopline-section-template--index__image-banner .block-tooltip__icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}
#shopline-section-template--index__image-banner .block-tooltip__icon svg {
  width: 20px;
  height: 20px;
}
#shopline-section-template--index__image-banner .block-tooltip .block-tooltip__content {
  box-sizing: border-box;
  top: auto;
  bottom: calc(100% + 12px);
  right: 0;
  left: auto;
  transform: none;
  width: 560px;
  min-width: 0;
  max-width: calc(100vw - 48px);
  padding: 20px 24px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1.5;
}
@media (max-width: 959px) {
  #shopline-section-template--index__image-banner .block-tooltip .block-tooltip__content {
    right: auto;
    left: 0;
    max-width: calc(100vw - 32px);
    padding: 16px 18px;
  }
}
