/* 产品信息小部件样式 */
.pinfo-widget {
    padding: 0;
}

.pinfo-title {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 8px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pinfo-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* 信息字段两列布局 */
.pinfo-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    margin-bottom: 24px;
}

.pinfo-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pinfo-label {
    font-size: 14px;
    color: #333;
}

.pinfo-value {
    font-size: 14px;
    color: #e53935;
    font-weight: 500;
}

/* 价格显示 */
.pinfo-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 24px;
    font-weight: 700;
    color: #e53935;
    margin: 20px 0 16px;
}

/* WooCommerce 默认促销价（del/ins 结构） */
.pinfo-price del {
    color: #bbb;
    font-size: 15px;
    font-weight: 400;
    text-decoration: line-through;
}
.pinfo-price del .woocommerce-Price-amount {
    color: #bbb;
}
.pinfo-price ins {
    text-decoration: none;
    color: #e53935;
}

/* 会员折扣价：划线原价 */
.pinfo-original-price {
    color: #bbb !important;
    font-size: 15px;
    font-weight: 400;
    text-decoration: line-through;
    text-decoration-color: #bbb;
}
.pinfo-original-price .woocommerce-Price-amount,
.pinfo-original-price bdi,
.pinfo-original-price .woocommerce-Price-currencySymbol {
    color: #bbb !important;
}

/* 会员折扣价：实付价格 */
.pinfo-member-price {
    text-decoration: none;
    color: #e53935;
    font-size: 26px;
    font-weight: 700;
}
.pinfo-member-price .woocommerce-Price-amount {
    color: #e53935;
}

/* 会员折扣标签（如「会员8折」） */
.pinfo-member-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    vertical-align: middle;
}

/* 下载按钮区域 */
.pinfo-download-wrap {
    position: relative;
    margin-top: 0;
}

.pinfo-download-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pinfo-download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.pinfo-download-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.pinfo-download-wrap:hover .pinfo-download-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* 格式下拉菜单 */
.pinfo-format-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.pinfo-download-wrap:hover .pinfo-format-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.pinfo-format-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.pinfo-format-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    cursor: pointer;
    transition: color 0.2s;
}

.pinfo-format-option:hover {
    color: #667eea;
}

.pinfo-format-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.pinfo-format-option span {
    font-size: 15px;
}

.pinfo-format-ext {
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    min-width: 50px;
}

.pinfo-format-meta {
    display: inline-flex;
    gap: 8px;
    margin-left: auto;
    font-size: 12px !important;
    color: #999;
    font-weight: 400;
}

.pinfo-format-meta span {
    font-size: 12px !important;
    white-space: nowrap;
}

.pinfo-format-option {
    justify-content: flex-start;
}

/* ===== 支付弹窗 ===== */
.pinfo-pay-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pinfo-pay-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
}

.pinfo-pay-dialog {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 650px;
    height: 600px;
    max-width: 92vw;
    max-height: 90vh;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    animation: pinfo-modal-in 0.2s ease-out;
}

@keyframes pinfo-modal-in {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.pinfo-pay-close {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 22px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    z-index: 2;
    user-select: none;
}

/* 左右主体 */
.pinfo-pay-body {
    display: flex;
    height: 100%;
}

/* 左侧：装饰区 */
.pinfo-pay-left {
    width: 240px;
    flex-shrink: 0;
    background: #f0f0f0;
}

/* 右侧：信息 + 支付 */
.pinfo-pay-right {
    flex: 1;
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
}

.pinfo-pay-product-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 弹窗内产品属性字段（与 pinfo-fields 一致） */
.pinfo-pay-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    margin-bottom: 12px;
}

.pinfo-pay-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pinfo-pay-field-label {
    font-size: 14px;
    color: #333;
}

.pinfo-pay-field-value {
    font-size: 14px;
    color: #333;
}

/* 价格行（与 pinfo-price 一致） */
.pinfo-pay-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pinfo-pay-price-original {
    color: #bbb;
    font-size: 15px;
    font-weight: 400;
    text-decoration: line-through;
    text-decoration-color: #bbb;
}

.pinfo-pay-price-current {
    font-size: 26px;
    font-weight: 700;
    color: #e53935;
    text-decoration: none;
}

.pinfo-pay-member-tag {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* 支付方式列表 */
.pinfo-pay-methods {
    display: flex;
    flex-direction: column;
}

.pinfo-pay-methods-title {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

.pinfo-pay-methods-row {
    display: flex;
    gap: 12px;
}

.pinfo-pay-method {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    padding: 14px 16px;
    border: 1.5px solid #e8e8e8;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
}

.pinfo-pay-method:hover {
    border-color: #333;
}

.pinfo-pay-method.active {
    border-color: #333;
    background: #fafafa;
}

/* 左侧：图标 + 名称（上下结构） */
.pinfo-pay-method-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.pinfo-pay-method-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pinfo-pay-icon-wechat {
    background: #66B645;
}

.pinfo-pay-icon-alipay {
    background: #1296DB;
}

.pinfo-pay-method-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

/* 右侧：二维码图标 */
.pinfo-pay-qr-icon {
    flex-shrink: 0;
    opacity: 0.85;
}

/* 返回按钮 */
.pinfo-pay-back {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    margin-bottom: 4px;
}

.pinfo-pay-back:hover {
    color: #333;
}

/* QR 码区域 */
.pinfo-pay-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
}

.pinfo-pay-qr-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

#pinfo-pay-qrcode {
    padding: 8px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    display: inline-block;
}

#pinfo-pay-qrcode img,
#pinfo-pay-qrcode canvas {
    display: block;
}

.pinfo-pay-hint {
    font-size: 12px;
    color: #999;
}

.pinfo-pay-status {
    font-size: 12px;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pinfo-pay-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: pinfo-spin 0.8s linear infinite;
}

@keyframes pinfo-spin {
    to { transform: rotate(360deg); }
}

/* 支付成功 */
.pinfo-pay-success {
    padding: 32px 0;
    text-align: center;
}

.pinfo-pay-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: #fff;
    font-size: 28px;
    line-height: 56px;
    margin: 0 auto 10px;
    font-weight: 700;
}

.pinfo-pay-success-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* 购买按钮样式 */
.pinfo-buy-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%) !important;
}

.pinfo-buy-btn:hover {
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4) !important;
}

/* 响应式 */
@media (max-width: 680px) {
    .pinfo-fields {
        grid-template-columns: 1fr;
    }

    .pinfo-title {
        font-size: 18px;
    }

    .pinfo-pay-dialog {
        height: auto;
        max-height: 90vh;
    }

    .pinfo-pay-body {
        flex-direction: column;
    }

    .pinfo-pay-left {
        width: 100%;
        height: 180px;
    }

    .pinfo-pay-right {
        padding: 20px 16px;
    }

    .pinfo-pay-methods-row {
        flex-direction: column;
        gap: 8px;
    }
}
