@using GheyasPlusShop.Utils;
@using Utils;

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="robots" content="noindex" />
    <title>@ViewBag.Title</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <!-- <link href="~/App_Css/app/bootstrap.min.css" type="text/css" rel="stylesheet" /> -->
    <link href="~/App_Css/app/bootstrap.min5.css" type="text/css" rel="stylesheet" />
    <link href="~/App_Css/app/common.css" type="text/css" rel="stylesheet" />
    <link href="~/App_Css/app/jquery-ui.css" type="text/css" rel="stylesheet" />


    @if (ViewBag.DesktopSection)
    {
        <style>

            .section-personal {
                display: none;
            }
            button.close {
                background-color: unset !important;
                border: none;
            }

            a {
                text-decoration: none !important;
            }

            body {
                direction: rtl;
                font-family: seyagh;
                font-size: 12px;
                font-weight: 400;
                line-height: 1.42857143;
                color: #292b2c;
                background-color: #fff;
            }
            /*#c2185b*/
            .button-accept, .button-action, .product-discount, .nav-header {
                color:@(StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteForColor);
                background-color: @(StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteColor);
            }

                .button-action svg {
                    fill: #000;
                }

            .product-price-new {
                color: @(StaticManager.WebsiteSetting[ConfigManager.NickName].WebsitePriceColor);
            }


            .button-action {
                height: 32px;
                width: 34px;
                cursor: pointer;
                border-radius: 2px 0 0 2px;
                border: 1px solid #ccc;
                box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
            }

            .header-top .dropdown-menu {
                /*left: -40px;*/
                left: -45px;
                right: unset;
                font-size: 12px;
                min-width: unset;
            }



            .profile-item {
                cursor: pointer;
                margin-bottom: 15px;
            }

                .profile-item span {
                    margin-right: 10px;
                }

                .profile-item a {
                    color: unset;
                }


                    .profile-item a:hover, .profile-item a:focus {
                        text-decoration: unset;
                    }

            ul {
                list-style: none;
                margin: 0 auto;
            }

            .nav-header {
                height: 36px;
                margin-bottom: 20px;
            }

                .nav-header ul li {
                    float: right;
                    padding: 0 28px;
                }

                    .nav-header ul li:hover {
                        text-decoration: underline;
                        color:@(StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteForColor);
                    }

                    .nav-header ul li .nameGroup {
                        line-height: 36px;
                        color:@(StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteForColor);
                        cursor: pointer;
                        font-size: 14px;
                    }


            .nav-footer ul li a {
                cursor: pointer;
                color: #000;
            }

            .footer-feature-item {
                margin-top: 10px;
                color: #616161;
                font-weight: 700;
            }

            .footer-social-link {
                width: 26px;
                margin-left: calc((100% - 124px)/3);
                cursor: pointer;
            }

            input {
                font-family: seyagh;
            }

            #div-cart:hover #shoppingCartAll {
                display: block;
            }

            .nav-header ul li .div-group {
                display: none;
                position: absolute;
                top: 116px;
                left: 0;
                right: 0;
                z-index: 111111;
            }

            .sub-group-kala {
                width: 82.3%;
                height: auto;
                position: absolute;
                left: 0;
                top: 0px;
                background: #fff;
                color: #000;
                padding: 15px;
                font-size: 14px;
            }

            .nameSubGroup {
                color: #000;
                font-size: 14px;
                font-weight: 700;
                height: 44px;
                padding: 10px 20px;
                cursor: pointer;
                background-color: #eceff1;
            }

            .nameSubGroup-select {
                color: @(StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteColor) !important;
                background-color: #fff !important;
                border-top-right-radius: 24px;
                border-bottom-right-radius: 24px;
                z-index: 999;
            }

            .item-search {
                padding: 4px 15px;
                cursor: pointer;
            }

                .item-search:hover {
                    background-color: #F5F5F5;
                }
        </style>

        <style>
            .section-personal .section-view {
                font-weight: 700;
                color: #379da7;
                cursor: pointer;
                /*text-decoration: underline;*/
                border-bottom: 1px solid #379da7;
                height: 28px;
            }

            .section-personal .menu-item {
                height: 44px;
                font-size: 14px;
                color: #838384;
                margin-bottom: 8px;
                padding: 8px 15px;
                cursor: pointer;
                display: flex;
            }

                .section-personal .menu-item span {
                    margin-right: 6px;
                }

                .section-personal .menu-item:hover, .section-personal .menu-item:focus {
                    text-decoration: unset;
                    color: unset;
                }

            .section-personal .menu-item-select {
                background-color: #fff;
                border-top-right-radius: 24px;
                border-bottom-right-radius: 24px;
                z-index: 999;
                color: @(StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteColor) !important;
            }

            .section-personal .content {
                display: none;
            }

            .section-personal .go-right-left {
                position: absolute;
                cursor: pointer;
                top: 140px;
            }

            .section-personal .suggested .suggested-img {
                width: 100%;
                height: 200px;
            }

            .section-personal .suggested label {
                margin: 12px 0 5px;
                font-weight: 700;
            }

            .section-personal .suggested > div {
                color: @(StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteColor);
            }

            .suggested > div > span {
                margin-left: 6px;
                font-size: 14px;
                font-weight: 700;
            }

            .section-personal .button-accept {
                width: 100%;
                height: 40px;
                background-color: #00838f;
            }

                .section-personal .button-accept img {
                    margin-left: 10px;
                    height: 24px;
                }

            .section-personal .deActive-side {
                position: absolute;
                top: 0;
                left: 0;
                height: 355px;
                z-index: 5;
                padding-top: 62px !important;
                background-color: rgba(255, 255, 255, 0.8);
            }

                .section-personal .deActive-side button {
                    width: 120px;
                    height: 30px;
                    background-color: #fff;
                    color: #00838f;
                    border: 1px solid #00838f;
                    display: block;
                    margin: 10px auto 0;
                }

            .section-personal .form-card.rb::before, .section-personal .form-card.rb::after {
                display: none !important;
                content: unset !important;
            }
        </style>
    }
    else
    {
        <style>

            body {
                background-color: #FFF7F9;
            }

            .button-accept {
                max-height: 45px !important;
                min-height: 40px !important;
            }

            header {
                position: sticky;
                top: 0;
                background-color: #fff;
                z-index: 98;
                box-shadow: 0 1px 1px #eee;
            }

                header a {
                    text-decoration: none;
                }

            .section-personal .mobile-profile {
                top: unset !important;
                right: unset !important;
                z-index: 0 !important;
                height: unset !important;
            }

            .section-personal .completed-info-wrapper {
                background-color: #fff;
                border-radius: 20px;
            }

            .section-personal .title {
                font-size: 14px;
                font-weight: 700;
            }

            .section-personal .button-accept {
                width: 100%;
                height: 35px;
                background-color: #00838f;
                color: #fff !important;
            }

            .section-personal .filed-title {
                font-size: 14px;
                font-weight: 500;
                color: #000;
                margin-bottom: 5px;
            }

            .section-personal input[name="type"] {
                -webkit-appearance: none;
                width: 15px;
                height: 15px;
                border: 1px solid #00838f;
                border-radius: 50%;
                margin-right: 10px;
                margin-left: 6px;
                background-color: transparent;
                position: relative;
                top: 6px
            }

                .section-personal input[name="type"]:checked::before {
                    content: "";
                    display: block;
                    width: 8px;
                    height: 8px;
                    background-color: #00838f;
                    border-radius: 50%;
                    position: absolute;
                    top: 50%;
                    left: 50%;
                    transform: translate(-45%, -43%);
                }

            .section-personal .my-profile, .section-personal .my-order, .section-personal .my-favorite {
                position: fixed;
                top: 0;
                right: -100%;
                background-color: #fff;
                height: 100%;
                width: 100%;
                transition: all 0.3s ease-in-out;
                z-index: 101;
            }

            .section-personal .header-back {
                padding: 25px;
                background-color: #fff7f9;
            }

                .section-personal .header-back span {
                    font-size: 16px;
                    font-weight: 700;
                }

            .section-personal .my-order .order-wrapper {
                padding: 15px 5px;
                border-bottom: 1px solid #d1d1d1;
            }

                .section-personal .my-order .order-wrapper:last-child {
                    border-bottom: none;
                }

                .section-personal .my-order .order-wrapper .order-code {
                    display: flex;
                    align-items: center;
                    justify-content: flex-start;
                    gap: 10px;
                }

                    .section-personal .my-order .order-wrapper .order-code .title {
                        font-size: 12px;
                        color: #655C5E;
                    }

                    .section-personal .my-order .order-wrapper .order-code .value {
                        font-size: 14px;
                        color: #000;
                        font-weight: 600;
                    }

                .section-personal .my-order .order-wrapper .order-info {
                    display: flex;
                    align-items: center;
                    justify-content: flex-start;
                    gap: 10px;
                }

                    .section-personal .my-order .order-wrapper .order-info .date,
                    .section-personal .my-order .order-wrapper .order-info .price {
                        font-size: 12px;
                        color: #000;
                        font-weight: 600;
                    }

                        .section-personal .my-order .order-wrapper .order-info .price .currency {
                            font-size: 11px;
                            color: #655C5E;
                        }


            .section-personal .product .info-product {
                display: flex;
                justify-content: space-between;
                gap: 10px;
                border-bottom: 1px solid #eee;
                padding: 15px 0;
            }

                .section-personal .product .info-product:last-child {
                    border-bottom: none;
                }

                .section-personal .product .info-product .avatar {
                    width: 60px;
                }

                    .section-personal .product .info-product .avatar img {
                        width: 60px;
                        height: 60px;
                        border-radius: 50px;
                    }

                .section-personal .product .info-product .text {
                    width: 90%;
                    padding: 3px 5px;
                }

                    .section-personal .product .info-product .text h2 {
                        font-weight: 600;
                        font-size: 14px;
                        line-height: 22px;
                        color: #201A1B;
                        width: 100%;
                        max-height: 45px;
                        overflow: hidden;
                    }

                .section-personal .product .info-product .delete {
                    width: 10%;
                    text-align: left;
                }

                .section-personal .product .info-product .text .count-number {
                    font-weight: 500;
                    font-size: 12px;
                    line-height: 16px;
                    color: #4B4548;
                }


            .section-personal .product:last-child hr {
                display: none;
            }

            .sumCount {
                background-color: red;
                color: aliceblue;
                width: 15px;
                height: 15px;
                display: flex;
                border-radius: 50px;
                align-items: center;
                justify-content: center;
                font-size: 12px;
                position: absolute;
                left: 8px;
                top: -11px;
            }
        </style>
    }

    @RenderSection("styles", required: false)
