/* ===================================
   TROPHYCENTRAL FILTER WIZARD - 2025 ALIGNMENT FIX
   Aligns product grid with blue navigation bar
   =================================== */

/* -----------------------------------
   CRITICAL: Main Content Container Alignment
   Everything must align with the blue nav bar
----------------------------------- */

/* The blue nav bar container - this sets our alignment reference */
/* Assuming it has a max-width, we need to match it */
.ysw-paging-table {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px; /* Match any padding the nav bar has */
    box-sizing: border-box;
    overflow: visible; /* Changed from hidden */
}

/* -----------------------------------
   TWO-COLUMN LAYOUT: Filters + Products
----------------------------------- */

/* Left sidebar - Filters */
#ysw-paging-filters {
    float: left;
    width: 275px;
    margin-right: 20px;
    background-color: #f8f8f8;
    padding: 12px;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Right content area - Products + Pagination */
#ysw-paging {
    float: left;
    width: calc(100% - 295px); /* 275px filters + 20px margin */
    box-sizing: border-box;
}

/* -----------------------------------
   PAGE CONTROLS (Sort, Items Per Page, View All)
   Must align within the product grid area
----------------------------------- */

.ysw-page-ctrl {
    width: 100%;
    margin-bottom: 15px;
    overflow: hidden;
    box-sizing: border-box;
}

.ysw-paging-sort {
    float: left;
    width: auto;
    max-width: 60%;
}

/* The "View all" button and pagination numbers - RIGHT ALIGNED */
.ysw-pager-num-group {
    float: right;
    text-align: right;
    padding-right: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
    width: auto !important;
    max-width: none !important;
}

.ysw-pager-view-all {
    display: inline-block;
    margin-right: 15px;
    vertical-align: middle;
}

.ysw-pager-view-all a {
    color: #2c5282;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: 0.15s ease;
    display: inline-block;
}

.ysw-pager-view-all a:hover {
    background: #e8f2ff;
}

.ysw-pager-num {
    display: inline-block;
    vertical-align: middle;
}

.ysw-pager-num a {
    color: #2c5282;
    text-decoration: none;
    padding: 4px 8px;
    margin: 0 2px;
    border-radius: 4px;
    transition: 0.15s ease;
}

.ysw-pager-num a:hover {
    background: #e8f2ff;
}

.ysw-pager-num a.ysw-curr-page {
    background: #2c5282;
    color: #fff;
}

.ysw-next, .ysw-last {
    color: #2c5282;
    text-decoration: none;
    padding: 4px 8px;
    margin-left: 5px;
}

/* -----------------------------------
   FIX THE COMPARE BUTTON WIDTH ISSUE
----------------------------------- */
.add-cmpr-prdt {
    width: auto !important;
    max-width: 100% !important;
    float: left !important;
    margin-left: 20px !important;
}

/* -----------------------------------
   PRODUCT GRID TABLE
----------------------------------- */

#ysw-paging table.ysw-item-block {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    table-layout: auto !important;
    box-sizing: border-box !important;
}

/* CRITICAL: Completely disable colgroup */
#ysw-paging table.ysw-item-block colgroup {
    display: none !important;
}

/* Override colgroup forcing specific widths */
#ysw-paging table.ysw-item-block colgroup,
#ysw-paging table.ysw-item-block colgroup col {
    width: auto !important;
}

/* NUCLEAR OPTION: Override colgroup inline styles */
#ysw-paging table.ysw-item-block colgroup col[style] {
    width: auto !important;
}

/* CRITICAL FIX: Hide the 8th column (trailing spacer) */
#ysw-paging table.ysw-item-block tr > td:nth-child(8) {
    display: none !important;
}

/* Product columns (4 columns at 24% each = 96%) */
#ysw-paging table.ysw-item-block td.img.item,
#ysw-paging table.ysw-item-block td.name.item {
    width: 24% !important;
    min-width: 24% !important;
    max-width: 24% !important;
    box-sizing: border-box !important;
    padding: 8px !important;
    vertical-align: top;
}

/* MOST AGGRESSIVE: Force ALL td.item elements to 24% regardless of anything */
#ysw-paging table.ysw-item-block td.item {
    width: 24% !important;
    min-width: 24% !important;
    max-width: 24% !important;
}

/* ULTRA AGGRESSIVE: Override ANY td.item with inline width style */
#ysw-paging table.ysw-item-block td.item[style*="width"] {
    width: 24% !important;
    min-width: 24% !important;
    max-width: 24% !important;
}

/* CRITICAL: Force column widths to persist after pagination/AJAX updates */
/* Nuclear option: Override ANY inline width on product columns */
#ysw-paging table.ysw-item-block td.img.item[style],
#ysw-paging table.ysw-item-block td.name.item[style],
#ysw-paging table.ysw-item-block td[width="226px"],
#ysw-paging table.ysw-item-block td.item[width] {
    width: 24% !important;
    min-width: 24% !important;
    max-width: 24% !important;
}

/* Nuclear option: Override ANY inline width on spacer columns */
#ysw-paging table.ysw-item-block td:not(.item)[style],
#ysw-paging table.ysw-item-block td[width="12"],
#ysw-paging table.ysw-item-block td:not(.item)[width] {
    width: 1.33% !important;
    min-width: 1.33% !important;
    max-width: 1.33% !important;
}

