.products_category_nav {
    width: 100%;
    background: #fff;
    padding: 20px 0 0; /* Only top padding */
    margin-bottom: 0;
    position: relative;
}

.products_cat_header {
    margin-bottom: 15px;
    border-bottom: 1px solid #f9f9f9;
}

.products_cat_header h3 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.8;
}

/* ROBUST STICKY BAR LOGIC */
.products_cat_container {
    width: 100%;
    background: #ffffff;
    position: fixed; 
    top: 60px; /* Tucking it completely behind the header */
    left: 0;
    z-index: 990; /* 990 is behind the header (1000) and way behind cart sidebars */
    padding: 10px 0 8px 0;
    transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none !important;
    outline: none !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.04);
}

/* Force Unified Look: Kill all separators */
body.products-page #site-header,
body.products-page #global-header,
body.products-page .top_header,
body.products-page .header-wrapper {
    box-shadow: none !important;
    border-bottom: none !important;
    border: none !important;
    background: #ffffff !important;
}

/* Adjust top when header is hidden */
body.header-hidden-state .products_cat_container {
    top: 0 !important;
}

/* Spacer logic: prevents products jumping because bar is now fixed */
.category_spacer {
    height: 30px; /* Force an overlap to completely kill the gap */
    width: 100%;
    display: block;
}

/* Adjust top when header is hidden */
body.header-hidden-state .products_cat_container {
    top: 0 !important;
}

.products_cat_grid {
    display: flex;
    gap: 10px;
    padding: 5px 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.products_cat_grid::-webkit-scrollbar {
    display: none;
}

.products_cat_btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid #EAEAEA;
    border-radius: 50px;
    background: #FFFFFF;
    color: #444;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.products_cat_btn:hover {
    border-color: #333;
    background: #f9f9f9;
}

.products_cat_btn.active {
    background: #2C2C2C !important;
    color: #FFFFFF !important;
    border-color: #2C2C2C !important;
}

.products_cat_btn.back_btn {
    background: #2C2C2C !important;
    color: #FFFFFF !important;
    border-color: #2C2C2C !important;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .products_cat_container {
        top: 60px; /* Tuck behind mobile header */
        padding: 5px 0;
    }
    
    .products_cat_btn {
        padding: 7px 16px;
        font-size: 12px;
    }
}

/* Desktop Visibility */
@media (min-width: 769px) {
    /* Hide the horizontal sticky bar completely on desktop (Sidebar applies instead) */
    .products_cat_container,
    .category_spacer,
    .products_category_nav {
        display: none !important;
    }
}

/* Ensure Cart is always on top (over everything) */
.cart, .favorites, .sidebar_overlay {
    z-index: 999999 !important;
}