</head>
<body dir="rtl">
    <div id="masterLockScreen" style="background: rgba(240, 248, 249, 0.54); display: none;position: fixed; width: 100%; height: 100%; top: 0; left: 0; padding: 0; overflow: auto; z-index: 10000;">
        <div class="loading__icon">
            <img src="~/App_Images/loading.svg" class="svg" />
        </div>
    </div>

    @if (ViewBag.DesktopSection)
    {
        <div class="container-fluid">
            <div class="row header-top" style="padding: 0 45px;height: 80px;background-color: #fff;">
                @*لوگو*@
                <div class="col-3 center-vertical" style="height:100%;">
                    @if (StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteLogo.IsNotEmpty())
                    {
                        <a href="@Html.GetHref("")" style="height: 48px;max-width: 128px;cursor:pointer;"><img src="@(StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteLogo.ToBase64File())" style="height: 100%;max-width: 128px;cursor: pointer;" /></a>
                    }
                </div>
                @*جستجو*@
                <div class="col-6 center-vertical" style="height:100%;">
                    <div class="d-flex position-relative">
                        <input type="text" class="text-control float-right" id="txtSearch" style="width:calc(100% - 40px);border-left: unset;border-bottom-left-radius: unset;border-top-left-radius: unset;" placeholder="محصول موردنظر خود را اینجا جستجو کنید" autocomplete="off" />
                        <button type="button" class="button-action float-right center-vertical" id="btnSearch">
                            <img src="~/App_Images/index/searchIcon.svg" class="svg" style="width:20px;fill:#fff;" />
                        </button>
                        <div id="divSearch" style="position: absolute;top: 32px;box-sizing: content-box;right: 0px;width: calc(100% - 8px);max-height: 380px;min-height: 96px;overflow: auto;border: 1px solid rgb(204, 204, 204);background-color: rgb(255, 255, 255);z-index: 11111;margin: 0px auto;padding: 16px 0px;box-shadow: rgba(0, 0, 0, 0.12) 0px 0px 0px 0px, rgba(0, 0, 0, 0.24) 0px 2px 2px 0px; display: none">
                            <img id="imgLoad" src="~/App_Images/loading.gif" style="position: absolute;top: 44%;left: 48%;" />
                        </div>
                    </div>
                </div>
                @*لاگین و سبد خرید*@
                <div class="col-3  center-vertical" style="height:100%;">
                    <div class="d-flex flex-row-reverse position-relative">
                        @*افزودن به سبد خرید*@
                        <div>
                            <div class="dropdown" id="div-cart">
                                <a href="@Html.GetHref("Home/ShowShoppingCart")" style="cursor:pointer;"><img src="~/App_Images/index/shoppingCart.svg" style="height:22px;" /></a>
                                <div class="sumCount" style="position:absolute;top:-6px;left:14px;width:14px;height:14px;border-radius:100%;background-color:@(StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteColor);text-align:center;color:#fff;font-size:10px;">
                                </div>
                                <div class="dropdown-menu no-padding" id="shoppingCartAll" style="width:350px;height:calc(100vh - 54px);top: 20px;">
                                    <div class="d-flex justify-content-between px-2 py-1" style="font-size:14px;line-height:46px;background-color:#eceff1;">
                                        <div><span style="font-weight:700;">سبد خرید </span>( <span class="sumCount"></span><span> کالا )</span></div>
                                        <a href="@Html.GetHref("Home/ShowShoppingCart")" style="color:#00838f;" id="btnShowCart">نمایش سبد</a>
                                    </div>
                                    <div class="items" style="height: calc(100vh - 200px);overflow: auto;">
                                        @*کالاها اینجا اپند میشوند*@
                                    </div>
                                    <div class="w-100 position-absolute" style="padding:20px 6px;bottom:0;left:0;background-color:#fff;box-shadow:0 0 0 0 rgba(0,0,0,.12), 0 -4px 5px 0 rgba(0,0,0,.12)">
                                        <div class="float-right text-center" style="width:calc(100%);">
                                            <div>مبلغ قابل پرداخت</div>
                                            <div><span style="font-size:16px;font-weight:700;" id="sumPrice"></span> ریال</div>
                                        </div>
                                        @*<div class="float-left">
                                                   <a href="@Html.GetHref("Home/PersonalInfo")">
                                                       <button type="button" class="button-accept" style="background-color:#00838f;height: 40px;width: 164px;">ادامه خرید</button>
                                                   </a>
                                            </div>*@
                                    </div>
                                </div>
                            </div>
                            @*وقتی یک کالا به سبد خرید اضافه میشود این قسمت برای سه ثانیه نمایش داده میشود*@
                            <div id="shoppingCartSingle" style="display:none;width:260px;position: absolute;left: -40px;top: 100%;z-index: 1000;background-color: #fff;border: 1px solid rgba(0,0,0,.15);border-radius:2px;">
                                <div class="d-flex justify-content-between" style="padding: 12px 10px;line-height: 24px;border-bottom: 1px solid #ccc;">
                                    <span>به تازگی افزوده شده</span>
                                    <button type="button" class="close">
                                        <img src="~/App_Images/index/Close.svg" onclick="$('#shoppingCartSingle').hide();" />
                                    </button>
                                </div>
                                <div style="padding:15px 12px;">
                                    <div class="d-flex justify-content-between" style="display:flex;padding-bottom:10px!important;border-bottom:1px dotted #ccc;">
                                        <img src="" id="img-product" style="width:52px;height:52px;border-radius:50%;border:1px solid #ccc;margin-left:10px;" />
                                        <div>
                                            <div style="font-weight:700;margin-top:5px;" id="shopCart-product"></div>
                                            <div><span style="margin:3px 0;" id="shopCart-price"></span> ریال </div>
                                            <div><span>تعداد: </span><span id="shopCart-count"></span> عدد </div>
                                        </div>
                                    </div>
                                    <div class="col-12 no-padding text-center">
                                        <a href="@Html.GetHref("Home/ShowShoppingCart")" onclick="ShowShoppingCart()"><button type="button" class="button-accept" style="width:134px;height:34px;background-color:#fff;border: 1px solid #00838f;color:#00838f;font-family: seyagh;margin-top:20px;">نمایش سبد خرید (<span id="shopCart-countSum">10</span>)</button></a>
                                        @*<a href="@Html.GetHref("Home/PersonalInfo")"><button type="button" class="button-accept" style="width:90px;height:34px;margin:0;background-color:#00838f;">ثبت سفارش</button></a>*@
                                    </div>
                                </div>
                            </div>
                        </div>
                        @*ورود با حساب کاربری*@
                        <div style="margin-left: 25px;">
                            @if (SessionManager.LoginInfo == null)
                            {
                                <div id="login" style="cursor:pointer;font-size:14px;"><a href="@Html.GetHref("Home/Login")" style="color:unset;text-decoration:unset;">ورود / ثبت نام</a></div>
                            }
                            else
                            {
                                <div class="dropdown dropdown-profile">
                                    <div class="dropdown-toggle" data-toggle="dropdown" data-bs-toggle="dropdown" aria-expanded="false">
                                        <img src="~/App_Images/index/user.svg" style="height:22px;cursor:pointer;" />
                                        <span class="caret no-margin"></span>
                                    </div>
                                    <div class="dropdown-menu" style="width:210px;padding:15px;left:0;">
                                        <div class="col-12 no-padding profile-item" style="border-bottom:1px dotted #ccc;padding-bottom:15px!important;">
                                            <img src="~/App_Images/index/avetar.svg" />
                                            <span style="font-weight:700;" id="userFullName">@SessionManager.LoginInfo.FullName</span>
                                        </div>
                                        <div class="col-12 no-padding profile-item">
                                            <a class="link-show-profile" href="#profile">
                                                <img src="~/App_Images/index/profile.svg" />
                                                <span>مشاهده پروفایل</span>
                                            </a>
                                        </div>
                                        <div class="col-12 no-padding profile-item">
                                            <a class="link-show-order" href="#order">
                                                <img src="~/App_Images/index/order.svg" />
                                                <span>سفارش های من</span>
                                            </a>
                                        </div>
                                        <div class="col-12 no-padding profile-item">
                                            <a class="link-show-interest" href="#interest">
                                                <img src="~/App_Images/index/LikeList.svg" />
                                                <span>لیست علاقه مندی ها</span>
                                            </a>
                                        </div>
                                        <div class="col-12 no-padding profile-item exitUser no-margin">
                                            <img src="~/App_Images/index/Exit.svg" />
                                            <span>خروج</span>
                                        </div>
                                    </div>
                                </div>
                            }
                        </div>
                    </div>
                </div>
            </div>

            @*منو*@
            <div class="row nav-header">
                <ul class="d-flex justify-content-center">
                    @if (StaticManager.MenuGroupList[ConfigManager.NickName].Count > 0)
                    {
                        foreach (var item in StaticManager.MenuGroupList[ConfigManager.NickName].Where(x => !x.ParentCode.HasValue))
                        {
                            <li>
                                <a href="@Html.GetHref("Home/ProductList?id=" + (item.Code))">
                                    <div class="nameGroup ">@item.Name</div>
                                </a>

                                @if (StaticManager.MenuGroupList[ConfigManager.NickName].Count(x => x.ParentCode == item.Code) > 0)
                                {
                                    <div class="div-group h-100">
                                        <div class="div-sub-group h-100" style="min-height:340px;overflow:auto;padding:20px;background-color:#eceff1;">
                                            @{
                                                var i = 0;
                                                foreach (var subGroup in StaticManager.MenuGroupList[ConfigManager.NickName].Where(x => x.ParentCode == item.Code))
                                                {

                                                    <a href="@Html.GetHref("Home/ProductList?id=" + (subGroup.Code))">
                                                        <div class="nameSubGroup @(i==0?"nameSubGroup-select" :"")" data-id="@subGroup.Code">
                                                            @subGroup.Name
                                                        </div>
                                                    </a>
                                                    <div class="sub-group-kala h-100" @(i == 0 ? "" : "hidden=hidden") data-href="@subGroup.Code">
                                                        <div class="row">
                                                            <div class="col-7">
                                                                <div class="row">
                                                                    @foreach (var subItem in StaticManager.MenuGroupList[ConfigManager.NickName].Where(x => x.ParentCode == subGroup.Code))
                                                                    {
                                                                        <div class="col-4" style="margin-bottom: 10px;">
                                                                            <a href="@Html.GetHref("Home/ProductList?id="+(subItem.Code))" style="color: unset;text-decoration: unset;">@subItem.Name</a>
                                                                        </div>
                                                                    }
                                                                </div>
                                                            </div>
                                                            @if (subGroup.Picture.IsNotEmpty())
                                                            {
                                                                <div class="col-5 border-right text-left" style="height:310px;">
                                                                    <div style="background-image:url(@(subGroup.Picture.ToBase64File()));max-width: 98%;height:70%;margin-top: 38px;background-size: cover;background-repeat:no-repeat;background-position:center;">
                                                                    </div>
                                                                </div>
                                                            }
                                                        </div>
                                                    </div>
                                                    i++;
                                                }
                                            }
                                        </div>
                                        <div class="div-menu-highlight" style="background-color:rgba(0,0,0,0.44);height: calc(100vh - 456px);"></div>
                                    </div>

                                }
                            </li>
                        }
                    }
                </ul>
            </div>

            <div class="section-main">
                @RenderBody()
            </div>

            <div class="section-personal">
                @if (SessionManager.LoginInfo != null)
                {
                    @Html.Action("PersonalProfile");
                }
            </div>

            @*فوتر*@
            <div class="row" style="background-color:#eceff1;border-top: 2px solid #b3b3b3;padding:0 45px;">
                <div class="col-12" style="padding:15px 0;border-bottom:1px solid #ccc;display:none;">
                    <div class="row">
                        <div class="col-8 offset-2">
                            <div class="row">
                                <div class="col-3 text-center">
                                    <img src="~/App_Images/index/express.svg" />
                                    <div class="footer-feature-item">ارسال سریع</div>
                                </div>
                                <div class="col-3 text-center">
                                    <img src="~/App_Images/index/local.svg" />
                                    <div class="footer-feature-item">ارسال به تمام نقاط ایران</div>
                                </div>
                                <div class="col-3 text-center">
                                    <img src="~/App_Images/index/pay.svg" />
                                    <div class="footer-feature-item">پرداخت در محل</div>
                                </div>
                                <div class="col-3 text-center">
                                    <img src="~/App_Images/index/orginal.svg" />
                                    <div class="footer-feature-item">ضمانت اصل بودن محصول</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-12" style="padding:15px 0;border-bottom:1px solid #ccc;">
                    <div class="row">
                        <div class="col-10 offset-1">
                            <div class="row">
                                <div class="col-3 nav-footer" style="font-size:14px;line-height: 32px;">
                                    <div style="font-weight:700;">لینک‌های پرکاربرد</div>
                                    <ul class="no-padding">
                                        @*<li>نحوه ثبت سفارش</li>*@
                                        <li><a href="@Html.GetHref("Home/Privacy")">حریم خصوصی</a></li>
                                        <li><a href="@Html.GetHref("Home/Faq")">سوالات متداول</a></li>
                                        <li><a href="@Html.GetHref("Home/AboutUs")">درباره ما</a></li>
                                        <li><a href="@Html.GetHref("Home/ContactUs")">تماس با ما</a></li>
                                    </ul>
                                </div>
                                <div class="col-4 offset-1 no-padding" style="font-size:14px;line-height: 32px;">
                                    <div style="font-weight:700;">با ما در ارتباط باشید</div>
                                    <div>
                                        <span>شماره تماس: </span>
                                        <span>@StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteTel</span>
                                    </div>
                                    <div>
                                        <span>ایمیل: </span>
                                        <span>@StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteEmail</span>
                                    </div>
                                    <div style="margin:12px 0;display:none;">
                                        <input type="text" class="text-control float-right" style="font-size:10px;width:calc(100% - 40px);border-left: unset;border-bottom-left-radius: unset;border-top-left-radius: unset;" placeholder="برای اطلاع از تخفیف‌ها و جدیدترین محصولات، ایمیل خود را وارد کنید." />
                                        <button type="button" class="button-action">ثبت</button>
                                    </div>
                                    <div style="margin-top:12px;">
                                        @if (StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteInstagram.IsNotEmpty())
                                        {
                                            <a href="@StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteInstagram">
                                                <img src="~/App_Images/index/insta.svg" class="footer-social-link" title="اینستاگرام" />
                                            </a>
                                        }
                                        @if (StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteWhatsApp.IsNotEmpty())
                                        {
                                            <a href="@StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteWhatsApp">
                                                <img src="~/App_Images/index/whatsapp.svg" class="footer-social-link" title="واتساپ" />
                                            </a>
                                        }
                                        @if (StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteTelegram.IsNotEmpty())
                                        {
                                            <a href="@StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteTelegram">
                                                <img src="~/App_Images/index/telegram.svg" class="footer-social-link" title="تلگرام" />
                                            </a>
                                        }
                                        @if (StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteTwitter.IsNotEmpty())
                                        {
                                            <a href="@StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteTwitter">
                                                <img src="~/App_Images/index/tiwtter.svg" class="footer-social-link no-margin" title="توئیتر" />
                                            </a>
                                        }
                                    </div>
                                </div>
                                <div class="col-3 offset-1 no-padding">
                                    <div style="border:1px solid #ccc;border-radius:24px;background-color:#fff;width:192px;padding: 20px 0;text-align: center;float:left;">
                                        <img src="~/App_Images/index/logo-safety.png" style="width: 150px;height: 150px;" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-12 center-vertical" style="height:50px;">
                    <div class="col-6 offset-3 text-center">
                        کلیه حقوق این سایت متعلق به
                        <a href="https://www.gheyas.com/" target="_blank" style="font-weight:700;text-decoration:underline;color:#000;cursor:pointer;">گروه نرم‌افزاری قیاس</a>
                        می‌باشد
                    </div>
                </div>
            </div>
        </div>
    }
    else
    {
        <style>
            i, svg {
                font-size: 18px;
            }

            a {
                color: #000;
            }

            .logo img {
                max-height: 45px;
            }

            .menu-side {
                position: fixed;
                top: 0;
                right: -100%;
                height: 100vh;
                width: 90%;
                background-color: #fff;
                z-index: 100;
                transition: all 0.3s ease-in-out;
            }

            .menu-side-after {
                width: 100vw;
                height: 100vh;
                position: fixed;
                top: 0;
                right: 0;
                background-color: #0e0e0ea3;
                z-index: 99;
                display: none;
                transition: all 0.3s ease-in-out;
            }

            .category-header {
                font-size: 16px;
                font-weight: 600;
                color: #000;
            }

            .menu-list {
                list-style: none;
                padding: 0;
                transition: all 0.3s ease-in-out;
                position: relative;
                background-color: #fff;
                width: 100%;
                height: 100%;
            }

                .menu-list li a {
                    text-decoration: none;
                    font-size: 16px;
                    font-weight: 400;
                    padding: 12px 20px;
                    border-bottom: 1px solid #CCCCCC;
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                }

                .menu-list.sub, .menu-list.sub2 {
                    position: absolute;
                    top: 0;
                    right: -100%;
                    transition: all 0.3s ease-in-out
                }

            .title-list-menu {
                background-color: #f5f5f5;
            }

                .title-list-menu a {
                    color: #000 !important;
                    font-size: 16px !important;
                    font-weight: 700 !important;
                    justify-content: flex-start !important;
                }

            footer {
                background-color: #ECEFF1;
                padding: 30px;
            }

                footer h3 {
                    font-size: 16px;
                    font-weight: 700;
                    color: #464646;
                }

                footer .usefull-link ul {
                    list-style: none;
                    padding: 0;
                    margin: 0;
                }

                    footer .usefull-link ul li {
                        display: inline-block;
                        width: 49%;
                        margin-bottom: 5px;
                    }

                    footer .usefull-link ul a {
                        color: #000000;
                        font-size: 14px;
                        font-weight: 500;
                        text-decoration: none;
                    }

                footer .contact {
                    display: flex;
                }

                    footer .contact .item-title {
                        color: #464646;
                        font-size: 14px;
                        font-weight: 500;
                        display: inline-block;
                        width: 49%;
                        margin-bottom: 5px;
                    }

                    footer .contact .item-value {
                        color: #000000;
                        font-size: 14px;
                        font-weight: 500;
                        display: inline-block;
                        width: 49%;
                        margin-bottom: 5px;
                    }

                footer .social-media {
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    margin: 20px;
                    gap: 20px;
                }

                footer .copy-right {
                    color: #000000;
                    font-size: 14px;
                    font-weight: 500;
                    text-align: center;
                }


            .mobile-profile {
                position: fixed;
                width: 100%;
                top: 0;
                right: 100%;
                z-index: 100;
                background-color: #fff;
                height: 100vh;
                transition: all 0.3s ease-in-out;
            }

                .mobile-profile .title {
                    display: flex;
                    align-items: center;
                    gap: 10px;
                    padding: 20px 25px;
                }

                    .mobile-profile .title h1 {
                        font-size: 16px;
                        font-weight: 700;
                        padding: 0;
                        margin: 0;
                    }

                .mobile-profile .user-info {
                    padding: 10px;
                }

                    .mobile-profile .user-info img {
                        width: 40px;
                        height: 40px;
                    }

                    .mobile-profile .user-info .user-name {
                        font-size: 14px;
                        font-weight: 700;
                    }

                .mobile-profile .wallet {
                    padding: 20px 25px;
                }

                    .mobile-profile .wallet .wrapper {
                        background-color: #00838F;
                        padding: 24px;
                        border-radius: 24px;
                        color: #fff;
                        background-image: url(/App_Images/index/GPLOGO.svg);
                        background-repeat: no-repeat;
                        background-position: 8% 85%;
                    }

                        .mobile-profile .wallet .wrapper .inventory-score {
                            display: flex;
                            align-items: center;
                            justify-content: space-between;
                        }

                            .mobile-profile .wallet .wrapper .inventory-score .inventory {
                                display: flex;
                                gap: 10px;
                            }

                                .mobile-profile .wallet .wrapper .inventory-score .inventory .text div:first-child {
                                    font-size: 14px;
                                    font-weight: 400;
                                }

                                .mobile-profile .wallet .wrapper .inventory-score .inventory .text div:last-child {
                                    font-size: 14px;
                                    font-weight: 700;
                                }

                            .mobile-profile .wallet .wrapper .inventory-score .score {
                                display: flex;
                                align-items: center;
                                gap: 10px;
                            }

                                .mobile-profile .wallet .wrapper .inventory-score .score .number {
                                    font-size: 20px;
                                    font-weight: 700;
                                }

                                .mobile-profile .wallet .wrapper .inventory-score .score .text {
                                    font-size: 14px;
                                    font-weight: 400;
                                }

                .mobile-profile .button-wallet {
                    display: flex;
                    align-items: center;
                    justify-content: flex-start;
                    gap: 23px;
                    margin-top: 35px;
                }

                    .mobile-profile .button-wallet .link {
                        display: flex;
                        flex-direction: column;
                        align-items: center;
                        gap: 5px;
                    }

                .mobile-profile .profile-list {
                    padding: 20px 25px;
                }

                    .mobile-profile .profile-list ul {
                        padding: 0;
                        list-style: none;
                        margin: 0;
                    }

                        .mobile-profile .profile-list ul li a {
                            font-size: 14px;
                            font-weight: 400;
                            text-decoration: none;
                            display: flex;
                            gap: 10px;
                            margin-bottom: 10px;
                        }
        </style>


        <div class="section-personal">
            @if (SessionManager.LoginInfo != null)
            {
                @Html.Action("PersonalProfile");
            }
        </div>



        <div class="menu-side">
            <div class="h-100">
                <div class="d-flex align-items-center justify-content-between p-4 mb-3">
                    <div class="category-header">دسته بندی</div>
                    <div class="close-menu"><img src="~/App_Images/index/tims.svg" alt="close" /></div>
                </div>
                <ul class="menu-list position-relative" style=" overflow: auto; height: calc(100dvh - 108px); ">
                    @if (StaticManager.MenuGroupList[ConfigManager.NickName].Count > 0)
                    {
                        foreach (var item in StaticManager.MenuGroupList[ConfigManager.NickName].Where(x => !x.ParentCode.HasValue))
                        {
                            <li class="list-item">
                                <a><span>@item.Name</span><img src="~/App_Images/index/arrow.svg" alt="gotosubmenu" /></a>

                                @if (StaticManager.MenuGroupList[ConfigManager.NickName].Count(x => x.ParentCode == item.Code) > 0)
                                {

                                    <ul class="menu-list sub">
                                        <li class="title-list-menu"><a><img style="margin-left: 25px;" src="~/App_Images/index/arrow2.svg" /><span></span></a></li>
                                        @{
                                            foreach (var subGroup in StaticManager.MenuGroupList[ConfigManager.NickName].Where(x => x.ParentCode == item.Code))
                                            {
                                                <li class="list-item2">
                                                    <a><span>@subGroup.Name</span><img src="~/App_Images/index/arrow.svg" alt="gotosubmenu" /></a>
                                                    <ul class="menu-list sub2">
                                                        <li class="title-list-menu"><a><img style="margin-left: 25px;" src="/App_Images/index/arrow2.svg" /><span></span></a></li>
                                                        @foreach (var subItem in StaticManager.MenuGroupList[ConfigManager.NickName].Where(x => x.ParentCode == subGroup.Code))
                                                        {
                                                            <li class="list-item3">
                                                                <a href="@Html.GetHref("Home/ProductList?id=" + (subItem.Code))">@subItem.Name</a>
                                                            </li>
                                                        }
                                                    </ul>
                                                </li>
                                            }
                                        }

                                    </ul>
                                }

                            </li>
                        }
                    }
                </ul>
            </div>
        </div>

        <div class="menu-side-after"></div>

        <header class="p-2">
            <div class="container-fluid">
                <div class="row align-items-baseline">
                    <div class="col-3 text-start menu">
                        <a><img src="~/App_Images/index/menubar.svg" alt="menu" /></a>
                    </div>
                    <div class="col-6 text-center logo">
                        @if (StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteLogo.IsNotEmpty())
                        {
                            <a href="@Html.GetHref("")"><img src="@(StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteLogo.ToBase64File())" class="img-fluid" /></a>
                        }
                    </div>

                    <div class="col-3 text-end login-and-cart">
                        @if (SessionManager.LoginInfo == null)
                        {
                            <a href="@Html.GetHref("Home/Login")" class="me-3">
                                <img src="~/App_Images/index/person.svg" alt="person" />
                            </a>
                        }
                        else
                        {
                            <a class="profile-open me-3">
                                <img src="~/App_Images/index/person.svg" alt="person" />
                            </a>
                            <div class="mobile-profile">
                                <div class="title">
                                    <img src="~/App_Images/index/tims.svg" class="close-profile" alt="close" />
                                    <h1>
                                        پروفایل کاربری
                                    </h1>
                                </div>
                                <div class="user-info d-flex align-items-center flex-column gap-3">
                                    <img class="img-fluid" src="~/App_Images/index/Profile-mobile.svg" alt="user" />
                                    <div class="user-name">@SessionManager.LoginInfo.FullName</div>
                                </div>
                                <div class="wallet">
                                    <div class="wrapper">
                                        <div class="inventory-score">
                                            <div class="inventory">
                                                <img src="~/App_Images/index/inventory.svg" alt="کیف" />
                                                <div class="text-start">
                                                    <div>موجودی</div>
                                                    <div>کیف پول شما </div>
                                                </div>
                                            </div>
                                            <div class="score">
                                                <div class="number">0.00</div>
                                                <div class="text">امتیاز</div>
                                            </div>
                                        </div>
                                        <div class="button-wallet">
                                            <div class="link">
                                                <div class="icon"><img src="~/App_Images/index/variz.svg" alt="واریز" /></div>
                                                <div class="">واریز</div>
                                            </div>
                                            <div class="link">
                                                <div class="icon"><img src="~/App_Images/index/bardasht.svg" alt="برداشت" /></div>
                                                <div class="">برداشت</div>
                                            </div>
                                            <div class="link">
                                                <div class="icon"><img src="~/App_Images/index/info-mobile.svg" alt="اطلاعات" /></div>
                                                <div class="">مشاهده جزئیات</div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="profile-list">
                                    <ul>
                                        <li><a id="my-account"><img src="~/App_Images/index/profile.svg" /><span>اطلاعات حساب کاربری</span></a></li>
                                        <li><a id="my-order"><img src="~/App_Images/index/order.svg" /><span>لیست سفارش‌ها</span></a></li>
                                        <li><a id="my-favorite"><img src="~/App_Images/index/LikeList.svg" /><span>لیست علاقمندی‌های من</span></a></li>
                                        <li><a class="exitUser"><img src="~/App_Images/index/Exit.svg" /><span>خروج</span></a></li>
                                    </ul>
                                </div>
                            </div>
                        }
                        <a class="position-relative" href="@Html.GetHref("Home/ShowShoppingCart")">
                            <img src="~/App_Images/index/shopping_cart.svg" alt="shopping_cart" />
                            <span class="sumCount">0</span>
                        </a>
                    </div>

                </div>
            </div>
        </header>

        @RenderBody()



        @*فوتر*@
        <footer>
            <div class="usefull-link mb-3">
                <h3>لینک‌های پرکاربرد</h3>
                <ul>
                    <li><a href="@Html.GetHref("Home/Privacy")">حریم خصوصی</a></li>
                    <li><a href="@Html.GetHref("Home/Faq")">سوالات متداول</a></li>
                    <li><a href="@Html.GetHref("Home/AboutUs")">درباره ما</a></li>
                    <li><a href="@Html.GetHref("Home/ContactUs")">تماس با ما</a></li>
                </ul>
            </div>
            <div class="contact-us mb-3">
                <h3>با ما در ارتباط باشید</h3>
                <div class="contact">
                    <div class="item-title">شماره تماس</div>
                    <div class="item-value">@StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteTel</div>
                </div>
                <div class="contact">
                    <div class="item-title">ایمیل</div>
                    <div class="item-value">@StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteEmail</div>
                </div>

            </div>
            <div class="social-media">
                @if (StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteInstagram.IsNotEmpty())
                {
                    <a href="@StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteInstagram">
                        <img src="~/App_Images/index/insta.svg" title="اینستاگرام" />
                    </a>
                }
                @if (StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteWhatsApp.IsNotEmpty())
                {
                    <a href="@StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteWhatsApp">
                        <img src="~/App_Images/index/whatsapp.svg" title="واتساپ" />
                    </a>
                }
                @if (StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteTelegram.IsNotEmpty())
                {
                    <a href="@StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteTelegram">
                        <img src="~/App_Images/index/telegram.svg" title="تلگرام" />
                    </a>
                }
                @if (StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteTwitter.IsNotEmpty())
                {
                    <a href="@StaticManager.WebsiteSetting[ConfigManager.NickName].WebsiteTwitter">
                        <img src="~/App_Images/index/tiwtter.svg" title="توئیتر" />
                    </a>
                }
            </div>
            <div class="namad d-flex align-items-center justify-content-center mb-3" style="display: none !important;">
                <img src="" alt="namad">
            </div>
            <div class="copy-right mb-3">
                کلیه حقوق این سایت متعلق به
                <a href="https://www.gheyas.com/" target="_blank">گروه نرم‌افزاری قیاس</a>
                می‌باشد
            </div>
        </footer>
    }

    <script>
    var baseUrl = "@Html.GetHref("")";
    var baseSrc = "@Href("~/")";
    </script>
    <script src="~/App_Scripts/app/jquery-2.1.1.js"></script>
    <script src="~/App_Scripts/app/jquery-ui.js"></script>
    <script src="~/App_Scripts/app/popper.js"></script>
    <!-- <script src="~/App_Scripts/app/bootstrap.min.js"></script> -->
    <script src="~/App_Scripts/app/bootstrap.min5.js"></script>
    <script src="~/App_Scripts/app/common.js"></script>
    <script src="~/App_Scripts/jquery.inputmask/inputmask.js"></script>
    <script src="~/App_Scripts/jquery.inputmask/jquery.inputmask.js"></script>

    @if (ViewBag.DesktopSection)
    {
        <script>
            $(document).ready(function () {

                if ($(".section-main .row-item").length === 0) {
                    $("#btnShowCart").hide();
                    $("#btnShoppingProcess").attr("disabled", true)
                    $("#continueOrder").attr("disabled", true)
                    $("#noShopping").show();
                } else {
                    $("#btnShowCart").show();
                    $("#btnShoppingProcess").attr("disabled", false)
                    $("#continueOrder").attr("disabled", false)
                    $("#noShopping").hide();
                }


                getShoppingCart();
                setTimeout(function () { $("#txtSearch").val("") }, 1000);
            });
            function setPesrsonalSection() {
                $("body").css("background-color", "#eceff1");
            }
            $(".dropdown-profile").on("click", "a", function () {
                $(".section-main").hide();
                $(".section-personal").show();
                setPesrsonalSection();
                setTimeout(function () { setProfileTab(); }, 200);

                if ("@(SessionManager.LoginInfo?.FullName)" === "-")
                    $('.section-personal .div-person-edit .deActive-side-btn').click();
                else if("@(SessionManager.LoginInfo?.FullName ?? "")" === "")
                    $('.section-personal .div-office-edit .deActive-side-btn').click();
            });
            $(".section-personal").on("click", "#lnkViewOrder, #lnkViewInterest", function () {
                setTimeout(function () { setProfileTab(); }, 200);
            });
        </script>
    }
    else
    {
        <script>
            $(document).ready(function () {

                if ($("#MobileSection .row-item").length === 0) {
                    $("#btnShowCart").hide();
                    $("#btnShoppingProcess").attr("disabled", true)
                    $("#continueOrder").attr("disabled", true)
                    $("#noShopping").show();
                } else {
                    $("#btnShowCart").show();
                    $("#btnShoppingProcess").attr("disabled", false)
                    $("#continueOrder").attr("disabled", false)
                    $("#noShopping").hide();
                }


                getShoppingCart();
                setTimeout(function () { $("#txtSearch").val("") }, 1000);

                $(".list-item").on("click", function (e) {
                    $(this).find(".sub").css("right", "0");
                })
                $(".list-item2").on("click", function (e) {
                    e.stopPropagation();
                    $(this).closest(".sub").css("overflow", "hidden");
                    $(this).find(".sub2").css("right", "0");
                })

                $(".close-menu").on("click", function (e) {
                    $(".menu-side").css("right", "-100%");
                    $(".menu-side-after").hide();
                    $(".sub2").css("right", "-100%");
                    $(".sub").css("right", "-100%");
                    $("body").css("overflow", "auto");
                })
                $(".menu a").on("click", function (e) {
                    $(".menu-side").css("right", "-1px");
                    $(".menu-side-after").show();
                    $("body").css("overflow", "hidden");
                })

                $(".profile-open").on("click", function () {
                    $(".mobile-profile").css("right", "0");
                })
                $(".close-profile").on("click", function () {
                    $(".mobile-profile").css("right", "100%");
                })

                let titleListMenu = document.querySelectorAll(".list-item");
                titleListMenu.forEach(item => {
                    let itemLocation = item.querySelector(".title-list-menu a span");
                    let text = item.querySelector("a span").innerText;
                    itemLocation.innerText = text;
                });

                let titleListMenu2 = document.querySelectorAll(".list-item2");
                titleListMenu2.forEach(item => {
                    let parentTitle = item.closest(".list-item");
                    let parentText = parentTitle.querySelector("a span").innerText;
                    let itemLocation = item.querySelector(".title-list-menu a span");
                    let text = item.querySelector("a span").innerText;
                    if (itemLocation) {
                        itemLocation.innerText = `${parentText} / ${text}`;
                    }
                });

                let backToParentList = document.querySelectorAll(".title-list-menu");
                backToParentList.forEach(function (item) {
                    item.addEventListener("click", function (e) {
                        e.preventDefault();
                        e.stopPropagation();
                        item.parentElement.style.right = "-100%";
                        item.parentElement.parentElement.closest(".sub").style.overflow = "auto";
                    })
                });
            })
            $(".profile-list").on("click", "a", function () {
                //$(".section-main").hide();
                //$(".section-personal").show();
                setTimeout(function () { setProfileTab(); }, 200);
                // setPesrsonalSection();

                if ("@(SessionManager.LoginInfo?.FullName)" === "-")
                    $('.section-personal .div-person-edit .deActive-side-btn').click();
                else if("@(SessionManager.LoginInfo?.FullName ?? "")" === "")
                    $('.section-personal .div-office-edit .deActive-side-btn').click();
            });
            //$(".section-personal").on("click", ".link-my-order", function () {
            //    $(".section-personal .my-order").css("right", "0");
            //})
            //$(".section-personal").on("click", ".link-my-favorite", function () {
            //    $(".section-personal .my-favorite").css("right", "0");
            //})
            //$(".section-personal").on("click", ".link-my-account", function () {
            //    $(".section-personal .my-profile").css("right", "0");
            //})
            //$(".section-personal").on("click", ".header-back", function () {
            //    $(".section-personal .my-profile,.section-personal .my-favorite,.section-personal .my-order").css("right", "-100%");
            //})
            $(".section-personal").on("change", ".lbl-real, .lbl-not-real", function () {
                document.querySelector(".section-personal .haqiqi").classList.toggle("d-none");
                document.querySelector(".section-personal .hoqoqi").classList.toggle("d-none");
            });


            $("#my-order").click(function () {
                $(".my-order").css("right", "0");
            })
            $("#my-favorite").click(function () {
                $(".my-favorite").css("right", "0");
            })
            $("#my-account").click(function () {
                $(".my-profile").css("right", "0");
            })
            $(".header-back").click(function () {
                $(".my-profile, .my-favorite, .my-order").css("right", "-100%");
            })



            async function loadShoppingCart() {
                var result;
                await ajax({
                    loading: false,
                    url: "Home/GetShoppingCart",
                    success: function (data) {
                        result = data;
                    }
                });
                return result;
            }
            //function setPesrsonalSection() {
            //    $("footer").css("display", "none");
            //    $("header .mobile-profile").css("display", "none");
            //    $("header .profile-open").css("display", "none");
            //    if (location.hash === '#order') {
            //        $(".my-order").css("right", "0");
            //    }
            //    if (location.hash === '#interest') {
            //        $(".my-favorite").css("right", "0");
            //    }
            //    if (location.hash === '#profile') {
            //        $(".my-profile").css("right", "0");
            //    }
            //}
        </script>
    }

    <script>
        $(document).on("click", function () {
            $("#divSearch").hide();
        });

        $(".exitUser").on("click", function () {
            ajax({
                url: "Home/ExitUser",
                success: function (result) {
                    window.location.href = baseUrl;
                }
            });
        });

        var menuTimeout = null;
        $(".nav-header ul li").on("mouseover", function () {
            $(".div-group").prop("hidden", false);
            if (menuTimeout) {
                clearTimeout(menuTimeout);
                menuTimeout = null;
            }
            var that = this;
            menuTimeout = setTimeout(function () { if (!$(that).find(".div-group").prop("hidden")) $(that).find(".div-group").show(); }, 500);
        });
        $(".nav-header ul li").on("mouseleave", function () {
            $(this).find(".div-group").prop("hidden", true);
            $(this).find(".div-group").hide();
        });

        $(".div-sub-group").on("mouseleave", function () {
            $(this).closest(".div-group").prop("hidden", true);
            $(this).closest(".div-group").hide();
        });

        $("#btnSearch").on("click", function () {
            $("#divSearch").empty();
            if ($("#txtSearch").val().trim() === "")
                return;
            var oldGroupName = "";
            $("#imgLoad").show();
            setTimeout(function () {
                ajax({
                    loading: true,
                    url: "Home/SearchProduct",
                    loading: false,
                    data: JSON.stringify({ search: $("#txtSearch").val() }),
                    success: function (result) {
                        for (var i = 0; i < result.length; i++) {
                            $("#divSearch").append("<div class='col-12 item-search'>" +
                                "<a href='" + baseUrl + "Home/ShowDetails?id=" + result[i].Code + "' style='text-decoration: unset;'>" +
                                (result[i].NameGroup && (oldGroupName === "" || oldGroupName !== result[i].NameGroup) ? "<div class='col-12 no-padding' style='color:#969696;font-size:12px;font-weight:700;margin-top: 10px;'> در گروه "  + result[i].NameGroup + "</div>" : "") +
                                "<div class='col-12 no-padding' style='color:#000;font-size:12px;margin:6px 8px 0;'>" + result[i].Name + "</div></a></div>");

                            oldGroupName = result[i].NameGroup ? result[i].NameGroup : "";
                        }
                        $("#divSearch").show();
                    },
                    complete: function () {
                        $("#imgLoad").hide();
                    }
                });
            }, 50);

        });

        var searchTimeout = null;
        $("#txtSearch").on("keydown", function (event) {
            if (searchTimeout) {
                clearTimeout(searchTimeout);
                searchTimeout = null;
            }
            searchTimeout = setTimeout(function () {
                $("#btnSearch").trigger("click");
            }, 1000);
        });

        $(".nameSubGroup").on("mouseover", function () {
            $(this).closest("li").find(".nameSubGroup").removeClass("nameSubGroup-select");
            $(this).addClass("nameSubGroup-select");
            $(this).closest("li").find(".sub-group-kala").attr("hidden", "hidden");
            $(".sub-group-kala[data-href=" + $(this).attr("data-id") + "]").removeAttr("hidden");
        });

        //کادر سه ثانیه فقط برای خرید فعلی
        function addShopingCart(id, name, picture, count, codePartProperty) {
            ajax({
                loading: true,
                url: "Home/AddShoppingCart",
                data: JSON.stringify({ id: id, count: count, codePartProperty: codePartProperty }),
                success: function (result) {
                    if (result.DisplayNewPrice) {
                        var $shopping = $("#shoppingCartSingle");
                        $shopping.find("#shopCart-count").text(result.Count);
                        $shopping.find("#shopCart-price").text(numberWithCommas(result.DisplayNewPrice));
                        $shopping.find("#shopCart-product").text(name);
                        $shopping.find("#img-product").attr("src", result.PicThumb);
                        $shopping.show();
                        getShoppingCart();
                        setTimeout(function () {
                            $shopping.hide();
                        }, 3000);
                        $("#shopCart-countSum").text(result.Count);
                    }
                }
            });
        }

        //کادر سبد خرید برای تمام خریدها
        function getShoppingCart() {
            var sumPrice = 0;
            ajax({
                loading: false,
                url: "Home/GetShoppingCart",
                success: function (result) {
                    $("#shoppingCartAll .items").empty();
                    for (var i = 0; i < result.length; i++) {
                        var price = result[i].DisplayNewPrice;
                        var property = "";
                        result[i].Property.forEach(function (item, index) {
                            property += "<div class='col-12' style ='margin:3px 0;'>" +
                                "<span>" + item.PropertyName + ": </span>" +
                                "<span>" + item.PropertyValue + "</span > </div > ";
                        });

                        $("#shoppingCartAll .items").append("<div class='col-12 no-padding row-item' data-id='" + result[i].Id + "'>" +
                            "<div class='col-12' style='display:flex;padding:10px 15px;'>" +
                            "<img src='" + result[i].PicThumb + "' style='width:62px;height:62px;border-radius:50%;border:1px solid #ccc;'/>" +
                            "<div style='width:calc(100% - 77px);margin-right: 15px;'>" +
                            "<div style='font-weight: 700;margin:12px 0 3px;'>" + result[i].NameKala + "</div>" +
                            "<div> <span>" + result[i].Count + "</span> عدد" +
                            "<img src='" + baseSrc + "App_Images/index/deleteProduct.svg' style='float:left;cursor:pointer;' title='حذف کالا' onclick='deleteShoppingCart(this)' />" +
                            "</div> </div> </div>" +
                            "<span style='display:none;' class='codePartProperty' data-id='" + (result[i].CodePartProperty ? result[i].CodePartProperty : "") + "'></span>" +
                            "<div class='col-12' style='border-bottom:1px dotted #ccc;color:#868788;background-color:#f2f7fb;'>" +
                            property +
                            "</div> </div>");

                        sumPrice = sumPrice + (price * result[i].Count);
                    }
                    $('#sumPrice').text(numberWithCommas(sumPrice));
                    $('.sumCount').text(result.length);
                }
            });
        }

        function deleteShoppingCart(sender) {
            if (!confirm("آیا برای حذف این کالا مطمئن هستید؟"))
                return;
            var $row = $(sender).closest(".row-item");
            var id = $row.attr("data-id");
            var codePartProperty = $row.find(".codePartProperty").attr("data-id");
            ajax({
                loading: true,
                url: "Home/DeleteShoppingCart",
                data: JSON.stringify({ id: id, codePartProperty: codePartProperty }),
                success: function () {
                    getShoppingCart();
                }
            });
        }

        function likeProduct(isLike, codeKala, codePart) {
            ajax({
                loading: false,
                url: "Home/LikeProduct",
                data: JSON.stringify({ isLike: isLike, codeKala: codeKala, codePart: codePart }),
                success: function () {

                }
            });
        }


        $(".section-personal").on("click", ".btn-change-password", function () {
            var error = checkValidation(".section-personal .div-password");
            if (error) {
                $('.section-personal .sp-password-error').text(error);
                return;
            }
            if ($(".section-personal #txtNewPassword").val() != $(".section-personal #txtRepeatNewPassword").val()) {
                $('.section-personal .sp-password-error').text("کلمه عبور جدید با تکرار آن یکسان نمیباشد");
                return;
            }

            var pass = $(".section-personal #txtPassword").val();
            var passNew = $(".section-personal #txtNewPassword").val();
            var passNewRepeat = $(".section-personal #txtRepeatNewPassword").val();

            ajax({
                loading: true,
                url: "Home/ChangePassProfile",
                data: JSON.stringify({ pass: pass, passNew: passNew, passNewRepeat: passNewRepeat }),
                success: function () {
                    $(".section-personal .div-password").find("input").val("");
                    $(".section-personal .sp-password-error").css("color", "#4caf50").text("کلمه عبور با موفقیت تغییر داده شد");
                    setTimeout(function () {
                        window.location.href = baseUrl + "#profile";
                        setProfileTab();
                    }, 2000);
                },
                error: function (err) {
                    var errorMsg;
                    if (err.responseJSON)
                        errorMsg = err.responseJSON.Message;
                    else
                        errorMsg = err.responseText;

                    $(".section-personal .sp-password-error").css("color", "Red").text(errorMsg);
                }
            });
        });
        $(".section-personal").on("click", ".menu-item", function () {
            setTimeout(function () { setProfileTab(); }, 200);
        });
        $('.section-personal .deActive-side-btn').on("click", function () {
            $('.section-personal .deActive-side').show();
            $('.section-personal .deActive-side.' + $(this).attr('data-id')).hide();
            $('.section-personal .save').hide();
            $('.section-personal .save.' + $(this).attr('data-id')).show();
        });
        function savePersonal(mode) {
            var fullName = null;
            var city = null;
            var birthDate = null;
            var email = null;
            var tell = null;
            var passNo = null;
            var address = null;

            if (mode == "person") {
                var error = checkValidation('.section-personal .div-person-edit');
                if (error)
                    return;
                fullName = $(".section-personal #txtPersonName").val();
                address = $(".section-personal #txtPersonAddress").val();
                birthDate = $(".section-personal #txtYear").val() + "/" + $(".section-personal #month").val() + "/" + $(".section-personal #day").val();
                email = $(".section-personal #txtPersonEmail").val();
                passNo = $(".section-personal #txtPassNo").val();
            }
            else {
                var error = checkValidation('.section-personal .div-office-edit');
                if (error)
                    return;
                fullName = $(".section-personal #txtOfficeName").val();
                address = $(".section-personal #txtOfficeAddress").val();
                tell = $(".section-personal #txtTel").val();
                city = $(".section-personal #cboCityCode").val();
            }
            if (fullName.trim() === "-") {
                alert("نام و نام خانوادگی و یا نام شرکت، وارد نشده است");
                return;
            }

            ajax({
                loading: true,
                url: "Home/SavePersonalInfo",
                data: JSON.stringify({ fullName, email, birthDate, tell, city, passNo, address }),
                success: function () {
                    showProfile();
                },
                error: function (err) {
                    var errorMsg;
                    if (err.responseJSON)
                        errorMsg = err.responseJSON.Message;
                    else
                        errorMsg = err.responseText;
                    $(".section-personal .sp-personal-error").text(errorMsg);
                }
            });
        }
        function setProfileTab() {
            $(".section-personal .menu-item").removeClass("menu-item-select");
            $(".section-personal .menu-item svg").css("fill", "#666666");
            $(".section-personal .content").hide();
            $(".section-personal .menu-item[href='" + window.location.hash + "']").addClass("menu-item-select");
            $(".section-personal .menu-item[href='" + window.location.hash + "'] svg").css("fill", $("#colorSite").val());
            $(".section-personal .div-" + window.location.hash.substr(1)).show();
        }
        function showProfile() {
            $(".section-personal .div-profile-edit").hide();
            $(".section-personal .div-profile-show").show();
        }
        function showProfileEdit() {
            $(".section-personal .div-profile-edit").show();
            $(".section-personal .div-profile-show").hide();
        }
        function deleteLikeProduct(sender) {
            var isLike = false;
            var codeKala = $(sender).attr("data-id");
            var codePart = $(sender).attr("data-part");
            showLoading();
            likeProduct(isLike, codeKala, codePart);
            window.location.reload();
        }
        function getCity() {
            ajax({
                url: "Home/GetCity",
                data: JSON.stringify({ provinceCode: $('.section-personal #cboProvinceCode').val() }),
                success: function (result) {
                    $('.section-personal #cboCityCode').empty();
                    $(result).each(function (index, item) {
                        $('.section-personal #cboCityCode').append('<option value="' + item.Value + '">' + item.Text + '</option>');
                    });
                }
            });
        }
    </script>

    @RenderSection("scripts", required: false)
</body>
</html>