/* ============================================================
   Product Detail Page — 精致清爽主题
   ============================================================ */

/* ---------- 主图区 ---------- */
.pd-main-image-frame {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    background: #fafbfc;
    border: 1px solid #eef2f5;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.pd-main-image-frame img {
    transition: opacity 0.35s ease;
}

/* ---------- Tab Buttons ---------- */
.tab-btn {
    position: relative;
    padding: 10px 20px;
    border-radius: 10px 10px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    background: transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
}
.tab-btn:hover {
    color: #64748b;
    background: rgba(var(--brand-rgb),0.04);
}
.tab-btn.active {
    color: var(--brand);
    background: #fff;
    box-shadow: 0 -1px 0 #eef2f5, -1px 0 0 #eef2f5, 1px 0 0 #eef2f5;
}
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--brand);
    border-radius: 2px 2px 0 0;
}

/* ---------- Tab Header 容器 ---------- */
.tabs-header {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #eef2f5;
    padding: 0 8px;
}

/* ---------- Tab Content ---------- */
.tab-content { display: none; }
.tab-content.active,
.tab-content[style*="display:block"] { display: block; }

/* ---------- Variant Axis ---------- */
.pd-variant-axis {
    margin-bottom: 14px;
}
.pd-variant-axis > span {
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ---------- Gallery Thumbnails ---------- */
.product-thumbnail {
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 12px;
    overflow: hidden;
}
.product-thumbnail img {
    transition: transform 0.3s ease;
}
.product-thumbnail:hover img {
    transform: scale(1.06);
}

/* ---------- Thumbnail Gallery with Arrows ---------- */
.thumb-gallery-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}
.thumb-scroll {
    flex: 1;
    min-width: 0;
    cursor: grab;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    user-select: none;
    -webkit-user-select: none;
}
.thumb-scroll::-webkit-scrollbar {
    display: none;
}
.thumb-scroll.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}
.thumb-scroll.is-dragging img {
    pointer-events: none;
}
.thumb-arrow {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #eef2f5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.thumb-arrow:hover {
    background: rgba(var(--brand-rgb),0.08);
    color: var(--brand);
    border-color: rgba(var(--brand-rgb),0.3);
    box-shadow: 0 2px 8px rgba(var(--brand-rgb),0.12);
}
.thumb-arrow:active {
    transform: scale(0.93);
}

/* ---------- Quantity Buttons ---------- */
.qty-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid #eef2f5;
    background: #fafbfc;
    color: #334155;
    font-size: 16px;
    font-weight: 500;
}
.qty-btn:hover {
    background: rgba(var(--brand-rgb),0.06);
    border-color: rgba(var(--brand-rgb),0.25);
    color: var(--brand);
}
.qty-btn:active {
    transform: scale(0.95);
    background: rgba(var(--brand-rgb),0.12);
}
.quantity-input {
    -moz-appearance: textfield;
    width: 56px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #eef2f5;
    background: #fafbfc;
    text-align: center;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    transition: all 0.2s;
}
.quantity-input:focus {
    border-color: rgba(var(--brand-rgb),0.4);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb),0.08);
}
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---------- 加入购物车按钮 ---------- */
.pd-add-cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 2px 8px rgba(var(--brand-rgb),0.18);
}
.pd-add-cart-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--brand-rgb),0.28);
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
}
.pd-add-cart-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(15,23,42,0.15);
}
.pd-add-cart-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* ---------- 促销标签 ---------- */
.pd-promo-tag {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(var(--brand-rgb),0.04);
    border: 1px solid rgba(var(--brand-rgb),0.12);
    font-size: 13px;
    color: #475569;
    transition: all 0.25s ease;
}
.pd-promo-tag:hover {
    background: rgba(var(--brand-rgb),0.07);
    border-color: rgba(var(--brand-rgb),0.22);
}

