/* --- Global Color Variables --- */
:root {
    --ippf-teal: #26a69a;
    --ippf-teal-dark: #1f8a7f;
    --ippf-navy: #002c59;
    --ippf-grey-bg: #f7f8f9;
}

/* --- Improved Search Bar Focus --- */
.ippf-search-wrapper input:focus {
    border-color: var(--ippf-teal);
    box-shadow: 0 0 0 3px rgba(38, 166, 154, 0.15);
    outline: none;
}

/* --- Wishlist Micro-Interaction --- */
.ippf-wishlist-btn {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ippf-wishlist-btn:hover {
    background: var(--ippf-teal);
    color: white;
    transform: scale(1.15);
}

/* --- Button Hover States --- */
/* Teal "More Info" Button */
.ippf-btn-info {
    background-color: #16a099 !important; /* Exact Teal from Figma */
}

.ippf-btn-info:hover {
    background-color: #12837d !important;
    transform: translateY(-2px);
}
/* Navy "Add to Cart" Button */
.ippf-btn-cart {
    background-color: #002c59 !important; /* Exact Navy from Figma */
}

.ippf-btn-cart:hover {
    background-color: #001a35 !important;
    transform: translateY(-2px);
}
/* SVG Icon Scaling & Alignment */
.ippf-card-footer i {
    display: flex;
    align-items: center;
}

.ippf-card-footer svg {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
}

/* Handle Single Button (When price is empty) */
.ippf-card-footer.single-btn .ippf-btn-info {
    max-width: 100%;
}
/* --- Shimmer Animation --- */
@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.ippf-loading .ippf-product-card {
    pointer-events: none;
}

/* Apply shimmer to the card parts while loading */
.ippf-loading .ippf-product-image,
.ippf-loading .ippf-product-title,
.ippf-loading .ippf-price,
.ippf-loading .ippf-btn-info,
.ippf-loading .ippf-btn-cart {
    color: transparent !important;
    background: #f6f7f8;
    background: linear-gradient(to right, #eeeeee 8%, #dddddd 18%, #eeeeee 33%);
    background-size: 800px 104px;
    animation: shimmer 1.5s linear infinite forwards;
    border-color: transparent !important;
    border-radius: 4px;
}

.ippf-loading .ippf-product-image img {
    opacity: 0;
}
/* Layout Wrapper */
.ippf-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    font-family: 'Inter', sans-serif;
}

/* This is the main container holding both Sidebar and Results */
.ippf-layout {
    display: flex;
    flex-wrap: nowrap; /* Prevents wrapping to the next line */
    gap: 30px;         /* Space between sidebar and products */
    align-items: flex-start;
    width: 100%;
}

/* Sidebar takes roughly 30% or a fixed width */
.ippf-sidebar {
    width: 25%;      /* Professional fixed width */
    flex-shrink: 0;    /* Prevents sidebar from getting squashed */
    background: #fff;
    padding: 15px;
    border: 1px solid #E6E7E8;
    border-radius: 6px;
}
/* Product results area takes up the remaining 70% */
.ippf-results {
    flex-grow: 1;      /* Takes up all available remaining space */
    width: 0;          /* Technical fix to ensure flexbox calculates correctly */
}

/* Ensure the grid inside the results stays in 3 columns */
.ippf-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.ippf-filter-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

.ippf-search-box input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    margin-bottom: 15px;
}

.ippf-filter-scroll {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ippf-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
}

/* Product Grid Area */
.ippf-content {
    flex-grow: 1;
}

.ippf-top-bar {
    display: flex;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    font-size: 14px;
}

.ippf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Columns like screenshot */
    gap: 20px;
}

/* Product Card Styling */
/* Card Container */
.ippf-product-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 0px 0px 20px;
    overflow: hidden;
    text-align: left;
}

.ippf-product-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
}

.ippf-product-card h4 {
    font-size: 16px;
    margin: 15px 0;
    overflow: hidden;
    color: #000000;
    font-weight: 600;
}

.ippf-product-card .price {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    display: block;
    margin-bottom: 15px;
}

/* Button Styling from Screenshot */
.ippf-product-card .button {
    background: #26a69a;
    color: white;
    padding: 10px;
    text-align: center;
    display: block;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
}
.ippf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.ippf-sort-wrapper select {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
}

