<?php
/**
 * Title: Main navigation — Home (+ Cart + Checkout if WooCommerce active)
 * Slug: iconvert-shoply/main-nav
 * Categories: iconvert-shoply, header
 * Description: Header navigation.
 * Keywords: navigation, menu, header
 * Inserter: no
 */

$iconvert_shoply_woo_active   = class_exists( 'WooCommerce' );
$iconvert_shoply_shop_url     = $iconvert_shoply_woo_active ? get_permalink( wc_get_page_id( 'shop' ) ) : '';
$iconvert_shoply_cart_url     = $iconvert_shoply_woo_active ? get_permalink( wc_get_page_id( 'cart' ) ) : '';
$iconvert_shoply_checkout_url = $iconvert_shoply_woo_active ? get_permalink( wc_get_page_id( 'checkout' ) ) : '';
?>
<!-- wp:navigation {"overlayMenu":"mobile","layout":{"type":"flex","setCascadingProperties":true,"flexWrap":"nowrap", "justifyContent":"right"},"style":{"spacing":{"blockGap":"1.5rem"},"typography":{"fontWeight":"300","textTransform":"none"}},"fontSize":"medium"} -->
<!-- wp:home-link {"label":"Home"} /-->
<?php if ( $iconvert_shoply_woo_active ) : ?>
<!-- wp:navigation-link {"label":"Shop","url":"<?php echo esc_url( $iconvert_shoply_shop_url ); ?>","kind":"custom","isTopLevelLink":true} /-->
<!-- wp:navigation-link {"label":"Cart","url":"<?php echo esc_url( $iconvert_shoply_cart_url ); ?>","kind":"custom","isTopLevelLink":true} /-->
<!-- wp:navigation-link {"label":"Checkout","url":"<?php echo esc_url( $iconvert_shoply_checkout_url ); ?>","kind":"custom","isTopLevelLink":true} /-->
<?php endif; ?>
<!-- /wp:navigation -->
