/*
Theme Name: Merto Child
Theme URI: https://demo.theme-sky.com/merto/
Author: Theme Sky Team
Author URI: http://theme-sky.com/
Description: A Premium and Responsive WordPress theme, designed for E-Commerce websites
Template: merto
Version: 1.0.0
License: GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Tags: two-columns, left-sidebar, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready
Text Domain: merto-child
*/
#wpc-checkbox-taxonomy-color-491 { 
/*ONYX*/
            background-color: #2F2B28;   border-color:#2F2B28!important;
}
#wpc-checkbox-taxonomy-color-384{
  /*Dusk*/
            background-color: #4D494A;   border-color:#4D494A !important;
}
#wpc-checkbox-taxonomy-color-385{
  /*Night*/
            background-color: #171717;   border-color:#171717 !important;
}
#wpc-checkbox-taxonomy-color-388{
  /*Twilight*/
            background-color: #A39686;   border-color:#A39686 !important;
}
#wpc-checkbox-taxonomy-color-390{
  /*Polaris*/
            background-color:#FAF5F1;   border-color:#FAF5F1 !important;
}
#wpc-checkbox-taxonomy-color-391{
  /*Silver Stone*/
            background-color: #635E5A;   border-color:#635E5A !important;
}
#wpc-checkbox-taxonomy-color-392{
  /*Bronze*/
            background-color: #796D61;   border-color:#796D61 !important;
}
#wpc-checkbox-taxonomy-color-389 { 
/*MAGMA*/
            background-color: #2F2F2F;   border-color:#2F2F2F !important;
}
#wpc-checkbox-taxonomy-color-387 { 
/*rogue*/
            background-color: #A3161C;   border-color:#A3161C !important;
}
#wpc-checkbox-taxonomy-color-386{
/*Puro*/
   background-color: #050505;   border-color:#050505 !important;
}
#wpc-checkbox-taxonomy-color-393 { 
/*Everest*/
            background-color: #D8CBC3;   border-color:#D8CBC3 !important;
}
#wpc-checkbox-taxonomy-color-394 { 
/*Nero*/
            background-color: #282425;   border-color:#282425 !important;
}
#wpc-checkbox-taxonomy-color-395 { 
/*Sabbia*/
            background-color: #B0A090;   border-color:#B0A090 !important;
}
#wpc-checkbox-taxonomy-color-396 { 
/*Concrete*/
            background-color: #8E8179;   border-color:#8E8179 !important;
}
#wpc-checkbox-taxonomy-color-402 { 
/*Balck*/
            background-color: #050505;   border-color:#050505 !important;
}
#wpc-checkbox-taxonomy-color-401 { 
/*Copper*/
            background-color: #B87333;   border-color:#B87333 !important;
}
#wpc-checkbox-taxonomy-color-404 { 
/*Gun Metal*/
            background-color: #838383;   border-color:#838383 !important;
}
#wpc-checkbox-taxonomy-color-495 { 
/*EDM*/
            background-color: #B5B5B5;   border-color:#B5B5B5 !important;
}
.wpc-filter-color  label{
  padding-bottom:0px
}  
.wpc-filter-color ul{
   

    flex-direction: row;
}
.wpc-filter-color ul li{
  width:45% !important;
  display:inline-flex;
}
.wpc-filter-color input[type="checkbox"] {
  width:25px !important;
height:25px !important;
 appearance: none; 
            border: 2px solid ;
            border-radius: 5px;
}
 .wpc-filter-color input[type="checkbox"]:checked::after {
            content: '✔';
            position: absolute;
            top: 3px;
            left: 8px;
            color: white;
        }
/*header mk */
.left-mk{
  display:flex;
  gap:5px;
width:20%;
     }
.left-mk .logo img{
  width:100% !important;
}
.mkr-container .header-right{
  width:20%;
}
.ccent-img-mk{
  display:flex;
align-items:center;
  
}
.ccent-img-mk img{
  width:100%
   
}
.mkr-container{
  display:flex;

}
.ccent-img-pk2 {
    
    width: 18% !important;
    justify-content: center;
}
.mkr-container .header-center{
  width:60%;
  gap:10px;
}
.header-middle {
  
    justify-content: center !important;
   
}
.mk-cont-bottom{
  margin:0 auto !important;
}

@media(max-width:768px){
  .mkr-container{
    display:none !important;
  }
  .mobile-menu-mk{
    display:block !important
  }
}


function custom_product_search_results_shortcode() {
    if (!is_main_query() && !isset($_GET['sfid'])) return;

    $output = '';
    $query = new WP_Query(array(
        'post_type' => 'product',
        'search_filter_id' => $_GET['sfid'] ?? '', // allows filtering via Search & Filter Pro
        'posts_per_page' => -1,
    ));

    if ($query->have_posts()) {
        $output .= '<div class="custom-search-results">';
        while ($query->have_posts()) {
            $query->the_post();
            global $product;

            $output .= '<div class="product-box">';
            $output .= '<a href="' . get_permalink() . '">';
            $output .= get_the_post_thumbnail(get_the_ID(), 'medium');
            $output .= '<h3>' . get_the_title() . '</h3>';
            $output .= '<p>' . get_the_excerpt() . '</p>';
            $output .= '</a>';
            $output .= '</div>';
        }
        $output .= '</div>';
    } else {
        $output .= '<p>No products found.</p>';
    }

    wp_reset_postdata();
    return $output;
}
add_shortcode('search_result_products', 'custom_product_search_results_shortcode');
