/* General Styles */
body {
    background-color: #f9f9f9;
    color: #333;
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
}

/* Filter Toggle Button */
.filter-toggle-btn {
    width: 100%;
    text-align: left;
    background: #339933;
    border-radius: 10px;
    padding: 10px 15px;
    font-weight: 500;
    margin-bottom: 15px;
    color: #fff;
}

.filter-toggle-btn .filter-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.filter-toggle-btn:hover {
    background: #2cbc63;
}

/* Filter Sidebar */
.cnt-sidebar {
    width: 450px;
    max-width: 100%;
    background: #fff;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
    border-radius: 15px;
    border: 1px solid #e0e0e0;
    padding: 20px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.cnt-sidebar h4 {
    color: #339933;
    font-weight: 600;
    margin-bottom: 20px;
}

.cnt-sidebar h5 {
    color: #333;
    font-weight: 500;
    margin-top: 20px;
}

.cnt-sidebar h6.text-primary {
    border-bottom: 2px solid #2cbc63;
    padding-bottom: 5px;
    margin-bottom: 10px;
    color: #2cbc63;
}

/* Filter Group */
.cnt-filter-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, auto));
    column-gap: 15px;
    row-gap: 5px;
    align-items: start;
    padding-right: 10px;
}

.cnt-filter-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* Custom Checkbox Styling */
.cnt-checkbox-wrapper input[type="checkbox"] {
    display: none !important;
    visibility: hidden;
}

.cnt-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cnt-checkbox-wrapper label {
    position: relative;
    padding-left: 2em;
    padding-right: 1em;
    line-height: 2;
    cursor: pointer;
    display: inline-flex;
    user-select: none;
    outline: none;
    color: #333;
    transition: color 0.25s ease;
}

.cnt-checkbox-wrapper label:hover {
    color: #339933;
}

.cnt-checkbox-wrapper label:before {
    box-sizing: border-box;
    content: " ";
    position: absolute;
    top: 0.3em;
    left: 0;
    display: block;
    width: 1.4em;
    height: 1.4em;
    border: 2px solid #9098A9;
    border-radius: 6px;
    z-index: -1;
    transition: 0.25s all ease;
}

.cnt-checkbox-wrapper input[type="checkbox"]:checked + label {
    padding-left: 1em;
    color: #0f5229 !important;
}

.cnt-checkbox-wrapper input[type="checkbox"]:checked + label:hover {
    color: #2cbc63 !important;
}

.cnt-checkbox-wrapper input[type="checkbox"]:checked + label:before {
    top: 0;
    width: 100%;
    height: 2em;
    background: #b7e6c9 !important;
    border-color: #2cbc63 !important;
}

/* Search Bar */
#cnt-search-box {
    max-width: 300px;
    border-radius: 20px;
    border: 1px solid #2cbc63;
    padding: 8px 15px 8px 35px;
    transition: box-shadow 0.3s ease;
}

#cnt-search-box:focus {
    box-shadow: 0 0 8px rgba(44, 188, 99, 0.3);
    outline: none;
    border-color: #f4a261;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: #2cbc63;
}

#search-button {
    border-radius: 20px;
    padding: 8px 20px;
    background: #339933;
    border: none;
    transition: background 0.3s ease;
}

#search-button:hover {
    background: #2cbc63;
}

/* Product Heading */
h2.banner-heading {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    color: #000000;
    border-radius: 10px;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Product Grid */
.cnt-product-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.cnt-product-container:empty {
    opacity: 0;
}

/* Product Card */
.cnt-product-card {
    width: 100%;
    max-width: 220px;
    height: auto;
    border-radius: 10px;
    background: #fff;
    padding: 15px;
    text-align: center;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    animation: fadeIn 0.5s ease-in-out;
}

.cnt-product-card:hover {
    transform: scale(1.05);
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    border-color: #339933;
}

.cnt-product-card img {
    width: 200px;
    height: 170px;
    object-fit: contain;
    margin: 0 auto 10px;
    display: block;
    transition: transform 0.3s ease;
}

.cnt-product-card:hover img {
    transform: scale(1.1);
}

.cnt-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #f4a261;
    color: #fff;
    padding: 2px 8px;
    font-size: 0.7rem;
    border-radius: 12px;
}

