/*
Theme Name: UFA Distro Child
Theme URI: http://khnsa.com
Template: ufa-distro
Author: Khnsa
Author URI: http://khnsa.co.uk
Description: Whole Sale Theme
Tags: custom-background,custom-logo,custom-menu,featured-images,threaded-comments,translation-ready
Version: 1.0.0.1702368064
Updated: 2023-12-12 08:01:04

*/

/* View Mode Switcher */
.view-mode-switcher {
    float: right;
    margin-bottom: 1em;
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.view-mode-icon {
    display: inline-block;
    padding: 5px 8px;
    text-decoration: none;
    color: #555;
    line-height: 1;
}
.view-mode-icon svg {
    vertical-align: middle;
}
.view-mode-icon.active,
.view-mode-icon:hover {
    background-color: #f0f0f0;
    color: #000;
}
.view-mode-icon.grid-view-icon {
    border-right: 1px solid #ddd;
}

/* Hide Grid/List based on wrapper class */
.view-as-list .ufa-main-newin-sale-cate {
    display: none;
}
.view-as-grid #product-list-view,
.view-as-grid .list-view-controls {
    display: none;
}

/* List View Table Styling */
#product-list-view {
    width: 100%;
    margin-bottom: 1.5em;
    border-collapse: collapse;
}
#product-list-view th,
#product-list-view td {
    border: 1px solid #eee;
    padding: 8px 12px;
    text-align: left;
    vertical-align: middle;
}
#product-list-view th {
    background-color: #f9f9f9;
    font-weight: bold;
}
#product-list-view .quantity {
    display: flex;
    align-items: center;
}
#product-list-view .quantity .qty {
    width: 70px;
    text-align: center;
    border: 1px solid #ddd;
    height: 30px;
}
#product-list-view .quantity .plus,
#product-list-view .quantity .minus {
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    background: #f9f9f9;
    cursor: pointer;
    text-decoration: none;
    color: #333;
}

/* List View Global Controls */
.list-view-controls {
    margin-bottom: 1.5em;
    display: flex;
    align-items: center;
    gap: 20px;
}
.global-quantity-label {
    font-weight: bold;
}

/* Loading state for buttons */
.button.loading {
    opacity: 0.7;
    cursor: wait;
}











/* --- 1. FIX SEARCH RESULTS GRID LAYOUT (5 COLUMNS) --- */

/* Reset the wrapper to allow full width */
.search .ufa-inner-newin-sale-cate {
    display: block !important;
    width: 100%;
}

/* Apply 5-column grid to the list */
.search .ufa-inner-newin-sale-cate ul.products {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important; /* Forces 5 columns */
    gap: 20px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none !important;
}

/* Force cards to fit the grid cells perfectly */
.search .ufa-inner-newin-sale-cate ul.products .ufa-custom-inner-brand-wrapper,
.search .ufa-inner-newin-sale-cate ul.products > * {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* --- 2. FIX VIEW SWITCHER ALIGNMENT (FAR RIGHT) --- */

/* Force the switcher container to the far right */
.view-mode-switcher {
    float: right !important;
    margin-left: auto !important; /* Pushes to right in flex containers */
    display: flex; /* Ensure it behaves as a flex box */
}

/* Keep the result count (e.g., "Showing all 2 results") on the left */
.woocommerce-result-count {
    float: left !important;
    margin-right: auto !important;
}

/* Clear floats to prevent layout collapse */
.woocommerce-before-shop-loop::after,
.ufa-custom-main-body::after {
    content: "";
    display: table;
    clear: both;
}

/* --- 3. RESPONSIVE LAYOUTS --- */

/* Laptop/Tablet Landscape (4 columns) */
@media (max-width: 1200px) {
    .search .ufa-inner-newin-sale-cate ul.products {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Tablet Portrait (3 columns) */
@media (max-width: 991px) {
    .search .ufa-inner-newin-sale-cate ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Mobile (2 columns) */
@media (max-width: 767px) {
    .search .ufa-inner-newin-sale-cate ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}