/* ============================================
   payment-page 视觉主题 · 发卡系统整合版
   Source: /home/payment-page/files/pay.css
   适配原 pay.html / goods.html HTML 结构
   ============================================ */

/* CSS 变量 */
:root {
    --primary-color: #2196F3;
    --secondary-color: #1976D2;
    --success-color: #43A047;
    --danger-color: #E53935;
    --warning-color: #FFC107;
    --text-primary: #263238;
    --text-secondary: #546E7A;
    --bg-gradient: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    --pay-store-bg: #E3F2FD;
    --pay-store-card: #ffffff;
    --pay-store-blue: #2196F3;
    --pay-store-blue-dark: #1976D2;
    --pay-store-yellow-bg: #FFF8E1;
    --pay-store-yellow-border: #FFC107;
    --pay-store-border: rgba(33, 150, 243, 0.22);
    --pay-store-shadow: 0 4px 18px rgba(33, 150, 243, 0.12);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(33, 150, 243, 0.12);
    --shadow-lg: 0 10px 28px rgba(33, 150, 243, 0.15);
    --transition: all 0.3s ease;
}

/* ===== 商品详情页 (goods.html) ===== */
body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-primary);
}

/* 支付页打开时 body 切换 */
body:has(.mobile-content:not(.hidden)),
body:has(#walletContent:not(.hidden)),
body:has(.pc-content:not(.hidden)) {
    margin: 0;
    padding: 0 !important;
    display: block;
    background: var(--pay-store-bg);
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
}

/* ========== 商品详情页样式 ========== */

.prod-details__body {
    max-width: 1000px;
    margin: 0 auto;
}

.prod-details-gwrap {
    background: var(--pay-store-card);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 30px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.prod-details__prod-name h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.info-wrapper .goods-tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

.goods-tag.text-success { background: rgba(67,160,71,0.1); color: var(--success-color) !important; }
.goods-tag.text-info { background: rgba(33,150,243,0.1); color: var(--primary-color) !important; }
.goods-tag.text-danger { background: rgba(229,57,53,0.1); color: var(--danger-color) !important; }
.goods-tag.text-warning { background: rgba(255,193,7,0.1); color: #F57F17 !important; }

.variations__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 20px 0 10px 0;
}

.count {
    border: 1.5px solid #e0e0e0;
    display: inline-flex;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
}

.count__ctrl {
    padding: 8px 18px;
    background: #f5f5f5;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.count__num {
    padding: 0 12px;
    border: none !important;
    width: 60px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    outline: none;
}

.select-specs {
    font-size: 13px;
    border: 1.5px solid rgba(167,167,167,0.2);
    font-weight: 500;
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    margin-right: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    display: inline-block;
    transition: var(--transition);
    background: #fff;
}

.select-specs:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(33,150,243,0.12);
}

.select-specs.active {
    border: 2px solid var(--primary-color);
    padding: 7px 15px !important;
    background: rgba(33,150,243,0.06);
    color: var(--secondary-color);
    font-weight: 700;
}

.select-specs.disabled {
    border-color: #ddd;
    color: #bbb;
    background: #f9f9f9;
    cursor: not-allowed;
    opacity: 0.6;
}

.variations__list#pay-type {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pay-type {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px !important;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 !important;
}

.pay-type:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pay-type.active {
    border: 2px solid var(--primary-color);
    padding: 9px 17px !important;
    background: rgba(33,150,243,0.06);
    color: var(--secondary-color);
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(33,150,243,0.12);
}

.pay-type svg, .pay-type img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.prod-offering {
    background: var(--pay-store-card);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.2);
}

.sale-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-color);
}

.prod-offering__benefits .precheck-benefits {
    background: var(--pay-store-yellow-bg);
    border: 1px solid var(--pay-store-yellow-border);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.precheck-benefits .text {
    font-size: 13px;
    color: #5D4037;
    font-weight: 500;
}

.form .form-control {
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--transition);
    background: #fafafa;
    width: 100%;
    outline: none;
}

.form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33,150,243,0.1);
    background: #fff;
}

.form-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    display: block;
}

