<?php $options = kaveh_get_options(); ?>
            <!-- Start Nav -->
            <header class="nav-mobile nav-mobile-sticky">
              <div class="container">
                <div class="nav-mobile-wrapper bg-white">
                  <div class="nav-mobile-up d-flex align-items-center overflow-hidden">
                    <!-- Start Btn Nav -->
                    <button type="button"
                      class="btn-nav-header btn-nav-kkheader p-0"
                      aria-label="btn nav">
                      <i class="icon-grid-2"></i>
                    </button>
                    <!-- Start Btn Nav -->
                    <!-- Start Logo -->
                    <a href="<?php echo home_url(); ?>" class="nav-mobile-logo">
                      <img class="imnavmo" src="<?php echo $options['kaveh_logo_up'] ?>"
                        alt="logo">
                    </a>
                    <!-- End Logo -->
                  <!-- Start Auth -->
                  <div class="nav-mobile-three-auth position-relative d-flex align-items-center me-2 ms-auto">
                    <a <?php if (!is_user_logged_in() && $options['kaveh_login_redirect'] === '1'): ?> data-auth-toggle="modal"
                          data-auth-target="auth-gajmarket" <?php else: ?>
                          href="<?php echo get_permalink(get_option('woocommerce_myaccount_page_id')); ?>" <?php endif; ?> class="stretched-link" aria-label="auth"></a>
                    <?php
                          if (is_user_logged_in()) {
                              // Get the current user object
                              $current_user = wp_get_current_user();
                              // Get the Gravatar URL for the current user
                              $avatar_url = get_avatar_url($current_user->user_email, array('size' => 30));
                          } else {
                              // Fallback image URL
                              $avatar_url = esc_url(KAVEH_TEMPLATE_URI) . '/assets/images/user2.png';
                          }
                          ?>
                          <img class="me-1" src="<?php echo $avatar_url; ?>" alt="avatar" width="33" height="33">
                    <?php if (is_user_logged_in()): ?>
                    <?php 
                    $first_name = get_user_meta( get_current_user_id(), 'first_name', true );
                    $last_name = get_user_meta( get_current_user_id(), 'last_name', true );
                    ?>
                    <div>
                      <div class="name"> <?php echo $first_name . ' ' . $last_name; ?> </div>
                      <div class="wellcome"> <?php esc_html_e('Welcome', 'kavehTheme'); ?> </div>
                    </div>
                    <?php endif; ?>
                  </div>
                  <!-- End Auth -->
                  </div>
                  <div class="nav-mobile-bottom d-flex align-items-center">
                    <form method="get" action="#" class="d-flex align-items-center me-4">
                      <button type="button" class="setting position-relative ps-0 " aria-label="setting">
                        <i class="icon-setting"></i>
                      </button>
                      <button type="button" class="search d-none" aria-label="search">
                        <i class="icon-search-3"></i>
                      </button>
                      <input id="maninpu" type="text" name="search" class="form-control bg-transparent border-0 shadow-none p-0 maninpu"
                        placeholder="<?php esc_attr_e('Search', 'kavehTheme'); ?>">
                    </form>



                    <?php if (class_exists('woocommerce')): ?>
                    <a data-open-cart="true" href="javascript:void(0)" class="nav-mobile-cart d-flex align-items-center justify-content-center position-relative me-1">
                      <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">
                        <div class="mob_cart_tot"> <?php echo WC()->cart->get_cart_contents_count(); ?> </div> </span>
                    </a>
                    <?php endif; ?>

                    <button type="button"
                      class="btn-nav-header btn-nav-kkheader d-none p-0"
                      aria-label="btn nav">
                      <i class="icon-grid-2"></i>
                    </button>
                  </div>
                
                </div>
              </div>
            </header>
            <!-- End Nav -->