<?php $options = get_option('kaveh_frame'); ?>
            <!-- Start Nav -->
            <header class="nav-mobile-two nav-mobile-sticky">
              <div class="container">
                <div class="nav-mobile-two-wrapper d-flex align-items-center bg-white">
                  <!-- Start Logo -->
                  <a href="#" class="nav-mobile-two-logo">
                    <img src="<?php echo esc_url(KAVEH_TEMPLATE_URI); ?>/assets/images/jadid/logo-01.png" alt="logo"
                      width="78" height="26">
                  </a>
                  <!-- End Logo -->
                  <!-- Start Auth -->
                  <a href="#" class="nav-mobile-auth nav-mobile-two-auth ms-auto">
                    <img src="<?php echo esc_url(KAVEH_TEMPLATE_URI); ?>/assets/images/jadid/avatar-01.png"
                      alt="avatar" width="29" height="29">
                  </a>
                  <!-- End Auth -->
                  <!-- Start Search -->
                  <button type="button"
                    class="nav-mobile-btn-search nav-mobile-two-btn-search d-flex align-items-center justify-content-center"
                    aria-label="search">
                    <i class="icon-search-3"></i>
                  </button>
                  <!-- End Search -->
                  <!-- Start Favorite -->
                  <a href="#"
                    class="nav-mobile-favorite nav-mobile-two-favorite position-relative d-flex align-items-center justify-content-center">
                    <i class="icon-heart"></i>
                    <span
                      class="position-absolute top-0 start-0 d-flex align-items-center justify-content-center rounded-circle text-white">
                      8 </span>
                  </a>
                  <!-- End Favorite -->
                  <!-- Start Cart -->
                  <a href="#"
                    class="nav-mobile-cart nav-mobile-two-cart d-flex align-items-center justify-content-center position-relative">
                    <i class="icon-shopping-cart"></i>
                    <span
                      class="position-absolute rounded-circle d-flex align-items-center justify-content-center text-white top-0 start-0">
                      8 </span>
                  </a>
                  <!-- End Cart -->
                  <!-- Start Btn Nav -->
                  <button type="button"
                    class="btn-nav-header <?php if ($options['kaveh_menu_mobile_type'] === 'value-1'): ?>btn-nav-kkheader<?php elseif ($options['kaveh_menu_mobile_type'] === 'value-2'): ?>btn-nav-kheader<?php endif; ?> p-0"
                    aria-label="btn nav">
                    <i class="icon-grid-2"></i>
                  </button>
                  <!-- Start Btn Nav -->
                  <?php if ($options['kaveh_menu_mobile_type'] === 'value-1'): ?>
                    <!-- Start Nav Responsive -->
                    <div class="nav-responsive position-fixed top-0 end-0 w-100 h-100">
                      <div class="nav-responsive-backdrop position-fixed top-0 end-0 w-100 h-100"></div>
                      <div class="nav-responsive-content position-absolute top-0 right-0 w-100 h-100">
                        <div class="nav-responsive-content-wrapper bg-white">
                          <button type="button"
                            class="nav-responsive-close rounded-circle d-flex align-items-center justify-content-center text-white">
                            <i class="icon-close"></i>
                          </button>
                          <ul class="nav-responsive-content-menu">
                            <?php
                            function has_sub_menu(array $menu_items, int $id)
                            {
                              foreach ($menu_items as $menu_item) {
                                if ((int) $menu_item->menu_item_parent === $id) {
                                  return true;
                                }
                              }
                              return false;
                            }
                            // wordpress does not group child menu items with parent menu items
                            $menus = get_terms('nav_menu', array('hide_empty' => true));
                            if (!empty($options['kaveh_mobile_select'])):
                              $menuop = $options['kaveh_mobile_select'];
                              $navbar_items = wp_get_nav_menu_items($menuop);
                            else:
                              $navbar_items = wp_get_nav_menu_items('primary');
                            endif;

                            foreach ($navbar_items as $navbar_item) {
                              $nav_meta = get_post_meta($navbar_item->ID);
                              $icon_class = $nav_meta['_menu_item_desc'];
                              if ($navbar_item->menu_item_parent == 0):
                                ?>
                                <li <?php if (has_sub_menu($navbar_items, $navbar_item->ID)): ?> class="has-child" <?php endif; ?>>
                                  <a href="<?php echo $navbar_item->url; ?>" class="d-block rounded-pill">
                                    <i class="<?php echo $icon_class[0]; ?>"></i>
                                    <?php echo $navbar_item->title; ?>
                                    <?php if (has_sub_menu($navbar_items, $navbar_item->ID)): ?>
                                      <i class="icon-angle-left position-absolute top-50 translate-middle-y m-0"></i>
                                    <?php endif; ?>
                                  </a>
                                  <?php if (has_sub_menu($navbar_items, $navbar_item->ID)): ?>
                                    <div class="children position-fixed top-0 start-0 w-100 h-100 bg-white">
                                      <div class="heading px-3 py-4 d-flex align-items-center justify-content-between">
                                        <?php echo $navbar_item->title; ?>
                                        <button type="button"
                                          class="nav-responsive-back rounded-circle d-flex align-items-center justify-content-center text-white mb-0">
                                          <i class="icon-arrow-left-2"></i>
                                        </button>
                                      </div>
                                      <ul>
                                        <?php
                                        foreach ($navbar_items as $menu_item) {
                                          if ((int) $menu_item->menu_item_parent === $navbar_item->ID) {
                                            ?>
                                            <li <?php if (has_sub_menu($navbar_items, $menu_item->ID)): ?>class="has-child" <?php endif; ?>>
                                              <a href="<?php echo $menu_item->url; ?>" class="d-block rounded-pill">
                                                <?php echo $menu_item->title; ?>
                                                <?php if (has_sub_menu($navbar_items, $menu_item->ID)): ?>
                                                  <i class="icon-angle-left position-absolute top-50 translate-middle-y m-0"></i>
                                                <?php endif; ?>
                                              </a>
                                              <?php if (has_sub_menu($navbar_items, $menu_item->ID)): ?>
                                                <div class="children position-fixed top-0 start-0 w-100 h-100 bg-white">
                                                  <div class="heading px-3 py-4 d-flex align-items-center justify-content-between">
                                                    <?php echo $menu_item->title; ?>
                                                    <button type="button"
                                                      class="nav-responsive-back rounded-circle d-flex align-items-center justify-content-center text-white mb-0">
                                                      <i class="icon-arrow-left-2"></i>
                                                    </button>
                                                  </div>
                                                  <ul>
                                                    <?php foreach ($navbar_items as $submenu_item): ?>
                                                      <?php if ((int) $submenu_item->menu_item_parent === $menu_item->ID): ?>
                                                        <li <?php if (has_sub_menu($navbar_items, $submenu_item->ID)): ?>class="has-child" <?php endif; ?>>
                                                          <a href="<?php echo $submenu_item->url; ?>" class="d-block rounded-pill">
                                                            <?php echo $submenu_item->title; ?>
                                                            <?php if (has_sub_menu($navbar_items, $submenu_item->ID)): ?>
                                                              <i class="icon-angle-left position-absolute top-50 translate-middle-y m-0"></i>
                                                            <?php endif; ?>
                                                          </a>
                                                          <?php if (has_sub_menu($navbar_items, $submenu_item->ID)): ?>
                                                            <div class="children position-fixed top-0 start-0 w-100 h-100 bg-white">
                                                              <div class="heading px-3 py-4 d-flex align-items-center justify-content-between">
                                                                <?php echo $submenu_item->title; ?>
                                                                <button type="button"
                                                                  class="nav-responsive-back rounded-circle d-flex align-items-center justify-content-center text-white mb-0">
                                                                  <i class="icon-arrow-left-2"></i>
                                                                </button>
                                                              </div>
                                                              <ul>
                                                                <?php foreach ($navbar_items as $subsubmenu_item): ?>
                                                                  <?php if ((int) $subsubmenu_item->menu_item_parent === $submenu_item->ID): ?>
                                                                    <li <?php if (has_sub_menu($navbar_items, $subsubmenu_item->ID)): ?>class="has-child"
                                                                      <?php endif; ?>>
                                                                      <a href="<?php echo $subsubmenu_item->url; ?>" class="d-block rounded-pill">
                                                                        <?php echo $subsubmenu_item->title; ?>
                                                                        <?php if (has_sub_menu($navbar_items, $subsubmenu_item->ID)): ?>
                                                                          <div class="children position-fixed top-0 start-0 w-100 h-100 bg-white">
                                                                            <div
                                                                              class="heading px-3 py-4 d-flex align-items-center justify-content-between">
                                                                              <?php echo $subsubmenu_item->title; ?>
                                                                              <button type="button"
                                                                                class="nav-responsive-back rounded-circle d-flex align-items-center justify-content-center text-white mb-0">
                                                                                <i class="icon-arrow-left-2"></i>
                                                                              </button>
                                                                            </div>
                                                                            <ul>
                                                                              <?php foreach ($navbar_items as $subsubsubmenu_item): ?>
                                                                                <?php if ((int) $subsubsubmenu_item->menu_item_parent === $subsubmenu_item->ID): ?>
                                                                                  <li class="has-child">
                                                                                    <a href="#" class="d-block rounded-pill"> ایتم 1 </a>
                                                                                    <div class="children position-fixed top-0 start-0 w-100 h-100 bg-white">
                                                                                      <div
                                                                                        class="heading px-3 py-4 d-flex align-items-center justify-content-between">
                                                                                        دسته بندی محصولات
                                                                                        <button type="button"
                                                                                          class="nav-responsive-back rounded-circle d-flex align-items-center justify-content-center text-white mb-0">
                                                                                          <i class="icon-arrow-left-2"></i>
                                                                                        </button>
                                                                                      </div>
                                                                                      <ul>
                                                                                        <li class="has-child">
                                                                                          <a href="#" class="d-block rounded-pill"> ایتم 1 </a>

                                                                                        </li>
                                                                                        <li class="has-child">
                                                                                          <a href="#" class="d-block rounded-pill"> ایتم 2 </a>

                                                                                        </li>
                                                                                        <li>
                                                                                          <a href="#" class="d-block rounded-pill"> ایتم 3 </a>
                                                                                        </li>
                                                                                      </ul>
                                                                                    </div>
                                                                                  </li>
                                                                                <?php endif; ?>
                                                                              <?php endforeach; ?>
                                                                            </ul>
                                                                          </div>
                                                                        <?php endif; ?>
                                                                      </a>
                                                                    </li>
                                                                  <?php endif; ?>
                                                                <?php endforeach; ?>
                                                              </ul>
                                                            </div>
                                                          <?php endif; ?>
                                                        </li>

                                                      <?php endif; ?>
                                                    <?php endforeach; ?>

                                                  </ul>
                                                </div>
                                              <?php endif; ?>
                                            </li>
                                            <?php
                                          }
                                        }
                                        ?>
                                      </ul>
                                    </div>
                                  <?php endif; ?>
                                </li>
                              <?php endif; ?>
                            <?php
                            }
                            ?>
                          </ul>
                        </div>
                        <div class="discounts-contact d-flex align-items-center justify-content-between position-relative">
                          <?php
                          if (!empty($options['kaveh_boxmenudown_mobile_on'])):
                            if ($options['kaveh_boxmenudown_mobile_on'] === '1'):
                              ?>
                              <a href="<?php echo $options['kaveh_boxmenudown_url']; ?>" class="discount rounded-pill">
                                <i class="<?php echo $options['kaveh_boxmenudown_iconclass']; ?>"></i>
                                <?php echo $options['kaveh_boxmenudown_text']; ?>
                              </a>
                              <ul class="d-flex align-items-center">
                                <li>
                                  <a href="#">
                                    <i class="icon-document"></i>
                                  </a>
                                </li>
                                <li>
                                  <a href="#">
                                    <i class="icon-phone-4"></i>
                                  </a>
                                </li>
                              </ul>
                              <?php
                            endif;
                          endif;
                          ?>
                        </div>
                        <?php if ($options['kaveh_icons_mobile_on'] == true): ?>
                          <div class="socials d-flex align-items-center justify-content-between position-relative">
                            <ul class="d-flex align-items-center">
                              <?php
                              if (!empty($options['kaveh_mobile_menu-repeater'])):
                                $iconh = $options['kaveh_mobile_menu-repeater'];
                                for ($i = 0; $i < count($iconh); $i++) {
                                  ?>
                                  <li>
                                    <a href="<?php echo $iconh[$i]['kaveh_mobile_menu_text']['url']; ?>"
                                      class="d-flex align-items-center justify-content-center rounded-pill">
                                      <i class="<?php echo $iconh[$i]['kaveh_mobile_menu_icon']; ?>"></i>
                                    </a>
                                  </li>
                                  <?php
                                }
                              endif;
                              ?>

                            </ul>
                            <span class="text-white"> شبکه های اجتماعی </span>
                          </div>
                        <?php endif; ?>

                      </div>
                    </div>
                    <!-- End Nav Responsive -->
                  <?php elseif ($options['kaveh_menu_mobile_type'] === 'value-2'): ?>
                    <div class="nav-mobile-six-menu position-absolute top-100 w-100">
                      <div class="nav-mobile-six-menu-backdrop position-fixed top-0 end-0 vw-100 vh-100"></div>
                      <div class="nav-mobile-six-menu-content bg-white w-100 overflow-hidden position-relative">
                        <!-- Start Search -->
                        <form method="get" action="#" class="position-relative">
                          <input id="maninpu" type="text" name="search" class="maninpu form-control" placeholder="جستجو کنید ...">
                          <button type="button" class="position-absolute top-50 translate-middle-y p-0">
                            <i class="icon-search"></i>
                          </button>
                        </form>
                        <!-- End Search -->
                        <div class="position-relative">
                          <ul class="menu mb-4">
                            <?php
                            function has_sub_menu(array $menu_items, int $id)
                            {
                              foreach ($menu_items as $menu_item) {
                                if ((int) $menu_item->menu_item_parent === $id) {
                                  return true;
                                }
                              }
                              return false;
                            }
                            // wordpress does not group child menu items with parent menu items
                            $menus = get_terms('nav_menu', array('hide_empty' => true));
                            if (!empty($options['kaveh_mobile_select'])):
                              $menuop = $options['kaveh_mobile_select'];
                              $navbar_items = wp_get_nav_menu_items($menuop);
                            else:
                              $navbar_items = wp_get_nav_menu_items('primary');
                            endif;
                            foreach ($navbar_items as $navbar_item) {
                              $nav_meta = get_post_meta($navbar_item->ID);
                              $icon_class = $nav_meta['_menu_item_desc'];
                              if ($navbar_item->menu_item_parent == 0):
                                ?>


                                <?php if (has_sub_menu($navbar_items, $navbar_item->ID)): ?>
                                  <li class="has-child arrow-left">
                                    <a href="<?php echo $navbar_item->url; ?>" class="d-flex align-items-center">
                                      <i class="<?php echo $icon_class[0]; ?>"></i>
                                      <?php echo $navbar_item->title; ?>
                                    </a>
                                    <ul class="position-absolute top-0 left-0 bg-white">
                                      <li class="back d-flex align-items-center justify-content-between">
                                        بازگشت
                                        <i class="icon-arrow-left-5 d-flex align-items-center justify-content-center text-white"></i>
                                      </li>
                                      <?php
                                      foreach ($navbar_items as $menu_item) {
                                        if ((int) $menu_item->menu_item_parent === $navbar_item->ID) {
                                          ?>
                                          <li>
                                            <a href="<?php echo $menu_item->url; ?>" class="d-block"> <?php echo $menu_item->title; ?> </a>
                                          </li>
                                          <?php
                                        }
                                      }
                                      ?>

                                    </ul>
                                  </li>
                                <?php else: ?>
                                  <li>
                                    <a href="<?php echo $navbar_item->url; ?>" class="d-flex align-items-center">
                                      <i class="<?php echo $icon_class[0]; ?>"></i>
                                      <?php echo $navbar_item->title; ?>
                                    </a>
                                  </li>
                                <?php endif; ?>



                              <?php endif; ?>
                            <?php
                            }
                            ?>
                          </ul>
                          <?php if ($options['kaveh_icons_mobile_on'] == true): ?>
                            <ul class="socials mt-auto d-flex align-items-center pt-4">
                              <?php
                              if (!empty($options['kaveh_mobile_menu-repeater'])):
                                $iconh = $options['kaveh_mobile_menu-repeater'];
                                for ($i = 0; $i < count($iconh); $i++) {
                                  ?>
                                  <li>
                                    <a href="<?php echo $iconh[$i]['kaveh_mobile_menu_text']['url']; ?>" class="d-block"
                                      aria-label="facebook">
                                      <i class="<?php echo $iconh[$i]['kaveh_mobile_menu_icon']; ?>"></i>
                                    </a>
                                  </li>
                                  <?php
                                }
                              endif;
                              ?>
                            </ul>
                          <?php endif; ?>
                        </div>
                      </div>
                      <?php if ($options['kaveh_icons_mobile_on'] == true): ?>
                        <ul
                          class="nav-mobile-six-menu-socials d-flex flex-column align-items-center justify-content-center position-absolute end-0">
                          <?php
                          if (!empty($options['kaveh_mobile_menu-repeater'])):
                            $iconh = $options['kaveh_mobile_menu-repeater'];
                            for ($i = 0; $i < count($iconh); $i++) {
                              ?>
                              <li>
                                <a href="<?php echo $iconh[$i]['kaveh_mobile_menu_text']['url']; ?>" class="d-block">
                                  <i class="<?php echo $iconh[$i]['kaveh_mobile_menu_icon']; ?>"></i>
                                </a>
                              </li>
                              <?php
                            }
                          endif;
                          ?>
                        </ul>
                      <?php endif; ?>
                    </div>
                    <div class="nav-mobile-six-bottom d-flex align-items-center position-fixed">
                      <div class="bg"></div>
                      <a data-open-cart="true" href="<?php echo wc_get_cart_url(); ?>"
                        class="notification d-flex align-items-center">
                        <i class="isax isax-bag-happy position-relative"></i>
                        سبد خرید
                      </a>
                      <a href="<?php echo home_url() ?>"
                        class="btn-center d-flex align-items-center justify-content-center position-absolute rounded-circle text-white top-0 end-50"
                        aria-label="home">
                        <i class="icon-home-5"></i>
                      </a>
                      <ul class="d-flex align-items-center ms-auto">
                        <?php if (is_user_logged_in()): ?>
                          <li class="position-relative">
                            <a href="<?php echo get_permalink(get_option('woocommerce_myaccount_page_id')) ?>" class="d-block"
                              aria-label="phone">
                              <i class="isax isax-user4 mnicon"></i>
                            </a>
                          </li>
                        <?php endif; ?>
                        <li class="position-relative">
                          <?php if (is_user_logged_in()): ?>
                            <a href="<?php echo wp_logout_url(home_url()); ?>" class="d-block" aria-label="logout">
                              <i class="icon-logout"></i>
                            </a>
                          <?php else: ?>
                            <a href="<?php echo get_permalink(get_option('woocommerce_myaccount_page_id')) ?>" class="d-block"
                              aria-label="logout">
                              <i class="isax isax-user4 mnicon"></i>
                            </a>
                          <?php endif; ?>
                        </li>
                      </ul>
                    </div>
                  <?php endif; ?>
                </div>
              </div>
            </header>
            <!-- End Nav -->
            <br>