.title-background{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    position: relative;
}
.title-background img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: -10;
    height: 100%;
    background-color: #ffffff;
    object-fit: cover;
}

.title-background::before {
    content: ""; 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); 
    z-index: -5;
}
.products_title h2{
    color: #FFF;
    font-size: 40px;
    font-weight: 400;
    line-height: 1.2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);

}
.product-grid{
    padding: 0;
}
.products-header-title{
    padding: 60px;
    padding-bottom: 0;
}
.products-header-title h2{
    font-size: 30px;
    line-height: 36px;
    letter-spacing: 1.5px;
    text-align: center;
}

.products-header-title {
    text-align: center;
}

.product-page-container {
    display: flex;
  
    margin: 40px 60px;
    margin-right: 0;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 60px;
}

.product-sidebar {
    width: 23%;
    
}

.filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px 20px;
    color: rgba(0,0,0,1);
    margin-bottom: 0;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 0.05em;
    font-size: 17px;
    letter-spacing: 0px;
    padding-top: 0px;
    padding-bottom: 0px;
    margin-top: 0px;
    color: #222222;
}
.filter-options{
    padding: 20px;
}
.filter-section-header h3{
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}
.view-toggle {
    display: flex;
    gap: 5px;
}

.view-toggle svg {
    padding: 5px;
    border: 1px solid #ccc;
    cursor: pointer;
}

.view-toggle svg.active {
    background-color: #000;
    fill: #fff;
}

.filter-options label {
    display: block;
    margin-bottom: 15px;
    line-height: 20px;
    letter-spacing: 0.3px;
    font-size: 16px;
}
.filter-options label{
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: transform 300ms ease;
}
.filter-options label:hover{
    color: #a0a0a0;
}


input[type="checkbox" i] {
    appearance: none; 
    box-sizing: border-box;
    margin: 3px 3px 3px 4px;
    padding: 0; 
    width: 18px; 
    height:18px;
    border:1.5px solid rgb(196, 195, 195); 
    border-radius: 4px;
    
    position: relative; 
}
.filter-options input{
    margin-right: 10px;
    cursor: pointer;
    
}
input[type="checkbox" i]:checked {
    background-color: black; 
    color: white;
    border:1.5px solid rgb(0, 0, 0); 
}

input[type="checkbox" i]:checked::after {
    content: ""; 
    background-image: url('/static/images/image.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: 16px; 
    height: 16px; 
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    filter: brightness(0) invert(1); 
}
input[type="checkbox"]:hover {
    background-color: black; 
    color: white;
    border: 1.5px solid rgb(0, 0, 0); 
}

input[type="checkbox"]:hover::after {
    content: ""; 
    background-image: url('/static/images/image.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: 16px; 
    height: 16px; 
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    filter: brightness(0) invert(1); 
}
.product-listing {
    width: 75%;
}

.product-listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}
.sale-filter{
    font-size: 13px;
}
.sort-filter{
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sort-filter select{
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 13px;
    border-radius: 20px;
    width: 150px;
}
.sort-filter select:focus{
    outline: none;
    border-color: #4285f4; 
    box-shadow: 0px 0px 8px rgba(66, 133, 244, 0.5); 
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    row-gap: 30px;
    padding: 0;
}

/* Default 3-column grid styles */
.product-grid:not(.grid-5-columns) .product-card {
    width: 100%;
}

.product-grid:not(.grid-5-columns) .product-card .image-container {
    height: 320px;
    padding: 40px 0;
}

.product-grid:not(.grid-5-columns) .product-card .description h3 {
    font-size: 15px;
    line-height: 24px;
}

/* 5-column grid styles */
.product-grid.grid-5-columns {
    gap: 12px;
    row-gap: 25px;
}

.product-grid.grid-5-columns .product-card {
    width: 100%;
    padding-bottom: 10px;
}

.product-grid.grid-5-columns .product-card .image-container {
    height: 220px;
    padding: 25px 0;
}

.product-grid.grid-5-columns .product-card .description {
    margin-top: 12px;
    padding: 0 8px;
}

.product-grid.grid-5-columns .product-card .description h3 {
    font-size: 13px;
    line-height: 18px;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.product-grid.grid-5-columns .product-card .description .price {
    font-size: 14px;
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}

.product-grid.grid-5-columns .product-card .image-container .enquiry {
    font-size: 12px;
    padding: 10px 6px;
}

/* 5-column grid: Make add-to-cart button icon-only */
.product-grid.grid-5-columns .add-to-cart-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    gap: 0;
    text-indent: -9999px;
    overflow: hidden;
    position: relative;
}

.product-grid.grid-5-columns .add-to-cart-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    text-indent: 0;
    position: absolute;
}

.product-grid.grid-5-columns .add-to-cart-btn::after {
    content: none;
}

/* 3-column grid explicit styles */
.product-grid.grid-3-columns {
    gap: 20px;
    row-gap: 30px;
}

.product-grid.grid-3-columns .product-card .image-container {
    height: 320px;
    padding: 40px 0;
}

.product-grid.grid-3-columns .product-card .description h3 {
    font-size: 15px;
    line-height: 24px;
}

@media only screen and (min-width: 1201px) and (max-width: 1380px){

    .product-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        row-gap: 30px;
        padding: 0;
    }
    
    /* Override for 5-column grid in medium screens */
    .product-grid.grid-5-columns {
        grid-template-columns: repeat(4, 1fr);
        row-gap: 25px;
    }
}
.product-card {
    width: 100%;
    cursor: pointer;
    max-width: 100%;
}

