/* --- 触发按钮基础样式 (完美适配 Elementor Flex 容器) --- */
.edp-rfq-wrapper {
    display: flex;
    width: 100%;
    margin-bottom: 0;
}

/* 响应 Elementor 原生的对齐前缀 */
.elementor-align-left .edp-rfq-wrapper { justify-content: flex-start; }
.elementor-align-center .edp-rfq-wrapper { justify-content: center; }
.elementor-align-right .edp-rfq-wrapper { justify-content: flex-end; }

/* 核心修复：铺满整行 (Justified) */
.elementor-align-justify .edp-rfq-wrapper {
    justify-content: stretch;
}
.elementor-align-justify .edp-rfq-trigger-btn {
    width: 100%; /* 强制按钮撑满父容器 */
    justify-content: center; /* 按钮内的文字居中 */
}

.edp-rfq-trigger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #007bff;
    color: #fff;
    border: 0;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    width: auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.edp-rfq-trigger-btn:hover {
    filter: brightness(0.92);
}

/* --- 修复：严格控制图标大小，防止 SVG 暴走 --- */
.edp-rfq-trigger-btn .edp-btn-icon,
.edp-rfq-trigger-btn svg {
    display: inline-block;
    width: 1em; /* 默认和旁边的文字一模一样大 */
    height: 1em;
    line-height: 1;
    flex-shrink: 0; /* 魔法属性：绝对禁止图标被挤压或无限拉伸 */
    fill: currentColor; /* 魔法属性：图标永远自动跟随文字的颜色，无论是正常还是悬停 */
}

/* --- 模态弹窗遮罩层 --- */
.edp-rfq-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 隐藏状态 */
.edp-rfq-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

/* 锁定底部滚动条 */
body.edp-modal-open {
    overflow: hidden;
}

/* --- 弹窗主体内容 --- */
.edp-rfq-modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    overflow-y: auto;
}

.edp-rfq-modal-overlay.edp-rfq-hidden .edp-rfq-modal-content {
    transform: translateY(20px);
}

/* 弹窗头部 */
.edp-rfq-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.edp-rfq-modal-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #333;
}
.edp-rfq-modal-close {
    background: none;
    border: 0;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.3s, background-color 0.3s;
}
.edp-rfq-modal-close:hover {
    color: #ff4d4f;
}

.edp-rfq-modal-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* 目标产品信息块 */
.edp-rfq-target-product {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #333;
}
.edp-rfq-target-product .edp-badge {
    font-size: 12px;
    color: #888;
    display: block;
    margin-bottom: 4px;
}
.edp-rfq-target-product .edp-sku {
    color: #007bff;
    font-family: monospace;
    margin-left: 5px;
}

/* --- 表单排版 --- */
.edp-rfq-form-group {
    margin-bottom: 18px;
    width: 100%;
}
.edp-rfq-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #444;
}
.edp-rfq-form-group label .required {
    color: #ff4d4f;
}

.edp-rfq-form-group input[type="text"],
.edp-rfq-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #333;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: inherit;
    box-sizing: border-box;
}
.edp-rfq-form-group input:focus,
.edp-rfq-form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.edp-rfq-form-row {
    display: flex;
    gap: 15px;
}
.edp-qty-group {
    max-width: 120px;
}

/* --- 提交区域 --- */
.edp-rfq-form-footer {
    margin-top: 25px;
}
.edp-rfq-submit-btn {
    width: 100%;
    padding: 14px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    position: relative;
}
.edp-rfq-submit-btn:hover {
    background: #0056b3;
}
.edp-rfq-submit-btn.is-loading {
    background: #6c757d;
    cursor: not-allowed;
}

/* 按钮内居中的 Loading 动画 */
.edp-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* --- 提示信息框 --- */
.edp-rfq-message-box {
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
    border-radius: 4px;
    padding: 0;
}
.edp-rfq-message-box.edp-success {
    padding: 10px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.edp-rfq-message-box.edp-error {
    padding: 10px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- 移动端响应式 (底部抽屉式体验) --- */
@media (max-width: 767px) {
    .edp-rfq-modal-content {
        width: 100%;
        max-width: 100%;
        margin-top: auto; /* 推到底部 */
        border-radius: 20px 20px 0 0; /* 仅上边圆角 */
        padding: 25px 20px 40px 20px;
        transform: translateY(100%); /* 从底部滑入动画 */
    }
    .edp-rfq-modal-overlay {
        align-items: flex-end; /* 内容对齐到底部 */
    }
    .edp-rfq-modal-overlay:not(.edp-rfq-hidden) .edp-rfq-modal-content {
        transform: translateY(0);
    }
    .edp-rfq-form-row {
        flex-direction: column;
        gap: 0;
    }
    .edp-qty-group {
        max-width: 100%;
    }
}