/*
Theme Name: Porto Child
Theme URI: http://newsmartwave.net/wordpress/porto
Author: SW-THEMES
Author URI: http://newsmartwave.net/
Description: Porto Responsive Wordpress + eCommerce Theme.
Version: 1.1
Template: porto
License: Commercial
License URI: http://themeforest.net/licenses/regular_extended
Tags: woocommerce, corporate, ecommerce, responsive, blue, black, green, white, light, dark, red, two-columns, three-columns, four-columns, left-sidebar, right-sidebar, fixed-layout, responsive-layout, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready
Text Domain: porto-child

*/

@import url("../porto/style.css");

/*************** ADD YOUR CUSTOM CSS HERE  ***************/
.mega-menu .wide .popup > .inner > ul.sub-menu > li.menu-item > a,
.mega-menu .wide .popup > .inner > ul.sub-menu > li.menu-item > h5 
{
    text-transform: none;
}

.mega-menu .wide .popup > .inner > ul.sub-menu > li.menu-item > a:hover,
.mega-menu .wide .popup > .inner > ul.sub-menu > li.menu-item > h5:hover 
{
    color: #ff0000!important;
    background-color: #f4f4f4!important;
}


/*homepahe*/
body.home .main-menu-wrap{padding-bottom:0px!important}
body.home .main-content{padding-top: 0px!important;}

/*minicart*/
#header:not(.sticky-header) #mini-cart.minicart-arrow .minicart-icon{color: #cccccc;}
#header:not(.sticky-header) #mini-cart.minicart-arrow {
    border: none;
    background-color:transparent;}
#mini-cart.minicart-arrow .cart-items {    background-color: #ff0000;}



#block-widget-3 li{line-height: 18px;}

/*wykonawcy*/
.member-item.member-item-3 .view-more{display:none}
.member-item.member-item-3 h4.text-lg{font-size: 16px!important;line-height: 24px;}
.member-item.member-item-3 span.text-md{font-size: 12px!important;line-height: 13px;!important}

.page-id-17 .aio-icon-description{margin-left:42px!important}
.page-id-17 .main-content{padding-top: 0px;}

#vd_form1 .wpcf7-list-item{display:block}
#vd_form1 label{display:block}
#vd_form1 input[type="text"]{margin-bottom:10px}
#vd_form1 #submit_row{padding:50px 0}
#vd_form1 #submit_row input{width:100%;font-size:24px}

#cat_button{background:red}

.single-product .product-summary-wrap .price:last-child{color:black!important;font-size:20px}

body .menu-ads-container {
    margin-left: -10px!important;
    margin-right: -10px!important;
	margin-top: 10px!important
}
.mega-menu li.menu-item>a{color:black}

#mini-cart .cart-items, #mini-cart .cart-items-text {
    color: #ffffff!important;
}

// Wyłącz CF7 globalnie, włącz tylko na stronach z formularzem
add_filter( 'wpcf7_load_js',  '__return_false' );
add_filter( 'wpcf7_load_css', '__return_false' );

add_action( 'wp_enqueue_scripts', function() {
      if ( is_page( 'kontakt' ) ) {
        wpcf7_enqueue_scripts();
        wpcf7_enqueue_styles();
    }
} );


<?php
/**
 * Optymalizacje wydajności — Wektor Bud
 * Wklej na końcu pliku functions.php motywu dziecięcego
 * (CF7 pominięty — już skonfigurowany)
 */

// ─────────────────────────────────────────────
// 1. Przenieś zbędne skrypty z <head> do footera
// ─────────────────────────────────────────────
add_action( 'wp_enqueue_scripts', function() {
    $move_to_footer = array(
        'ultimate-parallax',       // vhparallax.min.js — Ultimate Addons
        'ultimate-custom-js',
        'ultimate_bg',
        'jquery-blockui',          // WooCommerce blockUI
        'js-cookie',               // WooCommerce cookie
        'wc-conditional-shipping', // Conditional Shipping plugin
        'underscore',
        'wp-util',
    );
    foreach ( $move_to_footer as $handle ) {
        $script = wp_scripts()->query( $handle );
        if ( $script ) {
            $script->args = 1; // 1 = footer
        }
    }
}, 9999 );


// ─────────────────────────────────────────────
// 2. Usuń zbędne elementy z <head>
// ─────────────────────────────────────────────
add_action( 'init', function() {
    // Emoji (~15 KB zbędnego JS/CSS)
    remove_action( 'wp_head',        'print_emoji_detection_script', 7 );
    remove_action( 'wp_print_styles','print_emoji_styles' );
    remove_filter( 'the_content_feed','wp_staticize_emoji' );
    remove_filter( 'comment_text_rss','wp_staticize_emoji' );

    // Wersja WordPressa widoczna w kodzie źródłowym
    remove_action( 'wp_head', 'wp_generator' );

    // Linki archaiczne / zbędne na froncie
    remove_action( 'wp_head', 'rsd_link' );
    remove_action( 'wp_head', 'wlwmanifest_link' );
    remove_action( 'wp_head', 'rest_output_link_wp_head' );
    remove_action( 'wp_head', 'wp_shortlink_wp_head' );
} );


// ─────────────────────────────────────────────
// 3. Lazy loading obrazów w treści
// ─────────────────────────────────────────────
add_filter( 'wp_lazy_loading_enabled', '__return_true' );

add_filter( 'the_content', function( $content ) {
    // Dodaj loading="lazy" tylko jeśli jeszcze nie ma
    return preg_replace( '/<img(?![^>]*loading=)/', '<img loading="lazy"', $content );
} );


// ─────────────────────────────────────────────
// 4. Preconnect do zewnętrznych zasobów
// ─────────────────────────────────────────────
add_action( 'wp_head', function() {
    echo '<link rel="preconnect" href="https://fonts.googleapis.com" crossorigin>' . "\n";
    echo '<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>' . "\n";
    echo '<link rel="dns-prefetch" href="//www.googletagmanager.com">' . "\n";
    echo '<link rel="dns-prefetch" href="//www.google-analytics.com">' . "\n";
}, 1 );


add_filter( 'acf/ajax/shortcode_capability', function( $cap ) {
    if ( isset( $_POST['_vcnonce'] ) && wp_verify_nonce( $_POST['_vcnonce'], 'vc-nonce-vc-public-nonce' ) ) {
        return 'exist';
    }
    return $cap;
});


.vc_grid-item .vc_gitem-zone { min-height: 220px !important; }