.product-card .image-container {
    width: 100%;
    height: 320px;
    padding: 40px 0;
    transition: background-color 0.3s ease-in-out;
    position: relative;
    display: block;
    overflow: hidden;
    border-bottom: 1px solid #d4d4d4;
    
}
.filter-section{
    border-bottom: 1px dashed #dadada;
    padding-top: 20px;
}

.product-card .image-container img {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    -webkit-backface-visibility: hidden;
    transition: opacity 300ms ease 0s;
    position: absolute;
    top: 0;
    left: 0;
    object-fit: contain;
    
}
.product-card:hover .image-container img:first-child {
    opacity: 0; 
}

.product-card .image-container img:last-child {
    opacity: 0; 
}

.product-card:hover .image-container img:last-child {
    opacity: 1; 
}

.product-card .image-container img[data-hover-image] {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    -webkit-backface-visibility: hidden;
    transition: opacity 300ms ease 0s;
    position: absolute;
    top: 0;
    left: 0;
}

.product-card .description {
    margin-top: 17px;
}

.product-card .description h3 {
    line-height: 20px;
    font-size: 15px;
    line-height: 24px;
    letter-spacing: 0.375px;
    font-weight: normal;
    margin-bottom: 15px;
    transition: transform 0.3s ease-in-out;
    text-align: center;
    font-weight: 600;
}

.product-card .description .price {
    margin-bottom: 15px;
    letter-spacing: 0.075em;
    font-weight: 800;
}

.product-card {
    display:inline-block;
    position: relative; 
    border: 1px solid #ddd;
    padding-bottom: 15px;
    box-shadow: 0 0 5px #d4d4d4;
    background: #fff;
}
.product-card .image-container {
    position: relative;
    overflow: hidden;
}

.product-card .image-container .enquiry {
    position: absolute;
    bottom: 0; 
    left: 0;
    background-color: #000;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 15px 8px;
    text-align: center;
    width: calc(100% - 16px);
    opacity: 0; 
    transform: translateY(100%); 
    transition: opacity 300ms ease, transform 300ms ease;
    z-index: 99;
    cursor: pointer;
}

.product-card:hover .enquiry {
    opacity: 1; 
    transform: translateY(0); 
}

.product-card .description h3:hover {
    color: rgba(209, 2, 2, 1);
}

.product-card:hover .image-container .enquiry {
    opacity: 1;
}
ul.product-categories {
    cursor: pointer;
    display: inline-block;
    position: relative;
    line-height: 20px;
    text-decoration: none;
    transition: 200ms ease;
}



