/**
 * TrustWeb Builder — Popup templates.
 * Isolated namespace; no dependency on Off-Canvas or Elementor Pro.
 */
.twb-popup[hidden] {
    display: none !important;
}

.twb-popup,
.twb-popup *,
.twb-popup *::before,
.twb-popup *::after {
    box-sizing: border-box;
}

.twb-popup {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .26s ease, visibility .26s ease;
}

.twb-popup.is-open {
    opacity: 1;
    visibility: visible;
}

.twb-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 18, 28, .62);
    cursor: pointer;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.twb-popup__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    overflow: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -16px 60px rgba(10, 19, 33, .24);
    transform: translateY(24px);
    opacity: 0;
    transition: transform .26s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
    -webkit-overflow-scrolling: touch;
}

.twb-popup.is-open .twb-popup__dialog {
    transform: translateY(0);
    opacity: 1;
}

.twb-popup__content {
    width: 100%;
    min-width: 0;
}

.twb-popup__content > .elementor {
    width: 100%;
}

.twb-popup__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(19, 30, 47, .1);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: #172033;
    box-shadow: 0 6px 18px rgba(15, 24, 38, .12);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.twb-popup__close:hover {
    background: #fff;
}

.twb-popup__close:focus-visible,
.twb-popup__dialog:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.twb-popup__sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

html.twb-popup-open,
html.twb-popup-open body {
    overflow: hidden !important;
    overscroll-behavior: none;
}

@media (min-width: 768px) {
    .twb-popup {
        align-items: center;
        padding: 24px;
    }

    .twb-popup__dialog {
        width: min(860px, calc(100vw - 48px));
        max-height: calc(100vh - 48px);
        max-height: calc(100dvh - 48px);
        border-radius: 20px;
        box-shadow: 0 24px 80px rgba(10, 19, 33, .28);
        transform: translateY(12px) scale(.985);
    }

    .twb-popup.is-open .twb-popup__dialog {
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .twb-popup,
    .twb-popup__dialog {
        transition-duration: .01ms !important;
    }
}
