/* Client Carousel Image Size Fix - Override all other styles */

/* Ensure horizontal layout for carousel track */
.ud-clients-scroll {
    width: 100% !important;
    overflow: hidden !important;
    position: relative !important;
}

.ud-clients-track {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    width: auto !important;
    /* Let JavaScript control the width */
    /* Override any bootstrap or other CSS */
    flex-flow: row nowrap !important;
}

.ud-single-client {
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    /* Enhanced individual card styling */
    width: 200px !important;
    flex-basis: 200px !important;
    min-height: 200px !important;
    /* Increased height to accommodate larger images */
    justify-content: space-between !important;
    /* Ensure cards are visually distinct */
    margin: 0 12px !important;
}

/* Ultra-specific selectors to ensure our image sizing takes precedence */
.ud-clients .ud-clients-wrapper .ud-clients-scroll .ud-clients-track .ud-single-client .ud-client-image-wrapper .ud-client-logo img,
#clientsCarousel .ud-single-client .ud-client-image-wrapper .ud-client-logo img,
.ud-client-logo img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    min-width: 60px !important;
    /* Increased minimum width for SVGs */
    min-height: 40px !important;
    /* Increased minimum height for SVGs */
    object-fit: contain !important;
    object-position: center !important;
    box-sizing: border-box !important;
    /* Center and fill the available space */
}

/* Handle different image aspect ratios */
.ud-client-logo img[src*=".svg"] {
    /* SVG logos need better scaling to prevent them from appearing too small */
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 80px !important;
    min-height: 40px !important;
}

/* Special handling for specific SVG files that might be too small */
.ud-client-logo img[src*="easyways.svg"],
.ud-client-logo img[src*="aliyans.svg"],
.ud-client-logo img[src*="dhi-company.svg"],
.ud-client-logo img[src*="myself-and-my-moves-logo.svg"] {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 100px !important;
    /* Larger minimum for these specific SVGs */
    min-height: 50px !important;
}

.ud-client-logo img[src*=".png"],
.ud-client-logo img[src*=".jpg"],
.ud-client-logo img[src*=".jpeg"] {
    /* Bitmap images should also use full space available */
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Ensure container constraints for proper centering and filling */
.ud-client-logo {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    /* Remove constraints to allow filling */
}

.ud-client-image-wrapper {
    max-width: 170px !important;
    max-height: 120px !important;
    /* Increased height to prevent cropping */
    overflow: hidden !important;
    /* Ensure proper centering container */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Mobile specific overrides */
@media (max-width: 767px) {

    .ud-clients .ud-clients-wrapper .ud-clients-scroll .ud-clients-track .ud-single-client .ud-client-image-wrapper .ud-client-logo img,
    #clientsCarousel .ud-single-client .ud-client-image-wrapper .ud-client-logo img,
    .ud-client-logo img {
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center !important;
    }

    .ud-single-client {
        width: 160px !important;
        flex-basis: 160px !important;
        min-height: 180px !important;
        /* Increased mobile height */
        margin: 0 8px !important;
    }

    .ud-client-image-wrapper {
        max-width: 130px !important;
        max-height: 100px !important;
        /* Increased mobile image height */
    }
}