.loan-products {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.8rem;
    width: 100%;
}

/* Responsive layout - switch to 2 columns on medium screens */
@media screen and (max-width: 992px) {
    .loan-products {
        grid-template-columns: 1fr 1fr;
    }
}

/* Optional: switch to 1 column on very small screens */
@media screen and (max-width: 576px) {
    .loan-products {
        grid-template-columns: 1fr;
    }
}


.loan-products .loan-product {
    position: relative;
    display: flex;
    aspect-ratio: 1/1;
    overflow: hidden;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    cursor: pointer; /* Indicate it's clickable */
}

.loan-products .loan-product img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transition: transform 0.5s ease; /* Add transition for zoom effect */
}

/* Hover effect for the image */
.loan-products .loan-product:hover img {
    transform: scale(1.05); /* Zoom in on hover */
}

/* Use pseudo-element for the gradient overlay */
.loan-products .loan-product::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(to bottom,
                rgba(0,0,0,0.0) 50%,
                rgba(0,0,0,0.95) 100%);
    transition: background 0.3s ease; /* Smooth transition for background change */
}

.loan-products .lp-content {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    color: white;
    z-index: 2; /* Increase z-index to be above the pseudo-element */
    padding: 1.5rem;
    bottom: 0;
    box-sizing: border-box;
}

/* Heading with arrow container */
.loan-products .lp-content h3 {
    display: flex;
    line-height: 1.2;
    align-items: center; /* Vertically center content */
    justify-content: space-between; /* Push title and arrow to opposite ends */
    width: 100%;
    color: white;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
    text-transform: uppercase;
    font-family: 'Barlow Condensed', 'Roboto', sans-serif;
}

.loan-products .lp-content .subtitle {
    color: white;
    min-height: calc(1rem * 1.1);
    line-height: 1.1;
    font-size: 1rem;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
}

/* Arrow styling */
.loan-products .lp-arrow {
    display: inline-flex;
    margin-left: 0.5rem; /* Space between text and arrow */
    opacity: 0.8;
    transition: transform 0.3s ease;
    color: #ffcf00;
}

/* Arrow hover effect */
.loan-products .loan-product:hover .lp-arrow {
    opacity: 1;
    transform: translateX(5px);
}

.loan-products .lp-content .lp-new {
    line-height: 1;
    font-size: 1.625rem;
    text-transform: uppercase;
    font-family: 'Barlow Condensed', 'Roboto', sans-serif;
    color: #ffcf00;
}