/* Ensure the entire card is clickable */
.cnt-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    width: 100%;
}

/* Product Details */
.cnt-product-card h6 {
    font-size: 1rem;
    font-weight: bold;
    color: #2cbc63;
    margin-top: 10px;
    text-transform: capitalize;
}

.cnt-product-card p {
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.4;
}

.cnt-product-card p strong {
    color: #000;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sidebar Collapse Animation */
#filterSidebar {
    transition: all 0.3s ease;
}

/* Backdrop for Mobile Overlay */
.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

#filterSidebar.show + .backdrop {
    display: block;
}

/* Responsive Design */
@media (max-width: 991px) {
    .cnt-sidebar {
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        padding: 15px;
        max-height: none;
    }

    #filterSidebar.show {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #fff;
        z-index: 1000;
        overflow-y: auto;
    }

    .close-sidebar {
        position: absolute;
        top: 10px;
        right: 10px;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 50%;
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
        color: #333;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: color 0.3s ease, background 0.3s ease;
    }

    .close-sidebar:hover {
        color: #2cbc63;
        background: #f9f9f9;
    }

    .cnt-filter-group {
        grid-template-columns: repeat(1, minmax(150px, auto));
        column-gap: 10px;
        padding-right: 0;
    }

    .cnt-product-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }

    .cnt-product-card {
        max-width: 150px;
        padding: 10px;
    }

    .cnt-product-card img {
        width: 60px;
        height: 60px;
    }

    .cnt-product-card h6 {
        font-size: 0.9rem;
    }

    .cnt-product-card p {
        font-size: 0.75rem;
    }

    #cnt-search-box {
        max-width: 100%;
    }

    h2.banner-heading {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .cnt-product-card {
        max-width: 130px;
    }

    .cnt-product-card img {
        width: 50px;
        height: 50px;
    }

    .cnt-product-card h6 {
        font-size: 0.8rem;
    }

    .cnt-product-card p {
        font-size: 0.7rem;
    }
}

/* Pagination */
.cnt-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 10px;
}

.pagination-btn {
    background: #fff;
    border: 1px solid #002200;
    color: #2cbc63;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    font-size: 0.9rem;
}

.pagination-btn:hover {
    background: #2cbc63;
    color: #fff;
}

.pagination-btn.active {
    background: #2cbc63;
    border-color: #002200;
    color: #fff;
}

.pagination-btn:disabled {
    background: #e0e0e0;
    border-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

.pagination-ellipsis {
    margin: 0 5px;
    font-size: 16px;
    color: #333;
}

/* Image Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    width: 500px; /* Fixed width for square shape */
    height: 500px; /* Equal height to make it square */
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    box-sizing: border-box; /* Ensures padding doesn’t increase size */
}

.modal-image {
    width: 100%; /* Fill the square container */
    height: 100%; /* Fill the square container */
    object-fit: contain; /* Keeps image proportions without cropping */
}


.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    background: #fff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #e0e0e0;
    transition: color 0.3s ease, background 0.3s ease;
}

.close-btn:hover {
    color: #2cbc63;
    background: #f9f9f9;
}

/* Custom Reset Button */
.custom-reset-btn {
    display: inline-block;
    padding: 5px 5px;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
    background-color: #e74c3c;
    border: 2px solid #e74c3c;
    border-radius: 25px;
    cursor: pointer;
    outline: none;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.custom-reset-btn:hover {
    background-color: #c0392b;
    border-color: #c0392b;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.custom-reset-btn:active {
    background-color: #a93226;
    border-color: #a93226;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transform: translateY(0);
}

.custom-reset-btn:disabled {
    background-color: #d3d3d3;
    border-color: #d3d3d3;
    color: #888888;
    cursor: not-allowed;
    box-shadow: none;
}

.cnt-sidebar .custom-reset-btn {
    margin-top: 10px;
}

/* Ensure sticky behavior only on desktop */
@media (min-width: 992px) {
    .cnt-sidebar {
        position: sticky;
        top: 20px;
    }
}

.close-btn-floating {
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn-floating:hover {
    color: #e60000;
}
