/**

 * Custom AJAX Shop & Filter Styles

 * Target: [filter_shop] and [product_archive] shortcodes

 */



/* 1. Sidebar Filter Styling */

.shop-sidebar-custom {

    background: #ffffff;

    padding: 25px;

    border: 1px solid #e0e0e0;

    border-radius: 12px;

    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Soft shadow for premium look */

    position: sticky;

    top: 20px; /* Scroll korle sidebar fixed thakbe */

    z-index: 10;

}



/* Sidebar Widgets */

.filter-widget {

    margin-bottom: 30px;

}



.widget-title {

    font-size: 18px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.5px;

    margin-bottom: 15px;

    color: #222;

    border-bottom: 2px solid #0073aa; /* Heading niche ekta border */

    padding-bottom: 8px;

    display: inline-block;

}



/* 2. Search Box UI */

#ajax-search-input {

    width: 100%;

    padding: 12px 15px;

    border: 1px solid #ddd;

    border-radius: 8px;

    font-size: 14px;

    transition: all 0.3s ease;

    outline: none;

}



#ajax-search-input:focus {

    border-color: #0073aa;

    box-shadow: 0 0 8px rgba(0, 115, 170, 0.2); /* Focus effect */

}



/* 3. Category List UI */

.ajax-cat-list {

    list-style: none;

    padding: 0;

    margin: 0;

}



.cat-item {

    padding: 10px 15px;

    margin-bottom: 8px;

    background: #f9f9f9;

    border-radius: 6px;

    cursor: pointer;

    font-weight: 500;

    color: #444;

    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    display: flex;

    justify-content: space-between;

    align-items: center;

}



/* Hover & Active Category State */

.cat-item:hover {

    background: #f0f0f0;

    padding-left: 20px; /* Hover effect sliding */

    color: #0073aa;

}



.cat-item.active {

    background: #0073aa; /* Active color */

    color: #ffffff;

    box-shadow: 0 4px 10px rgba(0, 115, 170, 0.3);

}



/* 4. Price Slider Styling */

#price-slider {

    width: 100%;

    margin: 15px 0;

    cursor: pointer;

}



.price-display {

    font-size: 15px;

    font-weight: 600;

    color: #333;

    background: #f1f1f1;

    padding: 5px 10px;

    border-radius: 4px;

    display: inline-block;

}



#price-limit {

    color: #0073aa;

}



/* 5. Product Grid (4 Columns) */

.shop-main-content {

    position: relative;

    min-height: 400px; /* Loader thakle jeno jump na kore */

}





/* Product Card Animation */

#ajax-response-grid > div {

    animation: fadeIn 0.5s ease backwards;

}



@keyframes fadeIn {

    from { opacity: 0; transform: translateY(10px); }

    to { opacity: 1; transform: translateY(0); }

}



/* 6. Responsive Breakpoints */



/* Tablet: 2 Column */





/* Mobile: 1 Column & Layout Change */

@media (max-width: 768px) {


    .shop-sidebar-custom {

        position: static; /* Mobile e sticky dorkar nai */

        margin-bottom: 30px;

    }

}



/* 7. Loading Spinner */

.hidden-loader {

    display: none;

}



#shop-loader {

    position: absolute;

    top: 100px;

    left: 50%;

    transform: translateX(-50%);

    z-index: 99;

}



.spinner-icon {

    width: 50px;

    height: 50px;

    border: 5px solid #f3f3f3;

    border-top: 5px solid #0073aa;

    border-radius: 50%;

    animation: spin 1s linear infinite;

}



@keyframes spin {

    0% { transform: rotate(0deg); }

    100% { transform: rotate(360deg); }

}



/* No Result Message */

.no-result {

    grid-column: 1 / -1; /* Full width message */

    text-align: center;

    padding: 50px;

    font-size: 18px;

    color: #888;

    background: #f9f9f9;

    border-radius: 10px;

}





/* Product Grid Structure */

#ajax-response-grid {

    display: grid !important;



    gap: 20px !important;

    width: 100%;

}



/* Template Card Fix */

#ajax-response-grid .elementor-template {

    width: 100% !important;

    margin: 0 !important;

}



/* Tablet & Mobile Grid */

@media (max-width: 1024px) {

 

}

@media (max-width: 768px) {

 
}











