/* 国家选择框相关样式 */
.dynamic-country-select {
    min-width: 200px;
    transition: all 0.3s ease;
}

.dynamic-country-select:disabled {
    opacity: 0.7;
    background-color: #f8f9fa;
    cursor: wait;
}

.dynamic-country-select.loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-6.219-8.56'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 40px;
}


/* 移动端优化 */
@media (max-width: 768px) {
    .dynamic-country-select {
        min-width: 150px;
        font-size: 14px;
    }
}

/* 选择框内部选项样式 */
.dynamic-country-select option {
    padding: 8px 12px;
    font-size: 14px;
}

.dynamic-country-select optgroup {
    font-weight: bold;
    color: #333;
    font-size: 14px;
    padding: 5px 10px;
}

/* 询价表单样式 */
.quote-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.quote-popup-overlay.show {
    display: flex !important;
}

.quote-popup-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden; /* 改为hidden，内部单独控制滚动 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column; /* 添加flex布局 */
}

.quote-popup-header {
    background: #212b47;
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* 防止header被压缩 */
}

.quote-popup-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.close-quote-modal {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px 10px;
}

.quote-popup-body {
    padding: 25px;
    flex: 1; /* 填充剩余空间 */
    overflow-y: auto; /* 内容区域单独滚动 */
    max-height: calc(90vh - 160px); /* 减去header和footer的高度 */
}

.quote-subtitle {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1rem; /* 电脑端稍微加大字体 */
    line-height: 1.6;
}

.global-form-quote {
    margin-top: 20px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-group {
    flex: 1;
    min-width: 200px;
    padding: 0 10px;
    margin-bottom: 20px;
}

.wrap-input-quote {
    position: relative;
}

.wrap-input-quote input,
.wrap-input-quote select,
.wrap-input-quote textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box; /* 添加盒模型 */
}

.wrap-input-quote input:focus,
.wrap-input-quote select:focus,
.wrap-input-quote textarea:focus {
    outline: none;
    border-color: #212b47;
}

/* 修复移动端select默认颜色问题 */
.wrap-input-quote select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: white;
}

.product-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.product-title {
    font-weight: 600;
    color: #212b47;
}

