/* ============================================================
   PDP WC 原生输出桥接层 v3
   把 woocommerce_* 原生类皮肤成 prototype/product.html 视觉。
   依赖 product.css（原型静态类）与 glossiert-prototype-base.css（tokens）。
   ============================================================ */

/* ---- 面包屑（压过 Kadence 链接色） ---- */
.pdp-crumb { padding-top: 28px; }
.pdp-crumb .woocommerce-breadcrumb,
.pdp-crumb .woocommerce-breadcrumb a {
    font-size: 12px; color: var(--ink-500) !important; letter-spacing: .03em; margin: 0;
}
.pdp-crumb .woocommerce-breadcrumb a:hover { color: var(--gold-deep) !important; }
.pdp-crumb .woocommerce-breadcrumb .separator { margin: 0 8px; color: var(--ink-400); }

/* ---- 图库：WC gallery → 原型主图 + 5 缩略图 ---- */
.pdp-gallery .woocommerce-product-gallery { position: relative; margin: 0; }
.pdp-gallery .woocommerce-product-gallery__wrapper { margin: 0; }
/* flexslider 未初始化时兜底：只显示首张，避免 5 张堆叠撑高 */
.pdp-gallery .woocommerce-product-gallery__wrapper:not(.flexslider) { height: auto !important; overflow: visible !important; }
.pdp-gallery .woocommerce-product-gallery__wrapper:not(.flexslider) .woocommerce-product-gallery__image { display: none !important; }
.pdp-gallery .woocommerce-product-gallery__wrapper:not(.flexslider) .woocommerce-product-gallery__image:first-child { display: block !important; }
.pdp-gallery .woocommerce-product-gallery__image {
    border-radius: var(--radius-lg); overflow: hidden; background: var(--ivory);
    aspect-ratio: 1 / 1; box-shadow: var(--shadow-sm); margin: 0; position: relative;
}
.pdp-gallery .woocommerce-product-gallery__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-gallery .flex-control-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
    margin: 12px 0 0; padding: 0; list-style: none;
}
.pdp-gallery .flex-control-nav li { margin: 0; }
.pdp-gallery .flex-control-nav img {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
    border-radius: var(--radius-sm); border: 2px solid transparent; cursor: pointer; display: block; padding: 0;
}
.pdp-gallery .flex-control-nav li.flex-active img,
.pdp-gallery .flex-control-nav li:first-child img { border-color: var(--gold-deep); }
.pdp-gallery .woocommerce-product-gallery__trigger {
    background: rgba(28,23,18,.55) !important; border-radius: 50%; width: 38px; height: 38px;
}
.pdp-gallery .woocommerce-product-gallery__trigger img { filter: invert(1); width: 16px; height: 16px; }
.pdp-gallery .woocommerce-product-gallery__image .zoomImg { border-radius: var(--radius-lg); }

/* ---- 右栏：标题 / 评分 / 价格 / 摘要 ---- */
.pdp-info .product_title {
    font-family: var(--font-display); font-size: 34px; font-weight: 600;
    line-height: 1.2; color: var(--charcoal); margin: 10px 0 12px;
}
.pdp-info .woocommerce-product-rating {
    display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
    font-size: 13px; color: var(--ink-500); flex-wrap: wrap;
}
.pdp-info .woocommerce-product-rating .star-rating { margin: 0; }
.pdp-info .woocommerce-product-rating a.woocommerce-review-link { color: var(--gold-deep); text-decoration: underline; }
.pdp-info .price {
    font-family: var(--font-display); font-size: 28px; font-weight: 600;
    color: var(--charcoal); margin-bottom: 18px; display: block;
}
.pdp-info .price del { font-size: 16px; color: var(--ink-400); margin-right: 10px; font-weight: 400; }
.pdp-info .price ins { text-decoration: none; }
.pdp-info .woocommerce-product-details__short-description {
    color: var(--ink-600); font-size: 14.5px; line-height: 1.8; margin-bottom: 22px;
}
.pdp-info .woocommerce-product-details__short-description p { margin-bottom: 10px; }

/* ---- 变体表单 ---- */
.pdp-buy .variations { width: 100%; margin: 0 0 16px; }
.pdp-buy .variations table { width: 100%; border-collapse: collapse; }
.pdp-buy .variations tr { display: block; margin-bottom: 14px; }
.pdp-buy .variations td { display: block; padding: 0; }
.pdp-buy .variations label {
    font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--charcoal); margin-bottom: 8px; display: block;
}
.pdp-buy .variations select {
    width: 100%; padding: 11px 38px 11px 14px; border: 1px solid var(--line-300);
    border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; color: var(--charcoal);
    background-color: #fff; cursor: pointer; appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231C1712' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 12px;
    transition: border-color .2s ease;
}
.pdp-buy .variations select:focus { outline: none; border-color: var(--gold-deep); }
/* WVS 变体按钮（Color/Size/Material 若渲染为按钮）通用皮肤 */
.pdp-buy .variations button,
.pdp-buy .variations .wvs-term button,
.pdp-buy .variations .wvs-button {
    border: 1px solid var(--line-300); border-radius: var(--radius-sm); background: #fff;
    color: var(--charcoal); font-family: inherit; font-size: 13px; font-weight: 500;
    padding: 8px 16px; min-height: 40px; cursor: pointer; margin: 0 8px 8px 0;
    transition: all .18s ease;
}
.pdp-buy .variations button:hover,
.pdp-buy .variations .wvs-term button:hover { border-color: var(--charcoal); }
.pdp-buy .variations button.active,
.pdp-buy .variations .wvs-term.active button,
.pdp-buy .variations .wvs-term.selected button,
.pdp-buy .variations .wvs-term button.active {
    border-color: var(--charcoal); background: var(--charcoal); color: var(--ivory);
}
.pdp-buy .wvs-wrapper { width: 100%; }
.pdp-buy .wvs-wrapper .wvs-label {
    font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--charcoal); margin-bottom: 8px; display: block;
}

