/* JW 2026/01/09 為「以圖搜圖」浮動窗加上獨立樣式，避免污染既有 header / plp 的 CSS；也方便將來整包移除 */
.img-search-popover-overlay {
  position: fixed;
  inset: 0;
  /* JW 2026/02/01：避免壓住 V14 的 SweetAlert/Modal（Swal 預設約 1060） */
  z-index: 1050;
  background: transparent;
}

.img-search-popover {
  position: absolute;
  width: min(640px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  border-radius: 16px;
  overflow: hidden;
}

.img-search-popover__header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 18px 10px;
  border-bottom: 0;
  font-size: 22px;
  font-weight: 700;
  position: relative;
}

.img-search-popover__title {
  text-align: center;
}

.img-search-popover__close {
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 6px;
  line-height: 1;
  position: absolute;
  right: 14px;
  top: 14px;
  font-size: 26px;
}

.img-search-popover__body {
  padding: 10px 18px 18px;
}

.img-search-dropzone {
  border: 2px dashed rgba(0, 0, 0, 0.16);
  border-radius: 16px;
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  background: rgba(0, 0, 0, 0.01);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.img-search-dropzone.is-dragover {
  border-color: rgba(0, 0, 0, 0.32);
  background: rgba(0, 0, 0, 0.03);
}

.img-search-dropzone.is-busy {
  pointer-events: none;
  opacity: 0.75;
}

.img-search-dropzone.has-preview .img-search-dropzone__inner {
  display: none;
}

.img-search-dropzone.has-preview .img-search-preview {
  margin-top: 0;
}

.img-search-dropzone__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.img-search-dropzone__icon {
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background: var(--header_sub_bg_color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  /* JW 2026/01/09 icon 要只比圓圈小一點才好看（接近設計圖的視覺比例） */
  font-size: 44px;
}

/* JW 2026/01/09：icon font 常用 pseudo-element，保險起見直接鎖 i 的 font-size，避免被其他全域樣式蓋掉 */
.img-search-dropzone__icon i {
  font-size: 44px !important;
  line-height: 1;
}

.img-search-dropzone__hint {
  font-size: 20px;
  color: rgba(0, 0, 0, 0.75);
  line-height: 1.3;
}

.img-search-dropzone__hint--strong {
  color: var(--header_sub_bg_color);
  font-weight: 700;
}

.img-search-dropzone__note {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.75);
  line-height: 1.35;
}

.img-search-preview {
  margin-top: 16px;
  display: none;
  align-items: center;
  justify-content: center;
}

.img-search-preview__wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.img-search-preview__loading {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}

.img-search-dropzone.is-searching .img-search-preview__loading {
  display: flex;
}

.img-search-dropzone.is-searching .img-search-preview__loading:before {
  content: "";
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 4px solid rgba(255, 65, 130, 0.25);
  border-top-color: #ff4182;
  animation: imgSearchSpin 0.9s linear infinite;
  box-sizing: border-box;
  backdrop-filter: blur(1px);
}

@keyframes imgSearchSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.img-search-preview img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.img-search-note {
  margin-top: 10px;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.55);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .img-search-popover {
    width: min(640px, calc(100vw - 24px));
    border-radius: 14px;
  }
  .img-search-popover__header {
    font-size: 18px;
  }
  .img-search-dropzone {
    min-height: 260px;
  }
  .img-search-dropzone__hint {
    font-size: 16px;
  }
}