/* ---------- 阶梯价格表 ---------- */
.pd-tier-wrap {
    margin-top: 24px;
}
.pd-tier-wrap h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}
.pd-tier-wrap > p {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 16px;
}
.pd-tier-table {
    width: 100%;
    border-collapse: collapse;
}
.pd-tier-table th {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
}
.pd-tier-table th:last-child {
    text-align: right;
}
.pd-tier-table td {
    font-size: 13px;
    color: #475569;
    padding: 10px 0;
    border-bottom: 1px solid #f8fafc;
}
.pd-tier-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: var(--brand);
}
.pd-tier-table tr:last-child td {
    border-bottom: none;
}
.pd-tier-footer {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---------- Cart Toast ---------- */
.cart-add-toast {
    position: fixed;
    z-index: 9999;
    top: 96px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #eef2f5;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
}
.cart-add-toast--show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ---------- Added to Cart Flash ---------- */
.btn-added-flash {
    background: #10b981 !important;
    box-shadow: 0 2px 12px rgba(16,185,129,0.3) !important;
}

/* ---------- Cart Count Bump ---------- */
.cart-count--bump {
    animation: cartBump 0.5s ease;
}
@keyframes cartBump {
    0% { transform: scale(1); }
    40% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* ---------- Star Rating ---------- */
.stars iconify-icon {
    display: inline-block;
}

/* ---------- Review Card ---------- */
.review-card {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 20px 24px;
    transition: box-shadow 0.3s ease;
}
.review-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand);
    background: rgba(var(--brand-rgb),0.08);
}

/* ---------- Review Reply ---------- */
.review-reply {
    margin-top: 12px;
    margin-left: 20px;
    padding: 12px 16px;
    background: rgba(var(--brand-rgb),0.04);
    border: 1px solid rgba(var(--brand-rgb),0.08);
    border-radius: 12px;
    font-size: 13px;
}

/* ---------- Review Form ---------- */
.review-star-btn {
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    border: none;
    padding: 2px;
}
.review-star-btn:hover {
    transform: scale(1.12);
}
.review-textarea {
    width: 100%;
    border: 1px solid #eef2f5;
    border-radius: 12px;
    padding: 12px 16px;
    background: #fafbfc;
    color: #334155;
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: all 0.2s;
}
.review-textarea:focus {
    border-color: rgba(var(--brand-rgb),0.35);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb),0.06);
    background: #fff;
}
.review-submit-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}
.review-submit-btn:hover:not(:disabled) {
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(15,23,42,0.2);
}
.review-submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- 相关商品卡片 ---------- */
.pd-related-card {
    display: block;
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.pd-related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
    border-color: #e2e8f0;
}
.pd-related-card:hover img {
    transform: scale(1.05);
}
.pd-related-img {
    height: 220px;
    position: relative;
    background: #f8fafc;
    overflow: hidden;
}
.pd-related-img img {
    transition: transform 0.5s ease;
}

/* ---------- Product Tags（标签） ---------- */
.product-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.product-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

/* ---------- 分割装饰线 ---------- */
.pd-divider {
    width: 40px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--brand), var(--color-accent));
}

/* ---------- 分类标签 ---------- */
.pd-category-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: var(--brand);
    background: rgba(var(--brand-rgb),0.07);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ---------- 品牌文字 ---------- */
.pd-brand {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ---------- 简介绍文 ---------- */
.pd-intro {
    font-size: 14px;
    line-height: 1.7;
    color: #64748b;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

/* ---------- 价格区 ---------- */
.pd-price-current {
    font-size: 30px;
    font-weight: 800;
    color: var(--color-price);
    letter-spacing: -0.02em;
}
.pd-price-original {
    font-size: 16px;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
}

/* ---------- Specs Table ---------- */
.pd-specs-table {
    width: 100%;
    border-collapse: collapse;
}
.pd-specs-table td {
    padding: 12px 0;
    border-bottom: 1px solid #f8fafc;
    font-size: 13px;
}
.pd-specs-table td:first-child {
    color: #94a3b8;
    font-weight: 500;
    width: 140px;
    padding-right: 24px;
}
.pd-specs-table td:last-child {
    color: #334155;
    font-weight: 500;
}
.pd-specs-table tr:last-child td {
    border-bottom: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .product-thumbnail {
        width: 56px;
        height: 56px;
    }
    .cart-add-toast {
        left: 16px;
        right: 16px;
        top: auto;
        bottom: 16px;
    }
    .pd-price-current {
        font-size: 26px;
    }
    .pd-add-cart-btn {
        width: 100%;
        justify-content: center;
    }
    .tab-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}
