.action-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden !important;
}

.action-swiper {
    width: 100%;
    padding: 10px 0;
}

/* 当启用centeredSlides时的样式 */
.action-swiper.centered-slides-enabled {
    padding-left: 0;
    padding-right: 0;
}

/* 调整幻灯片容器在centeredSlides模式下的宽度 */
.action-swiper .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

/* 幻灯片基础样式 */
.action-slide {
    height: auto;
    display: flex;
    align-items: stretch;
    transition: transform 0.3s ease;
}

/* 在centeredSlides模式下，给当前活动幻灯片添加样式 */
.action-swiper.centered-slides-enabled .swiper-slide-active {
    z-index: 2;
}

.action-slide-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: inherit;
}

.action-slide-image-wrapper {
    width: 100%;
    overflow: hidden;
}

.action-slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.action-slide:hover .action-slide-image {
    transform: scale(1.05);
}

.action-slide-title {
    position: absolute;
    z-index: 2;
    margin: 20px;
    transition: all 0.3s ease;
}

/* Position Classes */
.title-position-top-left {
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
}

.title-position-top-center {
    top: 0;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
}

.title-position-top-right {
    top: 0;
    left: auto;
    right: 0;
    bottom: auto;
}

.title-position-middle-left {
    top: 50%;
    left: 0;
    right: auto;
    bottom: auto;
    transform: translateY(-50%);
}

.title-position-middle-center {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
}

.title-position-middle-right {
    top: 50%;
    left: auto;
    right: 0;
    bottom: auto;
    transform: translateY(-50%);
}

.title-position-bottom-left {
    top: auto;
    left: 0;
    right: auto;
    bottom: 0;
}

.title-position-bottom-center {
    top: auto;
    left: 50%;
    right: auto;
    bottom: 0;
    transform: translateX(-50%);
}

.title-position-bottom-right {
    top: auto;
    left: auto;
    right: 0;
    bottom: 0;
}

/* Navigation Buttons */
.action-swiper-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.action-swiper-button:hover {
    background: rgba(0, 0, 0, 0.8);
}

.action-swiper-button-prev {
    left: 10px;
}

.action-swiper-button-next {
    right: 10px;
}

.action-swiper-button i {
    font-size: 20px;
}

/* Pagination */
.swiper-pagination {
    position: relative;
    bottom: 0;
    margin-top: 20px;
    text-align: center;
}

.swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    display: inline-block;
    border-radius: 50%;
    background: #ccc;
    margin: 0 5px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.2);
}

/* Animation Delay */
.action-slide-title[data-animation-delay] {
    animation-delay: calc(var(--animation-delay, 0) * 1ms);
}

/* 为复制的幻灯片添加特殊类，便于调试和样式控制 */
.action-slide.duplicate-slide {
    opacity: 0.95;
}

/* 确保所有幻灯片都有相同的样式 */
.action-slide {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* 当循环启用时，确保无缝过渡 */
.action-swiper[data-loop="true"] .action-slide {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 在编辑器中的视觉提示 */
.elementor-editor-active .action-slide.duplicate-slide::after {
    content: " (复制)";
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    padding: 2px 5px;
    font-size: 10px;
    border-radius: 3px;
    z-index: 10;
}

/* 动态复制幻灯片的样式 */
.swiper-slide-duplicate {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.swiper-slide-dynamic {
    opacity: 0.99; /* 轻微透明度区别，便于调试 */
}

/* 确保所有幻灯片都有相同的样式 */
.swiper-slide,
.swiper-slide-original,
.swiper-slide-duplicate {
    height: auto;
    display: flex;
    align-items: stretch;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 在编辑器中的视觉提示 */
.elementor-editor-active .swiper-slide-duplicate::after {
    content: " (复制)";
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 100, 0, 0.8);
    color: white;
    padding: 2px 5px;
    font-size: 10px;
    border-radius: 3px;
    z-index: 10;
    opacity: 0.7;
}

.elementor-editor-active .swiper-slide-dynamic::after {
    content: " (动态)";
    background: rgba(0, 150, 255, 0.8);
}

/* 确保动态添加的幻灯片也能正确显示图片 */
.swiper-slide-duplicate .action-slide-image,
.swiper-slide-dynamic .action-slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 隐藏动态复制幻灯片中的重复标记，只在编辑器中显示 */
:not(.elementor-editor-active) .swiper-slide-duplicate::after,
:not(.elementor-editor-active) .swiper-slide-dynamic::after {
    display: none;
}

/* 确保滑动时的流畅性 */
.action-swiper {
    -webkit-overflow-scrolling: touch;
}

/* 优化滑动性能 */
/* .swiper-wrapper {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
} */

/* 响应式调整 */
@media (max-width: 1024px) {
    .action-swiper-button {
        width: 35px;
        height: 35px;
    }
    
    .action-swiper-button i {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .action-swiper-button {
        width: 30px;
        height: 30px;
        display: none; /* Hide on mobile by default */
    }
    
    .action-slide-title {
        margin: 15px;
        font-size: 90%;
    }
}

@media (max-width: 480px) {
    .action-slide-title {
        margin: 10px;
        font-size: 80%;
    }
    
    .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
    }
}

/* Fix for Elementor Editor */
.elementor-editor-active .action-swiper {
    overflow: hidden;
}