@use '../../utils' as *;

/*----------------------------------------*/
/*  4.1 Main menu css
/*----------------------------------------*/

.oit-header {
    &-menu {
        & nav {
            & ul {
                & li {
                    position: relative;

                    &.p-static {
                        position: static;
                    }

                    &.has-dropdown {
                        &>a {
                            transition: .3s;

                            &::after {
                                content: "\f063";
                                font-family: "Font Awesome 6 Pro";
                                display: inline-block;
                                font-size: 10px;
                                transition: 0.3s;
                                margin-inline-start: 5px;
                                transition: .3s;
                                transform: translateY(-1px) rotate(-45deg);
                            }
                        }
                    }

                    & .submenu {
                        position: absolute;
                        top: 100%;
                        inset-inline-start: 0;
                        width: 230px;
                        text-align: left;
                        padding: 30px 0;
                        opacity: 0;
                        visibility: hidden;
                        transition: 0.3s;
                        border-radius: 5px;
                        transition-duration: 0.1s;
                        transform-origin: top;
                        -webkit-transform: perspective(300px) rotateX(-18deg);
                        -moz-transform: perspective(300px) rotateX(-18deg);
                        -ms-transform: perspective(300px) rotateX(-18deg);
                        -o-transform: perspective(300px) rotateX(-18deg);
                        transform: perspective(300px) rotateX(-18deg);
                        background-color: var(--oit-clr-white);
                        border: 1px solid rgba(48, 48, 47, 0.1);
                        box-shadow: 0px 1px 2px 1px rgba(3, 11, 30, 0.06), 0px 1px 1px 0px rgba(3, 11, 30, 0.1);
                        z-index: 9999;

                        &.index-submenu {
                            width: 270px;
                        }

                        & li {
                            list-style: none;
                            display: block;
                            padding: 0 30px;

                            &:not(:last-child) {
                                margin-bottom: 5px;
                            }

                            & a {
                                font-weight: 600;
                                font-size: 16px;
                                position: relative;
                                display: inline-block;
                                letter-spacing: 0.2px;
                                text-transform: capitalize;
                                color: var(--oit-clr-black);

                                &::before {
                                    position: absolute;
                                    top: 13px;
                                    inset-inline-start: 0;
                                    content: "";
                                    height: 2px;
                                    width: 0px;
                                    opacity: 0;
                                    visibility: hidden;
                                    display: inline-block;
                                    transition: all 0.3s ease-out 0s;
                                    background-color: var(--oit-clr-black);
                                }
                            }

                            &:hover {
                                &>a {
                                    padding-inline-start: 20px;
                                    color: var(--oit-clr-black);
                                    &::before {
                                        width: 15px;
                                        visibility: visible;
                                        opacity: 1;
                                    }
                                }
                            }
                        }

                        & .submenu {
                            left: 100%;
                            top: 0;
                        }
                    }

                    & .has-home-img {
                        position: absolute;
                        left: 0;
                        right: 0;
                        width: 100%;
                        opacity: 0;
                        margin: 0 auto;
                        visibility: hidden;
                        text-align: center;
                        border-radius: 0;
                        padding: 55px 70px 20px 70px;
                        background-color: var(--oit-clr-white);
                        border: 1px solid rgba(48, 48, 47, 0.1);
                        box-shadow: 0px 1px 2px 1px rgba(3, 11, 30, 0.06), 0px 1px 1px 0px rgba(3, 11, 30, 0.1);
                        @media #{$xxl,$xl}{
                            padding: 30px;
                        }
                    }

                    & .oit-megamenu-wrap {
                        position: absolute;
                        left: 0;
                        right: 0;
                        width: 60%;
                        opacity: 0;
                        margin: 0 auto;
                        visibility: hidden;
                        padding: 30px 25px 30px 30px;
                        background-color: var(--oit-clr-white);
                        border: 1px solid rgba(48, 48, 47, 0.1);
                        box-shadow: 0px 1px 2px 1px rgba(3, 11, 30, 0.06), 0px 1px 1px 0px rgba(3, 11, 30, 0.1);
                        &.service-megamenu{
                            width: 70%;
                            @media #{$xxxl,$xxl} {
                                width: 80%;
                            }
                            @media #{$xxl} {
                                width: 90%;
                            }
                            @media #{$xl} {
                                width: 100%;
                            }
                        }

                        @media #{$xl} {
                            width: 75%;
                        }

                        & li {
                            padding: 0;
                        }
                    }

                    &:hover {
                        &.has-dropdown {
                            & a {
                                &::after {
                                    transform: rotate(-180deg);
                                }
                            }

                        }

                        &>.submenu {
                            visibility: visible;
                            opacity: 1;
                            transition-duration: .2s;
                            transform: (perspective(300px) rotateX(0deg));
                        }
                    }
                }
            }
        }
    }
}

