/* ====== 全局字体 & 动画 ====== */
@font-face {
    font-family: Inter;
    src: url('../font/Inter.ttf');
}

@font-face {
    font-family: NotoSansTC;
    src: url('../font/NotoSansTC.ttf');
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ====== 弹窗最外层 ====== */
.ai_search_popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483647 !important;
    animation: fadeIn 0.3s ease-in-out;
    font-family: 'NotoSansTC', sans-serif;
}

/* ====== 弹窗内容区 ====== */
.ai_search_popup_content {
    display: flex;
    width: calc(100% - 32px);
    max-width: 960px;
    max-height: 672px;
    background: #fff;
    border-radius: 10px;
    box-sizing: border-box;
    padding: 44px 16px 16px;
    position: relative;
    overflow: hidden;
}

/* 关闭按钮 */
.ai_search_popup_close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 12px;
    height: 12px;
    cursor: pointer;
    z-index: 10;
}

/* ====== Tab 导航（手機版） ====== */
.ai_search_popup_content_tab {
    display: none;
    /* 桌面版隱藏 */
    margin: 0 16px 8px;
}

.ai_search_popup_content_tab_item {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100px;
    height: 32px;
    padding: 0 8px;
    border-bottom: 2px solid #D5D5D5;
    cursor: pointer;
    box-sizing: border-box;
}

.ai_search_popup_content_tab_item.isTabActive {
    border-bottom: 2px solid #F15A24;
}

.ai_search_popup_content_tab_item img {
    width: 16px;
    height: 16px;
}

.ai_search_popup_content_tab_item_text {
    font-size: 12px;
    font-weight: 500;
    color: #505050;
}

/* ====== 左右分區 ====== */
.ai_search_popup_content_search,
.ai_search_popup_content_recommend {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai_search_popup_content_search {
    border-right: 1px solid #D5D5D5;
}

/* ====== 公共头部 Title ====== */
.popup_title {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.popup_title img {
    width: 24px;
    height: 24px;
}

.popup_title_text {
    font-size: 16px;
    font-weight: 500;
    color: #505050;
}

/* ====== "询问 AI" 区域内容 ====== */
/* 问题列表 */
.popup_questions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 16px;
    max-height: 161px;
    overflow-y: auto;
}

.popup_questions_item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.popup_questions_item.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.popup_questions_item img {
    width: 24px;
    height: 24px;
}

.popup_questions_item .default-img {
    display: block;
}

.popup_questions_item .active-img {
    display: none;
}

.popup_questions_item.active .default-img {
    display: none;
}

.popup_questions_item.active .active-img {
    display: block;
}

.popup_questions_item_text {
    font-size: 13px;
    font-weight: 400;
    color: #505050;
    opacity: .6;
    padding-top: 4px;
}

.popup_questions_item.active .popup_questions_item_text {
    opacity: 1;
}

/* 建议区域 */
.popup_suggest {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 16px;
    flex: 1;
    overflow: hidden;
}

/* 建议回答 */
.popup_suggest_answer {
    min-height: 127px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popup_suggest_title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup_suggest_title img {
    width: 24px;
    height: 24px;
}

.popup_suggest_title_text {
    font-size: 14px;
    font-weight: 500;
    color: #505050;
}

.popup_suggest_content {
    font-size: 13px;
    font-weight: 400;
    color: #505050;
    height: 95px;
    overflow-y: auto;
}

/* 建议商品 */
.popup_suggest_products {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

.popup_suggest_products_item {
    display: flex;
    flex-direction: column;
}

.popup_suggest_products_item .product_info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.popup_suggest_products_item .product_info_img {
    width: 155px;
    height: 103px;
}

.popup_suggest_products_item .product_info_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup_suggest_products_item .product_info_content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup_suggest_products_item .product_info_content_model {
    font-size: 14px;
    font-weight: 500;
    color: #505050;
}

.popup_suggest_products_item .product_info_content_title {
    font-size: 14px;
    font-weight: 400;
    color: #505050;
    opacity: .6;
}

.popup_suggest_products_item .product_info_content_button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 24px;
    background-color: #00A199;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    margin-top: 7px;
    text-decoration: none;
}

.popup_suggest_products_item .product_introduction {
    font-size: 13px;
    font-weight: 400;
    color: #505050;
    padding: 8px 0;
}

/* 输入框 */
.popup_suggest_input {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 40px;
    height: 40px;
    border: 1px solid #D5D5D5;
    border-radius: 100px;
    padding: 0 8px;
}

.popup_suggest_input input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    background-color: transparent;
    color: #505050;
    font-size: 14px;
    font-weight: 400;
}

.popup_suggest_input_button {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.popup_suggest_input_button.disabled {
    pointer-events: none;
}

.popup_suggest_input_button img {
    width: 100%;
    height: 100%;
}

/* ====== "关键字推荐" 区域内容 ====== */
/* Loading */
.popup_recommend_loading {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}

.popup_recommend_loading img {
    width: 130px;
    height: 130px;
}

/* 推荐内容 */
.popup_recommend_content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 16px;
    box-sizing: border-box;
}

.popup_recommend_content_area {
    width: 100%;
    padding-top: 48px;
    margin: 0;
}

.popup_recommend_content_title {
    font-size: 16px;
    font-weight: 500;
    color: #505050;
    text-align: center;
    position: relative;
    margin-bottom: 8px;
}

.popup_recommend_content_title_more {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 400;
    color: #F15A24;
    position: absolute;
    right: 0;
    top: -10px;
    height: 22px;
    cursor: pointer;
    text-decoration: none;
}

.popup_recommend_content_title_more img {
    width: 13px;
    height: 13px;
}

/* Swiper 相關 - 與原始設計保持一致 */
.popup_recommend_content .popup_recommend_content_area .swiper-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 0;
}

