/* =============================================
   Custom Elementor Addons - Accordion Panel
   ============================================= */

/* 容器：横向排列 */
.yk-accordion-panel {
    display: flex;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* ---- 单个面板 ---- */
.yk-panel-item {
    position: relative;
    flex: 1;
    min-width: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    overflow: hidden;
    transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 展开态占更大比例 */
.yk-panel-item.is-active {
    flex: 3;
}

/* 暗色遮罩 */
.yk-panel-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.65) 100%);
    opacity: 0.45;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.yk-panel-item.is-active::before {
    opacity: 0.5;
}

/* ---- 内容区：上下居中，左对齐 ---- */
.yk-panel-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 30px;
    color: #fff;
}

/* ---- 图标：始终靠左 ---- */
.yk-panel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    line-height: 1;
    transition: transform 0.3s ease;
}

/* 带边框样式 */
.yk-panel-icon.has-border {
    width: 70px;
    height: 70px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.yk-panel-icon i {
    font-size: 42px;
    color: #fff;
}

.yk-panel-icon svg {
    width: 42px;
    height: 42px;
    fill: #fff;
}

/* ---- 标题：支持 HTML 内容 ---- */
.yk-panel-title {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    margin: 0;
    transition: font-size 0.35s ease;
}

/* 收缩态标题缩小 */
.yk-panel-item:not(.is-active) .yk-panel-title {
    font-size: 16px;
}

/* ---- 按钮区域：始终可见（和标题紧挨，间距由控件控制） ---- */
.yk-panel-btn-wrap {
    margin-top: 16px;
    transition: margin-top 0.35s ease;
}

/* 按钮样式 */
.yk-panel-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: gap 0.3s ease;
}

.yk-panel-btn:hover {
    color: #fff;
    gap: 14px;
}

/* 按钮文字：收缩态隐藏 */
.yk-btn-text {
    transition: opacity 0.3s ease, max-width 0.3s ease;
    overflow: hidden;
    white-space: nowrap;
}

.yk-panel-item:not(.is-active) .yk-btn-text {
    opacity: 0;
    max-width: 0;
    /* 文字收起后 gap 也要消掉 */
    display: none;
}

.yk-panel-item.is-active .yk-btn-text {
    opacity: 1;
    max-width: 200px;
    display: inline;
}

/* 箭头圆圈：始终显示 */
.yk-btn-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.yk-btn-arrow svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
}

.yk-panel-btn:hover .yk-btn-arrow {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.9);
}

/* =============================================
   收缩态 - 图标靠左，内容居中
   ============================================= */
.yk-panel-item:not(.is-active) .yk-panel-content {
    justify-content: center;
    align-items: flex-start;
    padding: 30px 20px;
}

.yk-panel-item:not(.is-active) .yk-panel-icon {
    margin-bottom: 14px;
}

/* =============================================
   响应式 - 平板（<= 1024px）
   ============================================= */
@media (max-width: 1024px) {
    .yk-panel-item.is-active {
        flex: 2.5;
    }

    .yk-panel-content {
        padding: 30px 20px;
    }

    .yk-panel-item.is-active .yk-panel-title {
        font-size: 20px;
    }

    .yk-panel-item:not(.is-active) .yk-panel-title {
        font-size: 14px;
    }
}

/* =============================================
   响应式 - 移动端（<= 768px）
   竖向堆叠布局
   ============================================= */
@media (max-width: 768px) {
    .yk-accordion-panel {
        flex-direction: column;
        height: auto !important;
    }

    .yk-panel-item {
        flex: none;
        height: 80px;
        transition: height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .yk-panel-item.is-active {
        flex: none;
        height: 280px;
    }

    .yk-panel-content {
        padding: 20px 20px;
    }

    /* 收缩态：横向排列图标、标题、箭头 */
    .yk-panel-item:not(.is-active) .yk-panel-content {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        padding: 15px 20px;
    }

    .yk-panel-item:not(.is-active) .yk-panel-icon {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .yk-panel-item:not(.is-active) .yk-panel-icon.has-border {
        width: 46px;
        height: 46px;
    }

    .yk-panel-item:not(.is-active) .yk-panel-icon i {
        font-size: 22px;
    }

    .yk-panel-item:not(.is-active) .yk-panel-icon svg {
        width: 22px;
        height: 22px;
    }

    .yk-panel-item:not(.is-active) .yk-panel-title {
        font-size: 15px;
        margin: 0;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* 收缩态按钮区域靠右，只显示箭头 */
    .yk-panel-item:not(.is-active) .yk-panel-btn-wrap {
        margin-top: 0;
        margin-left: auto;
        flex-shrink: 0;
    }

    .yk-panel-item.is-active .yk-panel-title {
        font-size: 20px;
    }

    .yk-panel-item.is-active .yk-panel-content {
        justify-content: center;
        padding-bottom: 30px;
    }
}

/* =============================================
   响应式 - 小屏手机（<= 480px）
   ============================================= */
@media (max-width: 480px) {
    .yk-panel-item.is-active {
        height: 240px;
    }

    .yk-panel-item {
        height: 70px;
    }

    .yk-panel-item.is-active .yk-panel-title {
        font-size: 18px;
    }

    .yk-panel-content {
        padding: 15px;
    }
}
