/**=====================
      Header CSS Start
==========================**/
@use "../utils/variables" as *;

%for-animated-hover {
    box-shadow: 1px 2px 3px -3px rgba($dark-color, 0.60);
    transform: translateY(12px);
    opacity: 0;
    visibility: hidden;
    right: 0;
}

%for-animated-hover-box {
    opacity: 1;
    transform: translateY(0px);
    visibility: visible;
}

.logo-wrapper {
    @media (max-width: 480px) {
        display: none;
    }

    img {
        &.light-mode {
            display: flex;
        }

        &.dark-mode {
            display: none;
        }
    }

    .sm-logo {
        display: none;
    }
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;

    .logo-wrapper {
        a {
            display: inline-block;
            width: auto;
            object-fit: contain;

            img {
                width: 144px;
                height: 32px;
            }
        }
    }

    >a {
        font-size: unset;
        line-height: unset;
        height: unset;
        width: 38px;
        height: 38px;
        // background: rgba($white, 0.08);
        background: rgba($primary-color, 0.1);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;

        body.dark & {
            background-color: rgba($primary-color, 1) !important;
        }

        img {
            filter: brightness(0);

            body.dark & {
                filter: none !important;
            }
        }
    }
}

.page-wrapper {
    .page-main-header {
        // background-color: rgba($primary-color, 1);
        background-color: #F3F4F6;
        position: $main-header-position;
        height: $header-size;
        top: $main-header-top;
        z-index: 6;
        width: calc(100vw - $sidebar-width);
        display: flex;
        align-items: center;
        transition: 0.3s;
        margin-left: $sidebar-width;
        // box-shadow: 2px 0px 9px #eee;

        &.open {
            margin-left: 120px;
            width: calc(100vw - 120px);
            transition: $sidebar-transition;
        }

        .main-header {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            padding: $main-header-padding;
            margin: 0;

            i {
                color: rgba($primary-color, 1);
                font-size: 20px;
            }

            .nav-menus {
                display: flex;
                align-items: center;
                font-size: 15px;

                li {
                    color: $dark-color;
                    padding: $header-li-padding;

                    &:empty {
                        display: none;
                    }

                    a {
                        color: #222222;
                        font-weight: 400;
                        display: flex;
                        align-items: center;
                        gap: 10px;
                        min-width: max-content;
                        width: 100%;
                        font-size: 14px;

                        body.dark & {
                            color: white;
                        }
                    }

                    &.onhover-dropdown {
                        .badge {
                            height: 16px;
                            width: 16px;
                            position: absolute;
                            top: -4px;
                            right: -1px;
                            font-size: 11px;
                        }
                    }
                }

                .dark-light-mode {
                    cursor: pointer;

                    .light-mode {
                        display: flex;
                    }

                    .dark-mode {
                        display: none;
                    }
                }
            }

            .nav-left {
                .nav-menus {
                    li {
                        padding: 6px;

                        &:empty {
                            display: none;
                        }
                    }

                    .new-btn {
                        padding: 8px 17px;
                        color: rgba($primary-color, 1);
                        font-weight: 500;
                        border-radius: 10px;
                        overflow: hidden;
                        position: relative;
                        z-index: 0;
                        box-shadow: 4px 2px 2px rgb(38 38 38 / 50%);
                        background: rgb(34 34 34 / 12%);
                        transition: all .4s ease-in-out;

                        body.dark & {
                            background-color: rgba($primary-color, 1) !important;
                            color: white !important;

                            i {
                                color: white !important;
                            }
                        }

                        &:hover,
                        &:active,
                        &.active {
                            box-shadow: 0px 0px 2px rgb(38 38 38 / 50%);
                            transition: all .4s ease-in-out;
                        }

                        // &::before {
                        //     content: "";
                        //     position: absolute;
                        //     top: 0;
                        //     left: 0;
                        //     width: 100%;
                        //     height: 100%;
                        //     // background-color: rgba($white, 1);
                        //     background-color: #222222b0;
                        //     // opacity: .1;
                        //     z-index: -1;
                        // }

                        i {
                            color: rgba($primary-color, 1);
                        }

                        &.custom-padding {
                            padding: 4px 17px;
                        }
                    }

                    .onhover-dropdown {
                        .onhover-show-div {
                            ul {
                                li {
                                    padding: 0;
                                    margin-bottom: 8px;

                                    &:last-child {
                                        margin-bottom: 0;
                                    }

                                    a {
                                        line-height: 1.5;
                                    }
                                }
                            }
                        }

                        .quick-dropdown-box {
                            .onhover-show-div {
                                right: unset;
                                padding: 0;

                                .dropdown-title {
                                    padding: 18px;
                                    border-bottom: 1px dashed $white-dark;
                                    color: $dark-font;

                                    h4 {
                                        margin-bottom: 0;
                                        font-size: 18px;
                                        font-weight: 600;
                                    }
                                }

                                .dropdown-list {
                                    display: grid;
                                    grid-template-columns: 1fr 1fr;
                                    width: 350px;
                                    text-align: center;

                                    li {
                                        margin-bottom: 0;

                                        &:nth-child(odd) {
                                            border-right: 1px dashed $white-dark;
                                        }
                                    }

                                    a {
                                        display: grid !important;
                                        font-size: 13px;
                                        padding: 12px;
                                        border-top: unset;
                                        border-bottom: 1px dashed $white-dark;
                                        opacity: 1;
                                        color: $dark-font !important;

                                        &:hover {
                                            .svg-box {
                                                i {
                                                    body.dark & {
                                                        color: white !important;
                                                    }
                                                }
                                            }
                                        }

                                        .svg-box {
                                            width: 40px;
                                            height: 40px;
                                            border: 1px solid $white-dark;
                                            background-color: #F3F3F3;
                                            border-radius: 100%;
                                            display: flex;
                                            align-items: center;
                                            justify-content: center;
                                            margin-inline: auto;

                                            i {
                                                color: rgba($primary-color, 1);

                                                body.dark & {
                                                    color: white;
                                                }
                                            }
                                        }

                                        span {
                                            font-weight: 500;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            .mobile-sidebar {
                padding: 0;
                margin-top: -3px;

                i {
                    font-size: 22px;
                }
            }

            .nav-right {
                text-align: right;
                padding-left: $main-header-nav-right;

                ul {
                    gap: 15px;

                    @media (max-width: 991px) {
                        gap: 8px;
                    }

                    li {
                        &.onhover-dropdown {
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            width: calc(35px + (40 - 35) * ((100vw - 320px) / (1920 - 320)));
                            height: calc(35px + (40 - 35) * ((100vw - 320px) / (1920 - 320)));
                            // background-color: rgba($white, 0.08);
                            background-color: rgba($primary-color, 0.1);
                            border-radius: 10px;
                            // box-shadow: inset 4px 0px 10px #eeeeee7d;

                            >a {
                                justify-content: center;

                                &:hover {
                                    animation: shake 2s ease infinite;
                                }
                            }

                            i {
                                &:hover {
                                    animation: shake 2s ease infinite;
                                }
                            }
                        }

                        &:last-child {
                            padding: unset;
                            width: unset;
                            height: unset;
                            background-color: unset;
                            border-radius: unset;
                        }

                        .media {
                            .dotted-animation {
                                position: relative;
                                right: -3px;
                                top: -7px;

                                .animate-circle {
                                    position: absolute;
                                    top: -20px;
                                    right: -4px;
                                    height: 25px;
                                    width: 25px;
                                    z-index: 10;
                                    border: 5px solid $primary-color;
                                    border-radius: 70px;
                                    animation: heartbit 1s ease-out;
                                    animation-iteration-count: infinite;
                                }

                                .main-circle {
                                    width: 6px;
                                    height: 6px;
                                    border-radius: 30px;
                                    background-color: var(--primary-color);
                                    position: absolute;
                                    right: 6px;
                                    top: -10px;
                                }
                            }
                        }

                        svg {
                            width: $main-header-nav-icon-size;
                            height: $main-header-nav-icon-size;

                            path {
                                color: $main-header-nav-icon-color;
                            }
                        }

                        .dot {
                            width: 3px;
                            height: 3px;
                            border-radius: 30px;
                            background-color: $main-header-nav-icon-color;
                            position: absolute;
                            right: 17px;
                            bottom: 6px;
                            animation: blink 1.5s infinite;
                        }

                        .dot-chat {
                            right: 4px;
                            bottom: -11px;
                        }

                        &.currency-dropdown {
                            @media (max-width: 767px) {
                                padding: 4px 6px !important;
                            }

                            >a {
                                &.txt-dark {
                                    min-width: unset;
                                }
                            }

                            .onhover-show-div {
                                li {
                                    width: 100%;
                                    padding: 6px 10px;

                                    &:hover {
                                        a {
                                            color: var(--primary-color);
                                        }
                                    }

                                    a {
                                        transition: all 0.2s ease-in-out;
                                        display: flex;
                                        align-items: center;
                                        gap: 8px;
                                    }
                                }
                            }
                        }
                    }
                }

                >ul {
                    display: flex;
                    justify-content: flex-end;
                    align-items: center;
                    padding: 0 20px 0 10px;

                    @media (max-width: 991px) {
                        padding-right: unset;
                    }

                    >li {
                        position: relative;

                        &:first-child {
                            border-left: none;
                        }
                    }
                }

                .language-dropdown {
                    min-width: 160px;
                    width: max-content;
                    text-align: left;
                    left: unset;
                    right: 0;
                    border-radius: 6px;

                    li {
                        display: block;
                        padding: 4px 0;

                        a {
                            display: flex;
                            align-items: center;
                            gap: 8px;
                            font-size: 14px;

                            i {
                                margin-right: 10px;
                            }

                            span {
                                transition: all 0.35s ease;
                                transform: translateX(0px);
                            }
                        }

                        img {
                            width: 25px;
                        }

                        &:first-child {
                            padding-top: 0;
                        }

                        &:hover {
                            a {
                                span {
                                    transition: all 0.35s ease;
                                    transform: translateX(4px);
                                    color: $dark-color;
                                }
                            }
                        }
                    }
                }

                .profile-dropdown {
                    right: 0;
                    top: 60px;

                    &:before,
                    &:after {
                        left: inherit;
                        right: 0;
                    }

                    li {
                        display: block;
                        text-align: left;
                        padding: 0;
                        margin-bottom: 8px;

                        &:last-child {
                            margin-bottom: 0;
                        }

                        a {
                            i {
                                line-height: 1;
                                color: currentColor;
                            }
                        }
                    }

                    .inner-dropdown {
                        display: flex;
                        align-items: flex-start;
                        gap: 14px;

                        img {
                            width: 64px;
                            height: 64px;
                        }
                    }
                }
            }

            li {
                display: inline-block;
                position: relative;
            }
        }
    }

    .page-body-wrapper {
        .page-body {
            min-height: calc(100vh - 131px);
            margin-top: $header-size;
            margin-bottom: $footer-size;
            padding: $page-body-padding;
            padding: 20px 15px 27px 10px;
            position: relative;
            background-color: #F3F4F6;
            padding-top: 15px;
        }
    }
}

.nav-menus {
    .cleaning {
        &:hover {
            animation: shake 2s ease infinite;
        }
    }

    .onhover-dropdown {
        cursor: pointer;
        position: relative;

        &:before {
            display: none;
        }

        &:hover {
            .onhover-show-div {
                @extend %for-animated-hover-box;
            }
        }

        .notify-bell {
            animation: ring 2s ease-in-out infinite;
        }
    }
}

.onhover-show-div {
    padding: 16px;
    top: 55px;
    position: absolute;
    z-index: 8;
    background-color: $white;
    transition: all linear 0.3s;
    box-shadow: 0 0 20px #59667a1a;
    min-width: 140px;
    border-radius: 6px;
    @extend %for-animated-hover;

    .dropdown-title {
        padding: 0;
        padding-bottom: 10px;
        text-align: left;
        margin-bottom: 0;
        font-size: 18px;
        font-weight: 600;
        border-bottom: 1px dashed $white-dark;
    }

    .dropdown-footer {
        padding: 0;
        padding-top: 16px;
        margin-top: 6px;
        border-top: 1px dashed rgba(145, 142, 153, 0.3);

        .total {
            display: flex;
            align-items: center;
            gap: 8px;
            justify-content: space-between;
            font-size: 14px;
            font-weight: 500;
            margin-bottom: 16px;

            span {
                color: $dark-color;
                font-weight: 500;
            }
        }

        .btn {
            font-weight: 500 !important;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1.5;
        }
    }

    ul {
        padding: 0;
        text-align: left;
        max-height: 250px;
        overflow: auto;
        height: auto;

        li {
            display: block !important;

            &:hover {

                a,
                i {
                    transition: none;
                    color: var(--primary-color) !important;
                }
            }
        }
    }

    &.cart-dropdown {
        width: 350px;

        @media(max-width: 577px) {
            width: 288px;
        }

        li {
            padding: 16px 0 !important;
            width: 100%;

            .media {
                position: relative;
                gap: 12px;

                .media-img {
                    width: 60px;
                    height: 60px;
                }

                .media-content {
                    a {
                        font-weight: 500;
                        color: $dark-color;
                        margin-bottom: 0;
                        font-size: 15px;
                        display: -webkit-box;
                        -webkit-line-clamp: 1;
                        -webkit-box-orient: vertical;
                        overflow: hidden;
                        width: 100%;
                        min-width: unset;
                    }

                    h6 {
                        font-size: 16px;
                    }
                }
            }

            +li {
                border-top: 1px solid rgba($dark-color, 0.08);
            }

            &:last-child {
                padding-bottom: 0 !important;
            }
        }

        .remove-svg {
            position: absolute;
            right: 0;
            top: 0;
            width: 21px;
            height: 21px;
            margin: 0;
            background-color: unset;
            border: none;

            i {
                color: $danger-color !important;
                font-size: 18px;
            }
        }
    }

    &.message-dropdown {
        width: 350px;

        .message-box {
            padding: 16px 0 0;
        }

        li {
            display: flex;
            align-items: start;
            gap: 12px;
            padding: 12px !important;
            width: 100%;
            margin-bottom: 16px !important;
            border-radius: 6px;

            &:last-child {
                margin-bottom: 0 !important;
            }

            .media {
                position: relative;
                gap: 12px;
                justify-content: space-between;

                .media-img {
                    width: 35px;
                    height: 35px;
                    border-radius: 100%;
                }

                .hours {
                    white-space: nowrap;
                    font-size: 13px;
                    font-weight: 500;
                }

                .media-content {
                    a {
                        font-weight: 500;
                        margin-bottom: 0;
                        font-size: 14px;
                        display: -webkit-box;
                        -webkit-line-clamp: 1;
                        -webkit-box-orient: vertical;
                        overflow: hidden;
                        width: 100%;
                    }

                    h6 {
                        font-size: 16px;
                    }

                    p {
                        margin: 0;
                        display: -webkit-box;
                        -webkit-line-clamp: 2;
                        -webkit-box-orient: vertical;
                        overflow: hidden;
                        width: 100%;
                        color: $dark-color;
                    }
                }
            }
        }
    }

    &.notification-dropdown {
        width: 350px;
        cursor: default;

        @media (max-width:390px) {
            width: 270px;
            top: 65px;
        }

        .notification-box {
            padding: 16px 0 0;

            .no-notifications {
                padding-block: 20px !important;

                .no-data {
                    img {
                        width: calc(100px + (120 - 100) * ((100vw - 320px) / (1920 - 320)));
                    }
                }
            }

            .notification-item {
                margin-bottom: 0;
                cursor: pointer;

                .media {
                    .notification-img {
                        img {
                            width: calc(39px + (45 - 39) * ((100vw - 320px) / (1920 - 320)));
                            height: calc(39px + (45 - 39) * ((100vw - 320px) / (1920 - 320)));
                            border-radius: 100%;
                        }

                        .user-round {
                            width: 40px;
                            min-width: 40px;
                            height: 40px;
                            border-radius: 100%;
                            display: inline-flex;
                            align-items: center;
                            justify-content: center;
                            background-color: rgba($dark-color, 0.08);
                            text-transform: uppercase;

                            h6 {
                                font-size: 20px;
                                color: rgba($dark-color, 0.7);
                                line-height: 1.3;
                                padding: 0;
                                border: none;
                                margin: 0;
                            }
                        }
                    }

                    .media-body {
                        display: flex;
                        align-items: flex-end;
                        width: calc(100% - 10px - calc(39px + (45 - 39) * ((100vw - 320px) / (1920 - 320))));
                        justify-content: space-between;
                        gap: 15px;

                        h5 {
                            font-size: 14px;
                            font-weight: 500;
                            color: rgb(61, 67, 74);
                            line-height: 1.3;
                            margin: 0;
                        }

                        h6 {
                            font-size: 14px;
                            font-weight: 400;
                            color: rgba(141, 141, 141, 1);
                            padding: 0;
                            margin-block: 6px 0;
                            border: 0;
                            line-height: 1.3;

                        }

                        small {
                            font-size: 14px;
                            font-weight: 400;
                            color: rgba(141, 141, 141, 1);
                            margin-top: 4px;
                            display: block;
                        }

                        .badge {
                            background-color: var(--primary-color);
                            color: $white;
                        }

                        .text-end {
                            display: flex;
                            flex-direction: column;
                            align-items: flex-end;
                        }
                    }
                }
            }
        }

        li {
            padding: 12px !important;
            background-color: rgba($gray-color, 0.2);
            width: 100%;
            margin-bottom: 16px !important;
            border-radius: 6px !important;

            &:last-child {
                margin-bottom: 0 !important;
            }

            &:hover {
                i {
                    color: #E44141 !important;
                }
            }

            .onhover-dropdown {
                i {
                    &:hover {
                        animation: none;
                    }
                }
            }

            .media {
                position: relative;
                gap: 12px;

                i {
                    &:hover {
                        animation: none !important;
                    }
                }

                .media-img {
                    width: 35px;
                    height: 35px;
                    border-radius: 5px;
                    display: flex;
                    align-items: center;
                    justify-content: center;

                    i {
                        font-size: 18px;
                    }
                }

                .media-content {
                    display: flex;
                    align-items: flex-start;
                    gap: 14px;

                    a {
                        font-weight: 500;
                        color: var(--primary-color);
                        margin-bottom: 0;
                        font-size: 14px;
                        display: -webkit-box;
                        -webkit-line-clamp: 2;
                        -webkit-box-orient: vertical;
                        overflow: hidden;
                        width: 100%;
                        min-width: unset;
                        line-height: 1.3;
                    }

                    h6 {
                        font-size: 16px;
                    }

                    p {
                        display: inline-block;
                        color: rgba($dark-color, 0.6);
                        margin: 0;
                        width: 100%;
                    }

                    .view {
                        font-weight: 600;
                        color: $dark-color;
                    }

                    .remove-svg {
                        position: relative;
                        inset: unset;
                        width: auto;
                        height: auto;
                        margin: 0;
                        background-color: unset;
                        border: none;
                        display: flex;
                        align-items: center;
                        gap: 5px;

                        i {
                            color: #505050 !important;
                            font-size: 16px;
                            width: auto;

                            &:hover {
                                animation: none !important;
                            }
                        }
                    }
                }
            }
        }
    }
}

.profile-box {
    display: flex;
    align-items: center;
    font-weight: 400;
    font-size: 15px;
    gap: 10px;
    color: $sidebar-font-color;
    text-align: left;

    h6 {
        margin: 0;
        line-height: 1.5;
        // color: rgba($white, 1);
        color: #222;
        font-weight: 500;
        font-size: 15px;
        text-transform: capitalize;
    }

    span {
        line-height: 1;
        // color: rgba($white, 0.6);
        color: #222222e7;
        font-size: 13px;
        font-weight: 500;
        text-transform: capitalize;
    }

    .profile-image {
        width: 45px;
        height: 45px;
        object-fit: cover;
    }

    .profile-img {
        .user-round {
            width: calc(35px + (40 - 35) * ((100vw - 320px) / (1920 - 320)));
            height: calc(35px + (40 - 35) * ((100vw - 320px) / (1920 - 320)));
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: rgba($gray-color, 0.4);
            margin: 0 auto;

            h6 {
                font-size: calc(16px + (18 - 16) * ((100vw - 320px) / (1920 - 320)));
                font-weight: 600;
                text-transform: capitalize;
                letter-spacing: 0.4px;
            }
        }
    }

    img {
        width: 35px;
        height: 35px;
        border-radius: 8px;
    }
}

.dark-light-mode {
    cursor: pointer;

    .light-mode {
        display: flex;
    }

    .dark-mode {
        display: none;
    }
}

.plus-minus,
.increment {
    background-color: gray;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0;

    i {
        font-size: 18px;
        color: #808B97;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 29px;
        height: 29px;
    }

    input {
        color: lightblue;
        border: none;
        background-color: gray;
        text-align: center;
        width: 30px;
        height: 30px;
    }

    .add {
        background-color: var(--primary-color);
        color: #fff;
        border-radius: 6px;
    }
}

.main-header-left {
    width: max-content;
    padding-inline: 20px;

    i {
        font-size: 22px;
        color: $dark-color;
    }

    .logo-wrapper {
        a {
            color: $sidebar-font-color;
            display: inline-block;
            width: auto;
            height: calc(22px + (40 - 22) * ((100vw - 320px) / (1920 - 320)));
            object-fit: contain;

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

            i {
                font-size: 20px;
            }
        }
    }

    a {
        &.toggle {
            width: calc(35px + (40 - 35) * ((100vw - 320px) / (1920 - 320)));
            height: calc(35px + (40 - 35) * ((100vw - 320px) / (1920 - 320)));
            border-radius: 50%;
            background: $primary-color;
            display: flex;
            align-items: center;
            justify-content: center;

            .sidebar-toggle {
                width: 18px;
                height: 18px;
            }
        }
    }
}

/**=====================
      Header CSS End
==========================**/
