/* ==========================================================================
   拓步TIBO - WooCommerce 商城样式（Tmall 风格商品详情页）
   ========================================================================== */

.tibo-pdp {
    --pdp-red: #ff4400;
    --pdp-red-deep: #e63400;
    --pdp-gold: #ffb800;
    --pdp-ink: #1a1a1a;
    --pdp-muted: #888;
    --pdp-line: #eeeeee;
    --pdp-bg: #f5f5f5;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 16px var(--container-pad) 120px;
    color: var(--pdp-ink);
}

/* ---------- 店铺条 ---------- */
.tibo-store-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--pdp-line);
    margin-bottom: 18px;
}
.tibo-store-left { display: flex; align-items: center; gap: 14px; }
.tibo-store-logo {
    width: 52px; height: 52px; flex: 0 0 52px;
    background: #111; color: #fff;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 15px; letter-spacing: 1px;
}
.tibo-store-name {
    font-weight: 700; font-size: 16px; color: var(--pdp-ink);
    display: inline-flex; align-items: center; gap: 4px;
}
.tibo-store-arrow { color: #bbb; }
.tibo-store-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--pdp-muted); margin-top: 4px; }
.tibo-tmall-tag { color: var(--pdp-red); font-weight: 700; font-size: 12px; }
.tibo-store-stat { color: var(--pdp-muted); }
.tibo-store-actions { display: flex; gap: 10px; }
.tibo-store-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 20px; border-radius: 999px;
    border: 1px solid #ddd; font-size: 13px; color: #333; background: #fff;
}
.tibo-store-btn:hover { border-color: var(--pdp-red); color: var(--pdp-red); }