.popup_recommend_content_swiper {
    /* Swiper 基本樣式由 swiper-bundle.min.css 提供 */
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* 確保 swiper 容器正確計算寬度 */
.popup_recommend_content_swiper .swiper-wrapper {
    display: flex;
}

.popup_recommend_content_swiper .swiper-slide {
    flex-shrink: 0;
}

.popup_recommend_content .popup_recommend_content_area .swiper-container .slide_product_item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
}

.popup_recommend_content .popup_recommend_content_area .swiper-container .slide_product_item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup_recommend_content .popup_recommend_content_area .swiper-container .slide_product_item .product_info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.popup_recommend_content .popup_recommend_content_area .swiper-container .slide_product_item .product_info .product_info_model {
    font-size: 14px;
    font-weight: 500;
    color: #505050;
}

.popup_recommend_content .popup_recommend_content_area .swiper-container .slide_product_item .product_info .product_info_title {
    font-size: 14px;
    font-weight: 400;
    color: #505050;
    opacity: .6;
}

/* Swiper 按鈕 */
.swiper-button-prev,
.swiper-button-next {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 24px !important;
    height: 24px !important;
    opacity: 1 !important;
}

.swiper-button-next:after,
.swiper-button-prev:after {
    content: none !important;
}

/* 自定义滚动条 */
.popup_questions::-webkit-scrollbar,
.popup_suggest_content::-webkit-scrollbar,
.popup_suggest_products::-webkit-scrollbar,
.popup_recommend_content::-webkit-scrollbar {
    width: 4px;
}

.popup_questions::-webkit-scrollbar-thumb,
.popup_suggest_content::-webkit-scrollbar-thumb,
.popup_suggest_products::-webkit-scrollbar-thumb,
.popup_recommend_content::-webkit-scrollbar-thumb {
    background: rgba(213, 213, 213, .3);
    border-radius: 4px;
}

/* ====== 響應式：手机版 ====== */
.ai_search_popup_content.isMobile {
    flex-direction: column;
    padding: 16px 0 16px;
    max-height: 90vh;
    height: 90vh;
}

.ai_search_popup_content.isMobile .ai_search_popup_content_tab {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0 16px 8px;
}

.ai_search_popup_content.isMobile .popup_title {
    display: none;
}

