/**
 * 1. SIDEBAR FILTER STYLING
 */
.ifs-filter-card {
    border: 1px solid #e0e0e0;
    padding: 20px;
    background: #fff;
    margin-bottom: 20px;
}

/* Header/Toggle area */
.ifs-toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 20px; /* Adjusted to look more like the 2nd screenshot */
    font-weight: 700;
    color: #333;
    padding-bottom: 10px;
    margin: 0;
}

.ifs-arrow {
    transition: transform 0.3s ease;
    display: inline-block;
    font-size: 12px;
}



.ippf-search-icon {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #333;
    display: flex !important;
    align-items: center;
    pointer-events: none;
    z-index: 2;
}

/* FORCE collapse hidden items - this removes the "odd space" */
.ifs-category-list li.ifs-hidden {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    opacity: 0 !important;
    border: none !important;
}

/* Ensure the list container itself doesn't add strange padding when items hide */
.ifs-category-list {
    display: flex !important;
    flex-direction: column !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 10px 0 0 0 !important;
}

/* Ensure visible items have consistent spacing */
.ifs-category-list li:not(.ifs-hidden) {
    display: block !important;
    margin-bottom: 8px !important;
}

.ifs-category-list li {
    list-style: none !important;
    list-style-type: none !important;
    margin-bottom: 10px !important;
    padding: 0 !important;
    display: block !important;
}

.ifs-category-list li::before {
    content: none !important;
    display: none !important;
}

/* Checkbox alignment */
.ifs-checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    gap: 10px;
    color: #444;
}

.ifs-cat-check {
    margin: 0 !important;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/**
 * 2. RIGHT SIDE GRID STYLING (3 COLUMNS)
 */
/* 1. Ensure the grid row allows for equal height items */
.ifs-category-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 25px;
    width: 100%;
    align-items: stretch; /* Forces children to stretch to full height */
}

/* 2. Make the card a flex container */
.ifs-cat-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex !important;
    flex-direction: column !important; /* Stack thumbnail and info vertically */
    height: 100%; /* Occupy full available height from grid */
    overflow: hidden;
}

.ifs-cat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.ifs-cat-card a {
    display: block;
}

/* Ensure images don't break the layout */
.ifs-cat-thumbnail {
    flex-shrink: 0; /* Prevents the image area from squishing */
    background-color: #f4f7f6;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ifs-cat-thumbnail img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}
/* 3. The Info section needs to grow to fill the space */
.ifs-cat-info {
    padding: 20px;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1; /* This pushes the content to fill the card */
    text-align: left;
}

.ifs-cat-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #000 !important;
    margin: 0 0 10px 0 !important;
}
/* 4. The Description grows to push the link down */
.ifs-cat-desc {
    font-size: 14px;
    color: #777;
    line-height: 1.5;
    margin-bottom: 20px !important;
    flex-grow: 1; /* This is the secret: it eats up all empty space */
}
/* 5. The Link will now always sit at the very bottom */
.ifs-view-products {
    margin-top: auto; /* Final insurance to keep it at the bottom */
    color: #003366;
    font-weight: 700;
    text-decoration: none;
    font-size: 15px;
    display: inline-block;
}
.ifs-view-products:hover {
    text-decoration: underline;
}
/**
 * 3. HELP BOX & BUTTONS
 */
.ifs-help-box {
    background-color: #002b5c; /* Dark Industrial Blue */
    padding: 30px 25px;
    border-radius: 4px;
    text-align: center;
    margin-top: 20px;
    color: #ffffff;
}

.ifs-help-box h3 {
    color: #ffffff !important;
    font-size: 24px;
    font-weight: 500;
    margin: 0 0 15px 0;
    line-height: 1.2;
    text-align: left;
}

.ifs-help-box p {
    color: #ffffff;
    font-size: 16px;
    line-height: 1.4;
    margin: 0 0 25px 0;
    font-weight: 400;
    text-align: left;    
}

.ifs-phone-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1eb1a1; /* Teal Button Color */
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 14px 20px;
    border-radius: 30px; /* Fully Rounded */
    font-weight: 500;
    font-size: 18px;
    transition: background 0.3s ease;
}

.ifs-phone-btn:hover {
    background-color: #169689;
}

.ifs-phone-btn svg {
    flex-shrink: 0;
}
/* This class MUST be at the bottom to override everything else */
/* If the console says items are hidden but they still show, 
   this rule is either missing or being blocked by your theme */
/* 1. Force the hidden items to take up ZERO height and space */
.ifs-hidden {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
}
/* Ensure the list container allows scrolling but hides hidden items */
/* 2. Clean up the list items spacing */
.ifs-category-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 10px 0 0 0 !important; /* Space only at the top of the list */
    max-height: 250px;
    overflow-y: auto;
}
.ifs-category-list li {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 8px 0 !important; /* Controlled gap between items */
    display: block !important;
}

/* 3. Ensure the label inside doesn't add extra height */
.ifs-checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
    padding: 2px 0;
}

/* Styling for sub-categories in the grid */
.ifs-cat-card.ifs-is-sub {
    border-left: 4px solid #1eb1a1; /* Add a teal accent to sub-items */
    background: #fdfdfd;
}

.ifs-cat-card.ifs-is-sub .ifs-cat-title {
    font-size: 16px !important; /* Slightly smaller title for nested items */
}
/**
 * 4. RESPONSIVE
 */
@media (max-width: 991px) {
    .ifs-category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .ifs-phone-btn{
        font-size: 13px; 
    }
    .ifs-filter-card{
        padding: 15px;
    }
    .ifs-help-box{
        padding: 20px 20px;       
    }    
}
@media (max-width: 600px) {
    .ifs-category-grid {
        grid-template-columns: 1fr !important;
    }

}