/* Keep WooCommerce's existing column widths, floats, and responsive breakpoints. */
body.hsp-product-display-fix ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
}

body.hsp-product-display-fix ul.products li.product > a.woocommerce-LoopProduct-link,
body.hsp-product-display-fix ul.products li.product > a.woocommerce-loop-product__link {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
}

/* A square image area makes title rows start at the same height. */
body.hsp-product-display-fix ul.products li.product a.woocommerce-LoopProduct-link img,
body.hsp-product-display-fix ul.products li.product a.woocommerce-loop-product__link img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    margin: 0 auto !important;
}

/* Reserve two full lines even for short names, then clamp longer names. */
body.hsp-product-display-fix ul.products li.product .woocommerce-loop-product__title {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden !important;
    text-overflow: ellipsis;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    box-sizing: border-box !important;
    height: 3em !important;
    min-height: 3em !important;
    max-height: 3em !important;
    padding: 0 !important;
    margin: 16px 0 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    color: #111111 !important;
    text-align: center !important;
}

body.hsp-product-display-fix ul.products li.product > a.button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    float: none !important;
    align-self: center !important;
    box-sizing: border-box !important;
    width: auto !important;
    min-height: 44px !important;
    margin: 16px auto 0 !important;
    padding: 11px 24px !important;
    border: 1px solid #166534 !important;
    border-radius: 6px !important;
    background: #166534 !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    text-align: center !important;
    text-decoration: none !important;
    max-width: 100%;
    box-shadow: none;
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

body.hsp-product-display-fix ul.products li.product > a.button:hover,
body.hsp-product-display-fix ul.products li.product > a.button:focus-visible {
    background: #123453 !important;
    border-color: #123453 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(8, 20, 35, 0.24);
}

body.hsp-product-display-fix ul.products li.product > a.button:focus-visible {
    outline: 2px solid #123453;
    outline-offset: 3px;
}

@media (max-width: 767px) {
    body.hsp-product-display-fix ul.products li.product .woocommerce-loop-product__title {
        font-size: 14px !important;
    }

    body.hsp-product-display-fix ul.products li.product > a.button {
        padding-right: 16px !important;
        padding-left: 16px !important;
        font-size: 14px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.hsp-product-display-fix ul.products li.product > a.button {
        transition: none;
    }
}
