/* Moving Gallery Styles */
.ws-zmnd-moving-gallery-container {
    width: 100%;
    height: 400px;
    overflow: hidden;
    position: relative;
}

.ws-zmnd-moving-gallery-inner {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    position: relative;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-fill-mode: forwards;
}

.ws-zmnd-moving-gallery-item {
    box-sizing: border-box;
    padding: 5px;
    width: calc(100% / 3);
}

.ws-zmnd-moving-gallery-image {
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
}

.elementor .ws-zmnd-moving-gallery-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Image Fit Options */
.elementor .ws-zmnd-image-fit-cover .ws-zmnd-moving-gallery-image img {
    object-fit: cover;
}

.elementor .ws-zmnd-image-fit-contain .ws-zmnd-moving-gallery-image img {
    object-fit: contain;
    background-color: rgba(0, 0, 0, 0.03);
}

.elementor .ws-zmnd-image-fit-auto .ws-zmnd-moving-gallery-image img {
    object-fit: none;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: none;
    margin: 0 auto;
}

/* Auto height for original size mode */
.elementor .ws-zmnd-image-fit-auto .ws-zmnd-moving-gallery-container {
    height: auto;
    min-height: 100px;
}

.elementor .ws-zmnd-image-fit-auto .ws-zmnd-moving-gallery-inner {
    position: static;
    animation: none;
    transform: none !important;
}

.elementor .ws-zmnd-image-fit-auto .ws-zmnd-moving-gallery-item {
    height: auto;
}

/* Animation Directions */
.ws-zmnd-moving-up {
    animation-name: moveUp;
}

.ws-zmnd-moving-down {
    animation-name: moveDown;
}

/* Scale Animation: all items are scaled down by default, selected items scale up */
.ws-zmnd-scale-yes .ws-zmnd-moving-gallery-image {
    transform: scale(0.9);
}

/* Every third image */
.ws-zmnd-scale-yes.ws-zmnd-scale-pattern-third .ws-zmnd-moving-gallery-item:nth-child(3n+1) .ws-zmnd-moving-gallery-image {
    animation: scaleUpAnimation 5s ease-in-out infinite alternate;
}

/* Odd images */
.ws-zmnd-scale-yes.ws-zmnd-scale-pattern-odd .ws-zmnd-moving-gallery-item:nth-child(odd) .ws-zmnd-moving-gallery-image {
    animation: scaleUpAnimation 5s ease-in-out infinite alternate;
}

/* Even images */
.ws-zmnd-scale-yes.ws-zmnd-scale-pattern-even .ws-zmnd-moving-gallery-item:nth-child(even) .ws-zmnd-moving-gallery-image {
    animation: scaleUpAnimation 5s ease-in-out infinite alternate;
}

@keyframes scaleUpAnimation {
    0% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Scale Animation Speed Control */
/* Slow speed */
.ws-zmnd-scale-speed-slow.ws-zmnd-scale-pattern-third .ws-zmnd-moving-gallery-item:nth-child(3n+1) .ws-zmnd-moving-gallery-image,
.ws-zmnd-scale-speed-slow.ws-zmnd-scale-pattern-odd .ws-zmnd-moving-gallery-item:nth-child(odd) .ws-zmnd-moving-gallery-image,
.ws-zmnd-scale-speed-slow.ws-zmnd-scale-pattern-even .ws-zmnd-moving-gallery-item:nth-child(even) .ws-zmnd-moving-gallery-image {
    animation-duration: 8s;
}

/* Normal speed */
.ws-zmnd-scale-speed-normal.ws-zmnd-scale-pattern-third .ws-zmnd-moving-gallery-item:nth-child(3n+1) .ws-zmnd-moving-gallery-image,
.ws-zmnd-scale-speed-normal.ws-zmnd-scale-pattern-odd .ws-zmnd-moving-gallery-item:nth-child(odd) .ws-zmnd-moving-gallery-image,
.ws-zmnd-scale-speed-normal.ws-zmnd-scale-pattern-even .ws-zmnd-moving-gallery-item:nth-child(even) .ws-zmnd-moving-gallery-image {
    animation-duration: 5s;
}

/* Fast speed */
.ws-zmnd-scale-speed-fast.ws-zmnd-scale-pattern-third .ws-zmnd-moving-gallery-item:nth-child(3n+1) .ws-zmnd-moving-gallery-image,
.ws-zmnd-scale-speed-fast.ws-zmnd-scale-pattern-odd .ws-zmnd-moving-gallery-item:nth-child(odd) .ws-zmnd-moving-gallery-image,
.ws-zmnd-scale-speed-fast.ws-zmnd-scale-pattern-even .ws-zmnd-moving-gallery-item:nth-child(even) .ws-zmnd-moving-gallery-image {
    animation-duration: 3s;
}

/* Pause on Hover */
.ws-zmnd-pause-yes:hover .ws-zmnd-moving-gallery-inner {
    animation-play-state: paused;
}

/* Animation Keyframes */
@keyframes moveUp {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

@keyframes moveDown {
    0% {
        transform: translateY(-50%);
    }
    100% {
        transform: translateY(0);
    }
}

/* Responsive Styles */
@media (max-width: 767px) {
    .ws-zmnd-moving-gallery-item {
        width: calc(100% / 2);
    }
}

@media (max-width: 480px) {
    .ws-zmnd-moving-gallery-item {
        width: 100%;
    }
}
