/* B2RiPro 搜索模块 CSS 修复版 - 解决图片消失问题 */

/* 主容器 - 保持原样 */
.b2ripro-search-wrap {
    position: relative!important;
    display: flex!important;
    align-items: center!important;
    justify-content: center!important;
    text-align: center!important;
    margin: 0 auto 50px!important; /* 调整下边距为50px */
    padding-bottom: 50px!important; /* 额外增加内边距确保间距 */
    min-height: 400px!important;
    width: 100%!important;
    overflow: hidden!important;
    background: #f8f9fa!important;
    color: #fff!important;
    z-index: 0!important;

}

/* 关键修复：图片轮播容器 */
.b2ripro-bg-carousel {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
    overflow: hidden !important;
    
}

/* 关键修复：图片项样式 - 防止消失的核心修复 */
.b2ripro-bg-carousel .slide-item {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    opacity: 0 !important;
    transition: opacity 0.8s ease-in-out !important;
    z-index: 1 !important;
    /* 防止消失的关键属性 */
    visibility: visible !important;
    display: block !important;
    transform: translateZ(0) !important; /* 强制GPU加速 */
    backface-visibility: hidden !important; /* 防止闪烁 */
}

/* 关键修复：确保第一张图片始终显示 */
.b2ripro-bg-carousel .slide-item:first-child {
    opacity: 1 !important;
    z-index: 2 !important;
}

/* 关键修复：活动状态样式 */
.b2ripro-bg-carousel .slide-item.active {
    opacity: 1 !important;
    z-index: 2 !important;
    visibility: visible !important;
}

/* 遮罩层 - 调整透明度避免遮挡图片 */
.b2ripro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* 大幅降低遮罩透明度 */
    background: linear-gradient(135deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
    z-index: 2; /* 在图片之上，但在内容之下 */
    pointer-events: none;
}

/* 完全禁用遮罩的选项 */
.b2ripro-search-wrap.no-overlay .b2ripro-overlay {
    display: none;
}

/* 内容区域 - 确保在最顶层 */
.b2ripro-inner {
    position: relative;
    z-index: 10 !important; /* 最顶层 */
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 20px;
}

/* 标题样式 */
.b2ripro-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #fff;
    text-shadow: 0 4px 8px rgba(0,0,0,0.5);
    line-height: 1.2;
}

/* 描述样式 */
.b2ripro-desc {
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0 0 32px 0;
    color: rgba(255,255,255,0.95);
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    line-height: 1.6;
}

/* 搜索表单 */
.b2ripro-form {
    position: relative;
    max-width: 600px;
    margin: 0 auto 24px auto;
    display: flex;
    background: rgba(255,255,255,0.95);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #999;
    z-index: 10;
    pointer-events: none;
}

.b2ripro-form input[type="search"] {
    flex: 1;
    padding: 16px 24px 16px 50px; /* 增加左边距为图标留空间 */
    border: none;
    background: transparent;
    font-size: 15px;
    color: #333;
    outline: none;
    width: 100%;
}

.b2ripro-form input[type="search"]::placeholder {
    color: #999;
}

.b2ripro-form button {
    padding: 16px 28px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.b2ripro-form button:hover {
    background: linear-gradient(135deg, #357abd 0%, #2a5a8a 100%);
}

/* 搜索热词 */
.b2ripro-hots {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.b2ripro-hots > span {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 500;
    margin-right: 4px;
}

.b2ripro-hots a {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.b2ripro-hots a:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
    transform: translateY(-2px);
}

/* 指示点 - 修复版 */
.carousel-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20 !important; /* 确保在最顶层 */
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(0,0,0,0.6);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    pointer-events: auto !important; /* 确保可点击 */
}

.carousel-dots .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    pointer-events: auto !important;
}

.carousel-dots .dot.active {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.4);
    transform: scale(1.1);
}

.carousel-dots .dot:hover {
    background: rgba(255,255,255,0.9);
    transform: scale(1.2);
}

/* 关键修复：添加图片预加载样式 */
.b2ripro-bg-carousel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    z-index: 0;
}

/* 确保图片加载后显示 */
.b2ripro-bg-carousel .slide-item[style*="background-image"] {
    background-attachment: scroll !important;
}

/* 调试样式 - 可以临时添加来检查问题 */
.debug .b2ripro-bg-carousel {
    border: 3px solid red !important;
}

.debug .b2ripro-bg-carousel .slide-item {
    border: 2px solid blue !important;
}

.debug .b2ripro-bg-carousel .slide-item.active {
    border: 2px solid green !important;
}

.debug .b2ripro-overlay {
    border: 3px solid yellow !important;
}

.debug .b2ripro-inner {
    border: 3px solid purple !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
        .search-icon {
        left: 15px;
        width: 18px;
        height: 18px;
    }
    
    .b2ripro-form input[type="search"] {
        padding: 14px 20px 14px 45px;
        font-size: 14px;
    }
    
    .b2ripro-form button {
        padding: 14px 20px;
        font-size: 14px;
    }
    .b2ripro-title {
        font-size: 2rem;
    }
    
    .b2ripro-desc {
        font-size: 1rem;
    }
    
    .b2ripro-inner {
        padding: 30px 15px;
    }
    
    .carousel-dots {
        bottom: 20px;
        padding: 8px 15px;
        gap: 8px;
    }
    
    .carousel-dots .dot {
        width: 12px;
        height: 12px;
    }
}