/* WooCommerce 报价功能插件样式 */

.wc-quote-container {
    max-width: 100%;
    margin: 20px 0;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wc-quote-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

/* 搜索区域 */
.wc-quote-search {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

#wc-quote-product-search {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

#wc-quote-product-search:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

#wc-quote-add-product {
    padding: 10px 20px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#wc-quote-add-product:hover {
    background-color: #1976D2;
}

/* 产品表格 */
.wc-quote-products {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.wc-quote-table-header {
    display: flex;
    background-color: #f5f5f5;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.wc-quote-product-item {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.wc-quote-product-item:hover {
    background-color: #fafafa;
}

/* 表格列宽设置 */
.wc-quote-col-discount {
    width: 80px;
    padding: 10px;
}

.wc-quote-col-image {
    width: 60px;
    padding: 10px;
    text-align: center;
}

.wc-quote-col-sku {
    width: 100px;
    padding: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wc-quote-col-name {
    flex: 2;
    padding: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wc-quote-col-quantity {
    width: 80px;
    padding: 10px;
}

.wc-quote-col-price,
.wc-quote-col-discounted-price,
.wc-quote-col-subtotal {
    width: 100px;
    padding: 10px;
    text-align: right;
}

.wc-quote-col-actions {
    width: 80px;
    padding: 10px;
    text-align: center;
}

/* 产品图片 */
.wc-quote-col-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
}

/* 输入框样式 */
.wc-quote-quantity,
.wc-quote-discount {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    text-align: center;
}

.wc-quote-quantity:focus,
.wc-quote-discount:focus {
    outline: none;
    border-color: #2196F3;
}

/* 移除按钮 */
.wc-quote-remove-item {
    padding: 5px 10px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.wc-quote-remove-item:hover {
    background-color: #d32f2f;
}

/* 汇总信息 */
.wc-quote-summary {
    text-align: right;
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
}

.wc-quote-total {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

#wc-quote-total-price {
    color: #f44336;
    margin-left: 10px;
}

/* 消息提示 */
.wc-quote-message {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.wc-quote-message.wc-quote-info {
    background-color: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #2196F3;
}

.wc-quote-message.wc-quote-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.wc-quote-message.wc-quote-error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

/* 加载指示器 */
.wc-quote-loading {
    text-align: center;
    padding: 10px;
    background-color: #f5f5f5;
    color: #666;
    border-radius: 4px;
    margin-top: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .wc-quote-container {
        padding: 15px;
    }
    
    .wc-quote-search {
        flex-direction: column;
    }
    
    #wc-quote-product-search {
        width: 100%;
    }
    
    #wc-quote-add-product {
        width: 100%;
    }
    
    /* 在移动设备上调整表格显示 */
    .wc-quote-table-header {
        display: none;
    }
    
    .wc-quote-product-item {
        flex-direction: column;
        padding: 15px;
        border-bottom: 2px solid #e0e0e0;
    }
    
    .wc-quote-product-item > div {
        width: 100% !important;
        padding: 5px 0;
        text-align: left;
        display: flex;
        align-items: center;
    }
    
    .wc-quote-product-item > div:before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 10px;
        min-width: 80px;
    }
    
    .wc-quote-col-image {
        order: -1;
        justify-content: center;
    }
    
    .wc-quote-col-image:before {
        content: '';
        display: none;
    }
    
    .wc-quote-col-sku { white-space: normal; }
    .wc-quote-col-name { white-space: normal; }
    
    .wc-quote-col-discount,
    .wc-quote-col-quantity {
        display: flex;
        align-items: center;
    }
    
    .wc-quote-col-discount input,
    .wc-quote-col-quantity input {
        max-width: 60px;
        margin-left: 10px;
    }
    
    .wc-quote-col-actions {
        justify-content: flex-end;
    }
    
    .wc-quote-summary {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .wc-quote-container {
        margin: 10px 0;
        padding: 10px;
    }
    
    .wc-quote-container h2 {
        font-size: 20px;
    }
    
    .wc-quote-product-item > div:before {
        min-width: 60px;
        font-size: 12px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wc-quote-product-item {
    animation: fadeIn 0.3s ease-out;
}

/* 打印样式 */
@media print {
    .wc-quote-search,
    .wc-quote-col-actions,
    .wc-quote-message,
    .wc-quote-loading {
        display: none !important;
    }
    
    .wc-quote-container {
        box-shadow: none;
        border: none;
    }
    
    .wc-quote-product-item {
        page-break-inside: avoid;
    }
}

/* 产品选择对话框样式 */
.wc-quote-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.wc-quote-dialog-content {
    background-color: #fff;
    border-radius: 4px;
    width: 90%;
    max-width: 600px;
    max-height: 80%;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.3s ease-in-out;
}

.wc-quote-dialog-content h3 {
    margin: 0;
    padding: 15px 20px;
    background-color: #f7f7f7;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    font-weight: 600;
}

.wc-quote-product-search-results {
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.wc-quote-search-result-item {
    display: flex;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fff;
}

.wc-quote-search-result-item:hover {
    border-color: #4caf50;
    background-color: #f9f9f9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wc-quote-result-image {
    margin-right: 15px;
    flex-shrink: 0;
}

.wc-quote-result-image img {
    border-radius: 2px;
}

.wc-quote-result-info {
    flex: 1;
}

.wc-quote-result-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.wc-quote-result-sku {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.wc-quote-result-price {
    font-weight: 600;
    color: #4caf50;
}

.wc-quote-dialog-actions {
    padding: 15px 20px;
    background-color: #f7f7f7;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 响应式设计 - 对话框 */
@media (max-width: 768px) {
    .wc-quote-dialog-content {
        width: 95%;
        max-height: 85%;
    }
    
    .wc-quote-search-result-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .wc-quote-result-image {
        margin-right: 0;
        margin-bottom: 10px;
    }
}