/* Khung chat culcat.vn — xem js/chat.jsx.
   Chỉ dùng biến màu có sẵn trong colors_and_type.css để widget không lệch tông
   khi đổi mood. */

.cc-chat-launcher {
  position: fixed;
  right: 16px;
  bottom: 80px;
  z-index: 60;
  border: 1px solid var(--ink, #2B2721);
  background: var(--paper, #F6F1E7);
  color: var(--ink, #2B2721);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}
.cc-chat-launcher:hover { background: var(--ink, #2B2721); color: var(--paper, #F6F1E7); }

.cc-chat {
  position: fixed;
  right: 16px;
  bottom: 80px;
  z-index: 60;
  width: min(360px, calc(100vw - 32px));
  /* Chiều cao động chứ không cố định: bàn phím ảo trên điện thoại ăn mất nửa màn,
     và một khung chat cao hơn màn hình thì không bấm được nút Gửi. */
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--paper, #F6F1E7);
  border: 1px solid var(--ink, #2B2721);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .18);
}

.cc-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(43, 39, 33, .18);
  font-weight: 600;
}
.cc-chat__head button {
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
}

.cc-chat__body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.cc-chat__intro input,
.cc-chat__intro textarea,
.cc-chat__foot textarea {
  width: 100%;
  border: 1px solid rgba(43, 39, 33, .3);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ink, #2B2721);
}
.cc-chat__intro button,
.cc-chat__foot button {
  border: 1px solid var(--ink, #2B2721);
  background: var(--ink, #2B2721);
  color: var(--paper, #F6F1E7);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
.cc-chat__intro button:disabled,
.cc-chat__foot button:disabled { opacity: .45; cursor: default; }

.cc-chat__msg {
  max-width: 82%;
  padding: 8px 11px;
  border-radius: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.cc-chat__msg--me { align-self: flex-end; background: var(--ink, #2B2721); color: var(--paper, #F6F1E7); }
.cc-chat__msg--them { align-self: flex-start; background: rgba(43, 39, 33, .08); }
/* Link trong tin (vd link Instagram của tin tự động) — cùng màu chữ, chỉ gạch chân. */
.cc-chat__msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.cc-chat__hint { font-size: 12px; opacity: .65; }
.cc-chat__error { font-size: 12px; color: #B3261E; }

.cc-chat__foot {
  border-top: 1px solid rgba(43, 39, 33, .18);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cc-chat__foot button { align-self: flex-end; }

/* ---- Soạn tin: chọn sản phẩm, đính ảnh (16/10/2026) ------------------------ */
.cc-chat__composer { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.cc-chat__pending { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-chat__chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  border: 1px solid rgba(43, 39, 33, .3); border-radius: 999px; padding: 3px 6px 3px 3px;
  background: #fff; font-size: 12px;
}
.cc-chat__chip img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.cc-chat__chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.cc-chat__thumb { position: relative; }
.cc-chat__thumb img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; display: block; }
.cc-chat .cc-chat__chip button,
.cc-chat .cc-chat__thumb button {
  border: 0; padding: 0; width: 18px; height: 18px; border-radius: 50%; line-height: 18px; font-size: 13px;
  background: var(--ink, #2B2721); color: var(--paper, #F6F1E7); cursor: pointer;
}
.cc-chat .cc-chat__thumb button { position: absolute; top: -6px; right: -6px; }
.cc-chat__composer textarea { width: 100%; resize: none; }
.cc-chat__bar { display: flex; align-items: center; gap: 6px; }
.cc-chat .cc-chat__tool {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(43, 39, 33, .25); background: #fff; color: var(--ink, #2B2721);
  border-radius: 999px; padding: 6px 10px; font-size: 12px; line-height: 1; cursor: pointer;
}
.cc-chat .cc-chat__tool:disabled { opacity: .4; cursor: default; }
.cc-chat .cc-chat__send { margin-left: auto; }

/* Tin có sản phẩm / ảnh */
.cc-chat__item { display: flex; flex-direction: column; gap: 4px; max-width: 82%; }
.cc-chat__item--me { align-self: flex-end; align-items: flex-end; }
.cc-chat__item--them { align-self: flex-start; align-items: flex-start; }
.cc-chat__item .cc-chat__msg { max-width: 100%; }
.cc-chat__product {
  display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 12px;
  border: 1px solid rgba(43, 39, 33, .2); background: #fff; font-size: 13px;
}
.cc-chat__product img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.cc-chat__product span { display: flex; flex-direction: column; }
.cc-chat__product small, .cc-chat__picker small { opacity: .65; }
.cc-chat__images { display: flex; flex-wrap: wrap; gap: 4px; }
.cc-chat__images img { width: 110px; height: 110px; border-radius: 10px; object-fit: cover; display: block; }

/* Chọn sản phẩm */
.cc-chat__picker { gap: 8px; }
.cc-chat__picker-head { display: flex; gap: 6px; }
.cc-chat .cc-chat__picker-head button {
  border: 1px solid rgba(43, 39, 33, .3); background: #fff; color: inherit; border-radius: 10px; width: 36px; font-size: 18px; cursor: pointer;
}
.cc-chat__picker-head input {
  flex: 1; border: 1px solid rgba(43, 39, 33, .3); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; background: #fff;
}
.cc-chat__picker ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cc-chat .cc-chat__picker li button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 1px solid transparent; background: transparent; color: inherit; border-radius: 10px; padding: 6px; cursor: pointer; font-size: 13px;
}
.cc-chat .cc-chat__picker li button:hover { background: #fff; border-color: rgba(43, 39, 33, .2); }
.cc-chat__picker li img, .cc-chat__noimg { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: rgba(43, 39, 33, .08); flex: none; }
.cc-chat__picker li span { display: flex; flex-direction: column; }
