/*
 * Vendor Info Display - Styles
 * 
 * Layout Fix for Carousels:
 * This CSS ensures that when vendor info is injected into product cards,
 * the containers expand properly without pushing content off-screen.
 * 
 * Key strategies:
 * 1. Force product containers and carousel slides to use auto height
 * 2. Use flexbox on slick-track to allow variable heights
 * 3. Set overflow:visible on carousel to show all content
 * 
 * If the overflow:visible approach breaks carousel navigation, you can:
 * - Comment out the .slick-list and .slick-slider overflow rules below
 * - Adjust carousel settings to use adaptiveHeight: true
 * - Or use position:absolute for vendor info (see commented alternative below)
 */

/* ──────────────────────────────────────────────────────────────
   ALTERNATIVE APPROACH (if overflow:visible breaks carousel):
   Uncomment this to position vendor info absolutely
──────────────────────────────────────────────────────────────── */
/*
.slick-slide li.product,
.slick-slide div.product,
.slick-slide .product-item {
    position: relative;
    padding-bottom: 30px !important;
}

.slick-slide .vid-vendor-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10;
}
*/

/* ── Catalogue card ──────────────────────────────────────────── */
.vid-vendor-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    min-height: 20px; /* Reserve space to prevent layout shift */
    opacity: 1 !important;
    visibility: visible !important;
    transition: opacity 0.3s ease-in-out; /* Smooth appearance */
}

/* Ensure parent product containers expand to fit vendor info */
li.product,
div.product,
.e-loop-item,
.elementor-loop-item,
.product-item,
.wl-product-wrapper,
.woolentor-product-item,
.mf-product-item,
.mf-shop-loop-item,
[class*="product-grid-item"] {
    min-height: auto !important;
    height: auto !important;
}

/* Ensure carousel slides expand to accommodate content */
.slick-slide,
.slick-cloned {
    height: auto !important;
}

/* Make carousel track allow variable heights */
.slick-track {
    display: flex !important;
    align-items: stretch !important;
}

.slick-track .slick-slide {
    display: flex !important;
    height: auto !important;
    align-items: stretch !important;
}

/* Ensure product items within slick slides expand */
.slick-slide > *,
.slick-slide li.product,
.slick-slide div.product,
.slick-slide .product-item,
.slick-slide .wl-product-wrapper,
.slick-slide .woolentor-product-item {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.vid-vendor-label {
    font-size: 1em;
    opacity: 1 !important;
    visibility: visible !important;
}

.vid-vendor-name {
    font-weight: 600;
    color: #FA8128;
    text-decoration: none;
    transition: color 0.2s;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline !important;
}

.vid-vendor-name:hover {
    color: #1a4e8a;
    text-decoration: underline;
}

/* Ensure vendor info is visible in slick carousels */
.slick-slide .vid-vendor-info,
.slick-cloned .vid-vendor-info {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.slick-slide .vid-vendor-name,
.slick-cloned .vid-vendor-name {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline !important;
}

/* Ensure product content wrappers expand with vendor info */
.woocommerce-loop-product__link,
.product-inner,
.product-content,
.product-wrapper,
.wl-product-content,
.woolentor-product-content,
.ht-product-inner {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* Allow overflow for carousel items to show all content */
.slick-list {
    overflow: visible !important;
}

.slick-slider {
    overflow: visible !important;
}

/* Alternative: if overflow:visible breaks carousel navigation, 
   ensure min-height expands with content instead */
.vid-vendor-loaded {
    min-height: fit-content !important;
    height: auto !important;
}

/* ── Single product page ─────────────────────────────────────── */
.vid-vendor-info--single {
    background: #FAC898;
	border: 1px solid #eee!important;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    gap: 16px;
    margin-bottom: 10px;
    margin-top: 0;
}

.vid-vendor-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    min-width: 48px;
}

.vid-vendor-logo {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid #eee;
    background: #fff;
}

.vid-vendor-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}

.vid-vendor-sold-by {
    font-size: 1em;
    line-height: 1.1;
}

.vid-vendor-name--single {
    font-size: 1.1em;
    line-height: 1.1;
}

.vid-vendor-city {
    font-size: 0.95em;
    color: #666;
    margin-top: 2px;
    line-height: 1.1;
}

/* ── Tablet, smaller text, stay on one line ──────────── */
@media (max-width: 1024px) {
    .vid-vendor-info {
        font-size: 0.8rem;
        flex-wrap: nowrap;
        gap: 4px;
    }

    .vid-vendor-label,
    .vid-vendor-name {
        white-space: nowrap;
    }
}
/* ── Mobile, smaller text, stay on one line ──────────── */
@media (max-width: 767px) {
    .vid-vendor-info {
        font-size: 0.7rem;
        flex-wrap: nowrap;
        gap: 4px;
        min-height: 18px;
    }

    .vid-vendor-label,
    .vid-vendor-name {
        white-space: nowrap;
    }
}

/* ── Uniform spacing for product cards in carousels ──────────── */
/* Ensure all product cards have consistent height and alignment */
.slick-slider .product-inner,
.slick-slider .product,
.slick-slider .product-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Reserve space for vendor info to prevent layout shift */
.slick-slider .product .vid-vendor-info,
.mf-products-top-carousel .vid-vendor-info,
.mf-products-carousel .vid-vendor-info {
    min-height: 20px;
    margin-top: 4px;
    margin-bottom: 6px;
}

/* Ensure product title and price stay aligned */
.slick-slider .woocommerce-loop-product__title,
.slick-slider .product-title {
    min-height: 2.4em; /* Reserve space for 2 lines of title */
    line-height: 1.2;
}

.slick-slider .price {
    min-height: 1.5em; /* Reserve space for price */
    line-height: 1.5;
}

/* Force vendor info to always display in carousels */
.slick-initialized .vid-vendor-info {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

/* Prevent content jumping when vendor info loads */
.product:not(.vid-vendor-loaded) .vid-vendor-info::before {
    content: '';
    display: block;
    height: 20px;
}