/* ==========================================

   PRODUCT GRID & EQUAL HEIGHT LOGIC

   (Shudhu eituku update koro ba replace koro)

   ========================================== */



#ajax-response-grid {

    display: grid !important;



    gap: 20px !important;

    align-items: stretch !important; /* Row-r shob card-ke niche porjonto tene soman korbe */

}



/* Protiti card wrapper-ke flex kora jate button niche thake */

#ajax-response-grid > div {

    display: flex !important;

    height: 100% !important;

}



#ajax-response-grid .elementor-template {

    width: 100% !important;

    display: flex !important;

    flex-direction: column !important;

    height: 100% !important;

    justify-content: flex-start !important;

}



/* Title Logic: 2-Line Limit & Dynamic Height */

#ajax-response-grid h1, #ajax-response-grid h2, #ajax-response-grid h3, 

#ajax-response-grid h4, #ajax-response-grid h5, #ajax-response-grid h6,

#ajax-response-grid [class*="title"] {

    /* 2 line-er beshi hole "..." dekhabe */

    display: -webkit-box !important;

    -webkit-line-clamp: 2 !important; 

    -webkit-box-orient: vertical !important;

    overflow: hidden !important;

    text-overflow: ellipsis !important;

    

    /* Height logic: Fixed jayga dore rakhbe jate card soman thake */

    height: auto !important;

    min-height: 2.8em !important; /* 2 line-er soman jayga reserve rakhbe */

    max-height: 2.8em !important; 

    

    line-height: 1.4 !important;

    margin-top: 10px !important;

    margin-bottom: 10px !important;

}



/* Price Section */

#ajax-response-grid .price, 

#ajax-response-grid .elementor-widget-heading:not([class*="title"]) {

    margin-bottom: 15px !important;

    display: block !important;

    position: relative !important;

}



/* Add to Cart Button-ke forced bhabe card-er ekdom niche push kora */

#ajax-response-grid .elementor-widget-button,

#ajax-response-grid .elementor-button-wrapper {

    margin-top: auto !important; 

    padding-top: 10px !important;

}



/* Responsive Fix */

@media (max-width: 1024px) {

    

}

@media (max-width: 768px) {

   

}

/* ==========================================
   DYNAMIC COLUMN & DEVICE-WISE GAP
   ========================================== */

/* ১. ডেস্কটপ গ্রিড (PC) */
#ajax-response-grid {
    display: grid !important;
    grid-template-columns: repeat(var(--col-pc, 4), 1fr) !important;
    gap: var(--gap-pc, 20px) !important; 
    align-items: stretch !important;
}

/* ২. ট্যাবলেট গ্রিড (১০২৪ পিক্সেলের নিচে) */
@media (max-width: 1024px) {
    #ajax-response-grid {
        grid-template-columns: repeat(var(--col-tab, 2), 1fr) !important;
        gap: var(--gap-tab, 15px) !important; 
    }
}

/* ৩. মোবাইল গ্রিড (৭৬৮ পিক্সেলের নিচে) */
@media (max-width: 768px) {
    #ajax-response-grid {
        grid-template-columns: repeat(var(--col-mob, 1), 1fr) !important;
        gap: var(--gap-mob: 10px) !important; 
    }
}



/* মোবাইল ও ট্যাবলেটে ক্যাটাগরি স্লাইডার */
@media (max-width: 1024px) {
    .ajax-cat-list {
        display: flex !important; /* লিস্টকে এক লাইনে করবে */
        overflow-x: auto !important; /* বামে-ডানে স্লাইড করার সুবিধা */
        white-space: nowrap !important; /* লাইন ভাঙবে না */
        gap: 10px !important;
        padding-bottom: 15px !important; /* স্ক্রলবারের জন্য জায়গা */
        -webkit-overflow-scrolling: touch; /* স্মুথ স্ক্রলিং */
        scrollbar-width: none; /* ফায়ারফক্স স্ক্রলবার হাইড */
    }

    .ajax-cat-list::-webkit-scrollbar {
        display: none; /* ক্রোম/সাফারি স্ক্রলবার হাইড */
    }

    .cat-item {
        flex: 0 0 auto !important; /* আইটেমগুলো সঙ্কুচিত হবে না */
        margin-bottom: 0 !important;
        padding: 8px 20px !important;
        font-size: 14px !important;
    }
}

