/*------------------------------------------------*/
/*---------[Responsive Marquee Effect]------------*/
/*------------------------------------------------*/

/* Main marquee container - most styling applied via JS */
#marquee-container {
    width: 100%;
    padding: 30px 0;
    position: relative;
    will-change: transform; /* Optimize for animations */
    backface-visibility: hidden; /* Prevent flickering */
    
    /* Smooth fade edges */
    mask: linear-gradient(
        90deg,
        transparent 0%,
        black 5%,
        black 95%,
        transparent 100%
    );
    -webkit-mask: linear-gradient(
        90deg,
        transparent 0%,
        black 5%,
        black 95%,
        transparent 100%
    );
}

/* Ensure all child elements are flex-shrink: 0 to maintain size */
#marquee-container > * {
    flex-shrink: 0;
    display: inline-block;
}

/* Override Divi column styles if they exist within marquee */
#marquee-container .et_pb_column {
    margin: 0 !important;
    width: auto !important;
    display: inline-block !important;
}

/* Style Divi modules within marquee */
#marquee-container .et_pb_image {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#marquee-container .et_pb_image:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.12);
}

#marquee-container .et_pb_image img {
    width: 170px;
    height: 55px;
    object-fit: contain;
    display: block;
    max-width: none; /* Override any theme restrictions */
}

/* Text modules styling */
#marquee-container .et_pb_text,
#marquee-container .et_pb_heading {
    color: inherit;
    font-weight: 500;
    margin: 0;
}

/* Button modules */
#marquee-container .et_pb_button_module {
    margin: 0;
}

#marquee-container .et_pb_button {
    white-space: nowrap;
}

/* Generic styling for any custom elements */
#marquee-container > div:not([class*="et_pb"]) {
    display: inline-block;
    vertical-align: middle;
}

/* Performance optimizations */
#marquee-container,
#marquee-container * {
    transform-style: preserve-3d;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    #marquee-container {
        padding: 20px 0;
        /* Tighter mask on mobile */
        mask: linear-gradient(
            90deg,
            transparent 0%,
            black 3%,
            black 97%,
            transparent 100%
        );
        -webkit-mask: linear-gradient(
            90deg,
            transparent 0%,
            black 3%,
            black 97%,
            transparent 100%
        );
    }
    
    #marquee-container .et_pb_image {
        padding: 10px;
    }
    
    #marquee-container .et_pb_image img {
        width: 120px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    #marquee-container .et_pb_image img {
        width: 100px;
        height: 35px;
    }
}

/* Accessibility - respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    #marquee-container {
        transform: none !important;
    }
}

/* Loading state */
#marquee-container:not(.marquee-ready) {
    opacity: 0.7;
}

/* Hide cloned elements from screen readers */
.marquee-clone {
    pointer-events: none;
}