.tb-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100svh;
    z-index: 10000;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    place-items: center;

    &.tb-modal-container-visible {
        pointer-events: auto;
        display: grid;
    }
}

.tb-modal {
    overflow: hidden;
    margin: 0 auto;
    position: relative;
    background-color: #f9f9f9;
    padding: 2rem;
    border-radius: 0.5rem;

    .tb-modal-edge {
        position: absolute;
        box-shadow: inset 0 0 1.25rem 0.75rem #f9f9f9;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1;
        pointer-events: none;
    }

    .tb-modal-close-button {
        display: block;
        aspect-ratio: 1/1;
        position: absolute;
        top: 16px;
        right: 16px;
        padding: 0.3rem 0.6rem;
        z-index: 2;
    }

    .tb-modal-content {
        position: relative;
    }
}

.tb-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 10000;

    &.is-active {
        opacity: 1;
        pointer-events: auto;
    }
}

html.tb-modal-open,
body.tb-modal-open {
    overflow: hidden;
}

.tb-modal-header {
    position: sticky;
    margin-bottom: 2rem;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    background: transparent;
}

.tb-modal-close {
    position: absolute;
    top: -0.5rem;
    left: -0.67rem;
    width: 2.75rem;
    height: 2.75rem;
    display: grid !important;
    place-items: center;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    color: #ffffff !important;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    opacity: 0.9;

    &.mobile-modal-close {
        top: 0.4rem;
        right: -3.2rem;
    }

    &::before,
    &::after {
        content: "";
        position: absolute;
        left: 0.4rem;
        right: 0.4rem;
        top: 50%;
        height: 3px;
        border-radius: 999px;
        background: linear-gradient(
                90deg,
                rgba(28, 44, 84, 0.95),
                rgba(198, 156, 109, 0.90)
        );
        transform-origin: center;
        transition: transform 180ms cubic-bezier(.2, .8, .2, 1), opacity 160ms ease, scale 200ms ease;
    }

    &::before {
        transform: translateY(-50%) rotate(45deg);
    }

    &::after {
        transform: translateY(-50%) rotate(-45deg);
    }

    &:hover {
        opacity: 1;
        transform: scale(1.2);
    }

    &:active {
        transform: scale(1);
    }
}

.ct-div-block.tb-custom-modal {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    max-width: 80rem;
    width: min(92vw, 60rem);
    max-height: 80vh;
    padding: 1.4rem 1.6rem;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    background-color: rgba(0, 0, 0, 0.7);
    background-image: radial-gradient(
            circle at -20% 15%,
            rgba(40, 70, 140, 0.35) 0%,
            rgba(25, 50, 110, 0.55) 20%,
            rgba(15, 30, 80, 0.75) 40%,
            rgba(8, 15, 40, 0.90) 65%,
            rgba(0, 0, 0, 0.95) 100%
    );
    background-attachment: local;
    border: 1px solid #0024ff;
    border-radius: 0.5rem;
    box-shadow: 4px 4px 9px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 10001;

    &.is-open {
        display: block;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

body.oxygen-builder-body .tb-modal-overlay {
    display: none !important;
}

body.oxygen-builder-body .tb-custom-modal {
    display: block !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    max-height: none !important;
    width: 100% !important;
    opacity: 1 !important;
    z-index: auto !important;
}
