/* 四项 Tab 通用设置：1280px 是内容宽度，其余尺寸使用 em。 */
#nasa-single-product-tabs .product-tabs {
    --product-tabs-top: 0em; /* 有固定页头时，填写它占据的高度 */
    --description-preview-height: 150em; /* 桌面端折叠预览高度 */
    --description-fade-height: 8em; /* 底部渐隐范围 */
    --description-preview-background: #fff; /* 与详情区域底色一致 */
    position: relative;
    width: 100%;
    overflow: visible;
}

#nasa-single-product-tabs.product-tabs-ready > .oLRbYDmA {
    display: none !important;
}

/* 背景通栏，四个标题在 1280px 区域内左对齐。 */
#nasa-single-product-tabs .product-tabs-nav {
    position: sticky;
    top: var(--product-tabs-top);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 1.6em;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 1em max(1em, calc((100% - 1280px) / 2));
    background: #1d1d1f;
    overflow-x: auto;
}

#nasa-single-product-tabs .product-tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #aaa;
    font: inherit;
    font-size: 1.125em;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: none;
}

#nasa-single-product-tabs .product-tab-button:hover,
#nasa-single-product-tabs .product-tab-button.is-active {
    background: transparent;
    color: #009ac5;
}

#nasa-single-product-tabs .product-tab-button:focus-visible,
#nasa-single-product-tabs .product-description-toggle:focus-visible {
    outline: 0.125em solid #009ac5;
    outline-offset: 0.3em;
}

/* 参数、媒体、评论保持最大 1280px 居中。 */
#nasa-single-product-tabs .product-tabs > .product-tab-panel {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

#nasa-single-product-tabs .product-tabs > .product-tab-panel[hidden] {
    display: none !important;
}

/* Description 保留原本通栏的 Elementor 详情布局。 */
#nasa-single-product-tabs .product-tabs > .product-description-panel {
    max-width: none;
    margin: 0;
    padding: 0;
    background: var(--description-preview-background);
}

#nasa-single-product-tabs .product-description-preview {
    position: relative;
    display: flow-root;
    max-height: var(--description-preview-height);
    overflow: hidden;
}

/* 渐隐层只做视觉遮罩，不拦截点击。 */
#nasa-single-product-tabs .product-description-preview::after {
    content: "";
    position: absolute;
    z-index: 5;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--description-fade-height);
    max-height: 100%;
    background: linear-gradient(to bottom, transparent, var(--description-preview-background) 90%);
    pointer-events: none;
}

#nasa-single-product-tabs .product-description-panel.is-expanded > .product-description-preview {
    max-height: none;
    overflow: visible;
}

#nasa-single-product-tabs .product-description-panel.is-expanded > .product-description-preview::after {
    display: none;
}


/* 独立的白底按钮区：不依赖原详情面板的背景色。 */
#nasa-single-product-tabs .product-description-controls {
    position: relative;
    z-index: 6;
    display: flow-root;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: var(--description-preview-background, #fff);
}

/* 居中的圆形展开/收起按钮，箭头随状态翻转。 */
#nasa-single-product-tabs .product-description-toggle {
    position: relative;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3em;
    height: 3em;
    min-width: 0;
    min-height: 0;
    margin: 0.5em auto 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #009ac5;
    box-shadow: 0 0.1em 0.5em #0002;
    font-size: 1em;
    line-height: 1;
    cursor: pointer;
}

#nasa-single-product-tabs .product-description-toggle::before {
    content: "";
    display: block;
    width: 0.9em;
    height: 0.9em;
    margin-top: -0.4em;
    border-right: 0.125em solid currentColor;
    border-bottom: 0.125em solid currentColor;
    transform: rotate(45deg);
}

#nasa-single-product-tabs .product-description-panel.is-expanded .product-description-toggle::before {
    margin-top: 0.4em;
    transform: rotate(225deg);
}


/* 蓝色渐变按钮 */
#nasa-single-product-tabs .product-description-toggle {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 3.6em;
    height: 3.6em;
    margin: 1em auto 0.5em;
    border: 0.125em solid #ffffffb3;
    background: linear-gradient(135deg, #00bddb, #009ac5 55%, #0078ae);
    color: #fff;
    box-shadow:
        0 0.3em 0.9em #009ac54d,
        0 0 1.2em #00bddb33;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* 白色箭头 */
#nasa-single-product-tabs .product-description-toggle::before {
    position: relative;
    z-index: 2;
    width: 0.9em;
    height: 0.9em;
    margin-top: -0.4em;
    border-right: 0.16em solid currentColor;
    border-bottom: 0.16em solid currentColor;
    transform: rotate(45deg);
}

/* 收起状态的向上箭头 */
#nasa-single-product-tabs .product-description-panel.is-expanded .product-description-toggle::before {
    margin-top: 0.4em;
    transform: rotate(225deg);
}

/* 斜向流光，限制在圆形按钮内部 */
#nasa-single-product-tabs .product-description-toggle::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: -50%;
    left: 0;
    width: 55%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent,
        #ffffff80,
        transparent
    );
    pointer-events: none;
    transform: translateX(-220%) skewX(-25deg);
    animation: productDescriptionShine 2s ease-in-out infinite;
}

#nasa-single-product-tabs .product-description-toggle:hover {
    transform: translateY(-0.15em);
    box-shadow:
        0 0.4em 1em #009ac566,
        0 0 1.5em #00bddb55;
}

@keyframes productDescriptionShine {
    0%, 25% {
        transform: translateX(-220%) skewX(-25deg);
    }
    65%, 100% {
        transform: translateX(320%) skewX(-25deg);
    }
}

/* 尊重系统的减少动态效果设置 */
@media (prefers-reduced-motion: reduce) {
    #nasa-single-product-tabs .product-description-toggle::after {
        animation: none;
    }
    #nasa-single-product-tabs .product-description-toggle {
        transition: none;
    }
}

@media (max-width: 767px) {
    #nasa-single-product-tabs .product-tabs {
        --description-preview-height: 60em;
        --description-fade-height: 6em;
    }
    #nasa-single-product-tabs .product-tabs-nav {
        gap: 1.2em;
        padding: 0.9em 1em;
    }
    #nasa-single-product-tabs .product-tab-button {
        font-size: 1em;
    }
}