#buy-btn {
    width: 100%;
    background: var(--bg-gradient);
    color: white;
    padding: 16px 24px;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(33,150,243,0.3);
}

#buy-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(33,150,243,0.35);
}

#buy-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.delivinfo__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.delivinfo__item:last-child { border-bottom: none; }
.delivinfo__item .icon svg { width: 20px; height: 20px; stroke: var(--primary-color); }
.delivinfo__item .text { font-size: 14px; color: var(--text-secondary); }
.delivinfo__item .text b { color: var(--text-primary); margin-right: 6px; }

.prod-offering__merchant {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.precheck-bonuses {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel.shadow {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-md) !important;
    overflow: hidden;
}

.panel.shadow .panel-heading {
    background: var(--bg-gradient) !important;
    color: #fff !important;
    padding: 14px 20px !important;
    border: none !important;
    font-weight: 600;
}

.panel.shadow .panel-body {
    padding: 20px !important;
    background: #fff;
}

@media (max-width: 768px) {
    body { background: #fff; }
    .prod-details-gwrap {
        border-radius: 0;
        box-shadow: none;
        padding: 16px;
        background: #fff;
    }
    .prod-offering {
        border-radius: 16px;
        padding: 20px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    }
    .sale-price { font-size: 26px; }
}

/* ========== 支付页 (pay.html) ========== */

/* PC端 */
.pc-content .container {
    max-width: 800px;
    background: var(--pay-store-card);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
    margin: 20px auto;
}

.pc-content .header {
    text-align: center;
    margin-bottom: 24px;
}

.pc-content .header h1 {
    font-size: 24px;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    margin-bottom: 8px;
}

.pc-content .header p {
    font-size: 15px;
    color: var(--text-secondary);
}

.pc-content .alert {
    background: var(--pay-store-yellow-bg);
    border: 1px solid var(--pay-store-yellow-border);
    border-radius: 14px;
    color: #5D4037;
    padding: 14px 18px;
    margin: 0 0 20px;
    font-size: 14px;
    font-weight: 500;
}

.pc-content .qr-code {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.pc-content .qr-code canvas {
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.pc-content .info {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.pc-content .info:last-child { border-bottom: none; }

.pc-content .info h2 {
    font-size: 15px;
    color: var(--primary-color);
    font-weight: 600;
    min-width: 90px;
    margin: 0;
}

.pc-content .info p {
    font-size: 15px;
    color: var(--text-primary);
    margin: 0;
    word-break: break-all;
}

/* 移动端 H5 */
.mobile-content .container {
    max-width: 100%;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 14px 18px 100px;
    margin: 0;
}

.mobile-content .header {
    text-align: center;
    padding: 8px 0 16px;
}

.mobile-content .header h1 {
    display: none;
}

.mobile-content .header p {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    padding: 0 8px;
}

.mobile-content .header::before {
    content: '🔐';
    display: block;
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    line-height: 52px;
    font-size: 26px;
    background: var(--pay-store-card);
    border-radius: 16px;
    border: 2px solid var(--pay-store-blue);
    box-shadow: var(--pay-store-shadow);
}

.mobile-content .alert {
    background: var(--pay-store-yellow-bg);
    border: 1px solid var(--pay-store-yellow-border);
    border-radius: 14px;
    color: #5D4037;
    padding: 14px 16px;
    margin: 0 0 18px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(255,193,7,0.15);
}

.mobile-content .alert p { margin: 0; }

.mobile-content .qr-code {
    text-align: center;
    margin: 18px 0;
    position: relative;
}

.mobile-content .qr-code canvas {
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.mobile-content .info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin: 0;
    background: var(--pay-store-card);
    border-bottom: 1px solid #ECEFF1;
}

.mobile-content .info:first-of-type {
    border-radius: 16px 16px 0 0;
    margin-top: 18px;
}

.mobile-content .info:last-of-type {
    border-radius: 0 0 16px 16px;
    border-bottom: none;
}

.mobile-content .info h2 {
    font-size: 14px;
    color: var(--pay-store-blue);
    font-weight: 600;
    min-width: 76px;
    margin: 0;
}

.mobile-content .info p {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    flex: 1;
    margin: 0;
    word-break: break-all;
}

#paymentAmount {
    font-size: 22px;
    font-weight: 800;
    color: var(--pay-store-blue);
}

/* 钱包选择 - payment-page 风格网格 */
.mobile-content .wallet-selection {
    margin: 18px 0;
}

.mobile-content .wallet-selection h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--pay-store-blue-dark);
    margin: 0 0 14px 2px;
    padding: 0;
}

.mobile-content .wallet-selection h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    border-radius: 2px;
    margin-right: 8px;
    background: linear-gradient(180deg, #42A5F5, #1976D2);
    vertical-align: middle;
}

.mobile-content .wallet-selection ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: transparent;
    border: none;
}

.mobile-content .wallet-selection li {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 112px;
    padding: 14px 10px 12px;
    margin: 0;
    border: 1.5px solid #E0E0E0;
    border-radius: 14px;
    background: var(--pay-store-card);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-content .wallet-selection li:active {
    transform: scale(0.98);
    background: #FAFAFA;
}

.mobile-content .wallet-selection li.selected {
    border-color: var(--pay-store-blue);
    background: #E3F2FD;
    box-shadow: 0 0 0 2px rgba(33,150,243,0.25), 0 6px 18px rgba(33,150,243,0.18);
}

.mobile-content .wallet-selection li.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    line-height: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--pay-store-blue);
    border-radius: 50%;
}

