body:has(.enquiry-overlay.active) {
    overflow: hidden;
}

body {
    @media (max-width: 768px) {
        padding-bottom: 100px;
    }
}

#enquiryOverlay {
    --triggerHeight: 70px;

    div.trigger {
        position: fixed;
        bottom: 20px;
        right: 20px;
        height: var(--triggerHeight);
        background-color: var(--colourBrand);
        border-radius: 32px;
        
        cursor: pointer;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
        padding-left: 18px;
        padding-right: 18px;
        color: white;
        white-space: nowrap;
        width: fit-content; 
        z-index: 101;
        user-select: none;

        @media (max-width: 768px) {
            left: 20px;
            bottom: 10px;
            width: unset;
            transform-style: preserve-3d;

            &::after {
                transform: translateZ(-1px);
                content: ' ';
                background-color: white;
                position: fixed;
                left: -20px;
                right: -20px;
                bottom: -20px;
                height: 80px;
                box-shadow: var(--layoutShadow);
            }
        }

        > div {
            display: flex;
            gap: 9px;
            align-items: center;
            justify-content: center;
            height: 100%;

            svg {
                fill: white;
                width: 30px;
            }

            &.close {
                display: none;
            }
        }

        &:hover {
            background-color: color-mix(in srgb, var(--colourBrand) 80%, black 20%);
        }

        &:active {
            background-color: color-mix(in srgb, var(--colourBrand) 70%, black 30%);
        }
    }

    &.active {
        div.trigger {
            > div.open {
                display: none;
            }

            > div.close {
                display: flex;
            }
        }

        div.backdrop {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 100;
        }

        div.overlay {
            display: block;
            position: fixed;
            bottom: calc(40px + var(--triggerHeight));
            right: 20px;
            max-width: 450px;
            width: calc(100% - 40px);
            min-height: 200px;
            max-height: calc(100% - var(--triggerHeight) - 50px);
            overflow-y: auto;
            background-color: white;
            border-radius: 5px;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
            z-index: 101;
        }
    }

    &.loading {
        div.overlay {
            div.loading-state {
                display: flex;
            }
        }
    }

    &.success {
        div.overlay {
            > * {
                display: none !important;
            }

            div.success-state {
                display: block !important;
            }
        }
    }

    div.overlay {
        display: none;

        div.loading-state {
            display: none;

            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: rgba(0, 0, 0, 0.7);
            align-items: center;
            justify-content: center;
            z-index: 101;

            img.cog {
                width: 100px;
                aspect-ratio: 1/1;
                animation: rotation-anim 1.5s infinite linear;
                filter: drop-shadow(0px 0px 50px rgba(255, 255, 255, 0.5));
            }
        }

        div.success-state {
            display: none;

            text-align: center;
            img {
                max-width: 250px;
                margin: 36px auto;
            }

            p:last-child {
                margin-bottom: 36px;
            }
        }

        p.title {
            font-family: 'Inter Black';
            font-size: 1.2rem;
            text-align: center;
            margin-bottom: 18px;
        }

        div.top {
            display: flex;
            gap: 18px;
            flex-direction: column;
            align-items: center;
            margin-bottom: 18px;

            div.contact-methods {
                display: flex;
                flex-direction: column;
                gap: 9px;
            }

            div.or {
                display: flex;
                gap: 9px;
                align-items: center;

                &::before, &::after {
                    border-top: solid 1px var(--colourBorder);
                    content: ' ';
                    width: 40px;
                }
            }
        }

        form {
            margin-top: 18px;
            max-width: 400px;
            margin-left: auto;
            margin-right: auto;

            button {
                margin-top: 18px;
            }

            div.cf-turnstile {
                display: block;
                margin-left: auto;
                margin-right: auto;
                width: fit-content;
            }
        }
    }

    @media (max-width: 768px) {
        --triggerHeight: 50px;

        div.overlay {
            form {
                div.input-row {
                    flex-direction: column;
                }
            }
        }
    }
}