/* 外层容器：去掉垂直居中，添加最小高度（确保侧边栏有足够高度） */
.geniatech-info-bar-wrapper {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin: 40px auto;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    min-height: 180px; /* 可选：确保侧边栏有足够高度（可调整） */
}

/* 红色侧边栏：100%高度+内部文字上下居中 */
.geniatech-info-bar-sidebar {
    background-color: #ef4444;
    color: #ffffff;
    padding: 20px;
    min-width: 160px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 侧边栏标题：保持原有样式（无需额外调整，Flex会处理居中） */
.geniatech-info-bar-sidebar h2 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

/* 关键：箭头与侧边栏无缝连接（调整尺寸与定位） */
.geniatech-info-bar-sidebar::after {
    content: '';
    position: absolute;
    top: 50%; /* 垂直居中（相对于侧边栏） */
    right: -15px; /* 箭头向右偏移15px（与border-left宽度一致） */
    transform: translateY(-50%); /* 抵消top:50%的偏移，实现精准居中 */
    width: 0;
    height: 0;
    /* 箭头尺寸：border-left宽度=箭头宽度，border-top/bottom=箭头高度的一半 */
    border-top: 15px solid transparent; /* 上透明 */
    border-bottom: 15px solid transparent; /* 下透明 */
    border-left: 15px solid #e70d16; /* 左边界：与侧边栏同色（无缝连接） */
}

/* 服务列表容器：调整左边padding（减少与箭头的间隔） */
.geniatech-info-bar-services {
    display: flex;
    flex: 1;
    padding: 32px 24px 32px 24px; /* 左边padding减少至24px（与箭头更接近） */
    gap: 40px;
    justify-content: space-between;
    align-items: center; /* 列表项垂直居中（可选，与侧边栏文字对齐） */
}

/* 单个服务项：保持原有样式 */
.geniatech-service-item {
    flex: 1;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 服务项链接 */
.geniatech-service-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* 服务图片样式 */
.geniatech-service-item img {
    width: auto!important;
    height: 60px;
    object-fit: cover;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    display: block;
    border-radius: 8px;
}

/* 服务文字：保持原有样式 */
.geniatech-service-item p {
    font-size: 15px;
    color: #4a5568;
    line-height: 1.6;
    font-weight: 500;
    margin: 0;
}

/* hover交互效果（可选） */
.geniatech-service-item:hover {
    transform: translateY(-3px);
}

.geniatech-service-item:hover img {
    transform: scale(1.1);
}

.geniatech-service-item:hover p {
    color: #2d3748;
}

/* 响应式设计（手机端）：保持左右结构，右侧横向滑动 */
@media (max-width: 768px) {
    .geniatech-info-bar-wrapper {
        flex-direction: row; /* 保持左右结构 */
        align-items: stretch;
        margin: 16px;
        min-height: auto; /* 手机端取消最小高度 */
    }

    .geniatech-info-bar-sidebar {
        min-width: 140px; /* 固定左侧宽度，避免换行 */
        padding: 24px 16px;
        height: auto;
    }

    .geniatech-info-bar-services {
        display: flex;
        flex-direction: row; /* 横向排列 */
        flex-wrap: nowrap; /* 不换行 */
        justify-content: flex-start; /* 左对齐，便于横向滚动 */
        align-items: center;
        gap: 16px;
        padding: 16px;
        overflow-x: auto; /* 超出隐藏，横向滑动显示 */
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch; /* 提升iOS滑动体验 */
    }

    /* 隐藏移动端滚动条（可选） */
    .geniatech-info-bar-services::-webkit-scrollbar { height: 0; }
    .geniatech-info-bar-services { scrollbar-width: none; }
    .geniatech-info-bar-services::-webkit-scrollbar-thumb { background: transparent; }

    .geniatech-service-item {
        flex: 0 0 auto; /* 固定宽度，避免被拉伸 */
    }
}

/* 平板端调整 */
@media (max-width: 1024px) and (min-width: 769px) {
    .geniatech-info-bar-services {
        gap: 24px;
        padding: 24px 16px;
    }

    .geniatech-service-item img {
        width: auto !important;
        height: 48px;
        margin-bottom: 16px;
    }

    .geniatech-service-item p {
        font-size: 14px;
    }
}

/* 小屏幕优化 */
@media (max-width: 480px) {
    .geniatech-info-bar-wrapper {
        margin: 8px;
    }

    .geniatech-info-bar-sidebar {
        padding: 16px;
    }

    .geniatech-info-bar-sidebar h2 {
        font-size: 18px;
    }

    .geniatech-info-bar-services {
        gap: 24px;
        padding: 16px;
    }

    .geniatech-service-item img {
        width: auto !important;
        height: 40px;
        margin-bottom: 12px;
    }

    .geniatech-service-item p {
        font-size: 13px;
    }
}

/* Elementor编辑器中的样式调整 */
.elementor-editor-active .geniatech-info-bar-wrapper {
    pointer-events: auto;
}

.elementor-editor-active .geniatech-service-item {
    pointer-events: auto;
}

/* 确保图片正确显示 */
.geniatech-service-item img {
    max-width: 100%;
    height: auto;
}

/* 加载动画 */
.geniatech-info-bar-wrapper.loading {
    opacity: 0.7;
}

.geniatech-info-bar-wrapper.loading .geniatech-service-item {
    animation: service-fade-in 0.5s ease forwards;
}

@keyframes service-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 服务项延迟动画 */
.geniatech-service-item:nth-child(1) { animation-delay: 0.1s; }
.geniatech-service-item:nth-child(2) { animation-delay: 0.2s; }
.geniatech-service-item:nth-child(3) { animation-delay: 0.3s; }
.geniatech-service-item:nth-child(4) { animation-delay: 0.4s; }
.geniatech-service-item:nth-child(5) { animation-delay: 0.5s; }
.geniatech-service-item:nth-child(6) { animation-delay: 0.6s; }

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .geniatech-info-bar-wrapper {
        border-width: 2px;
        border-color: #000;
    }

    .geniatech-info-bar-sidebar {
        background-color: #000;
    }

    .geniatech-info-bar-sidebar::after {
        border-left-color: #000;
    }

    .geniatech-service-item img {
        filter: contrast(2);
    }

    .geniatech-service-item p {
        color: #000;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .geniatech-service-item {
        transition: none;
    }

    .geniatech-service-item img {
        transition: none;
    }

    .geniatech-service-item:hover {
        transform: none;
    }

    .geniatech-info-bar-wrapper.loading .geniatech-service-item {
        animation: none;
    }
}
