/* 首页轮播图banner响应式显示控制 */

/* 默认状态：桌面端banner显示，手机端banner隐藏 */
.banner-desktop {
    display: block !important;
    width: 100% !important;
    height: auto !important;
}

.banner-mobile {
    display: none !important;
    width: 100% !important;
    height: auto !important;
}

/* 手机端样式：隐藏桌面端banner，显示手机端banner */
@media (max-width: 768px) {
    .banner-desktop {
        display: none !important;
    }
    
    .banner-mobile {
        display: block !important;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .banner-mobile {
        /* 确保在超小屏幕上正确显示 */
        max-width: 100% !important;
        height: auto !important;
        object-fit: cover !important;
    }
}

/* 平板端样式：保持桌面端banner显示 */
@media (min-width: 769px) and (max-width: 1024px) {
    .banner-desktop {
        display: block !important;
    }
    
    .banner-mobile {
        display: none !important;
    }
}

/* 确保轮播图容器在不同设备上的正确显示 */
.swiper-container.lunbo {
    /* 保持轮播图功能正常 */
    overflow: visible !important;
    position: relative !important;
}

.swiper-slide {
    /* 确保滑动元素正确显示 */
    position: relative !important;
    overflow: hidden !important;
}

.swiper-zoom-container {
    /* 确保容器正确显示 */
    position: relative !important;
    width: 100% !important;
    height: auto !important;
}

/* 图片样式优化 */
.banner-desktop img,
.banner-mobile img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: cover !important;
}

/* 链接样式优化 */
.swiper-zoom-container a {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    text-decoration: none !important;
}

/* 确保轮播图分页器和导航按钮正确显示 */
.swiper-pagination {
    position: absolute !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 10 !important;
}

.swiper-button-prev,
.swiper-button-next {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
    color: #fff !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.swiper-button-prev {
    left: 20px !important;
}

.swiper-button-next {
    right: 20px !important;
}

/* 手机端导航按钮优化 */
@media (max-width: 768px) {
    .swiper-button-prev,
    .swiper-button-next {
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
    }
    
    .swiper-button-prev {
        left: 15px !important;
    }
    
    .swiper-button-next {
        right: 15px !important;
    }
    
    .swiper-pagination {
        bottom: 15px !important;
    }
}

/* 超小屏幕进一步优化 */
@media (max-width: 480px) {
    .swiper-button-prev,
    .swiper-button-next {
        width: 30px !important;
        height: 30px !important;
        font-size: 14px !important;
    }
    
    .swiper-button-prev {
        left: 10px !important;
    }
    
    .swiper-button-next {
        right: 10px !important;
    }
    
    .swiper-pagination {
        bottom: 10px !important;
    }
}

/* 确保轮播图在不同设备上的高度适配 */
.swiper-container.lunbo {
    /* 设置合适的高度 */
    height: auto !important;
    min-height: 300px !important;
}

@media (max-width: 768px) {
    .swiper-container.lunbo {
        min-height: 200px !important;
    }
}

@media (max-width: 480px) {
    .swiper-container.lunbo {
        min-height: 150px !important;
    }
}

/* 图片加载优化 */
.banner-desktop img,
.banner-mobile img {
    /* 防止图片加载时的闪烁 */
    opacity: 1 !important;
    transition: opacity 0.3s ease !important;
}

/* 确保图片在容器中正确居中 */
.swiper-zoom-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 响应式图片加载优化 */
@media (max-width: 768px) {
    /* 手机端预加载手机端banner */
    .banner-mobile {
        /* 确保手机端banner优先加载 */
        z-index: 1 !important;
    }
}

/* 桌面端预加载桌面端banner */
@media (min-width: 769px) {
    .banner-desktop {
        /* 确保桌面端banner优先加载 */
        z-index: 1 !important;
    }
}

/* 调试样式 - 开发时使用 */
/* 取消注释以下代码来查看banner区域 */
/*
@media (max-width: 768px) {
    .banner-desktop {
        border: 2px solid red !important;
    }
    
    .banner-mobile {
        border: 2px solid blue !important;
    }
}

@media (min-width: 769px) {
    .banner-desktop {
        border: 2px solid green !important;
    }
    
    .banner-mobile {
        border: 2px solid orange !important;
    }
}
*/ 