/* Card Header Container */
.ippf-card-header {
    position: relative;
    background: #f9f9f9; /* Match your light grey card background */
    padding: 20px;
    border-radius: 8px 8px 0 0;
}

/* Wishlist Button - Figma Match */
button.ippf-wishlist-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    background: #ffffff !important;
    border: none !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    z-index: 10;
    padding: 0 !important;
    /* Subtle shadow like the Figma design */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
button.ippf-wishlist-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}
/* Ensure the SVG stays centered and is sized correctly */
button.ippf-wishlist-btn svg {
    width: 18px;
    height: auto;
    display: block;
}
button.ippf-wishlist-btn svg path {
    stroke: #000000; /* Black outline like your 3rd screenshot */
    transition: fill 0.2s ease;
}

/* Optional: Red fill when active/clicked */
button.ippf-wishlist-btn.active svg path {
    fill: #e53935;
    stroke: #e53935;
}
/* Container for the image - ensures even height across all cards */
.ippf-product-image {
    background: #f7f8f9; /* Matches your design's light grey background */
    height: 220px;       /* Set a fixed height that fits your design */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}
/* The actual image styling */
.ippf-product-image img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: auto;
    /* This is the magic property: it scales the image to fit 
       without stretching or cropping */
    object-fit: contain; 
    transition: transform 0.3s ease;
}
/* Optional: slight zoom effect on hover for a pro feel */
.ippf-product-card:hover .ippf-product-image img {
    transform: scale(1.05);
}
/* Content Area */
.ippf-card-body {
    padding: 20px 20px 0px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0px;
}

.ippf-product-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.ippf-meta-row{
    gap: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;    
}
.ippf-stock-code {
    font-size: 14px;
    color: #6E727B;
    /*margin-top: 15px;*/
}

.ippf-price, .ippf-price-poa {
    font-size: 20px;
    font-weight: 700;
    color: #000000;
}

.ippf-lead-time {
    font-size: 13px;
    color: #002c59;
    text-decoration: underline !important;
    font-weight: 600;
}

.ippf-stock-status {
    font-size: 14px;
    font-weight: 400;
    margin-top: 5px;    
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}
.ippf-stock-status .stock-icon {
    width: 21px;
    object-fit: contain;
}
/* Green for available */
.ippf-stock-status.instock {
    color: #2e7d32;
}

/* Red for out of stock */
.ippf-stock-status.outofstock {
    color: #d32f2f;
}

/* Orange/Blue for backorder */
.ippf-stock-status.backorder {
    color: #ed6c02;
}

.check-icon {
    font-size: 14px;
}
/* Card Footer Layout */
.ippf-card-footer {
    display: flex;
    gap: 10px;
    padding: 15px 15px;
    background: #fff;
    border-radius: 0 0 8px 8px;
}

.ippf-card-footer.double-btn {
    grid-template-columns: 1fr 1fr;
}

.ippf-btn-info {
    background: #1cb0a4; /* Teal color */
    color: #fff !important;
    text-decoration: none;
    padding: 12px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ippf-btn-cart {
    background: #002c59; /* Navy blue color */
    color: #fff !important;
    text-decoration: none;
    padding: 12px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
/* Base Pill Button Styles */
.ippf-btn-info, .ippf-btn-cart {
    flex: 1;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 15px !important;
    border-radius: 50px !important; /* Perfect Pill Shape */
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    border: none !important;
    color: #ffffff !important;
}
.ippf-btn-info i, .ippf-btn-cart i {
    font-style: normal;
    font-size: 16px;
}


/* Sidebar Filter Group Container */
.ippf-filter-group {
    background: #fff;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 4px;
}

.ippf-filter-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

/* --- NEW: Search Box Styling --- */
.ippf-search-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.ippf-search-wrapper input {
    width: 100%;
    padding: 10px 10px 10px 35px; /* Extra padding for icon */
    border: 1px solid #E6E7E8 !important;
    border-radius: 6px !important;
    font-size: 14px;
}

.ippf-search-wrapper input:focus {
    border-color: #26a69a; /* Teal focus color */
    outline: none;
}


/* --- NEW: Scrollable Category List Styling --- */
.ippf-scrollable-content {
    max-height: 300px; /* Adjust based on your design preference */
    overflow-y: auto;
    padding-right: 10px;
    margin-top: 10px;
}
/* Styling the scrollbar (WebKit browsers like Chrome/Safari) */
/* Custom Scrollbar for a modern look */
.ippf-scrollable-content::-webkit-scrollbar {
    width: 5px;
}
.ippf-scrollable-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ippf-scrollable-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.ippf-scrollable-content::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Checkbox Labels styling */
.ippf-checkbox-label {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f9f9f9;
    gap: 10px;
}
.ippf-checkbox-label:last-child {
    border-bottom: none;
}

/* Header & Toggle Arrow */
.ippf-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.ippf-filter-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.ippf-toggle-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}
.ippf-filter-content {
    padding-top: 5px; /* Adds consistent spacing where search used to be */
}

.ippf-filter-box {
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 15px;
    padding-bottom: 10px;
}
.ippf-filter-box.collapsed .ippf-toggle-arrow {
    transform: rotate(180deg);
}

/* Minimalist Search Bar */

.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;
}

