/* Product Detail Widget */

.pd-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

/* ===== 左侧画廊 ===== */
.pd-gallery {
    position: sticky;
    top: 20px;
}

/* 内层容器：大图 + 缩略图，纵向排列 */
.pd-gallery-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pd-zoom-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: crosshair;
}

.pd-main-image {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.3s ease;
}

.pd-main-image.sliding {
    opacity: 0.7;
}

/* 大图切换按钮 */
.pd-main-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    opacity: 0;
}

.pd-zoom-container:hover .pd-main-nav {
    opacity: 1;
}

.pd-main-nav:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.pd-main-nav svg {
    width: 20px;
    height: 20px;
    color: #333;
}

.pd-main-prev {
    left: 12px;
}

.pd-main-next {
    right: 12px;
}

/* 放大镜遮罩 */
.pd-zoom-lens {
    display: none;
    position: absolute;
    border: 2px solid rgba(0,0,0,0.3);
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.15);
    pointer-events: none;
}

.pd-zoom-container.zooming .pd-zoom-lens {
    display: block;
}

/* 放大结果面板：绝对定位在大图右侧 */
.pd-zoom-result {
    display: none;
    position: absolute;
    top: 0;
    left: calc(100% + 16px);
    width: 380px;
    height: 380px;
    border: 1px solid #ddd;
    overflow: hidden;
    background-repeat: no-repeat;
    z-index: 100;
    background-color: #fff;
}

/* Swiper 缩略图 */
.pd-thumbs-swiper-wrap {
    position: relative;
}

.pd-thumbs-swiper {
    overflow: hidden;
}

.pd-thumb-item {
    aspect-ratio: 1;
    border: 1px solid #ddd;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.pd-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pd-thumb-item:hover,
.pd-thumb-item.active {
    border-color: #000;
}

/* ===== 右侧信息 ===== */
.pd-info {
    padding-top: 0;
}

.pd-above-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 6px;
}

.pd-brand {
    margin-bottom: 12px;
}

.pd-brand-logo {
    max-height: 40px;
    width: auto;
}

.pd-product-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 8px;
    color: #111;
}

.pd-short-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

/* 评分 */
.pd-rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.pd-stars {
    display: flex;
}

.pd-star {
    font-size: 18px;
    color: #ccc;
}

.pd-star.filled {
    color: #f5a623;
}

.pd-star.partial {
    position: relative;
    color: #ccc;
}

.pd-star-fill {
    position: absolute;
    left: 0;
    top: 0;
    overflow: hidden;
    width: var(--fill, 50%);
    color: #f5a623;
    white-space: nowrap;
}

.pd-review-count {
    font-size: 13px;
    color: #888;
}

/* 价格 */
.pd-price {
    font-size: 22px;
    font-weight: 600;
    color: #111;
    margin-bottom: 20px;
}

.pd-price .woocommerce-Price-amount {
    font-size: 22px;
    font-weight: 600;
}

/* 变体选择器 */
.pd-variations {
    margin-bottom: 20px;
}

.pd-variation-row {
    margin-bottom: 12px;
}

.pd-variation-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.pd-variation-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 0;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.pd-variation-select:focus {
    outline: none;
    border-color: #000;
}

/* 数量 */
.pd-quantity-section {
    margin-bottom: 16px;
}

.pd-qty-label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}

.pd-qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    width: fit-content;
    transition: border-color 0.2s;
}

.pd-qty-control:focus-within {
    border-color: #000;
}

.pd-qty-btn {
    width: 48px;
    height: 48px;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 20px;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: none !important;
}

.pd-qty-btn:hover {
    background: transparent !important;
    color: #000;
}

.pd-qty-input {
    width: 72px;
    height: 48px;
    border: none !important;
    border-left: 1px solid #ccc !important;
    border-right: 1px solid #ccc !important;
    text-align: center;
    font-size: 16px;
    outline: none !important;
    box-shadow: none !important;
    -moz-appearance: textfield;
    appearance: textfield;
    transition: border-color 0.2s;
    background: transparent !important;
}

.pd-qty-input:focus,
.pd-qty-input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border-left-color: #000 !important;
    border-right-color: #000 !important;
}

.pd-qty-input::-webkit-inner-spin-button,
.pd-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
}

/* 购物车按钮 */
.pd-cart-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.pd-add-to-cart {
    width: 100% !important;
    padding: 16px !important;
    background: transparent !important;
    color: #111 !important;
    border: 1px solid #111 !important;
    border-radius: 0 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    cursor: pointer !important;
    transition: background 0.2s, color 0.2s !important;
    text-transform: uppercase !important;
}

.pd-add-to-cart:hover {
    background: #111 !important;
    color: #fff !important;
}

.pd-add-to-cart.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.pd-add-to-cart.added {
    background: #444;
}

.pd-out-of-stock {
    font-size: 14px;
    color: #e00;
    margin: 12px 0;
}

/* 产品描述 */
.pd-description {
    font-size: 14px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 30px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.pd-description p {
    margin-bottom: 12px;
}

/* 自定义文本 */
.pd-custom-text {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 24px;
}

/* 规格参数 */


.pd-specs-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #111;
}

.pd-spec-item {
    font-size: 14px;
    color: #444;
    margin-bottom: 10px;
    line-height: 1.6;
}

.pd-spec-label {
    font-weight: 600;
    color: #333;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .pd-zoom-result {
        width: 280px;
        height: 280px;
    }
}

@media (max-width: 768px) {
    .pd-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .pd-gallery {
        position: static;
    }

    .pd-zoom-result {
        display: none !important;
    }

    .pd-zoom-lens {
        display: none !important;
    }

    .pd-zoom-container {
        cursor: default;
    }

    .pd-main-nav {
        opacity: 1;
    }

    .pd-product-title {
        font-size: 22px;
    }
}
