/* ==============
   命名空间：使用你模板已有的 .custom-product-page（避免冲突）
   ============== */
.custom-product-page {
    padding: 20px;
    box-sizing: border-box;
}
.custom-product-page .shop-breadcrumb{
    margin-bottom: 30px;
    color: #767676;
}
.custom-product-page .product-mobile-head{
    display: none;
    margin-bottom: 20px;
}

/* 主体布局 */
.custom-product-page .product-main {
    display: flex;
    /*flex-wrap: wrap;*/
    gap: 40px;
}

/* 图册区域 */
.custom-product-page .product-main .product-gallery {
    flex: 1 1 45%;
    --product-gallery-max-width: 500px;
    --product-gallery-max-height: 500px;
    max-width: var(--product-gallery-max-width);
    box-sizing: border-box;
}

.custom-product-page .product-main .product-gallery .main-image,
.custom-product-page .product-main .product-gallery img.main-image {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    object-fit: cover;
}

/* 缩略图容器（如果存在） */
.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper{
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}
.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .thumb-arrow{
    position: absolute;
    border: 1px solid #dcdcdc;
    border-radius: 20px;
    display: flex;
    background-color: #ffffff;
    padding: 5px;
    cursor: pointer;
    z-index: 10;
}
.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .thumb-arrow:hover{
    background-color: #f2f2f2;
}
.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .thumb-arrow.thumb-prev{
    left: 0;
}
.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .thumb-arrow.thumb-right{
    right: 0;
}
.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .gallery-thumbs {
    display: flex;
    gap: 10px;
    padding: 5px;
    overflow-x: auto;
    scrollbar-width: none;
}
.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .gallery-thumbs::-webkit-scrollbar{
    display: none;
}

.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .gallery-thumbs .gallery-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .18s, transform .18s;
}

.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .gallery-thumbs .gallery-thumb:hover {
    border-color: #aaa;
    transform: translateY(-2px);
}

.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .gallery-thumbs .gallery-thumb.active {
    border-color: var(--wp--preset--color--primary, #ff6600);
}
.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .gallery-thumbs .gallery-thumb.video-thumb {
    background: #000;
    color: #fff;
    font-size: 20px;
}
.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .gallery-thumbs .gallery-thumb.video-thumb.active {
    transform: translateY(-2px) scale(1.02);
}
.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .gallery-thumbs .gallery-thumb.video-thumb .video-thumb-icon{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 70px;
    height: 70px;
}

/* 产品信息区 */
.custom-product-page .product-main .product-info {
    flex: 1 1 45%;
    box-sizing: border-box;
}

.custom-product-page .product-main .product-info h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 10px;
}

.custom-product-page .product-main .product-info .base-info{
    --table-min-width: 60%;
    --table-width: fit-content;
}
.custom-product-page .product-main .product-info .base-info:last-child {
    margin-bottom: 12px;
}
.custom-product-page .product-main .product-info .base-info .product-btn{
    display: grid;
    grid-template-columns: 1fr 1fr 0;
    min-width: var(--table-min-width);
    width: var(--table-width);
    gap: 20px;
}
.custom-product-page .product-main .product-info .base-info .product-btn>div{
}
.custom-product-page .product-main .product-info .base-info .product-btn button{
    font-size: 16px;
    width: 100%;
    height: 100%;
}
.custom-product-page .product-main .product-info .base-info table{
    border-collapse: collapse;
    line-height: 1.6;
    margin: 15px 0 25px;
    padding: 15px 18px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    width: var(--table-width);
    max-width: 100%;
    font-size: 14px;
    color: #666;
    min-width: var(--table-min-width);
}
.custom-product-page .product-main .product-info .base-info table tr{
    border-bottom: 1px solid #eaeaea;
}
.custom-product-page .product-main .product-info .base-info table tr:last-child{
    border-bottom: none;
}
.custom-product-page .product-main .product-info .base-info table tr:hover td{
    background: #f3f3f3;
    transition: 0.2s;
}
.custom-product-page .product-main .product-info .base-info table tr td{
    padding: 10px 20px;
}
.custom-product-page .product-main .product-info .base-info table tr td:first-child{
    padding-right: 18px;
    white-space: nowrap;
    font-weight: 600;
    color: #555;
    text-align: left;
}
.custom-product-page .product-main .product-info .base-info table tr td:last-child{
    color: #5e5e5e;
}

