﻿/* ========= 外層啟動器 ========= */
.tpeChat-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2000;
}

    .tpeChat-launcher[data-state="closed"] .tpeChat-panel {
        opacity: 0;
        transform: translateY(8px) scale(.98);
        pointer-events: none;
        display: none;
    }

    .tpeChat-launcher[data-state="open"] .tpeChat-panel {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
        display:  flex;
    }

/* ========= 面板（桌機） ========= */
.tpeChat-panel {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 360px;
    height: 70vh;
    max-height: 640px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity .18s ease, transform .18s ease;
}

/* 讓 body 吃滿剩餘高度；iframe 填滿 body */
.tpeChat-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

    .tpeChat-body iframe {
        display: block;
        width: 100%;
        height: 100%;
        border: 0;
        min-height: 300px;
    }

/* ========= 面板（手機滿版） ========= */
@media (max-width:480px) {
    .tpeChat-panel {
        right: 0;
        left: 0;
        bottom: 0;
        top: 0;
        width: 100dvw;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
    }

    .tpeChat-body {
        flex: 1 1 auto;
        min-height: 0;
        padding: 16px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
}


/* 外層統一置中 */
.tpeChat-closedBar {
    display: flex;
    justify-content: center;  
    align-items: center;  
    gap: 8px;  
}

/* 重啟按鈕樣式與對齊 */
.tpeChat-restart,
.tpeChat-restart.btn-link {
    display: inline-flex;  
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
    color: #83176C;
    text-decoration: none;
    padding: 0;
    border: 0;
    background: none;
}

    .tpeChat-restart:hover,
    .tpeChat-restart:focus {
        color: #ad2324 !important;
        opacity: .8;
    }

    .tpeChat-restart svg {
        width: 20px;
        height: 20px;
        display: block;   
        vertical-align: middle;
        transform: none;
    }
.answerRow .answerRowInner {
    padding: 16px calc(18px + 20px) 0 calc(18px + 14px);
    font-size: 1rem; 
    line-height: 1.6;
}


@media (max-width: 450px) {
    .answerRow .answerRowInner {
        padding: 14px calc(18px + 20px) 0 calc(18px + 14px);
        font-size: .875rem;
    }
}

.tpeChat-inputBar {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    height: 58px;
    padding: 16px 24px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    border-top: 1px solid #2318153D;
    background: #fff;
}

    .tpeChat-inputBar.disable {
        background-color: #2318150f;
    }

        .tpeChat-inputBar.disable textarea {
            pointer-events: none;
        }

        .tpeChat-inputBar.disable .tpeChat-sendBtn {
            cursor: default;
        }

            .tpeChat-inputBar.disable .tpeChat-sendBtn:hover svg {
                fill: #2318153D;
            }


.tpeChat-sendBtn svg {
    width: 24px;
    height: 24px;
}

/* 空白時（placeholder 還在）→ 灰 */
.tpeChat-inputBar:not(.disable):has(.tpeChat-input:placeholder-shown) .tpeChat-sendBtn svg path {
    fill: #2318153D;
}

/* 有輸入內容 → 紫；hover → 紅 */
.tpeChat-inputBar:not(.disable):has(.tpeChat-input:not(:placeholder-shown)) .tpeChat-sendBtn svg path {
    fill: #83176c;
    transition: fill .2s ease;
}

.tpeChat-inputBar:not(.disable):has(.tpeChat-input:not(:placeholder-shown)) .tpeChat-sendBtn:hover svg path {
    fill: #ad2324;
}

/*補充:訂票資訊國家選單手機版下拉 */

.autocomplete-container {
    position: relative;
    overflow: visible !important;
    z-index: 10001; /* ⇦ 如父層有 stacking context，幫容器也墊高 */
}

/* 手機下拉本體：給高度、可捲、iOS 慣性捲動與觸控設定 */
#nationality-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: min(320px, 60vh); /* 有高度，才會出現內捲動 */
    overflow-y: auto;
    overflow-x: hidden; /* ⇦ 避免橫向小捲軸 */
    -webkit-overflow-scrolling: touch; /* iOS 慣性捲動 */
    overscroll-behavior: contain; /* 滾到邊界不要帶動整頁 */
    touch-action: pan-y; /* 僅垂直滑動（Safari 新版支援，舊版無妨） */
    z-index: 10000; /* 墊在頁面上方 */
    background: #fff; /* ⇦ 疊在內容上時保持不透明 */
}

/* 洲別列表折疊 */
.continent-countries.collapsed {
    display: none;
}

/* 只針對「整頁版」：largeContainer + contactUsContainer 範圍，且螢幕 >= 768px 才改成 60% */
@media (min-width: 768px) {
    .largeContainer .contactUsContainer .tpeChat-msg--bot {
        max-width: calc(60% + 48px);
    }

    .largeContainer .contactUsContainer .tpeChat-msg {
        max-width: 60%;
    }
}