.product-categories .cat-item .icon-toggle::before {
    content: '';
    width: 19px;
    height: 19px;
    border: 2px solid #b6b6b6;
    border-radius: 3px;
    position: absolute;
    top: 0;
    left: 0;
}
.filter-sidebar{
    border-right:1px solid #eeeeee ;
    margin-right: 10px;
}
.product-sidebar{
    width: 100%; 
}
.filter-btn{
    opacity: 0;
}
@media (max-width: 1200px) {
    .filter-btn{
        opacity: 1;
    }
    
    /* Hide grid selector on mobile/tablet */
    .grid-selector {
        display: none !important;
    }
    .title-background {
        height: 100px;
    }
    .products_title h2 {
        color: #FFF;
        font-size: 25px;
        font-weight: 400;
        line-height: 1em;
        text-align: center;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    }
    .overlay-content {
        padding: 15px;
        margin: 5px;
    }
    .addformbtn button {
        padding: 15px 30px;
        font-size: 14px;
        border-radius: 30px;
    }
    .product-sidebar{
        display: none;
    }
    .product-page-container {
        display: flex;
        margin: 0;
        margin-top: 25px;
        margin-right: 0;
        padding: 0;

    }
    .product-listing {
        width: 100%;
        padding: 10px;
        margin-bottom: 100px;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr); 
        gap: 15px;
        row-gap: 20px;
        padding: 0;
    }
    .product-card {
        width: auto; 
    }
    .product-card {
        display: inline-block;
        position: relative;
        border: none;
        padding-bottom: 0px;
        box-shadow: 0 0 4px #d4d4d4;
        background: #fff;
    }
    .product-card .description {
        margin-top: 12px;
    }
    .product-card .description h3{
        margin-bottom: 12px;
        font-size: 14px;
    }
    .product-card .image-container {
        height: 180px; 
        padding: 20px 0; 
        border-bottom: 0.8px solid #e4e3e3;
    }
    
    
    /* Mobile: Make add-to-cart button icon-only */
    .add-to-cart-btn {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0;
        gap: 0;
        text-indent: -9999px;
        overflow: hidden;
        position: relative;
    }
    
    .add-to-cart-btn svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        text-indent: 0;
        position: absolute;
    }
    
    .add-to-cart-btn::after {
        content: none;
    }

    .sort-filter select {
        padding: 8px;
        border: 1px solid #ccc;
        font-size: 12px;
        border-radius: 20px;
        width: 120px;
    }
    .filter-sidebar{
        position: fixed;
        opacity: 0; 
        visibility: hidden;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        content: "";
        background: rgba(0, 0, 0, 0.6);
        z-index: 99991;
        transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out; 
        margin: 0;
    }
    .product-sidebar{
        width: 100%;
        max-width: 325px;
        left: 0;
        right: auto;
        padding: 0;
        flex: 1;
        position: absolute;
        overflow-y: auto;
        background-color: rgba(255,255,255,1);
        color: rgba(0,0,0,1);
        transform: translateX(-100%);
        transition: transform 0.5s cubic-bezier(0.645, 0.045, 0.355, 1); 
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    .filter-sidebar.active {
        opacity: 1; 
        visibility: visible;
    }
    
    .filter-sidebar.active .product-sidebar { 
        transform: translateX(0); 
    }
    .filter-section {
        border-bottom: 1px dashed transparent;
        padding-top: 20px;
    }
    .product-sidebar{
        display: flex;
        max-width: 325px;
    }
}
@media (max-width: 375px) {
    .product-card .image-container {
        height: 130px; 
        padding: 20px 0; 
    }
}
@media only screen and (min-width: 375px) and (max-width: 480px) {
    .product-card .image-container {
        height: 150px; 
        padding: 20px 0; 
    }
}
@media only screen and (min-width: 480px) and (max-width: 530px) {
    .product-card .image-container {
        height: 180px; 
        padding: 20px 0; 
    }
}
@media only screen and (min-width: 531px) and (max-width: 700px) {
    .product-card .image-container {
        height: 230px; 
        padding: 20px 0; 
    }
}
@media only screen and (min-width: 701px) and (max-width: 768px) {
    .product-card .image-container {
        height: 280px; 
        padding: 20px 0; 
    }
}
@media only screen and (min-width: 768px) and (max-width: 968px) {
    .product-card .image-container {
        height: 300px; 
        padding: 20px 0; 
    }
}
@media only screen and (min-width: 968px) and (max-width: 1200px) {
    .product-card .image-container {
        height: 350px; 
        padding: 20px 0; 
    }
}