/* ===== 快速詢價懸浮視窗 ===== */
.product-contact-widget {
    position: fixed;
    bottom: 24px; /* 改為 24px，與 AI 客服一致 */
    right: 90px; /* 預設位置（沒有 AI 客服時） */
    z-index: 9998;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 如果有 AI 客服，往左移 */
.product-contact-widget-with-ai {
    right: 166px; /* 90 + 60 + 16 = 166px */
}

/* 懸浮按鈕 */
.pc-float-button {
    position: relative;
    width: 60px; /* 改為 60px，與 AI 客服一致 */
    height: 60px; /* 改為 60px，與 AI 客服一致 */
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}

    .pc-float-button:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
    }

    .pc-float-button:active {
        transform: scale(0.95);
    }

    .pc-float-button.pc-float-button-active {
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    }

.pc-icon {
    width: 28px;
    height: 28px;
    color: white;
}

/* 徽章 */
.pc-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ff4757;
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 對話框 */
.pc-dialog {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: pcSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pcSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 對話框標題列 */
.pc-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pc-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pc-header-icon {
    width: 24px;
    height: 24px;
}

.pc-header-title {
    font-size: 16px;
    font-weight: 600;
}

.pc-close-button {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .pc-close-button:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .pc-close-button svg {
        width: 18px;
        height: 18px;
        color: white;
    }

/* 對話框內容 */
.pc-dialog-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* 表單 */
.pc-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pc-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pc-form-label {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
}

.pc-required {
    color: #ff4757;
}

.pc-form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
}

    .pc-form-input:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

    .pc-form-input::placeholder {
        color: #a0aec0;
    }

/* 商品列表區域 */
.pc-product-list-section {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.pc-product-list-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 12px;
}

.pc-product-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.pc-product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f7fafc;
    border-radius: 8px;
    transition: all 0.2s;
}

    .pc-product-item:hover {
        background: #edf2f7;
    }

.pc-product-name {
    flex: 1;
    font-size: 14px;
    color: #2d3748;
}

.pc-product-remove {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

    .pc-product-remove:hover {
        background: #fed7d7;
    }

    .pc-product-remove svg {
        width: 14px;
        height: 14px;
        color: #e53e3e;
    }

.pc-empty-message {
    text-align: center;
    color: #a0aec0;
    font-size: 14px;
    padding: 20px;
}

/* 送出按鈕 */
.pc-submit-button {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    margin-top: 8px;
}

    .pc-submit-button:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    }

    .pc-submit-button:active:not(:disabled) {
        transform: translateY(0);
    }

    .pc-submit-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.pc-submit-icon {
    width: 18px;
    height: 18px;
}

/* 響應式設計 */
@media (max-width: 480px) {
    .pc-dialog {
        position: fixed;
        width: calc(100vw - 40px);
        max-height: 70vh;
        bottom: 100px; /* 固定位置，不受按鈕影響 */
        right: 20px;
        left: 20px;
        margin: 0 auto;
    }

    /* 手機版位置調整 */
    .product-contact-widget {
        left: 16px;
        bottom: 10px;
    }

    .product-contact-widget-with-ai {
        left: 16px;
        bottom: 86px; /* 在 AI 客服上方 */
    }
}

/* 滾動條樣式 */
.pc-dialog-body::-webkit-scrollbar,
.pc-product-list::-webkit-scrollbar {
    width: 6px;
}

.pc-dialog-body::-webkit-scrollbar-track,
.pc-product-list::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

.pc-dialog-body::-webkit-scrollbar-thumb,
.pc-product-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

    .pc-dialog-body::-webkit-scrollbar-thumb:hover,
    .pc-product-list::-webkit-scrollbar-thumb:hover {
        background: #a0aec0;
    }