/* ---- 购买行：数量 + 加购 + wishlist（wish 由钩子注入表单内） ---- */
.pdp-buy { display: flex; gap: 12px; margin: 24px 0 18px; align-items: stretch; flex-wrap: wrap; }
.pdp-buy form.cart { flex: 1 1 320px; margin: 0; display: block; }
.pdp-buy .single_variation_wrap { display: block; }
.pdp-buy .woocommerce-variation-add-to-cart {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px; width: 100%;
}
.pdp-buy .quantity {
    display: inline-flex; align-items: stretch; border: 1px solid var(--line-300);
    border-radius: var(--radius-sm); overflow: hidden; height: 48px; background: #fff; flex-shrink: 0;
}
.pdp-buy .quantity input.qty {
    width: 52px; height: 48px; border: 0; text-align: center; font-family: inherit;
    font-size: 15px; background: transparent; margin: 0;
}
.pdp-buy .quantity .plus, .pdp-buy .quantity .minus {
    width: 34px; height: 48px; border: 0; background: #faf7f2; color: var(--charcoal);
    font-size: 18px; cursor: pointer; line-height: 1; padding: 0;
}
.pdp-buy .single_add_to_cart_button,
.pdp-buy .single_add_to_cart_button.button,
.pdp-buy .single_add_to_cart_button.disabled,
.pdp-buy .single_add_to_cart_button.wc-variation-selection-needed {
    flex: 1 1 200px; min-height: 48px; background-color: var(--charcoal) !important;
    background-image: none !important; color: #fff !important; border: 1px solid var(--charcoal) !important;
    border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; cursor: pointer; padding: 0 28px; opacity: 1 !important;
    box-shadow: none !important; transition: background .2s ease, border-color .2s ease;
}
.pdp-buy .single_add_to_cart_button:hover,
.pdp-buy .single_add_to_cart_button:focus {
    background-color: var(--gold-deep) !important; border-color: var(--gold-deep) !important; color: #fff !important;
}
.pdp-buy .pdp-wish-btn {
    flex: 0 0 48px; width: 48px; height: 48px; border: 1px solid var(--line-300); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; background: #fff; flex-shrink: 0; align-self: center;
}
.pdp-buy .pdp-wish-btn svg { width: 20px; height: 20px; stroke: var(--charcoal); }
.pdp-buy .pdp-wish-btn:hover { border-color: var(--gold-deep); }
.pdp-buy .pdp-wish-btn:hover svg { stroke: var(--gold-deep); }

/* ---- 元信息 / 分享 ---- */
.pdp-info .product_meta { font-size: 13px; color: var(--ink-500); display: grid; gap: 7px; margin-top: 18px; }
.pdp-info .product_meta > span { display: block; }
.pdp-info .product_meta b, .pdp-info .product_meta .sku_wrapper b { color: var(--ink-700); font-weight: 600; display: inline-block; min-width: 74px; }
.pdp-info .product_meta a { color: var(--gold-deep); }
.pdp-info .product_meta .posted_in a, .pdp-info .product_meta .tagged_as a { margin-right: 6px; }
.pdp-info .share-buttons { margin-top: 14px; font-size: 13px; color: var(--ink-500); }
.pdp-info .share-buttons a { color: var(--gold-deep); margin-right: 10px; }

/* ---- 标签页：WC tabs → 原型 tab-nav / tab-panel ---- */
.pdp-tabs { margin-top: 10px; border-top: 1px solid var(--line-200); }
.pdp-tabs .woocommerce-tabs { margin: 0; }
.pdp-tabs .wc-tabs {
    display: flex; gap: 32px; border-bottom: 1px solid var(--line-200);
    overflow-x: auto; list-style: none; margin: 0; padding: 0;
}
.pdp-tabs .wc-tabs li { margin: 0; }
.pdp-tabs .wc-tabs a {
    display: block; padding: 18px 2px; font-size: 13.5px; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500);
    border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.pdp-tabs .wc-tabs li.active a { color: var(--charcoal); border-bottom-color: var(--gold-deep); }
.pdp-tabs .wc-tab { display: none; padding: 28px 0 10px; font-size: 14.5px; color: var(--ink-600); line-height: 1.8; }
.pdp-tabs .wc-tab.active { display: block; }
.pdp-tabs .wc-tab h2 { font-size: 22px; color: var(--charcoal); margin-bottom: 14px; }
.pdp-tabs .wc-tab ul { display: grid; gap: 8px; margin: 12px 0 0 20px; list-style: disc; }
.pdp-tabs .commentlist { list-style: none; margin: 0; padding: 0; }

/* ---- 相关产品 ---- */
.related.products { padding: 64px 0 80px; background: var(--surface-50); margin-top: 40px; }
.related.products > h2 { font-size: 32px; color: var(--charcoal); margin-bottom: 30px; }
.related.products ul.products {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px;
    list-style: none; margin: 0; padding: 0;
}
.related.products ul.products li.product { margin: 0; }
@media (max-width: 992px) {
    .related.products ul.products { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .related.products { padding: 44px 0 56px; }
    .related.products > h2 { font-size: 26px; }
    .related.products ul.products { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .pdp-info .product_title { font-size: 27px; }
    .pdp-buy { flex-direction: column; align-items: stretch; }
    .pdp-buy .pdp-wish-btn { width: 100%; height: 44px; flex: none; }
    .pdp-buy .single_add_to_cart_button { flex: 1 1 100%; }
}
