
    /* ----------------------------------------------------------- */
    /* 1. CRITICAL FIX: Hide Ghost Elements (Fixes Grid Alignment) */
    /* ----------------------------------------------------------- */
    ul.products::before,
    ul.products::after {
        content: none !important;
        display: none !important;
    }

    /* ----------------------------------------------------------- */
    /* 2. Main Layout & Sidebar */
    /* ----------------------------------------------------------- */
    .shop-layout {
        display: flex;
        flex-wrap: nowrap;
        align-items: flex-start; /* Required for sticky */
        gap: 40px;
        margin-top: 40px;
        max-width: 1300px;
        margin-left: auto;
        margin-right: auto;
        padding: 0 20px;
    }

    .shop-sidebar {
        width: 250px;
        flex-shrink: 0;
        border-right: 1px solid #eee;
        padding-right: 30px;
        
        /* Sticky Logic */
        position: -webkit-sticky;
        position: sticky;
        top: 20px;
        height: fit-content;
        max-height: 100vh;
        overflow-y: auto;
    }

    .shop-content {
        flex-grow: 1;
        width: calc(100% - 290px);
    }

    /* ----------------------------------------------------------- */
    /* 3. Product Grid */
    /* ----------------------------------------------------------- */
    ul.products {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 30px !important;
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    ul.products li.product {
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
        background: #fff;
        text-align: center;
        border: 1px solid #f0f0f0;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        transition: all 0.3s ease;
    }

    ul.products li.product:hover {
        box-shadow: 0 10px 30px rgba(0,0,0,0.08);
        transform: translateY(-5px);
    }

    ul.products li.product img {
        width: 100% !important;
        height: 250px !important;
        object-fit: contain !important;
        padding: 15px;
        box-sizing: border-box;
        display: block;
        margin: 0 auto;
    }

    .woocommerce-loop-product__title {
        font-size: 15px;
        font-weight: 600;
        padding: 0 10px;
        margin: 10px 0;
        color: #333;
        min-height: 40px;
    }

    .price {
        font-size: 15px;
        color: #000;
        font-weight: bold;
        display: block;
        margin-bottom: 15px;
    }

    /* ----------------------------------------------------------- */
    /* 4. Sorting Dropdown (Fixed Alignment) */
    /* ----------------------------------------------------------- */
    .custom-sorting-wrapper {
        margin-bottom: 20px;
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-end; /* Fixed: Uncommented to align right */
        width: 100%;
        clear: both;
    }
    
    .custom-sorting-wrapper form { margin: 0; }

    .custom-select-box {
        padding: 10px 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        background-color: #fff;
        cursor: pointer;
        font-size: 14px;
        min-width: 200px;
        outline: none;
    }

    /* ----------------------------------------------------------- */
    /* 5. Pagination */
    /* ----------------------------------------------------------- */
    .shop-pagination { margin: 60px 0; display: flex; justify-content: center; width: 100%; }
    
    .shop-pagination ul { 
        display: flex; 
        gap: 8px; 
        list-style: none; 
        padding: 0; 
        margin: 0; 
        align-items: center; 
        justify-content: center;
        flex-wrap: wrap; 
    }

    .shop-pagination a, .shop-pagination span.current {
        width: 40px; height: 40px;
        display: flex; justify-content: center; align-items: center;
        border: 1px solid #e1e1e1;
        text-decoration: none; color: #333; background: #fff;
    }
    .shop-pagination .current { background: #000; color: #fff; border-color: #000; font-weight: bold; }
    .shop-pagination a:hover { border-color: #000; color: #000; }
    .shop-pagination .dots { border: none; background: transparent; padding: 0 5px; color: #777; }

    /* ----------------------------------------------------------- */
    /* 6. Sidebar Widgets */
    /* ----------------------------------------------------------- */
    .widget { margin-bottom: 30px; }
    .widget-title { font-size:16px; font-weight:700; text-transform:uppercase; border-bottom:2px solid #000; padding-bottom:5px; display:inline-block; margin-bottom:15px; }
    .widget ul { list-style:none; padding:0; margin:0; }
    .widget ul li { margin-bottom:8px; }
    .widget ul li a { text-decoration:none; color:#555; display:flex; justify-content:space-between; }
    .widget ul li.active a { color:#000; font-weight:bold; }
    
    .sidebar-search { display:flex; gap:5px; }
    .sidebar-search input { width:100%; padding:8px; border:1px solid #ddd; }
    .sidebar-search button { background:#000; color:#fff; border:none; padding:0 15px; cursor:pointer; }
    .clear-filters-btn { display: inline-block; background: #d9534f; color: #fff; padding: 8px 15px; border-radius: 4px; text-decoration: none; font-size: 13px; margin-bottom: 20px; }

    /* ----------------------------------------------------------- */
    /* 7. Responsive (Mobile) */
    /* ----------------------------------------------------------- */
 
/* =========================================
   MOBILE CATEGORY PILLS (Stronger Selectors)
   ========================================= */

@media screen and (max-width: 991px) {

    /* 1. Reset Sidebar Layout */
    aside.shop-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        padding: 10px 15px !important;
        margin-bottom: 20px !important;
        border-bottom: 1px solid #eee;
        background: #fff;
        clear: both;
    }

    /* 2. Hide Widget Titles (Like "Categories") */
    aside.shop-sidebar .widget-title {
        display: none !important;
    }

    /* 3. Force Horizontal Scroll on the UL */
    aside.shop-sidebar .widget ul {
        display: flex !important;
        flex-direction: row !important; /* Force row direction */
        flex-wrap: nowrap !important;   /* Prevent stacking */
        overflow-x: auto !important;    /* Enable scroll */
        gap: 10px !important;
        padding: 5px 0 15px 0 !important;
        margin: 0 !important;
        list-style: none !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar on Firefox */
    }

    /* Hide Scrollbar on Chrome/Safari */
    aside.shop-sidebar .widget ul::-webkit-scrollbar {
        display: none;
    }

    /* 4. Reset List Items */
    aside.shop-sidebar .widget ul li {
        flex: 0 0 auto !important; /* Stop items from shrinking */
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important; /* Remove any default list borders */
    }

    /* 5. Style Links as Pill Buttons */
    aside.shop-sidebar .widget ul li a {
        display: block !important;
        padding: 10px 20px !important;
        background-color: #fff !important;
        border: 1px solid #333 !important; /* Dark border */
        border-radius: 50px !important;    /* Pill Shape */
        color: #333 !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        text-decoration: none !important;
        white-space: nowrap !important;    /* Keep text on one line */
        line-height: 1 !important;
        transition: all 0.2s ease;
    }

    /* 6. Active State (Black Background) */
    aside.shop-sidebar .widget ul li.active a,
    aside.shop-sidebar .widget ul li a:hover {
        background-color: #000 !important;
        color: #fff !important;
        border-color: #000 !important;
    }

    /* 7. Hide the Search Bar inside Sidebar (Optional - if you only want pills) */
    /* If you want to keep the search bar, remove the lines below */
    aside.shop-sidebar .sidebar-search {
        display: none !important;
    }
}
    
    @media(max-width: 768px) {
        /* Sorting Mobile */
       /* 1. Reset Sidebar Layout */
    aside.shop-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        padding: 10px 15px !important;
        margin-bottom: 20px !important;
        border-bottom: 1px solid #eee;
        background: #fff;
        clear: both;
    }

    /* 2. Hide Widget Titles (Like "Categories") */
    aside.shop-sidebar .widget-title {
        display: none !important;
    }

    /* 3. Force Horizontal Scroll on the UL */
    aside.shop-sidebar .widget ul {
        display: flex !important;
        flex-direction: row !important; /* Force row direction */
        flex-wrap: nowrap !important;   /* Prevent stacking */
        overflow-x: auto !important;    /* Enable scroll */
        gap: 10px !important;
        padding: 5px 0 15px 0 !important;
        margin: 0 !important;
        list-style: none !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar on Firefox */
    }

    /* Hide Scrollbar on Chrome/Safari */
    aside.shop-sidebar .widget ul::-webkit-scrollbar {
        display: none;
    }

    /* 4. Reset List Items */
    aside.shop-sidebar .widget ul li {
        flex: 0 0 auto !important; /* Stop items from shrinking */
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important; /* Remove any default list borders */
    }

    /* 5. Style Links as Pill Buttons */
    aside.shop-sidebar .widget ul li a {
        display: block !important;
        padding: 10px 20px !important;
        background-color: #fff !important;
        border: 1px solid #333 !important; /* Dark border */
        border-radius: 50px !important;    /* Pill Shape */
        color: #333 !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        text-decoration: none !important;
        white-space: nowrap !important;    /* Keep text on one line */
        line-height: 1 !important;
        transition: all 0.2s ease;
    }

    /* 6. Active State (Black Background) */
    aside.shop-sidebar .widget ul li.active a,
    aside.shop-sidebar .widget ul li a:hover {
        background-color: #000 !important;
        color: #fff !important;
        border-color: #000 !important;
    }

    /* 7. Hide the Search Bar inside Sidebar (Optional - if you only want pills) */
    /* If you want to keep the search bar, remove the lines below */
    aside.shop-sidebar .sidebar-search {
        display: none !important;
    }
    }
    @media(max-width: 480px) {
         /* 1. Reset Sidebar Layout */
    aside.shop-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        padding: 10px 15px !important;
        margin-bottom: 20px !important;
        border-bottom: 1px solid #eee;
        background: #fff;
        clear: both;
    }

    /* 2. Hide Widget Titles (Like "Categories") */
    aside.shop-sidebar .widget-title {
        display: none !important;
    }

    /* 3. Force Horizontal Scroll on the UL */
    aside.shop-sidebar .widget ul {
        display: flex !important;
        flex-direction: row !important; /* Force row direction */
        flex-wrap: nowrap !important;   /* Prevent stacking */
        overflow-x: auto !important;    /* Enable scroll */
        gap: 10px !important;
        padding: 5px 0 15px 0 !important;
        margin: 0 !important;
        list-style: none !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar on Firefox */
    }

    /* Hide Scrollbar on Chrome/Safari */
    aside.shop-sidebar .widget ul::-webkit-scrollbar {
        display: none;
    }

    /* 4. Reset List Items */
    aside.shop-sidebar .widget ul li {
        flex: 0 0 auto !important; /* Stop items from shrinking */
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important; /* Remove any default list borders */
    }

    /* 5. Style Links as Pill Buttons */
    aside.shop-sidebar .widget ul li a {
        display: block !important;
        padding: 10px 20px !important;
        background-color: #fff !important;
        border: 1px solid #333 !important; /* Dark border */
        border-radius: 50px !important;    /* Pill Shape */
        color: #333 !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        text-decoration: none !important;
        white-space: nowrap !important;    /* Keep text on one line */
        line-height: 1 !important;
        transition: all 0.2s ease;
    }

    /* 6. Active State (Black Background) */
    aside.shop-sidebar .widget ul li.active a,
    aside.shop-sidebar .widget ul li a:hover {
        background-color: #000 !important;
        color: #fff !important;
        border-color: #000 !important;
    }

    /* 7. Hide the Search Bar inside Sidebar (Optional - if you only want pills) */
    /* If you want to keep the search bar, remove the lines below */
    aside.shop-sidebar .sidebar-search {
        display: none !important;
    }
    }
    