/* Khung chat nổi — Yến Sào Như Anh */
.chat-nut {
  position: fixed; right: 14px; bottom: calc(var(--cao-thanh-day, 0px) + 14px + env(safe-area-inset-bottom)); z-index: 50;
  display: inline-flex; align-items: center; gap: 8px; height: 54px; padding: 0 18px 0 15px; border-radius: 27px; border: 0; cursor: pointer;
  background: var(--muc, #3a2517); color: #fff7ea; font: 600 16px/1 var(--chu-than, sans-serif);
  box-shadow: 0 0 0 3px rgba(253, 249, 241, .9), 0 14px 28px -10px rgba(58, 37, 23, .7);
  -webkit-tap-highlight-color: transparent;
}
.chat-nut svg { width: 24px; height: 24px; }
.chat-nut-chu { white-space: nowrap; }
@media (max-width: 899px) { .co-thanh-day .chat-nut { width: 54px; padding: 0; justify-content: center; } .co-thanh-day .chat-nut-chu { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
.chat-cham {
  position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%; background: #d8342b; box-shadow: 0 0 0 2px var(--muc, #3a2517);
}
.chat-nut.co-tin-moi { animation: chat-rung 2.4s ease-in-out infinite; }
@keyframes chat-rung { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(-6deg); } 95% { transform: rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .chat-nut.co-tin-moi { animation: none; } }
.chat-dang-mo .chat-nut { display: none; }

.chat-khung {
  position: fixed; z-index: 60; right: 8px; left: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
  height: min(600px, calc(100dvh - 24px)); display: flex; flex-direction: column; overflow: hidden;
  background: var(--giay, #fdf9f1); border: 1px solid var(--vien, #dcc9a8); border-radius: 20px;
  box-shadow: 0 30px 60px -20px rgba(42, 25, 14, .55); font-family: var(--chu-than, sans-serif); color: var(--muc, #3a2517);
}
.chat-khung[hidden] { display: none; }
@media (min-width: 700px) { .chat-khung { left: auto; right: 20px; bottom: 20px; width: 380px; height: min(620px, calc(100vh - 40px)); } }

.chat-dau { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; background: var(--muc, #3a2517); color: #fff7ea; }
.chat-dau b { display: block; font: 600 19px/1.1 var(--chu-tieu-de, serif); }
.chat-dau span { font-size: 14px; color: #e2cfb2; }
.chat-dau > div { flex: 1; min-width: 0; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #f3e3c4; color: var(--dong-dam, #87571f); font: 700 15px/1 var(--chu-tieu-de, serif); box-shadow: 0 0 0 2px #c08b4c; flex: none; }
.chat-dong { width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .08); color: #fff7ea; display: grid; place-items: center; cursor: pointer; }
.chat-dong svg { width: 22px; height: 22px; }

.chat-tin { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.chat-bong { max-width: 84%; padding: 10px 13px 6px; border-radius: 16px; font-size: 16px; line-height: 1.45; word-wrap: break-word; white-space: pre-wrap; }
.chat-bong small { display: block; font-size: 12px; opacity: .7; margin-top: 3px; text-align: right; }
.chat-bong.shop { align-self: flex-start; background: #fff; border: 1px solid var(--vien-nhat, #e9dcc4); border-bottom-left-radius: 6px; }
.chat-bong.khach { align-self: flex-end; background: var(--muc-2, #6a4e3a); color: #fff7ea; border-bottom-right-radius: 6px; }
.chat-bong.chao { background: #f3e3c4; border-color: transparent; padding-bottom: 10px; }
.chat-bong.dang-gui { opacity: .7; }
.chat-bong.loi { background: #f7dcd6; color: #6d1a14; }
.chat-gui-lai { font: inherit; font-weight: 700; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

.chat-loi { margin: 0 12px 8px; padding: 10px 12px; border-radius: 12px; background: #fbeee0; border: 1px dashed var(--dong, #b07a3b); font-size: 15px; }
.chat-loi p { margin: 0 0 8px; }
.chat-loi-nut { display: flex; gap: 8px; flex-wrap: wrap; }
.chat-loi-nut a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 10px; background: var(--tao, #9c2a23); color: #fff; font-weight: 600; text-decoration: none; }
.chat-loi-nut a + a { background: var(--muc, #3a2517); }

.chat-form { border-top: 1px solid var(--vien-nhat, #e9dcc4); padding: 8px 10px 10px; background: var(--giay, #fdf9f1); }
.chat-thong-tin summary { cursor: pointer; font-size: 14px; color: var(--muc-2, #6a4e3a); padding: 4px 4px 8px; }
.chat-hai-o { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chat-hai-o label span { display: block; font-size: 13px; color: var(--muc-3, #8b7260); margin-bottom: 2px; }
.chat-hai-o input { width: 100%; min-height: 42px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--vien, #dcc9a8); font: 16px/1.2 var(--chu-than, sans-serif); background: #fff; color: inherit; }
.chat-ghi { font-size: 13px; color: var(--muc-3, #8b7260); margin: 6px 2px 8px; }
.chat-bay { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.chat-o-go { display: flex; gap: 8px; align-items: flex-end; }
.chat-o-go textarea {
  flex: 1; min-height: 46px; max-height: 120px; resize: none; padding: 11px 12px; border-radius: 14px; border: 1px solid var(--vien, #dcc9a8);
  font: 16px/1.4 var(--chu-than, sans-serif); background: #fff; color: inherit;
}
.chat-gui { width: 46px; height: 46px; border-radius: 14px; border: 0; background: var(--tao, #9c2a23); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.chat-gui svg { width: 22px; height: 22px; }