.ai_search_popup_content.isMobile .ai_search_popup_content_search,
.ai_search_popup_content.isMobile .ai_search_popup_content_recommend {
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ai_search_popup_content.isMobile .ai_search_popup_content_search.isActive,
.ai_search_popup_content.isMobile .ai_search_popup_content_recommend.isActive {
    display: flex;
}

.ai_search_popup_content.isMobile .ai_search_popup_content_search {
    border-right: none;
}

/* 手機版樣式調整 */
.ai_search_popup_content.isMobile .popup_questions_item img {
    width: 16px;
    height: 16px;
}

.ai_search_popup_content.isMobile .popup_questions_item_text {
    font-size: 12px;
    padding-top: 1px;
}

.ai_search_popup_content.isMobile .popup_questions_item {
    gap: 4px;
}

.ai_search_popup_content.isMobile .popup_suggest_title {
    gap: 4px;
}

.ai_search_popup_content.isMobile .popup_suggest_title img {
    width: 16px;
    height: 16px;
}

.ai_search_popup_content.isMobile .popup_suggest_title_text {
    font-size: 12px;
    font-weight: 400;
}

.ai_search_popup_content.isMobile .popup_suggest_content {
    font-size: 12px;
}

.ai_search_popup_content.isMobile .popup_suggest_products_item .product_info_img {
    width: 120px;
    height: 80px;
}

.ai_search_popup_content.isMobile .popup_suggest_products_item .product_info_content_model {
    font-size: 12px;
}

.ai_search_popup_content.isMobile .popup_suggest_products_item .product_info_content_title {
    font-size: 12px;
}

.ai_search_popup_content.isMobile .popup_suggest_products_item .product_info_content_button {
    width: 100px;
    height: 16px;
    font-size: 12px;
}

.ai_search_popup_content.isMobile .popup_suggest_products_item .product_introduction {
    font-size: 12px;
}

.ai_search_popup_content.isMobile .popup_suggest_input {
    margin-bottom: 0;
    height: 32px;
    min-height: 32px;
}

.ai_search_popup_content.isMobile .popup_recommend_content {
    padding: 0;
    margin: 0 16px;
    width: calc(100% - 32px);
}

.ai_search_popup_content.isMobile .popup_recommend_content_area {
    padding-top: 8px;
}

.ai_search_popup_content.isMobile .popup_recommend_content_title {
    font-size: 12px;
}

.ai_search_popup_content.isMobile .popup_recommend_content_title_more {
    display: inline-flex !important;
    font-size: 12px;
    top: -8px;
    right: 0;
    height: 20px;
}

.ai_search_popup_content.isMobile .slide_product_item .product_info_model {
    font-size: 12px;
}

.ai_search_popup_content.isMobile .slide_product_item .product_info_title {
    font-size: 12px;
}

/* 輸入框 placeholder 樣式 */
.popup_suggest_input input::placeholder {
    color: #999999;
    opacity: 0.6;
}

/* 跨瀏覽器相容性 */
.popup_suggest_input input::-webkit-input-placeholder {
    color: #999999;
    opacity: 0.6;
}

.popup_suggest_input input::-moz-placeholder {
    color: #999999;
    opacity: 0.6;
}

.popup_suggest_input input:-ms-input-placeholder {
    color: #999999;
    opacity: 0.6;
}

.popup_suggest_input input:-moz-placeholder {
    color: #999999;
    opacity: 0.6;
}

/* 單品模式：把 slide 置中 */
.popup_recommend_content_area .swiper-wrapper {
  display: flex;
  justify-content: flex-start; /* 預設，如果 JS 有套 justifyContent=center 就會居中 */
}
/* Swiper 按鈕基本樣式 */

/* 只剩一張卡片時，把它撐滿、置中，並關閉箭頭 */
.popup_recommend_content_swiper .swiper-wrapper > .swiper-slide:only-child {
   flex: 0 0 240px !important;
    max-width: 240px !important;
    height: 160px !important;
    /* 置中顯示 */
    margin: 0 auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* 確保單品圖片等比填滿 */
.popup_recommend_content_swiper .swiper-wrapper > .swiper-slide:only-child img {
  width: auto;                     /* 依版面自行調整 */
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;             /* 保留完整圖片 */
}

/* 單一產品卡片樣式 - 比照輪播圖尺寸，靠左排列 */
.popup_recommend_content_area .single-product-card {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  width: 100% !important;
  padding: 8px 0 !important;
  margin: 0 !important;
  margin-left: 30px !important;
  text-align: left !important;
}

.popup_recommend_content_area .single-product-card .slide_product_item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  width: 160px !important;
  height: auto !important;
  text-decoration: none !important;
  overflow: hidden !important;
  cursor: pointer !important;
  margin: 0 !important;
  float: left !important;
}

/* 單品圖片樣式 - 使用更高優先級的選擇器 */
.popup_recommend_content_area .single-product-card .slide_product_item img {
  width: 160px !important;
  height: 110px !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 !important;
}

.single-product-card .product_info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.single-product-card .product_info_model {
  font-size: 14px;
  font-weight: 500;
  color: #505050;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.single-product-card .product_info_title {
  font-size: 14px;
  font-weight: 400;
  color: #505050;
  opacity: 0.6;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

/* Cache bust: 1754453754 */
