/* Webbo Tooltip -----------------------------------------------------------
 * One shared portal is used for every enabled Elementor element. Per-element
 * styling is stored as CSS custom properties on the Elementor wrapper and is
 * copied to the portal only while that target is active. */
.webbo-tooltip-portal {
    --webbo-tooltip-bg: #111827;
    --webbo-tooltip-color: #ffffff;
    --webbo-tooltip-font-family: inherit;
    --webbo-tooltip-font-size: 14px;
    --webbo-tooltip-font-weight: 400;
    --webbo-tooltip-line-height: 1.4em;
    --webbo-tooltip-padding: 8px 12px;
    --webbo-tooltip-border-style: none;
    --webbo-tooltip-border-width: 1px;
    --webbo-tooltip-border-color: rgba(255, 255, 255, 0.12);
    --webbo-tooltip-radius: 6px;
    --webbo-tooltip-shadow: 0 8px 24px rgba(17, 24, 39, 0.14);
    --webbo-tooltip-max-width: 280px;

    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: max-content;
    max-width: min(var(--webbo-tooltip-max-width), calc(100vw - 16px));
    padding: var(--webbo-tooltip-padding);
    color: var(--webbo-tooltip-color);
    background: var(--webbo-tooltip-bg);
    border-style: var(--webbo-tooltip-border-style);
    border-width: var(--webbo-tooltip-border-width);
    border-color: var(--webbo-tooltip-border-color);
    border-radius: var(--webbo-tooltip-radius);
    box-shadow: var(--webbo-tooltip-shadow);
    font-family: var(--webbo-tooltip-font-family);
    font-size: var(--webbo-tooltip-font-size);
    font-weight: var(--webbo-tooltip-font-weight);
    line-height: var(--webbo-tooltip-line-height);
    text-align: start;
    overflow-wrap: anywhere;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transform: translate3d(0, 0, 0);
    transition: opacity 160ms ease, transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
    /* Do not use paint containment here: the arrow intentionally protrudes
     * outside the tooltip box and paint containment clips it. */
    contain: layout style;
    overflow: visible;
}

.webbo-tooltip-portal.is-measuring {
    visibility: hidden;
    opacity: 0;
    transition: none !important;
}

.webbo-tooltip-portal.is-visible {
    visibility: visible;
    opacity: 1;
}

.webbo-tooltip-portal[data-animation="none"] {
    transition: none;
}

.webbo-tooltip-portal[data-animation="fade"] {
    transform: translate3d(0, 0, 0) !important;
}

.webbo-tooltip-portal[data-animation="fade_move"][data-position="top"]:not(.is-visible) {
    transform: translate3d(0, 5px, 0);
}

.webbo-tooltip-portal[data-animation="fade_move"][data-position="bottom"]:not(.is-visible) {
    transform: translate3d(0, -5px, 0);
}

.webbo-tooltip-portal[data-animation="fade_move"][data-position="left"]:not(.is-visible) {
    transform: translate3d(5px, 0, 0);
}

.webbo-tooltip-portal[data-animation="fade_move"][data-position="right"]:not(.is-visible) {
    transform: translate3d(-5px, 0, 0);
}

.webbo-tooltip-portal[data-position="cursor"] {
    transform: translate3d(0, 0, 0) !important;
}

.webbo-tooltip-portal__content > :first-child {
    margin-top: 0;
}

.webbo-tooltip-portal__content > :last-child {
    margin-bottom: 0;
}

.webbo-tooltip-portal__arrow {
    position: absolute;
    width: 9px;
    height: 9px;
    background: var(--webbo-tooltip-bg);
    transform: rotate(45deg);
    pointer-events: none;
}

.webbo-tooltip-portal[data-arrow="no"] .webbo-tooltip-portal__arrow,
.webbo-tooltip-portal[data-position="cursor"] .webbo-tooltip-portal__arrow {
    display: none;
}

.webbo-tooltip-portal[data-position="top"] .webbo-tooltip-portal__arrow {
    left: 50%;
    bottom: -4px;
    margin-left: -4.5px;
}

.webbo-tooltip-portal[data-position="bottom"] .webbo-tooltip-portal__arrow {
    left: 50%;
    top: -4px;
    margin-left: -4.5px;
}

.webbo-tooltip-portal[data-position="left"] .webbo-tooltip-portal__arrow {
    top: 50%;
    right: -4px;
    margin-top: -4.5px;
}

.webbo-tooltip-portal[data-position="right"] .webbo-tooltip-portal__arrow {
    top: 50%;
    left: -4px;
    margin-top: -4.5px;
}

@media (prefers-reduced-motion: reduce) {
    .webbo-tooltip-portal {
        transition: none !important;
        transform: none !important;
    }
}

/* Standalone Tooltip controller -------------------------------------------
 * The widget is a configuration/controller node only. Keep its Elementor
 * wrapper out of frontend layout entirely, including flex/grid gaps, while
 * showing a small selectable card inside the editor canvas. */
.webbo-tooltip-controller-widget {
    display: none !important;
}

.elementor-editor-active .webbo-tooltip-controller-widget {
    display: block !important;
    width: 100%;
}

.webbo-tooltip-controller-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 12px;
    color: #111827;
    background: rgba(255, 255, 255, 0.9);
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    line-height: 1.25;
}

.webbo-tooltip-controller-preview__icon {
    flex: 0 0 auto;
    font-size: 18px;
}

.webbo-tooltip-controller-preview__copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.webbo-tooltip-controller-preview__copy strong {
    font-size: 12px;
    font-weight: 600;
}

.webbo-tooltip-controller-preview__copy small {
    overflow: hidden;
    color: #6b7280;
    font-size: 11px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}
