/**
 * Twenty Twenty-Five Bridge: Unified Cashier Modal Styles
 */

.bridge-checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.bridge-checkout-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bridge-checkout-modal {
    background: #ffffff;
    width: 90%;
    max-width: 460px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.bridge-checkout-overlay.active .bridge-checkout-modal {
    transform: scale(1) translateY(0);
}

.bridge-checkout-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bridge-checkout-title {
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #ffffff;
}

.bridge-checkout-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.bridge-checkout-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.bridge-checkout-body {
    padding: 24px;
}

/* Order Summary Box */
.bridge-order-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.bridge-summary-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    line-height: 1.4;
}

.bridge-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
}

.bridge-summary-row.total-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #cbd5e1;
    color: #0f172a;
    font-weight: 600;
    font-size: 15px;
    align-items: baseline;
}

.bridge-total-price {
    font-size: 24px;
    font-weight: 800;
    color: #ea580c;
}

.bridge-total-price small {
    font-size: 15px;
    font-weight: 600;
    margin-right: 2px;
}

/* Payment Channel Tabs */
.bridge-channel-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

/* In WeChat Browser: hide alipay and let wxpay take full width */
.bridge-checkout-modal.in-wechat-env .bridge-channel-tabs {
    grid-template-columns: 1fr;
}
.bridge-checkout-modal.in-wechat-env .bridge-tab-alipay {
    display: none !important;
}

.bridge-channel-tab {
    border: 2px solid #e2e8f0;
    background: #ffffff;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bridge-channel-tab:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.bridge-channel-tab.active-wxpay {
    border-color: #07c160;
    background: #f0fdf4;
    color: #15803d;
}

.bridge-channel-tab.active-alipay {
    border-color: #1677ff;
    background: #eff6ff;
    color: #1d4ed8;
}

.bridge-tab-icon {
    font-size: 18px;
}

/* Payment Panels */
.bridge-channel-panel {
    display: none;
    text-align: center;
}

.bridge-channel-panel.active {
    display: block;
}

/* WeChat QR Panel */
.bridge-qr-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    min-width: 196px;
    min-height: 196px;
    position: relative;
    margin-bottom: 12px;
}

.bridge-qr-box canvas, .bridge-qr-box img {
    display: block;
    border-radius: 6px;
}

.bridge-qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #64748b;
}

.bridge-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e2e8f0;
    border-top-color: #ea580c;
    border-radius: 50%;
    animation: bridgeSpin 0.8s linear infinite;
}

@keyframes bridgeSpin {
    to { transform: rotate(360deg); }
}

.bridge-pay-tip {
    font-size: 13px;
    color: #64748b;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bridge-pay-heartbeat {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    animation: bridgePulse 1.5s infinite;
}

@keyframes bridgePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Alipay Panel */
.bridge-alipay-btn {
    background: #1677ff;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 28px;
    cursor: pointer;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px -1px rgba(22, 119, 255, 0.3);
}

.bridge-alipay-btn:hover {
    background: #0958d9;
    transform: translateY(-1px);
}

/* Success Overlay */
.bridge-success-panel {
    display: none;
    text-align: center;
    padding: 24px 10px;
}

.bridge-success-panel.active {
    display: block;
}

.bridge-success-icon {
    width: 60px;
    height: 60px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 16px;
    animation: bridgePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bridgePop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.bridge-success-title {
    font-size: 18px;
    font-weight: 700;
    color: #15803d;
    margin-bottom: 6px;
}

.bridge-success-msg {
    font-size: 14px;
    color: #64748b;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .bridge-checkout-modal {
        width: 94%;
        border-radius: 12px;
    }
    .bridge-checkout-body {
        padding: 16px;
    }
}
