/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

 /* 针对 .pp-buy-now-btn 类进行样式 */
.pp-buy-now-btn {
    background: url('/wp-content/plugins/ab-checkout-lite/public/images/pp-btn-buy-now.png') no-repeat center center; /* PayPal 图像 URL */
    background-size: contain; /* 让图像填满按钮 */
    width: 200px; /* 按钮宽度，可根据需求调整 */
    height: 38px; /* 按钮高度，可根据需求调整 */
    border: none; /* 去掉默认边框 */
    cursor: pointer; /* 鼠标样式为手形 */
    text-indent: -9999px; /* 隐藏按钮文字，图像替代文字 */
    display: inline-block; /* 使其像按钮一样显示 */
}

.pp-buy-now-btn:hover {
    opacity: 0.8; /* 悬停时稍微改变透明度 */
}

/* ============================================
   弹窗支付模态框样式
   ============================================ */

/* 模态框容器 */
.abcl-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* 遮罩层 */
.abcl-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 确保模态框显示时页面不可滚动 */
body.abcl-modal-open {
    overflow: hidden !important;
}

body.abcl-modal-open .woocommerce,
body.abcl-modal-open .site-header,
body.abcl-modal-open .site-footer {
    filter: blur(2px);
    pointer-events: none;
}

/* 模态框内容 */
.abcl-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: abclModalFadeIn 0.3s ease-out;
    z-index: 1;
}

/* 模态框淡入动画 */
@keyframes abclModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 抖动动画 - 当用户尝试点击遮罩时 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.abcl-modal-content.shake {
    animation: shake 0.3s ease-in-out;
}

/* 关闭按钮 */
.abcl-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.abcl-modal-close:hover {
    color: #333;
    transform: rotate(90deg);
}

/* 模态框头部 */
.abcl-modal-header h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    text-align: center;
}

/* 模态框主体 */
.abcl-modal-body {
    text-align: center;
    padding: 20px 0;
}

/* 加载器容器 */
.abcl-loader {
    margin: 20px auto 30px;
    width: 60px;
    height: 60px;
    position: relative;
}

/* 旋转动画 */
.abcl-spinner {
    width: 100%;
    height: 100%;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: abclSpin 1s linear infinite;
}

@keyframes abclSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 加载器成功状态 */
.abcl-loader.success .abcl-spinner {
    border-top-color: #10b981;
}

/* 加载器错误状态 */
.abcl-loader.error .abcl-spinner {
    border-top-color: #ef4444;
}

/* 状态消息 */
.abcl-status-message {
    font-size: 16px;
    color: #666;
    margin: 10px 0 20px;
    line-height: 1.6;
}

/* 警告框 */
.abcl-warning-box {
    background: #fff8e5;
    border: 2px solid #ffb900;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.abcl-warning-box p {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 15px;
    line-height: 1.6;
}

.abcl-warning-box p:last-child {
    margin-bottom: 0;
}

.abcl-warning-box strong {
    color: #d97706;
}

/* 按钮样式 */
.abcl-button {
    display: inline-block;
    padding: 14px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin: 10px 5px;
}

.abcl-button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.abcl-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.abcl-button-primary:active {
    transform: translateY(0);
}

/* 提示文字 */
.abcl-hint {
    font-size: 13px;
    color: #999;
    margin-top: 15px;
}

/* 模态框底部 */
.abcl-modal-footer {
    border-top: 1px solid #eee;
    margin-top: 30px;
    padding-top: 20px;
    text-align: center;
}

.abcl-secure-text {
    font-size: 14px;
    color: #10b981;
    margin: 0;
    font-weight: 600;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .abcl-modal-content {
        padding: 30px 25px;
        max-width: 95%;
    }
    
    .abcl-modal-header h3 {
        font-size: 20px;
    }
    
    .abcl-status-message {
        font-size: 14px;
    }
    
    .abcl-button {
        padding: 12px 24px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .abcl-modal-content {
        padding: 25px 20px;
    }
    
    .abcl-modal-header h3 {
        font-size: 18px;
    }
    
    .abcl-loader {
        width: 50px;
        height: 50px;
    }
    
    .abcl-button {
        width: 100%;
        display: block;
        margin: 10px 0;
    }
}