/* 支付弹窗 - 底部弹出式(bottom sheet) */
.pay-modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
}

.pay-modal.show {
    display: flex;
}

/* 遮罩层 */
.pay-sheet-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1;
}

/* 底部面板 */
.pay-sheet {
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 16px 16px 0 0;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
}

.pay-sheet.sheet-active {
    transform: translateY(0);
}

/* 拖拽条 */
.pay-sheet-bar {
    width: 36px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

/* 头部 */
.pay-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    flex-shrink: 0;
}

.pay-sheet-title {
    font-size: 16px;
    font-weight: 700;
    color: #222;
}

.pay-sheet-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}

.pay-sheet-close:active {
    background: #eee;
    color: #666;
}

/* 主体内容区(可滚动) */
.pay-sheet-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 18px;
}

/* 支付方式列表 */
.pay-methods {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pay-method-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    cursor: pointer;
    position: relative;
    border-bottom: 1px solid #f5f5f5;
    -webkit-tap-highlight-color: transparent;
}

.pay-method-item:last-child {
    border-bottom: none;
}

.pay-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pay-method-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    margin-right: 12px;
}

/* 微信绿色 */
.wechat-icon {
    background: #e8f8ef;
    color: #2aa378;
}

/* 支付宝蓝色 */
.alipay-icon {
    background: #e8f2ff;
    color: #208bee;
}

/* 银联 - 银行卡标志：UnionPay+银联 均叠在三色块上 */
.unionpay-icon {
    background: #fff;
    box-shadow: inset 0 0 0 1px #f0f0f0;
}

.unionpay-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 三色块容器 - 承载色块+文字 */
.unionpay-logo .up-blocks {
    position: relative;
    width: 34px;
    height: 20px;
    overflow: hidden;
}

.unionpay-logo .up-red,
.unionpay-logo .up-blue,
.unionpay-logo .up-green {
    position: absolute;
    width: 11px;
    height: 20px;
    border-radius: 2px;
    transform: skewX(-18deg);
}

/* 红-左 */
.unionpay-logo .up-red {
    background: #e60012;
    left: 5px;
    top: 0;
    z-index: 1;
}

/* 蓝-中 */
.unionpay-logo .up-blue {
    background: #005fcc;
    left: 11px;
    top: 0;
    z-index: 2;
}

/* 绿-右 */
.unionpay-logo .up-green {
    background: #009944;
    left: 17px;
    top: 0;
    z-index: 3;
}

/* UnionPay 英文 - 粗体无衬线，三色块内居右倾斜，垂直居中 */
.unionpay-logo .up-en {
    position: absolute;
    right: 1px;
    top: 3px;
    transform: skewX(-18deg);
    z-index: 10;
    color: #fff;
    font-size: 6px;
    font-weight: 900;
    letter-spacing: 0.3px;
    font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    line-height: 1;
}

/* 银联 中文 - 黑体正体，三色块内居右倾斜，垂直居中，紧贴英文 */
.unionpay-logo .up-cn {
    position: absolute;
    right: 2px;
    top: 10px;
    transform: skewX(-18deg);
    z-index: 10;
    color: #fff;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 1px;
    font-family: "SimHei", "Microsoft YaHei", "PingFang SC", sans-serif;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    line-height: 1;
}

.pay-method-name {
    flex: 1;
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.pay-method-check {
    color: #ccc;
    font-size: 20px;
    transition: color 0.15s;
}

.pay-method-item.selected .pay-method-check {
    color: #ea1a26;
}

/* 底部固定区域 */
.pay-sheet-foot {
    flex-shrink: 0;
    padding: 12px 18px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
}

.pay-total-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pay-total-label {
    font-size: 13px;
    color: #999;
}

.pay-total-value {
    font-size: 22px;
    font-weight: 700;
    color: #ea1a26;
}

.pay-total-value span {
    font-size: 14px;
    font-weight: 600;
}

/* 确认支付按钮 */
.pay-submit-btn {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 22px;
    background: linear-gradient(100deg, #fb565a 0%, #ea1a26 54%, #f75d3f 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(234, 26, 38, 0.25);
    transition: transform 0.12s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.pay-submit-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 6px rgba(234, 26, 38, 0.18);
}

.pay-submit-btn:disabled {
    background: linear-gradient(100deg, #e0e0e0, #f5f5f5);
    color: #bbb;
    cursor: not-allowed;
    box-shadow: none;
}

/* iPhone底部安全区域适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .pay-sheet-foot {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}

/* 小屏适配 */
@media (max-height: 580px) {
    .pay-sheet {
        max-height: 85vh;
    }
    .pay-method-item {
        padding: 10px 0;
    }
}