/**
 * Vital Fit - Uniform product cards for Blonwe, version 1.1.
 *
 * The companion script moves the existing WooCommerce variations form below
 * the product name. These rules then align stock, title, selectors, price and
 * CTA without changing any product or variation data.
 */

/* Equal-height cards in grids and carousels. */
.products .product.vufc-card {
    display: flex;
    min-width: 0;
}

.products .product.vufc-card > .product-wrapper.style-6 {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.products .product.vufc-card > .product-wrapper.style-6 > .product-inner {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

.products .product.vufc-card .thumbnail-wrapper {
    flex: 0 0 auto;
}

.products .product.vufc-card .content-wrapper.vufc-card-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

/* One predictable stock line before every title. */
.products .product.vufc-card .content-wrapper > .product-inventory,
.products .product.vufc-card .vufc-stock-placeholder {
    box-sizing: border-box;
    min-height: 1.35em;
    margin-bottom: 0.3125rem;
    overflow: hidden;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Every name begins at the same height and occupies exactly two lines. */
.products .product.vufc-card .content-wrapper > .product-title {
    display: -webkit-box;
    min-height: 2.6em;
    max-height: 2.6em;
    margin-bottom: 0.625rem;
    overflow: hidden;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* The original variation form now sits directly below the title. */
.products .product.vufc-card form.variations_form.vufc-variation-form {
    box-sizing: border-box;
    flex: 0 0 auto;
    width: 100%;
    margin: 0 0 0.625rem;
}

.products .product.vufc-card form.variations_form table.variations {
    width: 100%;
    margin-bottom: 0;
}

.products .product.vufc-card form.variations_form table.variations select {
    width: 100%;
    max-width: 100%;
}

/* Price and CTA remain aligned at the bottom of each equal-height card. */
.products .product.vufc-card .content-wrapper > .price {
    margin-top: auto;
}

.products .product.vufc-card .content-wrapper .product-buttons {
    flex: 0 0 auto;
}

/* Slick carousels require an explicit equal-height track. */
.products.klb-slider .slick-track {
    display: flex;
}

.products.klb-slider .slick-slide {
    height: auto;
}

.products.klb-slider .slick-slide > div,
.products.klb-slider .slick-slide .product {
    height: 100%;
}

@media (max-width: 767px) {
    .products .product.vufc-card .content-wrapper > .product-title {
        min-height: 3.25em;
        max-height: 3.25em;
        line-height: 1.625;
    }

    .products .product.vufc-card .content-wrapper > .product-inventory,
    .products .product.vufc-card .vufc-stock-placeholder {
        min-height: 1.45em;
    }
}