/* 星级 */
.tibo-stars { display: inline-flex; gap: 1px; color: #ddd; font-style: normal; }
.tibo-star { font-style: normal; font-size: 13px; }
.tibo-star.is-full { color: #ff9500; }
.tibo-rating-count { color: #ff9500; font-weight: 700; font-size: 12px; margin-left: 4px; }

/* ---------- 主体布局 ---------- */
.tibo-pdp-main {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

/* ---------- 图库 ---------- */
.tibo-gallery { display: flex; gap: 14px; }
.tibo-gallery-thumbs {
    display: flex; flex-direction: column; gap: 10px;
    width: 76px; flex: 0 0 76px;
    max-height: 520px; overflow-y: auto; padding-right: 2px;
}
.tibo-gallery-thumbs::-webkit-scrollbar { width: 4px; }
.tibo-gallery-thumbs::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
.tibo-thumb {
    width: 68px; height: 68px; flex: 0 0 68px;
    border: 2px solid transparent; border-radius: 8px;
    overflow: hidden; background: #f7f7f7; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .2s;
}
.tibo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tibo-thumb.is-active, .tibo-thumb:hover { border-color: var(--pdp-red); }
.tibo-thumb-specs { color: #999; background: #fafafa; flex-direction: column; }
.tibo-gallery-main {
    position: relative; flex: 1; min-width: 0;
    aspect-ratio: 1 / 1; background: #f7f7f7; border-radius: 12px;
    overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.tibo-gallery-img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; transition: opacity .25s; }
.tibo-sale-flag {
    position: absolute; top: 14px; left: 14px;
    background: var(--pdp-red); color: #fff;
    font-size: 12px; padding: 3px 10px; border-radius: 4px; font-weight: 700;
}
.tibo-gallery-zoom {
    position: absolute; right: 12px; bottom: 12px;
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,.92); border: 1px solid #eee;
    display: flex; align-items: center; justify-content: center; color: #555; cursor: pointer;
}
.tibo-gallery-zoom:hover { color: var(--pdp-red); }
.tibo-gallery-caption {
    margin-top: 18px; padding: 16px 20px; background: #fafafa; border-radius: 10px;
    font-size: 14px; line-height: 1.7; color: #555;
}
.tibo-gallery-caption h1, .tibo-gallery-caption h2, .tibo-gallery-caption h3 { font-size: 18px; margin-bottom: 8px; color: var(--pdp-ink); }
.tibo-gallery-modes { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.tibo-mode-chip { padding: 6px 18px; border-radius: 999px; background: #f2f2f2; font-size: 13px; color: #666; }
.tibo-mode-chip.is-active { background: #111; color: #fff; }

/* ---------- 右侧信息 ---------- */
.tibo-pdp-summary-col { min-width: 0; }
.tibo-vip-bar {
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(90deg, #fff3e6, #ffe9d6);
    border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; color: #a15a1a;
}
.tibo-vip-badge { background: #2b2b2b; color: #ffd28a; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 4px; }
.tibo-vip-text { flex: 1; }
.tibo-vip-action { color: #c57a2a; font-weight: 600; }

.tibo-product-title { font-size: 22px; line-height: 1.45; font-weight: 600; color: var(--pdp-ink); margin-bottom: 10px; }
.tibo-product-submeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--pdp-muted); margin-bottom: 16px; }
.tibo-product-submeta b { color: #666; }
.tibo-dot { color: #ddd; }

.tibo-price-block {
    display: flex; align-items: baseline; gap: 10px;
    padding: 4px 0 2px;
}
.tibo-price-label { font-size: 13px; color: var(--pdp-muted); }
.tibo-price-now { font-size: 34px; font-weight: 800; color: var(--pdp-red); }
.tibo-price-now .woocommerce-Price-currencySymbol { font-size: 20px; }
.tibo-price-now del { font-size: 15px; font-weight: 400; color: #bbb; margin-left: 8px; }
.tibo-price-now ins { text-decoration: none; }
.tibo-price-extra { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.tibo-price-extra span { font-size: 12px; color: #a15a1a; background: #fff3e6; padding: 3px 10px; border-radius: 4px; }
.tibo-price-extra em { color: var(--pdp-red); font-style: normal; font-weight: 700; }

/* 服务承诺 */
.tibo-services { list-style: none; border-top: 1px solid var(--pdp-line); border-bottom: 1px solid var(--pdp-line); padding: 14px 0; margin-bottom: 22px; }
.tibo-services li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 13px; color: #666; padding: 5px 0; }
.tibo-services svg { color: #999; flex: 0 0 auto; }
.tibo-svc-strong { color: #333; }
.tibo-svc-em { color: var(--pdp-red); }

/* 变体色卡 */
.tibo-variations { margin-bottom: 6px; }
.tibo-variation-group { margin-bottom: 18px; }
.tibo-variation-label { font-size: 13px; color: var(--pdp-muted); margin-bottom: 10px; }
.tibo-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.tibo-swatch {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 12px; border: 1px solid #e5e5e5; border-radius: 8px;
    background: #fff; font-size: 12px; color: #444; cursor: pointer;
    transition: all .15s;
}
.tibo-swatch:hover { border-color: #bbb; }
.tibo-swatch.is-active { border-color: var(--pdp-red); color: var(--pdp-red); box-shadow: inset 0 0 0 1px var(--pdp-red); }
.tibo-swatch.is-disabled { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.tibo-swatch-dot {
    width: 16px; height: 16px; border-radius: 50%; flex: 0 0 16px;
    background: #ddd center/cover no-repeat;
    border: 1px solid rgba(0,0,0,.08);
}
.tibo-hidden-select { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.reset_variations { font-size: 12px; color: #bbb; }

/* 数量 + 加购 */
.tibo-buy-area { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.tibo-buy-area form.cart { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 0; }
.tibo-buy-area .woocommerce-variation-add-to-cart { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.woocommerce-variation-price { display: none; }
.tibo-buy-area .quantity {
    display: inline-flex; align-items: center; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; height: 46px;
}
.tibo-buy-area .quantity input.qty {
    width: 56px; height: 100%; border: 0; text-align: center; font-size: 15px; -moz-appearance: textfield;
}
.tibo-buy-area .quantity input.qty::-webkit-outer-spin-button,
.tibo-buy-area .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tibo-buy-area .single_add_to_cart_button {
    height: 46px; padding: 0 34px; border: 0; border-radius: 8px;
    background: linear-gradient(90deg, #ff9500, var(--pdp-red));
    color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
    transition: opacity .2s;
}
.tibo-buy-area .single_add_to_cart_button:hover { opacity: .9; }
.tibo-buy-area .single_add_to_cart_button.disabled { opacity: .5; cursor: not-allowed; }
.tibo-buy-area .stock { width: 100%; color: #999; font-size: 13px; margin: 0; }
.tibo-wishlist-btn {
    height: 46px; padding: 0 20px; border: 1px solid #ddd; border-radius: 8px; background: #fff;
    display: inline-flex; align-items: center; gap: 6px; color: #666; font-size: 14px; cursor: pointer;
}
.tibo-wishlist-btn:hover, .tibo-wishlist-btn.is-active { color: var(--pdp-red); border-color: var(--pdp-red); }
.tibo-wishlist-btn.is-active svg { fill: var(--pdp-red); }

.tibo-product-meta { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tibo-cat-chip { font-size: 12px; color: #666; background: #f5f5f5; padding: 4px 12px; border-radius: 999px; }
.tibo-sku { font-size: 12px; color: #aaa; }

/* ---------- 选项卡 ---------- */
.tibo-pdp-tabs { margin-top: 60px; }
.tibo-tab-nav { display: flex; gap: 34px; border-bottom: 1px solid var(--pdp-line); overflow-x: auto; }
.tibo-tab-btn {
    position: relative; padding: 14px 0; font-size: 16px; color: #777; white-space: nowrap;
    border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tibo-tab-btn.is-active { color: var(--pdp-ink); font-weight: 700; border-color: var(--pdp-red); }
.tibo-tab-count { font-size: 12px; color: #bbb; margin-left: 4px; }
.tibo-tab-pane { display: none; padding: 32px 0; }
.tibo-tab-pane.is-active { display: block; }

/* 评价 */
.tibo-reviews-summary { display: flex; gap: 40px; align-items: center; padding: 24px; background: #fafafa; border-radius: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.tibo-reviews-score { text-align: center; min-width: 140px; }
.tibo-reviews-score strong { display: block; font-size: 40px; font-weight: 800; color: var(--pdp-red); line-height: 1; }
.tibo-reviews-total { display: block; font-size: 12px; color: #999; margin-top: 8px; }
.tibo-reviews-bars { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.tibo-rating-bar { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #999; }
.tibo-rating-bar-label { width: 30px; }
.tibo-rating-bar-track { flex: 1; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; }
.tibo-rating-bar-track i { display: block; height: 100%; background: var(--pdp-red); border-radius: 4px; }
.tibo-rating-bar-num { width: 40px; text-align: right; }
.tibo-reviews-list .woocommerce-Reviews { margin: 0; }
.tibo-reviews-list #reviews #comments ol.commentlist { padding: 0; }
.tibo-reviews-list .woocommerce-Reviews .comment_container { padding: 18px 0; border-bottom: 1px solid var(--pdp-line); }
.tibo-reviews-list .woocommerce-Reviews .star-rating { color: #ff9500; }

/* 参数表 */
.tibo-specs-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tibo-specs-table th, .tibo-specs-table td { padding: 14px 18px; border: 1px solid var(--pdp-line); text-align: left; }
.tibo-specs-table th { background: #fafafa; width: 160px; color: #666; font-weight: 500; }

/* 详情 */
.tibo-detail-content img { max-width: 100%; height: auto; }
.tibo-detail-content { font-size: 15px; line-height: 1.9; color: #444; }

/* 推荐网格 */
.tibo-product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.tibo-product-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #f0f0f0; border-radius: 12px; overflow: hidden; transition: all .25s; }
.tibo-product-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.tibo-product-card-img { display: block; aspect-ratio: 1; overflow: hidden; background: #f7f7f7; }
.tibo-product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.tibo-product-card-title { font-size: 14px; color: #333; padding: 12px 14px 4px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tibo-product-card-price { padding: 0 14px 14px; color: var(--pdp-red); font-weight: 700; font-size: 15px; }
.tibo-product-card-price del { color: #bbb; font-weight: 400; font-size: 12px; margin-left: 6px; }

.tibo-empty { text-align: center; color: #aaa; padding: 40px; }

/* ---------- 底部悬浮购买栏 ---------- */
.tibo-buybar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
    background: rgba(255,255,255,.98); border-top: 1px solid var(--pdp-line);
    box-shadow: 0 -4px 20px rgba(0,0,0,.06);
    transform: translateY(100%); transition: transform .3s ease;
}
.tibo-buybar.is-visible { transform: translateY(0); }
.tibo-buybar-inner {
    max-width: var(--container-max); margin: 0 auto; padding: 10px var(--container-pad);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.tibo-buybar-price { display: flex; align-items: baseline; gap: 8px; }
.tibo-buybar-label { font-size: 13px; color: #999; }
.tibo-buybar-value { font-size: 22px; font-weight: 800; color: var(--pdp-red); }
.tibo-buybar-value del { font-size: 13px; color: #bbb; font-weight: 400; }
.tibo-buybar-actions { display: flex; gap: 10px; }
.tibo-buybar-btn { height: 46px; padding: 0 28px; border: 0; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; }
.tibo-buybar-cart { background: linear-gradient(90deg, #ffc107, #ff9500); color: #fff; }
.tibo-buybar-buy { background: linear-gradient(90deg, #ff6a00, var(--pdp-red)); color: #fff; }
.tibo-buybar-fav { background: #fff; border: 1px solid #ddd; color: #666; display: inline-flex; align-items: center; gap: 6px; }
.tibo-buybar-fav.is-active { color: var(--pdp-red); border-color: var(--pdp-red); }
.tibo-buybar-fav.is-active svg { fill: var(--pdp-red); }

/* 数量控件按钮 */
.tibo-qty-btn {
    width: 42px; height: 100%; border: 0; background: #fafafa; color: #555;
    font-size: 18px; line-height: 1; cursor: pointer; transition: background .15s;
}
.tibo-qty-btn:hover { background: #f0f0f0; color: var(--pdp-red); }
.tibo-qty-btn:first-child { border-right: 1px solid #eee; }
.tibo-qty-btn:last-child { border-left: 1px solid #eee; }

/* 全屏预览 */
.tibo-pdp-lightbox { position: fixed; inset: 0; z-index: 99999; display: none; align-items: center; justify-content: center; }
.tibo-pdp-lightbox.is-open { display: flex; }
.tibo-pdp-lightbox-mask { position: absolute; inset: 0; background: rgba(0,0,0,.9); }
.tibo-pdp-lightbox-img { position: relative; max-width: 94vw; max-height: 92vh; object-fit: contain; }
.tibo-pdp-lightbox-close {
    position: absolute; top: 20px; right: 26px; width: 48px; height: 48px;
    border: 0; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff;
    font-size: 30px; line-height: 1; cursor: pointer;
}
.tibo-pdp-lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .tibo-pdp-main { grid-template-columns: 1fr; gap: 28px; }
    .tibo-product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .tibo-pdp { padding: 8px 16px 110px; }
    .tibo-store-meta .tibo-store-stat { display: none; }
    .tibo-store-actions .tibo-store-btn span { display: none; }
    .tibo-gallery { flex-direction: column-reverse; }
    .tibo-gallery-thumbs { flex-direction: row; width: 100%; flex: 0 0 auto; max-height: none; overflow-x: auto; }
    .tibo-thumb { width: 58px; height: 58px; flex: 0 0 58px; }
    .tibo-product-title { font-size: 18px; }
    .tibo-price-now { font-size: 28px; }
    .tibo-product-grid { grid-template-columns: repeat(2, 1fr); }
    .tibo-buybar-inner { padding: 8px 12px; }
    .tibo-buybar-price { display: none; }
    .tibo-buybar-actions { flex: 1; }
    .tibo-buybar-btn { flex: 1; padding: 0 10px; font-size: 14px; }
    .tibo-buybar-fav { flex: 0 0 auto; }
}
@media (max-width: 480px) {
    .tibo-product-grid { grid-template-columns: 1fr; }
    .tibo-reviews-bars { min-width: 100%; }
}