/* Custom Scrollbar Styling */
.ippf-scrollable-content {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 8px;
}

.ippf-scrollable-content::-webkit-scrollbar {
    width: 6px;
}

.ippf-scrollable-content::-webkit-scrollbar-track {
    background: transparent;
}

.ippf-scrollable-content::-webkit-scrollbar-thumb {
    background: #999; /* Grey thumb like 2nd image */
    border-radius: 10px;
}

/* Search Box - Absolute fix for icon floating */
.ifs-search-box {
    position: relative !important;
    margin: 15px 0;
    display: block !important;
}

.ifs-search-box input {
    width: 100% !important;
    padding: 10px 40px 10px 12px !important; /* Space for icon */
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    font-size: 14px;
    box-sizing: border-box !important;
    background: #fff;
    text-overflow: ellipsis;    
}

.ifs-search-box input:focus {
    border-color: #003366 !important;
    outline: none;
}

.ifs-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;
}
.ippf-count-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ippf-reset-btn {
    background: none;
    border: 1px solid var(--ippf-teal);
    color: var(--ippf-teal);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ippf-reset-btn:hover {
    background: var(--ippf-teal);
    color: #fff;
}
/* Sidebar Reset Container */
.ippf-sidebar-footer {
    margin-top: 15px;
    border-top: 1px solid #eeeeee;
}

/* Reset Pill Button */
#ippf-reset-filters {
    background-color: #002c59; /* Navy Blue matching card buttons */
    color: #ffffff;
    border: none;
    width: 100%;
    padding: 12px 20px;
    border-radius: 50px; /* Force pill shape */
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: block;
}

#ippf-reset-filters:hover {
    background-color: #001a35; /* Slightly darker navy */
    transform: translateY(-1px);
}

#ippf-reset-filters:active {
    transform: translateY(0);
}


.ippf-pagination-wrapper {
    margin-top: 40px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.ippf-pagination-wrapper .page-numbers {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #002c59;
    text-decoration: none;
    transition: all 0.2s;
}

.ippf-pagination-wrapper .page-numbers.current {
    background: #26a69a; /* Teal */
    color: #fff;
    border-color: #26a69a;
}

.ippf-pagination-wrapper .page-numbers:hover:not(.current) {
    background: #f0f0f0;
}
/* 1. Remove the !important from display here */
#ippf-load-more {
    display: none; 
}

/* 2. Your high-specificity block remains almost the same */
div.ippf-wrapper button#ippf-load-more.ippf-action-pill,
div.ippf-wrapper button#ippf-reset-filters.ippf-reset-pill {
    background-color: #002c59 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 14px 40px !important;
    border-radius: 50px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    cursor: pointer !important;
    /* Remove !important from display: inline-block */
    display: inline-block; 
    min-width: 180px !important;
    text-align: center !important;
    box-shadow: none !important;
    line-height: 1 !important;
    height: auto !important;
    transition: background-color 0.3s ease !important;
}

/* Specific fix for Sidebar Reset width */
.ippf-sidebar-footer button#ippf-reset-filters.ippf-reset-pill {
    width: 100% !important;
    display: block !important; /* Reset button should always be visible in its container */
}
/* Specific fix for Sidebar Reset width */
.ippf-sidebar-footer button#ippf-reset-filters.ippf-reset-pill {
    width: 100% !important;
}

