/* 产品信息小部件样式 */
.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-wrap {
    margin: 20px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pinfo-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: nowrap;
}

.pinfo-price-label {
    font-size: 13px;
    color: #999;
    font-weight: 500;
    min-width: 40px;
    flex-shrink: 0;
    line-height: 1;
    white-space: nowrap;
}

.pinfo-price-commercial .pinfo-price-label {
    color: #f7931e;
}

.pinfo-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 24px;
    font-weight: 700;
    color: #e53935;
    margin: 0;
    flex: 1;
    min-width: 0;
}

/* 弹窗内价格类型切换 Tab */
.pinfo-pay-type-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 10px;
    background: #f5f5f7;
    border-radius: 8px;
    padding: 3px;
}

.pinfo-pay-type-tab {
    flex: 1;
    text-align: center;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    user-select: none;
}

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

.pinfo-pay-type-tab.is-active {
    background: #fff;
    color: #1a1a2e;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 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;
}
.pinfo-member-price .woocommerce-Price-currencySymbol {
    font-size: 16px;
    font-weight: 600;
    margin-right: 2px;
}

/* 普通价格货币符号缩小 */
.pinfo-price > .woocommerce-Price-amount .woocommerce-Price-currencySymbol,
.pinfo-price > ins .woocommerce-Price-currencySymbol {
    font-size: 16px;
    font-weight: 600;
    margin-right: 2px;
}

/* 会员折扣标签（如「会员8折」） */
.pinfo-member-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    font-size: 8px;
    font-weight: 400;
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.2px;
    white-space: nowrap;
    line-height: 1.2;
    align-self: flex-start;
    margin-left: -4px;
    margin-top: 2px;
}

/* 下载按钮区域 */
.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: 800px;
    height: 520px;
    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: 55%;
    flex-shrink: 0;
    background: #f5f5f5;
    position: relative;
    overflow: hidden;
}

.pinfo-pay-left-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 35%,
        rgba(255, 107, 53, 0.45) 65%,
        rgba(247, 147, 30, 0.95) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.pinfo-pay-left-bottom {
    padding: 24px;
}

.pinfo-pay-left-title {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 300;
    color: #fff;
    line-height: 1.3;
    letter-spacing: 1px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.pinfo-pay-left-desc {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 右侧：信息 + 支付 */
.pinfo-pay-right {
    width: 45%;
    flex-shrink: 0;
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.pinfo-pay-agreement {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 11px;
    color: #999;
    text-align: center;
    line-height: 1.6;
}

.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;
    background: #f7f7f8;
    border-radius: 8px;
    padding: 14px 16px;
}

.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;
    font-weight: 600;
}

/* 价格行（与 pinfo-price 一致） */
.pinfo-pay-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    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-family: MiSans-Heavy, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.01em;
    background: linear-gradient(90.31deg, rgb(251, 0, 255) -0.85%, rgb(255, 121, 0) 101.44%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.pinfo-pay-price-current .pinfo-pay-currency {
    font-size: 18px;
    font-weight: 600;
    margin-right: 2px;
}

.pinfo-pay-price-original .pinfo-pay-currency {
    font-size: 12px;
    margin-right: 1px;
}

.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: 12px;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pinfo-pay-methods-title img {
    width: 18px;
    height: 18px;
}

.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: 1px solid #e8e8e8;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
}

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

.pinfo-pay-method.active {
    border-color: #f7931e;
    background: #fff7f2;
}

/* 左侧：图标 + 名称 */
.pinfo-pay-method-info {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.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: 400;
    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: 8px;
}

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

/* QR 码区域 */
.pinfo-pay-qr {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.pinfo-pay-qr-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pinfo-pay-qr-method {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.pinfo-pay-qr-method.is-wechat {
    background: #66B645;
}

.pinfo-pay-qr-method.is-alipay {
    background: #1296DB;
}

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

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

/* QR 骨架加载动画 */
#pinfo-pay-qrcode.is-loading {
    position: relative;
    background: #f8f8f8;
}

#pinfo-pay-qrcode.is-loading::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e8e8e8 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: pinfo-skeleton 1.5s ease-in-out infinite;
}

@keyframes pinfo-skeleton {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

#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: #f7931e;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

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

/* 支付成功 */
.pinfo-pay-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
    gap: 10px;
}

.pinfo-pay-success-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto;
}

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

/* 购买按钮样式 */
.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 {
        width: 100%;
        padding: 20px 16px;
    }

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