/*
Theme Name:   Success Farm Child
Theme URI:    https://successfarmbd.com
Description:  Woostify Child Theme for Success Farm - Fixed & Optimized
Author:       Success Farm
Author URI:   https://successfarmbd.com
Template:     woostify
Version:      1.0.1
Text Domain:  woostify-child
*/


/* ==========================================================================
   1. INLINE SEARCH BAR (replaces the slow ElementsKit popup)
   ========================================================================== */
.sf-inline-search {
    width: 100%;
    max-width: 400px;
}
.sf-inline-search form {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #f9f9f9;
}
.sf-inline-search form:focus-within {
    border-color: #1346af;
    box-shadow: 0 0 0 3px rgba(19, 70, 175, 0.1);
    background: #fff;
}
.sf-inline-search input[type="search"] {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 18px;
    font-size: 14px;
    background: transparent;
    color: #333;
    min-width: 0;
}
.sf-inline-search input[type="search"]::placeholder {
    color: #999;
}
.sf-inline-search button {
    background: #1346af;
    color: #fff;
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 50px 50px 0;
}
.sf-inline-search button:hover {
    background: #0f3688;
}

/* Large variant (used on search results page) */
.sf-inline-search--large {
    max-width: 600px;
    margin: 0 auto;
}
.sf-inline-search--large input[type="search"] {
    padding: 14px 22px;
    font-size: 16px;
}
.sf-inline-search--large button {
    padding: 14px 24px;
}


/* ==========================================================================
   2. SEARCH RESULTS PAGE (custom search.php template)
   ========================================================================== */
.sf-search-header {
    text-align: center;
    padding: 40px 20px 30px;
    max-width: 1200px;
    margin: 0 auto;
}
.sf-search-title {
    font-size: 24px;
    font-weight: 600;
    color: #2b2b2b;
    margin-bottom: 25px;
}
.sf-search-results-count {
    text-align: center;
    padding: 0 20px 20px;
    max-width: 1200px;
    margin: 0 auto;
    color: #666;
    font-size: 14px;
}

/* Product Grid */
.sf-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    list-style: none;
    padding: 0 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}
.sf-product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.sf-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}
.sf-product-card__link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.sf-product-card__image {
    position: relative;
    background: #f8f8f8;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.sf-product-card__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.sf-product-card:hover .sf-product-card__image img {
    transform: scale(1.05);
}
.sf-product-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #e74c3c;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}
.sf-product-card__info {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.sf-product-card__title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin: 0 0 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sf-product-card__price {
    font-size: 16px;
    font-weight: 700;
    color: #1346af;
    margin-top: auto;
}
.sf-product-card__price del {
    color: #999;
    font-weight: 400;
    font-size: 14px;
}
.sf-product-card__price ins {
    text-decoration: none;
    color: #e74c3c;
    font-weight: 700;
}
.sf-product-card__rating {
    margin-top: 8px;
}
.sf-product-card__action {
    padding: 0 18px 18px;
}
.sf-product-card__action .button,
.sf-product-card__action a.add_to_cart_button {
    display: block;
    width: 100%;
    text-align: center;
    background: #1346af;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.sf-product-card__action .button:hover,
.sf-product-card__action a.add_to_cart_button:hover {
    background: #0f3688;
    color: #fff;
}
.sf-out-of-stock {
    display: block;
    text-align: center;
    background: #f0f0f0;
    color: #999;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
}

/* No results state */
.sf-no-results {
    text-align: center;
    padding: 80px 20px;
    max-width: 600px;
    margin: 0 auto;
}
.sf-no-results__icon {
    margin-bottom: 20px;
}
.sf-no-results h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
}
.sf-no-results p {
    color: #777;
    margin-bottom: 30px;
}

/* Search page pagination */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px 0 50px;
}
.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}
.nav-links .page-numbers:hover {
    background: #1346af;
    color: #fff;
}
.nav-links .page-numbers.current {
    background: #1346af;
    color: #fff;
}

/* ==========================================================================
   3. GENERAL PRODUCT GRID IMPROVEMENTS (Homepage & Category Pages)
   ========================================================================== */

/* Elementor Pro WooCommerce Products Widget */
.elementor-widget-woocommerce-products .products .product,
.woocommerce ul.products li.product {
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}
.elementor-widget-woocommerce-products .products .product:hover,
.woocommerce ul.products li.product:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* Product images */
.woocommerce ul.products li.product a img {
    border-radius: 8px 8px 0 0;
    transition: transform 0.4s ease;
}
.woocommerce ul.products li.product:hover a img {
    transform: scale(1.03);
}

/* Product title */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    padding: 8px 12px 4px;
    color: #333;
}

/* Price styling */
.woocommerce ul.products li.product .price {
    color: #1346af;
    font-weight: 700;
    font-size: 15px;
    padding: 0 12px;
}
.woocommerce ul.products li.product .price del {
    color: #999;
    font-size: 13px;
}
.woocommerce ul.products li.product .price ins {
    text-decoration: none;
    color: #e74c3c;
}

/* Sale badge */
.woocommerce ul.products li.product .onsale,
.woocommerce span.onsale {
    background: #e74c3c;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    min-width: auto;
    min-height: auto;
    line-height: 1;
    padding: 6px 14px;
}

/* Out of stock badge */
.woocommerce ul.products li.product .woostify-out-of-stock-label {
    background: rgba(0,0,0,0.6);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
}

/* Add to cart button in product loop */
.woocommerce ul.products li.product .button {
    border-radius: 8px !important;
    font-size: 13px;
    transition: all 0.3s ease;
}


/* ==========================================================================
   4. OVERALL SECTION & LAYOUT IMPROVEMENTS
   ========================================================================== */

/* Better spacing for Elementor sections */
.elementor-section {
    margin-bottom: 0;
}
.elementor-section .elementor-container {
    max-width: 1200px;
}

/* Elementor heading improvements (global) */
.elementor-widget-heading .elementor-heading-title {
    position: relative;
}

/* Category section titles (like উন্নত জাতের পেঁয়াজ বীজ) */
.elementor-section .elementor-widget-heading .elementor-heading-title {
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Blog post cards (কৃষি বিষয়ক তথ্য section) - ElementsKit Blog Posts Widget */
.ekit-blog-posts .elementskit-post-card,
.ekit-blog-posts .ekit-post-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.ekit-blog-posts .elementskit-post-card:hover,
.ekit-blog-posts .ekit-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Quick View button styling */
.yith-wcqv-button {
    border-radius: 6px !important;
}


/* ==========================================================================
   5. MOBILE RESPONSIVENESS
   ========================================================================== */
@media (max-width: 767px) {
    .sf-inline-search {
        max-width: 100%;
    }
    .sf-search-header {
        padding: 25px 15px 20px;
    }
    .sf-search-title {
        font-size: 18px;
    }
    .sf-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 12px 30px;
    }
    .sf-product-card__info {
        padding: 12px;
    }
    .sf-product-card__title {
        font-size: 13px;
    }
    .sf-product-card__price {
        font-size: 14px;
    }
    .sf-product-card__action {
        padding: 0 12px 12px;
    }
    .sf-product-card__action .button,
    .sf-product-card__action a.add_to_cart_button {
        padding: 8px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .sf-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .sf-product-card__image {
        padding: 10px;
    }
}