/* Fix for Load More wrapper spacing */
.ippf-load-more-wrapper {
    text-align: center;
    padding: 40px 0;
    margin-top: 20px;
    clear: both;
}
/* Tablet Responsive Adjustments (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    
    /* 1. Grid Adjustment */
    .ippf-product-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* 2 columns is safer on tablets with sidebars */
        gap: 15px !important;
    }

    /* 2. Image Height Scaling */
    .ippf-card-header {
        height: 220px !important;
        padding: 0px !important;
    }

    .ippf-product-image img {
        max-height: 140px !important;
    }

    /* 3. Typography scaling */
    .ippf-product-title {
        font-size: 15px !important;
        height: 2em !important; /* Limit to 3 lines to keep grid aligned */
        line-height: 1.2 !important;
    }

    .ippf-price, .ippf-price span {
        font-size: 18px !important;
    }

    /* 4. Button sizing */
    .ippf-card-footer {
        padding: 12px !important;
        gap: 8px !important;
    }

    .ippf-btn-info, .ippf-btn-cart {
        padding: 10px 5px !important;
        font-size: 12px !important;
        min-width: auto !important; /* Remove the 180px desktop constraint */
    }

    .ippf-btn-info svg, .ippf-btn-cart svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* 5. Wishlist Button scaling */
    button.ippf-wishlist-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }
}
/* Mobile Responsive Adjustments */
@media (max-width: 767px) {
    /* Force 2-column grid for products */
    .ippf-product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* 2. Adjust Card Image Height */
    .ippf-card-header {
        padding: 10px !important;
        height: 160px !important; /* Fixed height for consistency */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ippf-product-image img {
        max-height: 200px !important;
        width: auto !important;
        object-fit: contain;
    }

/* Ensure titles don't push buttons out of alignment */
    .ippf-product-title {
        font-size: 13px !important;
        height: 2em !important; 
        margin-bottom: 5px !important;
    }

/* Scale down the stock and code text */
    .ippf-stock-code, .ippf-stock-status {
        font-size: 10px !important;
    }

    .ippf-price {
        font-size: 18px !important;
        margin: 5px 0 !important;
    }

/* Force Buttons to stay side-by-side */
    .ippf-card-footer {
        flex-direction: row !important; /* This keeps them on one line */
        flex-wrap: nowrap !important;
        gap: 5px !important;
        padding: 10px 15px !important;
    }

/* Scale buttons to fit the narrow mobile card */
    .ippf-btn-info, .ippf-btn-cart {
        padding: 8px 4px !important; /* Reduced padding */
        font-size: 11px !important;   /* Smaller font to prevent wrapping */
        letter-spacing: -0.2px;       /* Tighter text */
        height: 38px !important;      /* Consistent height */
    }
/* Adjust Icon Size for mobile buttons */
    .ippf-btn-info svg, .ippf-btn-cart svg {
        width: 14px !important;
        height: 14px !important;
    }
    .ippf-btn-info i, .ippf-btn-cart i {
        transform: scale(0.8); /* Shrink icons slightly */
    }

    /* 5. Wishlist Button Scale */
    button.ippf-wishlist-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        top: 8px !important;
        right: 8px !important;
    }
}

/* Extra Small Phones (Very narrow) */
@media (max-width: 480px) {
    .ippf-product-grid {
        grid-template-columns: 1fr !important; /* Switch to 1 column for very small screens */
    }
    
    .ippf-card-header {
        height: 250px !important;
    }
    .ippf-stock-code {
        margin-top: 15px;
    }
    .ippf-stock-status {
        margin-bottom: 10px;
    }    
    
}
/* For very small phones (under 380px) hide button text and show icons only to avoid breaking */
@media (max-width: 380px) {
    .ippf-btn-info span, .ippf-btn-cart span {
        display: none !important;
    }
    .ippf-btn-info, .ippf-btn-cart {
        min-width: 40px !important;
    }
}
/* Responsive fix: Stack them on mobile devices */
@media (max-width: 768px) {
    .ippf-layout {
        flex-direction: column;
    }
    .ippf-sidebar, .ippf-results {
        width: 100%;
    }
    /*.ippf-product-grid {*/
    /*    grid-template-columns: repeat(2, 1fr);*/
    /*}*/
}