if ( ! function_exists( 'bridge_qode_child_theme_enqueue_scripts' ) ) {

	function bridge_qode_child_theme_enqueue_scripts() {
		wp_register_style( 'bridge-childstyle', get_stylesheet_directory_uri() . '/style.css' );
		wp_enqueue_style( 'bridge-childstyle' );
	}

	add_action( 'wp_enqueue_scripts', 'bridge_qode_child_theme_enqueue_scripts', 11 );
}

/**
 * Fuerza un único meta viewport correcto.
 */

/* 1) Intenta quitar la función del tema si existe */
add_action( 'after_setup_theme', function () {
	remove_action( 'wp_head', 'bridge_qode_header_meta' );
}, 999 );

/* 2) Reescribe el HTML final y elimina cualquier viewport previo */
add_action( 'template_redirect', function () {
	ob_start( function ( $html ) {

		// Elimina cualquier meta viewport existente, aunque tenga atributos en distinto orden
		$html = preg_replace(
			'/<meta[^>]*name=["\']viewport["\'][^>]*>/i',
			'',
			$html
		);

		// Inserta un único viewport correcto antes de </head>
		$viewport = '<meta name="viewport" content="width=device-width, initial-scale=1">' . "\n";

		if ( stripos( $html, '</head>' ) !== false ) {
			$html = preg_replace( '/<\/head>/i', $viewport . '</head>', $html, 1 );
		}

		return $html;
	} );
}, 0 );<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://nagagear.com/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://nagagear.com/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://nagagear.com/wp-sitemap-posts-product-1.xml</loc></sitemap><sitemap><loc>https://nagagear.com/wp-sitemap-taxonomies-product_cat-1.xml</loc></sitemap><sitemap><loc>https://nagagear.com/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