.remove-product {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.add-product-btn {
    background: #212b47;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
}

.add-product-btn i {
    margin-right: 8px;
}

.terms-checkbox {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.terms-checkbox input {
    margin-right: 10px;
}

.terms-checkbox label {
    font-size: 14px;
    color: #666;
}

.terms-checkbox a {
    color: #212b47;
    text-decoration: underline;
}

.quote-popup-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    text-align: right;
    background: white;
    border-radius: 0 0 12px 12px;
    flex-shrink: 0; /* 防止footer被压缩 */
}

.submit-quote-btn {
    background: #212b47;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-quote-btn:hover {
    background: #2d3a5c;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

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

.message-success,
.message-error {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
/* 表单消息样式 */
.form-message {
    display: none;
    margin: 15px 0;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    border: 2px solid transparent;
    z-index: 100000; /* 确保消息框在表单弹窗之上 */
}

/* 成功消息样式 */
.form-message.success-message {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* 错误消息样式 */
.form-message.error-message {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* 弹出表单中的消息样式 */
.quote-popup-modal .form-message {
    position: sticky; /* 改为sticky，跟随滚动 */
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - 48px);
    max-width: 500px;
    animation: slideDownMessage 0.3s ease-out;
    margin: -25px auto 15px; /* 调整边距 */
}

@keyframes slideDownMessage {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* 全局顶部消息（固定定位） */
.form-message.global-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    padding: 20px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    width: auto;
    min-width: 300px;
    border: none;
    animation: slideDown 0.3s ease-out;
}

/* 确保表单弹窗在正确的层级 */
.quote-popup-overlay {
    z-index: 99999 !important;
}

.quote-popup-modal {
    z-index: 100001 !important;
    background: white !important;
    position: relative;
}

/* 移动端优化 */
@media screen and (max-width: 768px) {
    /* 移动端全屏覆盖 */
    .quote-popup-overlay {
        padding: 0;
        align-items: stretch; /* 拉伸填满整个屏幕 */
    }
    
    .quote-popup-modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    
    .quote-popup-header {
        border-radius: 0 !important;
        padding: 18px 20px !important;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .quote-popup-header h3 {
        font-size: 1.3rem !important;
    }
    
    .quote-popup-body {
        padding: 20px 15px !important;
        max-height: calc(100vh - 140px) !important; /* 减去头部和底部高度 */
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    }
    
    /* 移动端文案字体加大 */
    .quote-subtitle {
        font-size: 1.1rem !important;
        line-height: 1.6;
        margin-bottom: 20px !important;
        color: #555; /* 稍微加深颜色，提高可读性 */
    }
    
    /* 防止表单输入时页面放大 */
    .quote-popup-modal input[type="text"],
    .quote-popup-modal input[type="email"],
    .quote-popup-modal input[type="tel"],
    .quote-popup-modal input[type="number"],
    .quote-popup-modal select,
    .quote-popup-modal textarea {
        font-size: 16px !important;
        padding: 14px 12px !important;
    }
    
    /* 移动端表单元素间距 */
    .form-row {
        flex-direction: column !important;
        margin: 0 !important;
        gap: 15px !important;
    }
    
    .form-group {
        width: 100% !important;
        min-width: 100% !important;
        padding: 0 !important;
        margin-bottom: 15px !important;
    }
    
    /* 移动端按钮优化 */
    .submit-quote-btn {
        width: 100% !important;
        padding: 16px 20px !important;
        font-size: 16px !important;
    }
    
    /* 移动端动态国家选择框优化 */
    .dynamic-country-select {
        min-width: 100% !important;
        font-size: 16px !important;
    }
    
    /* 产品项在移动端的优化 */
    .product-item {
        padding: 14px !important;
    }
    
    /* 添加产品按钮在移动端的优化 */
    .add-product-btn {
        width: 100% !important;
        justify-content: center;
        padding: 14px !important;
        font-size: 16px !important;
        margin-bottom: 20px !important;
    }
    
    .quote-popup-footer {
        position: sticky;
        bottom: 0;
        padding: 15px 20px !important;
        background: white;
        border-top: 1px solid #eee;
        border-radius: 0 !important;
    }
    
    /* 移动端消息框样式优化 */
    .form-message {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 85% !important;
        max-width: 90% !important;
        margin: 0 !important;
    }
    
    .quote-popup-modal .form-message {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 85% !important;
        max-width: 90% !important;
        margin: 0 !important;
    }
    
    /* 条款复选框在移动端加大 */
    .terms-checkbox {
        margin: 20px 0 !important;
    }
    
    .terms-checkbox label {
        font-size: 15px !important;
        line-height: 1.5;
    }
    
    .terms-checkbox input {
        transform: scale(1.2);
        margin-right: 12px !important;
    }
}

/* 电脑端高度优化 */
@media (min-width: 769px) {
    .quote-popup-modal {
        max-height: 85vh; /* 电脑端稍微调高一点 */
    }
    
    .quote-popup-body {
        max-height: calc(85vh - 160px); /* 调整内容区域高度 */
    }
}

/* 超小屏幕优化（手机横屏或小尺寸手机） */
@media (max-width: 480px) {
    .quote-popup-body {
        padding: 15px !important;
        max-height: calc(100vh - 130px) !important;
    }
    
    .quote-popup-header {
        padding: 16px 15px !important;
    }
    
    .quote-popup-footer {
        padding: 15px !important;
    }
    
    /* 超小屏幕副标题进一步加大 */
    .quote-subtitle {
        font-size: 1.05rem !important;
        line-height: 1.6;
        margin-bottom: 18px !important;
    }
    
    .product-item {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }
    
    .terms-checkbox {
        margin: 18px 0 !important;
    }
    
    .terms-checkbox label {
        font-size: 14px !important;
        line-height: 1.5;
    }
}