.home-img {
    &:hover {
        & .home-img-thumb {
            &.home-img-overly::after {
                opacity: 1;
                visibility: visible;
            }
            & img{
                transform: scale(1.02);
            }
        }

        & .home-img-title {
            & a {
                color: var(--oit-clr-black);
            }
        }
    }
}

.home-img-thumb {
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    height: 254px;
    -webkit-transition: all 0.3s 0s ease-out;
    -moz-transition: all 0.3s 0s ease-out;
    -ms-transition: all 0.3s 0s ease-out;
    -o-transition: all 0.3s 0s ease-out;
    transition: all 0.3s 0s ease-out;
    box-shadow: 0px 1px 2px 1px rgba(3, 11, 30, 0.09), 0px 1px 1px 0px rgba(3, 11, 30, 0.15);
    @media #{$xxxl,$xxl,$xl}{
        height: 200px;
    }
    @media #{$lg,$md,$xs}{
        height: auto;
    }
    & img {
        width: 100%;
        height: 100%;
        transition: .9s;
    }

    &.home-img-overly::after {
        position: absolute;
        content: "";
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(1, 15, 28, 0.3);
        visibility: hidden;
        opacity: 0;
        transition: .3s;
        pointer-events: none;
    }

    &.coming-soon {
        position: relative;

        &::before {
            content: "";
            position: absolute;
            z-index: 2;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.2);
            backdrop-filter: blur(6px);
        }

        &::after {
            display: none;
        }
    }

}

.home-img {
    &-title {
        font-size: 17px;
        font-weight: 500;
        letter-spacing: -0.17px;
        color: var(--oit-clr-black);
    }
}

