/* 詢問車樣式 */
.inquiry-cart-widget {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,123,255,0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2px solid rgba(255,255,255,0.2);
}
.inquiry-cart-widget:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,123,255,0.4);
}
.inquiry-cart-widget .text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    transition: opacity 0.15s ease;
}
.inquiry-cart-widget .cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-radius: 50%;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(220,53,69,0.4);
}
.product-actions {
    position: relative;
}
.ltt_box_product_img02 {
    position: relative;
}
.btn-add-to-inquiry, .inquiry-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    z-index: 10;
}
.btn-add-to-inquiry:hover, .inquiry-btn:hover {
    background-color: #0056b3;
}
.btn-add-to-inquiry.added, .inquiry-btn.added {
    background-color: #28a745;
}
.btn-add-to-inquiry.added:hover, .inquiry-btn.added:hover {
    background-color: #1e7e34;
}
.product-image-container {
    position: relative;
    display: inline-block;
}
.inquiry-cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7); /* 增加背景不透明度從 0.5 到 0.7 */
    z-index: 120000; /* 必須高於主選單與語系列，確保遮罩完整覆蓋 */
}
.inquiry-cart-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 1);
    padding: 20px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.inquiry-cart-modal .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}
.inquiry-cart-modal .close:hover {
    color: #000;
}
.inquiry-cart-modal h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}
.inquiry-cart-products {
    margin-bottom: 20px;
}
.inquiry-cart-product {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #f9f9f9;
}
.inquiry-cart-product img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    margin-right: 10px;
    border-radius: 4px;
}
.product-info {
    flex: 1;
}
.product-info strong {
    display: block;
    color: #333;
}
.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.remove-btn:hover {
    background: #c82333;
}
.cart-actions {
    text-align: center;
    margin-top: 20px;
}
.btn-clear-cart, .btn-proceed-inquiry {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 10px;
    font-size: 14px;
}
.btn-clear-cart:hover, .btn-proceed-inquiry:hover {
    background: #5a6268;
}
.btn-proceed-inquiry {
    background: #007bff;
}
.btn-proceed-inquiry:hover {
    background: #0056b3;
}
.alert {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}
.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.cart-required-highlight {
    border: 2px solid #dc3545 !important;
    border-radius: 6px;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
    animation: cart-required-pulse 0.8s ease-in-out 2;
}

@keyframes cart-required-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

#cart-message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 300px;
}

/* 在 Modal 內部的訊息改為嵌入式顯示 */
.modal-content #cart-message {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
}
}
.inquiry-form {
    margin: 20px 0;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
.inquiry-form h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
    font-size: 18px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}
.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 必填欄位標記 */
.required {
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

/* 表單提示文字 */
.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* ===== iframe 版本樣式 ===== */
/* 以下樣式專為 inquiry_cart_iframe.php 設計，用於 iframe 嵌入時的顯示效果 */

.inquiry-cart-iframe body {
    margin: 0;
    padding: 20px;
    font-family: Arial, sans-serif;
    background: transparent;
}

.inquiry-cart-iframe .loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.inquiry-cart-iframe .inquiry-cart-modal {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    z-index: auto !important;
}

.inquiry-cart-iframe .modal-content {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: 600px !important;
    width: 90% !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    margin: 0 !important;
    background-color: rgba(255, 255, 255, 1) !important;
}

.inquiry-cart-iframe .close {
    display: none !important;
}

/* ===== 詢問車上限 5 項：鎖定按鈕樣式 ===== */
.inquiry-btn.cart-full {
    background-color: #adb5bd !important;
    cursor: not-allowed;
    opacity: 0.8;
}
.inquiry-btn.cart-full:hover {
    background-color: #adb5bd !important;
    transform: none;
}

/* ===== RWD：響應式 iframe 高度（保留 iframe 內部自動捲軸） ===== */
/* clamp(最小高度, 依螢幕高度縮放, 最大高度) */
/* 外層 modal-content 有 padding 約 40px + 關閉按鈕，故扣除 */
#inquiry-cart-iframe {
    display: block;
    height: clamp(400px, calc(78vh - 40px), 640px);
}

/* 小螢幕寬度（手機直向） */
@media screen and (max-width: 600px) {
    .inquiry-cart-modal .modal-content {
        max-height: 94vh;
        padding: 28px 10px 10px;
        width: 96%;
    }
    #inquiry-cart-iframe {
        height: calc(94vh - 45px);
    }
    /* 詢問車小工具縮小，避免遮擋主要內容 */
    .inquiry-cart-widget {
        width: 60px;
        height: 60px;
        bottom: 80px;
        top: auto;
        right: 12px;
    }
    .inquiry-cart-widget .text {
        font-size: 11px;
    }
}

/* 矮螢幕裝置（橫向手機、小筆電） */
@media screen and (max-height: 600px) {
    .inquiry-cart-modal .modal-content {
        max-height: 96vh;
    }
    #inquiry-cart-iframe {
        height: calc(96vh - 45px);
    }
}

/* ── 詢問車：未送出提醒脈動動畫（每 5 秒一次漣漪效果）── */
@keyframes inquiryPulse {
    0%   { box-shadow: 0 4px 20px rgba(0,123,255,0.3), 0 0 0 0    rgba(0,123,255,0.55); }
    8%   { box-shadow: 0 4px 20px rgba(0,123,255,0.3), 0 0 0 10px rgba(0,123,255,0.25); }
    16%  { box-shadow: 0 4px 20px rgba(0,123,255,0.3), 0 0 0 20px rgba(0,123,255,0); }
    100% { box-shadow: 0 4px 20px rgba(0,123,255,0.3), 0 0 0 0    rgba(0,123,255,0); }
}
.inquiry-cart-widget.has-pending {
    animation: inquiryPulse 5s ease-in-out infinite;
}
.inquiry-cart-widget.has-pending:hover {
    animation-play-state: paused;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,123,255,0.4);
}

/* 首頁引導：未加入產品時，文字做輕量呼吸動畫 */
@keyframes inquiryGuideTextBreath {
    0%, 100% { opacity: 1; transform: translateY(0); }
    50% { opacity: 0.82; transform: translateY(-1px); }
}
.inquiry-cart-widget.home-find-guide .text {
    animation: inquiryGuideTextBreath 1.7s ease-in-out infinite;
}

/* ── 找產品面板：搜尋結果卡片 ────────────────────────────── */
.search-result-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fff;
}
.search-result-card img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: #f1f3f5;
}
.search-result-info {
    flex: 1;
    min-width: 0;
}
.search-result-info strong {
    display: block;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-cat {
    font-size: 11px;
    color: #888;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn-search-add-cart {
    flex-shrink: 0;
    padding: 6px 12px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: background 0.2s;
}
.btn-search-add-cart:hover {
    background: #0056b3;
}
.btn-search-add-cart.in-cart {
    background: #28a745;
    cursor: default;
}