.mobile-content .wallet-selection li img {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    margin: 0 0 10px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mobile-content .wallet-selection li span {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.mobile-content .wallet-selection input[type="radio"] {
    display: none;
}

/* 支付按钮（移动端底部固定） */
.mobile-content .pay-button {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
    margin: 0;
    min-height: 56px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 14px;
    border: none;
    z-index: 100;
    background: var(--bg-gradient);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(33,150,243,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
}

/* 钱包DAPP内 */
#walletContent .container {
    max-width: 100%;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 14px 18px 100px;
    margin: 0;
}

#walletContent .header {
    text-align: center;
    padding: 8px 0 16px;
}

#walletContent .header h1 { display: none; }

#walletContent .header p {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

#walletContent .product-image-container {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

#walletContent .product-image {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--pay-store-border);
    box-shadow: var(--pay-store-shadow);
}

#walletContent .info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin: 0;
    background: var(--pay-store-card);
    border-bottom: 1px solid #ECEFF1;
}

#walletContent .info:first-of-type {
    border-radius: 16px 16px 0 0;
    margin-top: 18px;
}

#walletContent .info:last-of-type {
    border-radius: 0 0 16px 16px;
    border-bottom: none;
}

#walletContent .info h2 {
    font-size: 14px;
    color: var(--pay-store-blue);
    font-weight: 600;
    min-width: 76px;
    margin: 0;
}

#walletContent .info p {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    flex: 1;
    margin: 0;
}

#walletContent .pay-approvalbutton {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
    margin: 0;
    min-height: 56px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 14px;
    border: none;
    z-index: 100;
    background: var(--bg-gradient);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(33,150,243,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
}

/* 弹窗 */
#alert-html {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
}

#alert-html .content { padding: 24px !important; }

#alert-html .modal_close {
    background: var(--bg-gradient);
    color: #fff;
    padding: 14px;
    font-weight: 600;
    cursor: pointer;
}

#lean_overlay {
    background: rgba(0,0,0,0.4) !important;
    backdrop-filter: blur(4px);
}

.hidden { display: none !important; }

/* 移动端适配 */
@media (max-width: 768px) {
    body:has(.mobile-content:not(.hidden)),
    body:has(#walletContent:not(.hidden)) {
        background: linear-gradient(180deg, #E3F2FD 0%, #BBDEFB 55%, #E3F2FD 100%);
    }

    .pc-content .container {
        padding: 20px;
        margin: 10px;
        border-radius: 16px;
    }
    
    .mobile-content .wallet-selection ul {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .mobile-content .wallet-selection li {
        min-height: 100px;
        padding: 12px 8px;
    }
    
    .mobile-content .wallet-selection li img {
        width: 40px;
        height: 40px;
    }
}
