/* ─── 제품 카테고리 뱃지 ────────────────────────── */
.mck-card-cat-row {
  margin-bottom: 6px;
}
.mck-card-cat {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 2px 7px;
  border-radius: 3px;
  background: #f0f0f1;
  color: #444;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════
   MCK AI Frontend — 독자용 UI
   ═══════════════════════════════════════════════════ */

/* ─── FAB (캡슐형: 텍스트 라벨 + 원형 봇 아이콘) ──── */
.mck-fab {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: 24px;
  height: 56px;
  width: 182px;
  border-radius: 28px;
  background: #000;
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
  transition: transform .2s, box-shadow .2s, width .4s cubic-bezier(.4,0,.2,1);
  font-family: inherit;
  overflow: hidden;
}
.mck-fab:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 24px rgba(0,0,0,.38);
}
.mck-fab:active {
  transform: scale(.96);
  transition: transform .08s;
}

/* 텍스트 라벨: 좌측에 절대 배치, 줄어들 때 페이드아웃만 */
.mck-fab-label {
  position: absolute;
  top: 0;
  left: 0;
  right: 56px; /* 아이콘 영역만큼 여유 둠 */
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 1;
  padding-left: 16px;
  transition: opacity .25s ease;
}
.mck-fab-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

/* 우측 원형 아이콘: 항상 같은 자리에 고정 */
.mck-fab-ico {
  position: absolute;
  top: 0;
  right: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mck-fab-bot-img {
  width: 46px;
  height: 46px;
  display: block;
  object-fit: contain;
  animation: mck-bot-shake 3s ease-in-out infinite;
  transition: transform .25s ease;
}
.mck-fab:hover .mck-fab-bot-img {
  animation: none;
  transform: rotate(-8deg);
}
.mck-fab-close {
  width: 22px;
  height: 22px;
  display: none;
}
/* 닫힌(원형) 상태에서 캐릭터 아래 노출되는 AI 텍스트 */
.mck-fab-ico-label {
  display: none;
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #fff;
  line-height: 1;
}

/* 열린 상태: 텍스트만 숨기고 폭을 아이콘 크기로 축소 */
.mck-fab.open,
.mck-fab.scrolled:not(.open) {
  width: 56px;
  border-radius: 28px;
}
.mck-fab.open .mck-fab-label,
.mck-fab.scrolled:not(.open) .mck-fab-label {
  opacity: 0;
  transition: opacity .2s ease;
}
/* open 상태에서는 X 아이콘, scrolled만인 상태에서는 봇 이미지 + AI 라벨 유지 */
.mck-fab.open .mck-fab-bot-img { display: none; }
.mck-fab.open .mck-fab-ico-label { display: none; }
.mck-fab.open .mck-fab-close { display: block; }
.mck-fab.scrolled:not(.open) .mck-fab-bot-img {
  display: block;
  width: 46px;
  height: 46px;
 /* margin-top: -6px; */
}
.mck-fab.scrolled:not(.open) .mck-fab-ico-label { display: none; }
.mck-fab.scrolled:not(.open) .mck-fab-close { display: none; }

/* 3초 주기 좌우 흔들림 (캐릭터 애니메이션) */
@keyframes mck-bot-shake {
  0%, 84%, 100% { transform: rotate(0); }
  88%            { transform: rotate(-10deg); }
  92%            { transform: rotate(10deg); }
  96%            { transform: rotate(-6deg); }
}

@media (max-width: 900px) {
  .mck-fab {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    height: 54px;
    width: 182px;
  }
  .mck-fab.open,
  .mck-fab.scrolled:not(.open) { width: 54px; }
  .mck-fab-ico { width: 54px; height: 54px; }
  .mck-fab-bot-img { width: 42px; height: 42px; }
  .mck-fab.scrolled:not(.open) .mck-fab-bot-img { width: 42px; height: 42px; }
  .mck-fab-title { font-size: 12px; }
}

/* ─── 팝업 패널 ──────────────────────────────────── */
.mck-popup {
  position: fixed;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  right: 24px;
  width: 360px;
  max-height: 75vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 36px rgba(0,0,0,.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9997;
}
.mck-popup.open { display: flex; }

.mck-popup-hd {
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.mck-popup-title {
  font-size: 14px;
  font-weight: 700;
  color: #111;
}
.mck-popup-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #888;
  padding: 2px 8px;
  line-height: 1;
}
.mck-popup-close:hover { color: #111; }

.mck-popup-bd {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 8px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* 입력창 */
.mck-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px 14px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.mck-input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 13px;
  outline: none;
  background: #fafafa;
  color: #1d2327;
  font-family: inherit;
  transition: border-color .15s;
}
.mck-input:focus {
  border-color: #1d2327;
  background: #fff;
}
.mck-send {
  width: 36px;
  height: 36px;
  background: #1d2327;
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.mck-send:hover { background: #333; }
.mck-send svg { width: 16px; height: 16px; }

@media (max-width: 900px) {
  .mck-popup {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  /* 팝업이 열려있을 때는 하단 FAB(X 버튼) 숨김 - 팝업 헤더의 X 버튼으로 닫음 */
  .mck-fab.open {
    display: none;
  }
}

/* ─── PC 사이드바 카드 ───────────────────────────── */
.mck-sidebar-card {
  margin-bottom: 24px;
}
.mck-sidebar-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  text-align: left;
  transition: border-color .2s, box-shadow .2s;
}
.mck-sidebar-trigger:hover {
  border-color: #1d2327;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.mck-sidebar-trigger-text {
  font-size: 13px;
  font-weight: 700;
  color: #111;
}
.mck-sidebar-trigger-sub {
  font-size: 10.5px;
  color: #888;
  margin-top: 2px;
}
.mck-sidebar-arrow {
  color: #999;
  font-size: 18px;
  font-weight: 300;
  transition: transform .25s;
}
.mck-sidebar-trigger.open .mck-sidebar-arrow { transform: rotate(90deg); }

.mck-sidebar-body {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  margin-top: 6px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.mck-sidebar-hd {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mck-sidebar-hd-title {
  font-size: 13px;
  font-weight: 700;
  color: #1d2327;
}
.mck-sidebar-hd-sub {
  font-size: 10.5px;
  color: #888;
  margin-top: 1px;
}
.mck-sidebar-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
  padding: 2px 8px;
  line-height: 1;
  margin-left: auto;
}
.mck-sidebar-close:hover { color: #111; }

.mck-sidebar-chips {
  padding: 12px 16px 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}
.mck-sidebar-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px 14px;
  border-top: 1px solid #f0f0f0;
}

/* ─── 봇 마크 ────────────────────────────────────── */
.mck-bot-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #111;
  flex-shrink: 0;
}
.mck-bot-mark svg,
.mck-bot-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }
.mck-bot-mark.loading svg,
.mck-bot-mark.loading img {
  animation: mck-bounce .9s ease-in-out infinite;
  transform-origin: bottom center;
}
@keyframes mck-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

/* ─── 인트로 ─────────────────────────────────────── */
.mck-intro {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
}
.mck-intro .mck-bot-mark {
  margin-top: 0;
}
.mck-intro-text {
  font-size: 12.5px;
  color: #222;
  line-height: 1.5;
  background: #f4f4f5;
  border-radius: 4px 14px 14px 14px; 
  padding: 9px 13px;
  max-width: 80%;
  margin-top:0 !important;
}

/* ─── 질문 칩 ────────────────────────────────────── */
.mck-chips,
.mck-followup {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.mck-chip {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 18px;
  padding: 8px 14px;
  text-align: right;
  font-size: 12px;
  color: #222;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .18s, background .18s;
  line-height: 1.4;
  max-width: 100%;
}
.mck-chip:hover {
  background: #fafafa;
  border-color: #999;
}

/* ─── 대화 스레드 ────────────────────────────────── */
.mck-thread {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.mck-turn { display: flex; flex-direction: column; gap: 12px; }

.mck-user-msg {
  align-self: flex-end;
  background: #1d2327;
  color: #fff;
  border-radius: 18px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  max-width: 92%;
  text-align: right;
  line-height: 1.4;
}
.mck-ai-msg {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mck-ai-msg-content {
  font-size: 12.5px;
  color: #222;
  line-height: 1.75;
}
.mck-ai-msg-content p { margin: 0 0 8px; }
.mck-ai-msg-content p:last-child { margin-bottom: 0; }
.mck-err { color: #c0392b; }

/* ─── 로딩 스켈레톤 ──────────────────────────────── */
.mck-loading { display: none; margin-top: 18px; }
.mck-loading.show { display: flex; align-items: flex-start; gap: 10px; }
.mck-skel { flex: 1; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.mck-skel-line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: mck-skel-anim 1.4s ease-in-out infinite;
}
@keyframes mck-skel-anim {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── 팔로업 / 면책 ──────────────────────────────── */
.mck-followup {
  margin-top: 14px;
}
.mck-disclaim {
  font-size: 10px;
  color: #aaa;
  text-align: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  line-height: 1.5;
}

/* ─── 제품 / 장소 카드 ───────────────────────────── */
.mck-card-list {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.mck-card-list::-webkit-scrollbar { height: 4px; }
.mck-card-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.mck-card {
  display: flex;
  flex-direction: column;
  width: 140px;
  flex-shrink: 0;
  padding: 8px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fff;
  scroll-snap-align: start;
}
.mck-card-img {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 6px;
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.mck-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mck-card-img-placeholder {
  font-size: 9px;
  color: #aaa;
}
.mck-card-body { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.mck-card-brand {
  font-size: 9.5px;
  font-weight: 700;
  color: #111;
  letter-spacing: .5px;
}
.mck-card-name {
  font-size: 11px;
  color: #444;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.mck-card-price {
  font-size: 10.5px;
  font-weight: 600;
  color: #111;
  margin-bottom: 8px;
  line-height: 1.3;
}
.mck-card-btn {
  display: block;
  text-align: center;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  margin-top: auto;
  transition: background .15s;
}
.mck-card-btn:hover { background: #333; color: #fff; }

/* 지도 버튼 */
.mck-map-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
}
.mck-map-btn {
  display: block;
  text-align: center;
  border-radius: 6px;
  padding: 7px 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  border: none;
  transition: opacity .12s;
}
.mck-map-btn:hover { opacity: .85; }
.mck-map-kakao { background: #FEE500; color: #1d2327; }
.mck-map-naver  { background: #03C75A; color: #fff; }
.mck-map-google { background: #4285F4; color: #fff; }

/* ─── 반응형: FAB+팝업 PC/모바일 공통 ──────────────── */
/* PC: 팝업 더 넓게, 우하단 고정 */
@media (min-width: 901px) {
  .mck-fab {
    bottom: 40px;
    right: 40px;
    height: 60px;
    width: 182px;
  }
  .mck-fab.open,
  .mck-fab.scrolled:not(.open) {
    width: 60px;
  }
  .mck-fab-ico { width: 60px; height: 60px; }
  .mck-fab-bot-img { width: 48px; height: 48px; }
  .mck-fab.scrolled:not(.open) .mck-fab-bot-img { width: 48px; height: 48px; }
  .mck-fab-title { font-size: 13px; }
  .mck-popup {
    width: 400px;
    max-height: 80vh;
    bottom: 120px;
    right: 40px;
    border-radius: 18px;
  }
  .mck-sidebar-card { display: none !important; }
}