.oit-menu-mobile,
.oit-category-mobile-menu {
    & .oit-menu-content {
        margin-bottom: 70px;
    }

    & ul {
        position: static;
        display: block;
        box-shadow: none;

        & li {
            list-style: none;
            position: relative;
            width: 100%;
            padding: 0;

            &:not(:last-child) {
                &>a {
                    border-bottom: 1px solid rgba($color: #000, $alpha: 0.1);
                }
            }

            &.has-dropdown {
                & > a {
                    & .dropdown-toggle-btn {
                        position: absolute;
                        inset-inline-end: 0;
                        top: 25%;
                        transform: translateY(-2px);
                        font-size: 18px;
                        color: var(--oit-clr-black);
                        font-family: "Font Awesome 5 Pro";
                        transition: all .3s ease-in-out;
                        z-index: 1;
                        width: 25px;
                        height: 25px;
                        line-height: 21px;
                        text-align: center;
                        border: 1px solid rgba(176, 162, 162, 0.35);
                        transition: background-color .3s ease-in-out, border-color .3s ease-in-out, color .3s ease-in-out;

                        & i {
                            transition: all .3s ease-in-out;
                            margin-left: 2px;
                        }

                        &.dropdown-opened {
                            & i {
                                transform: rotate(90deg);
                            }
                        }

                        &:hover {
                            background-color: var(--oit-clr-black);
                            border-color: var(--oit-clr-black);
                            color: var(--oit-clr-white);

                            & i {
                                color: var(--oit-clr-white);
                            }
                        }
                    }

                }
                &.expanded {
                    color: var(--oit-clr-black);
                    & .dropdown-toggle-btn {
                        background-color: var(--oit-clr-black);
                        border-color: var(--oit-clr-black);
                        color: var(--oit-clr-white);
                        & i {
                            color: var(--oit-clr-white);
                        }
                    }
                }

                &:hover {
                    &>a {
                        &::after {
                            color: var(--oit-clr-black);
                        }
                    }
                }
            }

            &:last-child {
                & a {
                    & span {
                        border-bottom: 0;
                    }
                }
            }

            &>a {
                display: block;
                font-size: 16px;
                position: relative;
                padding: 10px 0;
                font-weight: 500;
                padding-inline-end: 20px;
                text-transform: capitalize;
                color: var(--oit-clr-black);

                &:hover {
                    color: var(--oit-theme-1);
                }

                & svg {
                    transform: translateY(-2px);
                }

                &>i {
                    display: inline-block;
                    width: 11%;
                    margin-right: 13px;
                    transform: translateY(4px);
                    font-size: 21px;
                    line-height: 1;
                }

                & .menu-text {
                    font-size: 16px;
                    line-height: 11px;
                    border-bottom: 1px solid #EAEBED;
                    width: 82%;
                    display: inline-block;
                    padding: 19px 0 17px;
                }
            }

            & img {
                width: 100%;
                height: 100%;
            }

            & ul {
                padding: 0;

                & li {
                    padding: 0;

                    & a {
                        margin-left: auto;
                        width: 93%;
                        padding: 10px 5%;
                        text-shadow: none !important;
                        visibility: visible;
                        padding-left: 0;
                        padding-right: 20px;

                    }

                    & li {
                        & a {
                            width: 88%;
                            padding: 10px 7%;
                            padding-left: 0;
                            padding-right: 20px;
                        }

                        & li {
                            & a {
                                width: 83%;
                                padding: 10px 9%;
                                padding-left: 0;
                                padding-right: 20px;
                            }

                            & li {
                                & a {
                                    width: 68%;
                                    padding: 10px 11%;
                                    padding-left: 0;
                                    padding-right: 20px;
                                }
                            }
                        }
                    }
                }
            }

            &:hover {
                &>a {

                    &::after {
                        color: var(--oit-theme-1);
                    }

                    & .dropdown-toggle-btn i {
                        color: var(--oit-theme-1);
                    }
                }

                & .mega-menu {
                    visibility: visible;
                    opacity: 1;
                    top: 0;
                }
            }

            & .mega-menu,
            & .submenu {
                position: static;
                min-width: 100%;
                padding: 0;
                box-shadow: none;
                visibility: visible;
                opacity: 1;
                display: none;

                & li {
                    float: none;
                    display: block;
                    width: 100%;
                    padding: 0;

                    &:hover {
                        & a {
                            & .dropdown-toggle-btn {
                                color: var(--oit-theme-1);
                            }
                        }
                    }
                }
            }
        }
    }

    & .oit-menu-content ul li:not(:last-child) .home-img-title a {
        border-bottom: none;
    }

    & *ul,
    & *li {
        transition: none !important;
    }
}


.service-megamenu{
    & .oit-megamenu-title{
        font-size: 20px;
    }
    & .oit-megamenu-item{
        margin-inline-start: 30px;
        & ul{
            padding-inline-start: 20px;
            padding-bottom: 20px;
            border-bottom: 1px solid rgba($color: #000000, $alpha: 0.1);
            & li {
                margin-bottom: 8px !important;
                & a {
                    font-size: 16px !important;
                    letter-spacing: 0; 
                    font-weight: 500;
                }
            }
        }
    }
}

.oit-megamenu {
    &-title {
        font-size: 17px;
        font-weight: 500;
        letter-spacing: -0.17px;
        margin-bottom: 20px;
        padding-bottom: 10px;
        color: var(--oit-clr-black);
        border-bottom: 1px solid rgba($color: #000000, $alpha: 0.1);
    }
    &-contact{
        & p{
            font-size: 18px;
        }
    }
}

/* ===== Left: service grid ===== */
.oit-megamenu-services {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    @media #{$lg,$md,$xs}{
        grid-template-columns: repeat(1, 1fr);
    }
}

/* ===== Service card ===== */
.oit-service-card {
    display: block;
    position: relative;
    padding: 30px 30px 28px;
    border-right: 1px solid rgba($color: #000000, $alpha: 0.1);
    border-bottom: 1px solid rgba($color: #000000, $alpha: 0.1);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s;

    @media #{$lg,$md,$xs}{
        padding: 20px 0;
        border-right: 0;
    }
    /* Remove bottom border on last row */
    &:nth-last-child(-n+2) {
        border-bottom: none;
        @media #{$lg,$md,$xs}{
            border-bottom: 1px solid rgba($color: #000000, $alpha: 0.1);
        }
    }

    &:hover {
        background: #F5F8F8;
        @media #{$lg,$md,$xs}{
            background: transparent;
        }
    }

    /* Hover: activate arrow */
    &:hover .oit-card-arrow {
        transform: rotate(-45deg);
        color: var(--oit-clr-white);
        background: var(--oit-clr-black);
        border-color: var(--oit-clr-black);
    }
}

/* Arrow icon (top-right corner of each card) */
.oit-card-arrow {
  position: absolute;
  top: 30px;
  inset-inline-end: 30px;
  width: 40px;
  height: 40px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: transparent;
  color: var(--oit-clr-black);
  border: 1px solid rgba($color: #000000, $alpha: 0.1);
  transition: background 0.18s, color 0.18s, transform 0.2s;
}

.oit-service-card{
    &__title{
        font-size: 24px;
        font-weight: 500;
        color: var(--oit-clr-black);
        margin-bottom: 4px;
    }
    &__num{
        margin-bottom: 7px;
    }
    &__desc{
        margin-bottom: 0;
        font-size: 18px;
    }
}