.footer {
    position: relative;
    padding: 7rem 0 2.5rem;
    background-color: $primary;
    overflow: hidden;

    // .footer__bg
    &__bg {
        width: 46rem;
        height: auto;
        position: absolute;
        top: unset;
        bottom: -2rem;
        right: -19rem;
        opacity: .2;
        @media (min-width: $tabletSmallP1) {
            top: -9rem;
            width: 46rem;
            right: -10rem;
            bottom: unset;
        }

        img {
            width: 100%;
            height: auto;
            object-fit: contain;
        }
    }

    // .footer__container

    &__container {
        color: $white;
        position: relative;
        z-index: 2;

        a {
            color: inherit;

            &:hover {
                color: $secondary;
            }
        }
    }

    // .footer__main

    &__main {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3rem;

        @media(min-width: $tabletSmallP1) {
            align-items: flex-start;
            gap: 2rem;
        }

        @media(min-width: $tabletLargeP1) {
            flex-direction: row;
            justify-content: space-between;
        }

        h2 {
            color: $secondary;
            font-weight: 500;
            font-size: 1.4rem;
            line-height: 1.5;
            letter-spacing: 0;
            margin-top: 0;

            & + .footer__link-wrapper {
                margin-top: .8rem;
            }
        }

    }

    // .footer__logo

    &__logo {
        max-width: 12.5rem;
        width: 100%;
        flex-shrink: 0;

        img, svg {
            width: 100%;
            height: auto;
        }
    }

    // .footer__columns

    &__columns {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
        width: 100%;

        @media(min-width: $tabletSmallP1) {
            display: grid;
            grid-template-columns: 1fr;
            grid-template-columns: repeat(3, 1fr);
            align-items: flex-start;
            gap: 1.5rem;
        }

        @media(min-width: $tabletLargeP1) {
            grid-template-columns: auto auto 22.6rem;
            max-width: 71.7rem;
        }

        br {
            display: none;
            @media(min-width: $tabletSmallP1) {
                display: block;
            }
        }
    }

    // .footer__column

    &__column {
        text-align: center;

        @media(min-width: $tabletSmallP1) {
            text-align: left;
        }

        ul:not(.footer__social) {
            list-style: none;
            padding: 0;
            margin-top: .8rem;

            li {
                margin: 0;
                padding: 0;

                a {
                    padding-block: .9rem;
                    font-weight: 500;
                    line-height: 1;
                    text-decoration: underline;
                    display: block;
                    @media(min-width: $tabletSmallP1) {
                        display: flex;
                    }
                }
            }

            
        }

        a {
            font-size: 1.4rem;
        }
    }

    // .footer__link-wrapper

    &__link-wrapper {
        a {
            text-decoration: underline;
            line-height: 1.5;
            display: block;
        }

        p {
            line-height: 1.5;
            margin: 0;
            font-size: 1.4rem;
        }
    }

    // .footer__social

    &__social {
        display: flex;
        align-items: center;
        justify-content: center;
        list-style: none;
        padding: 0;
        gap: 1.1rem;
        margin-top: 3rem;

        @media(min-width: $tabletSmallP1) {
            justify-content: flex-start;
            margin-top: 2rem;
        }

        li {
            padding: 0;
            margin: 0;
            cursor: pointer;

            transition: .2s all;
        }

        a {
            max-width: 2.9rem;
            width: 100%;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            text-decoration: none !important;
            padding-block: 0 !important;
            position: relative;
            
            &::before {
                content: '';
                width: 4.4rem;
                height: 4.4rem;
                position: absolute;
                top: 50%;
                left: 0;
                transform: translateY(-50%);
            }

            &:hover {
                transform: translateY(-.4rem);
            }

            img {
                width: 100%;
                height: auto;
            }
        }
    }

    // .footer__logos

    &__logos {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2.2rem;
        margin-top: 2rem;
        a {
            max-width: 10.3rem;
            width: 100%;
            flex-shrink: 0;

            img {
                width: 100%;
                height: auto;
            }
        }
    }

    // .footer__form

    &__form {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;

        @media(min-width: $tabletLargeP1) {
            max-width: 45.1rem;
            display: block;
        }

        p {
            margin-top: 1rem;
            font-size: 1.4rem;
            display: none;

            @media(min-width: $tabletSmallP1) {
                display: block;
            }


        }

        form {
            display: flex;
            align-items: center;
            flex-direction: column;
            gap: 1.6rem;
            width: 100%;

            @media(min-width: $tabletLargeP1) {
                flex-direction: row;
            }

            &:not(:first-child) {
                margin-top: 1rem;
            }

            input {
                background-color: #D6D1BD;
                border-radius: .5rem;
                overflow: hidden;
                padding: .9rem 1.2rem;
                min-height: 4rem;
                min-width: 27.5rem;
                max-width: 100%;
                width: 100%;
                border: none;
                outline: none;
                text-align: center;

                @media(min-width: $tabletSmallP1) {
                    text-align: left;
                }

                @media(min-width: $tabletLargeP1) {
                    max-width: 50rem;
                }
            }

            button {
                background-color: #B4D2D2;
                width: 100%;
                
                @media(min-width: $tabletLargeP1) {
                    width: fit-content;
                }
            }

            & + p {
                font-size: 1.2rem;
                font-weight: 500;
                text-align: center;
                display: block;
                @media(min-width: $tabletSmallP1) {
                    text-align: left;
                }

                @media(max-width: $tabletSmall) {
                    margin-top: 1.8rem;
                }
            }
        }
    }

    // .footer__copy

    &__copy {
        display: flex;
        align-items: center;
        flex-direction: column;
        gap: 2rem;
        margin-top: 3rem;

        font-size: 1.2rem;
        line-height: 1.6;
        letter-spacing: 0;

        @media(min-width: $tabletSmallP1) {
            margin-top: 2.8rem;
        }

        @media(min-width: $tabletLargeP1) {
            flex-direction: row;
            justify-content: space-between;
        }

        p, li, a {
            color: rgba($white, .25);
            font-size: 1.2rem;
            line-height: 1.5;
        }

        a {
            &:hover {
                color: $secondary;
            }
        }

        ul {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            align-items: center;
            gap: .5rem;

            li {
                margin: 0;
                padding: 0;
                padding-left: .5rem;
                position: relative;

                &::before {
                    content: '';
                    width: .1rem;
                    height: 100%;
                    position: absolute;
                    top: 0;
                    left: 0;
                    background-color: rgba($white, .25);
                }

                &:first-child {
                    padding-left: 0;

                    &::before {
                        display: none;
                    }
                }
            }
        }
    }

    // .footer__copy-left

    &__copy-left {
        display: flex;
        align-items: center;
        gap: .5rem;
        flex-wrap: wrap;
        justify-content: center;

        @media(min-width: $tabletSmallP1) {
            flex-wrap: nowrap;
            justify-content: left;
        }

        p {
            margin: 0;
            text-align: center;

            @media(min-width: $tabletSmallP1) {
                text-align: left;
            }
        }

    }

    // .footer__copy-rigth

    &__copy-rigth {

        p {
            text-align: center;
            @media(min-width: $tabletSmallP1) {
                text-align: left;
            }
        }
        

        a {
            text-decoration: underline;
            position: relative;

            &:before {
                content: "";
                width: 100%;
                height: 4.4rem;
                position: absolute;
                top: 50%;
                left: 0;
                transform: translateY(-50%);
            }

        }
    }
}