/* Spacer columns between products (3 visible spacers at ~1.33% each = 4%) */
#ysw-paging table.ysw-item-block td:not(.item) {
    width: 1.33% !important;
    max-width: 1.33% !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Force spacer divs to respect parent width */
#ysw-paging table.ysw-item-block td div[style*="width:5px"],
#ysw-paging table.ysw-item-block td div[style*="width:12px"] {
    width: 100% !important;
    max-width: 100% !important;
}

/* -----------------------------------
   FILTER SIDEBAR STYLING
----------------------------------- */

#ysw-paging-filters .title {
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c5282;
}

#ysw-paging-filters strong {
    display: block;
    font-size: 15px;
    margin: 15px 0 5px 0;
    color: #2c5282;
}

#ysw-paging-filters ul {
    padding: 0;
    margin: 0 0 10px 0;
    list-style: none;
}

#ysw-paging-filters li {
    padding: 6px 4px;
    font-size: 14px;
}

#ysw-paging-filters a {
    color: #2c5282;
    text-decoration: none;
    transition: 0.15s;
}

#ysw-paging-filters a:hover {
    color: #1a365d;
}

/* Pseudo-checkbox styling */
.ysw-pseudo-check {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #cbd5e0;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
    background: #fff;
    position: relative;
}

/* Active filter indicator - BLACK checkbox with white checkmark */
.ysw-pseudo-check.active-filter {
    background: #000;
    border-color: #000;
}

.ysw-pseudo-check.active-filter::after {
    content: "✓";
    color: #fff;
    position: absolute;
    left: 2px;
    top: -2px;
    font-size: 14px;
}

#ysw-paging-filters li.checked .ysw-pseudo-check {
    background: #2c5282;
    border-color: #2c5282;
    position: relative;
}

#ysw-paging-filters li.checked .ysw-pseudo-check::after {
    content: "✓";
    color: #fff;
    position: absolute;
    left: 2px;
    top: -2px;
    font-size: 14px;
}

/* Price filter - style the price display (not the slider bar) */
#ysw-paging-filters input[type="text"][style*="color: #f6931f"],
#ysw-paging-filters ul li input[type="text"] {
    background-color: #f8f8f8 !important;
    padding: 6px 10px !important;
    border-radius: 4px !important;
    position: relative !important;
    top: -5px !important;
    left: 40px !important;
    margin: 0 !important;
    font-size: 14.5px !important;
    max-width: calc(100% - 50px) !important;
    width: auto !important;
    box-sizing: border-box !important;
    color: #4a5568 !important;
    font-weight: bold !important;
}

/* -----------------------------------
   PRODUCT STYLING
----------------------------------- */

.imgWrap {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
    display: block;
}

.imgWrap a {
    display: block;
    text-align: center;
}

.imgWrap img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    margin: 0 auto;
}

.name.item a {
    color: #2c5282;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.name.item a:hover {
    color: #1a365d;
    text-decoration: underline;
}

.price {
    margin: 8px 0;
    font-size: 14px;
    color: #000000;
    font-weight: normal;
}

.slash-price {
    text-decoration: line-through;
    color: #718096;
    margin-right: 5px;
    font-weight: normal;
}

.desc {
    font-size: 13px;
    color: #4a5568;
    margin: 5px 0;
}

.prItemRatingCat {
    font-size: 12px;
    color: #718096;
    margin: 5px 0;
}

/* -----------------------------------
   UTILITY CLASSES
----------------------------------- */

.clear {
    clear: both;
}

.showMore {
    color: #2c5282;
    font-weight: bold;
}

.showMore:hover {
    text-decoration: underline;
}

.yswFWCount {
    color: #718096;
    font-size: 13px;
}

/* -----------------------------------
   RESPONSIVE BREAKPOINTS
----------------------------------- */

@media (max-width: 1024px) {
    /* 3 columns on tablets */
    #ysw-paging table.ysw-item-block td.img.item,
    #ysw-paging table.ysw-item-block td.name.item {
        width: 32% !important;
    }
    
    #ysw-paging table.ysw-item-block td:not(.item) {
        width: 2% !important;
    }
}

@media (max-width: 768px) {
    /* Stack filters on top */
    .ysw-paging-table {
        padding: 0 15px;
    }
    
    #ysw-paging-filters {
        float: none;
        width: 100%;
        margin: 0 0 20px 0;
    }
    
    #ysw-paging {
        float: none;
        width: 100% !important;
    }
    
    .ysw-paging-sort {
        float: none;
        max-width: 100%;
        margin-bottom: 10px;
    }
    
    .ysw-pager-num-group {
        float: none;
        text-align: left;
    }
    
    /* 2 columns on mobile */
    #ysw-paging table.ysw-item-block td.img.item,
    #ysw-paging table.ysw-item-block td.name.item {
        width: 48% !important;
    }
    
    #ysw-paging table.ysw-item-block td:not(.item) {
        width: 4% !important;
    }
}

@media (max-width: 480px) {
    /* Single column on very small screens */
    #ysw-paging table.ysw-item-block td.img.item,
    #ysw-paging table.ysw-item-block td.name.item {
        display: block;
        width: 100% !important;
    }
    
    #ysw-paging table.ysw-item-block td:not(.item) {
        display: none;
    }
}
