/* PEHCHAAN WooCommerce Grid Layout Optimization */

/* Forces all product card images to a 1:1 aspect ratio with object-fit cover */
.woocommerce ul.products li.product a img {
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    width: 100% !important;
    height: auto !important;
}

/* Truncates WooCommerce product titles in grids to one line with an ellipsis */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2 {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 16px !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
}

/* Makes every product card in a row equal height with the price and Add to cart button aligned to the bottom */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 24px !important;
}
@media (min-width: 768px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

.woocommerce ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    padding: 16px !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    margin: 0 !important;
    width: auto !important;
    float: none !important;
}

.woocommerce ul.products li.product a.woocommerce-LoopProduct-link {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
}

.woocommerce ul.products li.product .price {
    margin-top: auto !important;
    margin-bottom: 12px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #0d141a !important;
}

/* Styles product card buttons in the accent colour (#61CE70), uppercase, 12px, full width, no border radius */
.woocommerce ul.products li.product .button {
    background-color: #61CE70 !important;
    color: #ffffff !important;
    text-transform: uppercase !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    border-radius: 0px !important;
    padding: 12px 16px !important;
    width: 100% !important;
    text-align: center !important;
    margin: 0 !important;
    transition: background-color 0.3s ease !important;
    display: block !important;
}

.woocommerce ul.products li.product .button:hover {
    background-color: #4eb75d !important;
}