.custom-product-page .product-main .product-info .product-price {
    font-size: 26px;
    font-weight: 700;
    color: var(--wp--preset--color--primary, #ff6600);
    margin-bottom: 18px;
}

/* 货币切换器和短描述 */
.custom-product-page .product-main .product-info .currency-switcher {
    margin-bottom: 14px;
}

.custom-product-page .product-main .product-info .product-short-description {
    font-size: 15px;
    color: #444;
    margin: 16px 0;
}

/* Add to Cart 表单 */
.custom-product-page .product-main .product-info form.cart {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.custom-product-page .product-main .product-info form.cart .quantity input,
.custom-product-page .product-main .product-info form.cart input.qty {
    padding: 8px;
    width: 80px !important;
    box-sizing: border-box;
}

.custom-product-page .product-main .product-info form.cart .single_add_to_cart_button {
    padding: 10px 18px !important;
    background: var(--wp--preset--color--primary, #ff6600) !important;
    color: #fff !important;
    border-radius: 6px !important;
    border: none !important;
    cursor: pointer;
    transition: opacity .15s, transform .08s;
}

.custom-product-page .product-main .product-info form.cart .single_add_to_cart_button:hover {
    opacity: .92;
}

/* 表单内的其他按钮（若有）*/
.custom-product-page .product-main .product-info .cart .button.secondary,
.custom-product-page .product-main .product-info .cart .button.alt {
    border-radius: 6px;
}

/* 标签切换（描述/评论） */
.custom-product-page .product-tabs {
    margin-top: 40px;
}

.custom-product-page .product-tabs .tabs-nav {
    list-style: none;
    padding: 0;
    margin: 0 0 18px 0;
    display: flex;
    gap: 20px;
    border-bottom: 2px solid #eee;
}

.custom-product-page .product-tabs .tabs-nav li a {
    padding: 8px 4px;
    font-size: 16px;
    color: #444;
    text-decoration: none;
    display: inline-block;
    border-bottom: 2px solid transparent;
}

.custom-product-page .product-tabs .tabs-nav li.active a,
.custom-product-page .product-tabs .tabs-nav li a.active {
    border-color: var(--wp--preset--color--primary, #ff6600);
    color: var(--wp--preset--color--primary, #ff6600);
    font-weight: 700;
}

.custom-product-page .product-tabs .tab-content {
    padding: 6px 0;
    font-size: 15px;
    color: #333;
    scroll-margin-top: var(--header-height);
}
.custom-product-page .product-tabs .tab-content .product-detail-panels{
    display: grid;
    grid-template-columns: 2fr 1fr;
    padding: 20px 0 40px;
    align-items: start;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .detail-section{
    margin-bottom: 45px;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .detail-section-title{
    font-size: 26px;
    font-weight: 700;
    color: #222;
    margin-bottom: 18px;
    padding-left: 14px;
    border-left: 4px solid #ff6a00;
    scroll-margin-top: var(--header-height);
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .detail-section-content table{
    width: 100%;
    border-collapse: separate;
    border-bottom: 1px solid #ececec;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .detail-section-content table th{
    border-right: 1px solid #ececec;
    background-color: #f2f2f2;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .detail-section-content table td{
    border-top: 1px solid #ececec;
    border-right: 1px solid #ececec;
    padding: 10px;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .detail-section-content table th:first-child,
.custom-product-page .product-tabs .tab-content .product-detail-panels .detail-section-content table td:first-child{
    border-left: 1px solid #ececec;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels #faq-content.detail-section-title + * > *{
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    padding: 10px;
    margin-bottom: 10px;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .detail-section-content{
    font-size: 16px;
    line-height: 1.75;
    color: #333;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .detail-section-content img{
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 15px 0;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .product-params-table{
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .product-params-table tr{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-left: 1px solid #ececec;
    border-right: 1px solid #ececec;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .product-params-table tr:first-child{
    border-top: 1px solid #ececec;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .product-params-table tr:last-child{
    border-bottom: 1px solid #ececec;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .product-params-table tr:last-child td{
    border-bottom: unset;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .product-params-table tr:hover{
    background: #fafafa;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .product-params-table tr td{
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #ececec;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .product-params-table tr td:first-child{
    border-right: 1px solid #ececec;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .product-params-table tr td span.param-label{
    font-weight: 600;
    color: #333;
    margin-right: 10px;
    flex: 1;
    word-break: break-word;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .product-params-table tr td span.param-value{
    color: #555;
    flex: 2;
}

.custom-product-page .product-tabs .tab-content .product-detail-panels .sticky-nav {
    position: sticky;
    /*top: 80px;*/
    top: var(--header-height);
    background: #fff;
    padding: 18px 20px;
    border-radius: 10px;
    border: 1px solid #e6e6e6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    margin-left: auto;    /* 让它贴靠右边，不占太多空间 */
    width: 90%;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .sticky-nav .nav-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #222;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .sticky-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .sticky-nav li {
    /*
    margin: 6px 0;
    padding: 4px 0;
    border-left: 2px solid transparent;
    transition: 0.2s;
     */
    padding: 14px 12px;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .sticky-nav li:last-child{
    border-bottom: none;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .sticky-nav li:hover{
    /*border-left-color: #ff7a00;*/
    background: #f0f0f0;
    transform: translateX(4px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .sticky-nav a {
    text-decoration: none;
    font-size: 15px;
    color: #444;
    display: block;
    padding-left: 8px;
    transition: 0.2s;
}
.custom-product-page .product-tabs .tab-content .product-detail-panels .sticky-nav a.active{
    font-weight: 600;
    color: #ff7a00;
    border-left-color: #ff7a00;
}


/* 仅影响本模板输出的产品列表卡片 */
.custom-product-page .woocommerce ul.products li.product {
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* ==============
   产品主图：鼠标跟随放大镜
   扩展自你的 .custom-product-page 命名空间
   ============== */

/* 放大镜容器 */
.custom-product-page .product-main .product-gallery {
    position: relative;
}

/* 放大镜 lens（跟随鼠标的透明小窗） */
.custom-product-page .product-main .product-gallery .zoom-lens {
    position: absolute;
    pointer-events: none;
    width: 150px;              /* 放大镜可调整 */
    height: 150px;
    /*border: 2px solid #ddd;*/
    border-radius: 8px;
    background-repeat: no-repeat;
    background-size: 200%;     /* 放大倍数 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    display: none;
    z-index: 20;
}

/* 主图鼠标移入时变得更清晰 */
.custom-product-page .product-main .product-gallery .main-image {
    /*cursor: zoom-in;*/
    transition: opacity .2s ease;
}

/* 缩略图（你的基础上增强 active 和 hover 效果） */
.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .gallery-thumbs .gallery-thumb {
    position: relative;
    transition: border-color .18s, transform .18s, opacity .18s;
}

/* 鼠标在主图上时，缩略图稍微变暗，突出焦点 */
.custom-product-page .product-main .product-gallery:hover .gallery-thumbs-wrapper .gallery-thumbs .gallery-thumb {
    opacity: .75;
}

.custom-product-page .product-main .product-gallery:hover .gallery-thumbs-wrapper .gallery-thumbs .gallery-thumb.active {
    opacity: 1;
}

/* active 样式保持你的主色 */
.custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .gallery-thumbs .gallery-thumb.active {
    border-color: var(--wp--preset--color--primary, #ff6600);
    transform: translateY(-2px) scale(1.02);
}

/* 主图外层容器 */
.custom-product-page .product-main .product-gallery .main-image-wrapper {
    position: relative;
    overflow: hidden; /* 放大镜不会溢出 */
    width: var(--product-gallery-max-width);
    height: var(--product-gallery-max-height);
}
.custom-product-page .product-main .product-gallery .main-image-wrapper .product-video-wrapper{
    display:none;
    width: 100%;
    height: 100%;
    background-color: #000000;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.custom-product-page .product-main .product-gallery .main-image-wrapper .product-video-wrapper video{
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* 放大镜只在主图上面显示，不覆盖缩略图 */
.custom-product-page .product-main .product-gallery .zoom-lens {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 20;
}


/* 响应式 */
@media (max-width: 1280px) {
    .custom-product-page .product-main .product-info .base-info{
        --table-min-width: 80%;
    }
}
@media (max-width: 1100px) {
    .custom-product-page .product-main .product-info .base-info{
        --table-min-width: 100%;
    }
}
@media (max-width: 900px) {
    .custom-product-page .product-mobile-head{
        display: block;
    }
    .custom-product-page .product-main {
        flex-direction: column;
    }
    .custom-product-page .product-main .product-gallery,
    .custom-product-page .product-main .product-info {
        flex: 1 1 100%;
        max-width: 100%;
    }
    .custom-product-page .product-main .product-gallery .main-image-wrapper{
        width: 100%;
        height: 750px;
    }
    .custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .gallery-thumbs .gallery-thumb{
        width: 120px;
        height: 120px;
    }
    .custom-product-page .product-main .product-gallery .gallery-thumbs-wrapper .gallery-thumbs .gallery-thumb.video-thumb .video-thumb-icon{
        width: 120px;
        height: 120px;
    }
    .custom-product-page .product-tabs .tab-content .product-detail-panels {
        grid-template-columns: 1fr;
    }
    .custom-product-page .product-tabs .tab-content .product-detail-panels .sticky-nav {
        display: none;
    }
}
@media (max-width: 768px) {
    .custom-product-page .product-main .product-info .base-info {
        width: 100%;
    }
    .custom-product-page .product-tabs .tab-content .product-detail-panels .detail-section-title {
        font-size: 22px;
    }
    .custom-product-page .product-tabs .tab-content .product-detail-panels {
        padding: 10px 5px;
    }
    .custom-product-page .product-tabs .tab-content .product-detail-panels .product-params-table tr{
        grid-template-columns: repeat(1,1fr);
    }
    .custom-product-page .product-tabs .tab-content .product-detail-panels .product-params-table tr:hover{
        background: unset;
    }
    .custom-product-page .product-tabs .tab-content .product-detail-panels .product-params-table tr td:hover{
        background: #fafafa;
    }
    .custom-product-page .product-tabs .tab-content .product-detail-panels .product-params-table tr td:first-child{
        border-right: unset;
    }
}
@media (max-width: 650px) {
    .custom-product-page .product-main .product-gallery .main-image-wrapper{
        height: 550px;
    }
}
@media (max-width: 570px) {
    .custom-product-page .product-main .product-info .base-info .product-btn{
        grid-template-columns: 1fr;
    }
}
@media (max-width: 550px) {
    .custom-product-page .product-main .product-gallery .main-image-wrapper{
        height: 450px;
    }
}
@media (max-width: 450px) {
    .custom-product-page .product-main .product-gallery .main-image-wrapper{
        height: 380px;
    }
}
@media (max-width: 400px) {
    .custom-product-page .product-main .product-gallery .main-image-wrapper{
        height: 340px;
    }
}