@use '../utils' as *;

/*----------------------------------------*/
/*  2.10 Search css start
/*----------------------------------------*/

.#{$theme-prifix}-search{
    &-form{
        &-toggle{
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            background-color: var(--tp-common-white);
            z-index: 100;
            padding-top: 70px;
            padding-bottom: 100px;
            opacity: 0;
            -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
            -webkit-transform: translateY(calc(-100% - 80px));
            -ms-transform: translateY(calc(-100% - 80px));
            transform: translateY(calc(-100% - 80px));
            -webkit-transition: opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;
            transition: opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;
            transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
            transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;
            -webkit-transition-delay: 0.5s;
            transition-delay: 0.5s;
            z-index: 9999;
            &.active {
                opacity: 1;
                -webkit-transform: translateY(0%);
                -ms-transform: translateY(0%);
                transform: translateY(0%);
                -webkit-transition-delay: 0s;
                transition-delay: 0s;
                & .tp-search-form-input{
                    transform: translateY(0px);
                    opacity: 1;
                    transition-delay: 0.3s;
                }
            }
        }
        &-icon{
            position: absolute;
            top: 50%;
            right: 0;
            -webkit-transform: translateY(-50%);
            -ms-transform: translateY(-50%);
            transform: translateY(-50%);
            font-size: 22px;
            color: var(--tp-common-black);
        }
        &-input{
            position: relative;
            height: 52px;
            transform: translateY(-40px);
            transition: all 0.3s ease-in-out;
            transition-delay: 0.5s;
            opacity: 0;
            & input{
                width: 100%;
                height: 100% ;
                background-color: transparent;
                border: 0;
                outline: 0;
                font-size: 24px;
                font-weight: 400;
                color: var(--tp-common-black);
                border-bottom: 1px solid var(--tp-border-1) ;
                font-family: var(--tp-ff-inter);
                padding: 0;
                padding-right: 30px;
                @include placeholder{
                    font-size: 24px;
                    color: var(--tp-grey-1);
                }
                & ~ .tp-search-focus-border {
                    position: absolute;
                    bottom: 0;
                    left: auto;
                    right: 0;
                    width: 0;
                    height: 1px;
                    background-color: var(--tp-common-black);
                    transition: all 0.5s;
                }
                &:focus{
                    border-color: transparent;
                }
                &:focus ~ .tp-search-focus-border {
                    width: 100%;
                    left: 0;
                    right: auto;
                    transition: all 0.8s;
                }
            }
        }
    }
    &-close{
        color: var(--tp-common-black);
        font-size: 40px;
        transition: all .3s ease;
        &:hover{
            color: var(--tp-grey-1);
            transform: rotate(180deg);
        }
    }
    &-body{
        &-overlay {
            position: fixed;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(24, 24, 24, 0.5);
            z-index: 99;
            cursor: -webkit-zoom-out;
            cursor: zoom-out;
            -webkit-transform: translateY(calc(-100% - 80px));
            -ms-transform: translateY(calc(-100% - 80px));
            transform: translateY(calc(-100% - 80px));
            -webkit-transition: all 0.5s ease-in-out 0s;
            transition: all 0.5s ease-in-out 0s;
            -webkit-transition-delay: 0.3s;
            transition-delay: 0.3s;
            &.active{
                -webkit-transform: translateY(0);
                -ms-transform: translateY(0);
                transform: translateY(0);
            }
        }
    }
    &-dark{
        background-color: var(--tp-common-black);
        & .tp-search-form-input input {
            color: var(--tp-common-white);
            border-bottom: 1px solid var(--tp-border-3);
            & ~ .tp-search-focus-border {
                background-color: var(--tp-common-white);
            }
        }
        & .tp-search-close {
            color: var(--tp-common-white);
        }
        & .tp-search-close:hover {
            color: var(--tp-grey-2);
        }
        & .tp-search-form-icon {
            color: var(--tp-common-white);
        }
    }
}