/* 2026-10-13 엔핍 AI 상담사 (헤더 버튼 + 상담창). PC=우측 패널, MO(≤767)=하단 시트 */

/* ---------- 헤더 버튼 ---------- */
.aic-btn-pc {
  height: 50px; padding: 0 18px; border: 0; border-radius: 25px; flex-shrink: 0;
  background: #fff4e6; color: #e8820c; font-size: 14px; font-weight: 700; letter-spacing: -0.3px;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 0 0 1.5px #ffd8a8; transition: background .15s;
}
.aic-btn-pc:hover { background: #ffe8cc; }
.aic-btn-pc .aic-spark { font-size: 15px; line-height: 1; }

.m-header .header-section.header-aic { flex: 0 0 auto; display: flex; align-items: center; padding-left: 4px; }
.aic-btn-mo {
  width: 34px; height: 34px; border: 0; border-radius: 50%; padding: 0;
  background: #fff4e6; color: #e8820c; font-size: 11px; font-weight: 800; letter-spacing: -0.3px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  box-shadow: inset 0 0 0 1.5px #ffd8a8; cursor: pointer;
}
.aic-btn-mo .aic-spark { font-size: 10px; margin-bottom: 1px; }

/* ---------- 상담창 ---------- */
.aic-panel {
  position: fixed; z-index: 2147483000; right: 20px; top: 90px;
  width: 380px; height: min(640px, calc(100vh - 110px));
  display: none; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.18);
  font-size: 14px; color: #222; letter-spacing: -0.2px;
}
.aic-panel.show { display: flex; }
.aic-dim { display: none; }

.aic-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 16px; flex-shrink: 0; }
.aic-ava {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #ffb347, #ff8c1a); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.aic-ava.sm { width: 26px; height: 26px; font-size: 12px; }
.aic-tt { flex: 1; min-width: 0; line-height: 1.25; }
.aic-tt b { display: block; font-size: 16px; }
.aic-tt small { color: #888; font-size: 12px; }
.aic-x { border: 0; background: none; font-size: 26px; line-height: 1; color: #888; padding: 0 4px; cursor: pointer; }

.aic-tabs { display: flex; gap: 8px; padding: 0 14px 10px; flex-shrink: 0; }
.aic-tab {
  flex: 1; height: 38px; border: 1px solid #eee; border-radius: 19px; background: #fafafa;
  font-size: 13px; color: #555; cursor: pointer; white-space: nowrap;
}
.aic-tab.on { background: #fff4e6; border-color: #ffc078; color: #e8820c; font-weight: 700; }

.aic-quick {
  display: flex; gap: 6px; overflow-x: auto; padding: 0 14px 10px; flex-shrink: 0;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.aic-quick::-webkit-scrollbar { display: none; }
.aic-chip {
  flex: 0 0 auto; height: 32px; padding: 0 12px; border: 1px solid #e5e5e5; border-radius: 16px;
  background: #fff; font-size: 13px; color: #333; cursor: pointer; white-space: nowrap;
}
.aic-chip:hover { border-color: #ffc078; color: #e8820c; }

.aic-body {
  flex: 1; overflow-y: auto; padding: 12px 14px; background: #f7f7f8;
  border-top: 1px solid #f0f0f0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.aic-msg { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-start; }
.aic-msg.me { justify-content: flex-end; }
.aic-col { min-width: 0; flex: 1; }
.aic-bub {
  display: inline-block; max-width: 100%; padding: 9px 12px; border-radius: 14px;
  line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; white-space: normal; /* 2026-10-15 낱말 중간 줄바꿈 방지 */
}
.aic-msg.bot .aic-bub { background: #fff; border: 1px solid #eee; border-top-left-radius: 4px; }
.aic-msg.me .aic-bub { background: #fff1de; color: #5a3b12; border-top-right-radius: 4px; max-width: 80%; }
.aic-bub a { color: #e8820c; word-break: break-all; }

.aic-typing .aic-bub i {
  display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: #ccc;
  animation: aicDot 1s infinite ease-in-out;
}
.aic-typing .aic-bub i:nth-child(2) { animation-delay: .15s; }
.aic-typing .aic-bub i:nth-child(3) { animation-delay: .3s; }
@keyframes aicDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.aic-cards { display: flex; gap: 8px; overflow-x: auto; margin-top: 8px; padding-bottom: 4px; scrollbar-width: thin; }
.aic-card {
  flex: 0 0 120px; display: flex; flex-direction: column; background: #fff; border: 1px solid #eee;
  border-radius: 10px; padding: 8px; text-decoration: none !important; color: #222;
}
.aic-cimg { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; background: #f3f3f3; }
.aic-cimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aic-cname {
  margin-top: 6px; font-size: 12px; line-height: 1.35; height: 2.7em; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.aic-cprice { margin-top: 3px; font-size: 13px; font-weight: 700; }
.aic-cbtn {
  margin-top: 6px; height: 28px; line-height: 28px; text-align: center; border-radius: 6px;
  background: #fff4e6; color: #e8820c; font-size: 12px; font-weight: 700;
}

.aic-handoff {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 16px; flex-shrink: 0;
  border: 0; border-top: 1px solid #f0f0f0; background: #fff; color: #666; font-size: 12.5px;
  text-align: left; cursor: pointer;
}
.aic-handoff span { flex: 1; }
.aic-handoff.hl { background: #fff8ef; color: #c26a00; font-weight: 600; }

.aic-input { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid #f0f0f0; flex-shrink: 0; background: #fff; }
.aic-input input {
  flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 1px solid #e5e5e5; border-radius: 21px;
  font-size: 14px; background: #fafafa; outline: none;
}
.aic-input input:focus { border-color: #ffc078; background: #fff; }
.aic-input button {
  width: 42px; height: 42px; border: 0; border-radius: 50%; background: #ffa02e; color: #fff;
  font-size: 15px; cursor: pointer; flex-shrink: 0;
}

/* ---------- 모바일: 하단 시트 ---------- */
@media (max-width: 767px) {
  .aic-panel {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 85vh; height: 85dvh;
    border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.2);
  }
  .aic-dim.show { display: block; position: fixed; inset: 0; z-index: 2147482999; background: rgba(0,0,0,.35); }
  .aic-input { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  /* iOS 자동확대 방지: 입력칸 16px 필수 */
  .aic-input input { font-size: 16px !important; }
  html.aic-open, html.aic-open body { overflow: hidden; }
}

/* 2026-10-14 피드백: 모바일 상담창이 화면 밖으로 넘쳐 입력칸/X 버튼이 안 보임
   - 높이·위치는 JS(fit, visualViewport)가 지정. 여기선 대화 영역만 줄어들며 스크롤되게 보장 */
.aic-panel .aic-body { min-height: 0; flex: 1 1 auto; }
.aic-panel > .aic-head, .aic-panel > .aic-tabs, .aic-panel > .aic-quick,
.aic-panel > .aic-handoff, .aic-panel > .aic-input { flex-shrink: 0; }
@media (max-width: 767px) {
  .aic-panel { max-height: 88vh; }
  .aic-x { font-size: 30px; min-width: 44px; min-height: 44px; }   /* 닫기 버튼 손가락 크기 */
}
/* 2026-10-14 근본원인: 모바일 테마 CSS가 상담창 display 를 block 으로 덮어써 세로 flex 배치가 깨짐
   → 대화 영역이 내용 길이만큼 늘어나 입력칸·X가 화면 밖으로. ID+!important 로 고정 */
#aic-panel.aic-panel.show { display: flex !important; flex-direction: column !important; }

/* 2026-10-14 담당자 피드백: 대표질문 칩 줄 가로 넘김 — 끝에 더 있으면 가장자리 흐림 + PC 마우스 끌기 커서 */
.aic-quick.more-r { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
.aic-quick.more-l { -webkit-mask-image: linear-gradient(to left, #000 82%, transparent); mask-image: linear-gradient(to left, #000 82%, transparent); }
.aic-quick.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 82%, transparent); mask-image: linear-gradient(to right, transparent, #000 12%, #000 82%, transparent); }
@media (hover: hover) and (pointer: fine) {
  .aic-quick, .aic-cards { cursor: grab; }
  .aic-quick .aic-chip { cursor: pointer; }
}
.aic-quick.aic-dragging, .aic-cards.aic-dragging { cursor: grabbing; user-select: none; }
.aic-quick { touch-action: pan-x pan-y; overscroll-behavior-x: contain; }
/* 2026-10-16 사용자요청: 모바일 헤더(장바구니 옆) AI 아이콘 숨김 — 우측 하단 AI 버튼으로 진입. 롤백=aicounsel.css.bak_20261016_mohide */
.header-section.header-aic{display:none !important}

/* 2026-10-16 2차: 주문 카드·로그인/비회원 확인 상자 */
.aic-chip.aic-chip-od{background:#fff4e6;border-color:#ffb24d;color:#c25e00;font-weight:700}
.aic-ods{display:flex;flex-direction:column;gap:8px;margin-top:8px}
.aic-od{background:#fff;border:1px solid #eee;border-radius:12px;padding:10px 12px;font-size:13px;line-height:1.5}
.aic-od-top{display:flex;justify-content:space-between;gap:8px;color:#888;font-size:12px}
.aic-od-top b{color:#e8730c;font-size:13px;text-align:right}
.aic-od-it{margin-top:4px;color:#222;font-weight:600;word-break:keep-all}
.aic-od-it em{font-style:normal;color:#666;font-weight:400;margin-left:4px}
.aic-od-cp{margin-top:4px;color:#666;font-size:12px;word-break:keep-all}
.aic-od-bt{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.aic-od-bt a{display:inline-block;padding:5px 10px;border:1px solid #ffc98a;border-radius:14px;background:#fffaf3;color:#c25e00 !important;font-size:12px;font-weight:600;text-decoration:none !important}
.aic-auth{margin-top:8px;display:flex;flex-direction:column;gap:8px}
.aic-auth-login{display:block;text-align:center;padding:9px;border-radius:10px;background:#ffa733;color:#fff !important;font-weight:700;font-size:13px;text-decoration:none !important}
.aic-guest{display:flex;flex-wrap:wrap;gap:6px;align-items:center;background:#fafafa;border:1px solid #eee;border-radius:10px;padding:8px}
.aic-guest b{width:100%;font-size:12px;color:#555}
.aic-guest input{flex:1 1 110px;min-width:0;height:34px;border:1px solid #ddd;border-radius:8px;padding:0 8px;font-size:16px}
.aic-guest button{height:34px;padding:0 14px;border:0;border-radius:8px;background:#333;color:#fff;font-size:13px;font-weight:700}
