/* Nút liên hệ nổi (việc 39·47, phiếu 0072) — mảnh resources/views/partials/khung/_nut-lien-he.blade.php.
   Nạp ở home.blade.php + blog/_khung.blade.php (KHÔNG ở dat-mon/_khung — Sếp chốt không hiện ở Đặt món).
   Màu: var(--forest-deep) · var(--gold) của xmg.css; chữ kem #f5f1e2 / nâu #241a0c như .sticky-cta.
   Mốc ≤ 720px = đúng mốc hiện .sticky-cta trong xmg.css (chỉ huy chốt phiếu 0072, không dùng mốc 1024). */
.lhn {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 55;               /* < .sticky-cta 60 · < .modal-overlay 100 · < .lightbox 200 */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;      /* vỏ không chặn chạm; chỉ nút nhận */
}
.lhn__btn {
  pointer-events: auto;
  display: none;             /* mặc định ẩn; luật tiếng / khổ bên dưới bật */
  align-items: center;
  justify-content: center;
  position: relative;        /* mốc cho nhãn .lhn__nhan */
  width: 52px;               /* 39·51: mọi nút = hình TRÒN 52 px, chỉ biểu tượng */
  height: 52px;
  padding: 0;
  border-radius: 50%;
  font: 700 14px/1 system-ui, sans-serif;
  text-decoration: none;
  box-shadow: 0 6px 18px -8px rgba(35, 43, 24, .7);
}
.lhn__goi { display: flex; background: var(--forest-deep, #4a6b2f); color: #f5f1e2; }
.lhn__tin { background: var(--forest-deep, #4a6b2f); color: #f5f1e2; }   /* 39·51: nút nhắn tin xanh rêu như Gọi */
/* Tiếng: vi → Zalo · ru/en → WhatsApp · ko → KakaoTalk (body[data-lang] do máy chủ ghi, xmg.js setLang đổi) */
body[data-lang="vi"] .lhn__zalo,
body[data-lang="ru"] .lhn__wa,
body[data-lang="en"] .lhn__wa,
body[data-lang="ko"] .lhn__kakao { display: flex; }
.lhn__btn:focus-visible { outline: 3px solid #241a0c; outline-offset: 2px; }

/* Điện thoại: bỏ Gọi (ống nghe đã ở .sticky-cta), nâng lên trên thanh đáy cao 73px + khe 12px */
@media (max-width: 720px) {
  .lhn { bottom: calc(73px + 12px + env(safe-area-inset-bottom)); }
  .lhn__goi { display: none !important; }
}
/* Đăng nhập, chưa bật sửa: né nút «✎ Edit trang» .e-launch (editor-ui.css: bottom 18 + cao 38) — chỉ
   máy tính; điện thoại nút nổi đã ở trên 85px. */
@media (min-width: 721px) {
  body[data-can-edit] .lhn { bottom: calc(18px + 38px + 12px + env(safe-area-inset-bottom)); }
}
/* Ẩn lúc sửa trang & trong khung xem thử theo thiết bị của trình sửa (home.blade.php: body data-canvas khi ?xmg_canvas=1) */
body.xmg-edit-on .lhn,
body[data-canvas] .lhn { display: none; }

/* ===== 39·49 · nút «Đặt bàn» nổi (chỉ khổ > 720 px) — kiểu «trượt vào rồi nảy» ===== */
/* Màu: var(--lacquer) = clay-500 #8a4a2a (xmg.css:69 ← tokens.css:45), chữ kem #fff8ea → tương phản 6,4:1. Cao 52 px (min .lhn__btn). */
.lhn__dat {
  display: flex;
  background: var(--lacquer, #8a4a2a);
  color: #fff8ea;
  border: 0;
  cursor: pointer;
  transition: transform 150ms ease-out;
}
.lhn__dat:hover, .lhn__dat:focus-visible { transform: translateY(-2px); }
.lhn__dat:focus-visible { outline: 3px solid #fff8ea; outline-offset: 2px; box-shadow: 0 0 0 5px #241a0c; }
@media (max-width: 720px) { .lhn__dat { display: none !important; } }  /* thanh đáy .sticky-cta đã có Đặt bàn */
/* Chưa hiện: chỉ khi JS đã chạy (html.js — xmg.js dòng 12); không JS thì nút hiện sẵn, khỏi mất nút. */
.js .lhn__dat:not(.lhn__dat--vao) { visibility: hidden; opacity: 0; transform: translateX(calc(100% + 24px)); }
/* Hiện: trượt 350 ms rồi nảy 600 ms, đúng 1 lần (~0,95 s < 1,2 s). fill `backwards` (không `both`) để xong thì
   thả transform về luật thường → rê chuột vẫn nâng 2 px. */
.js .lhn__dat--vao {
  animation: lhn-truot 350ms ease-out backwards, lhn-nay 600ms ease-in-out 350ms backwards;
}
@keyframes lhn-truot { from { opacity: 0; transform: translateX(calc(100% + 24px)); } to { opacity: 1; transform: none; } }
@keyframes lhn-nay { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-14px); } 50% { transform: translateY(0); } 75% { transform: translateY(-5px); } }
/* Giảm chuyển động: chỉ hiện ra, không trượt, không nảy, không nâng khi rê. */
@media (prefers-reduced-motion: reduce) {
  .js .lhn__dat--vao { animation: none; }
  .lhn__dat { transition: none; }
  .lhn__dat:hover, .lhn__dat:focus-visible { transform: none; }
}

/* ===== 39·51 · cụm nút TRÒN, chỉ biểu tượng; nhãn chữ nhỏ hiện bên TRÁI khi rê chuột / Tab ===== */
.lhn__nhan {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 7px 12px;
  border-radius: 8px;
  background: #241a0c;
  color: #fff8ea;
  font: 600 13px/1 system-ui, sans-serif;
  white-space: nowrap;
  pointer-events: none;      /* nhãn không nhận chuột → không chặn nút khác */
  opacity: 0;
  transition: opacity 150ms ease-out;   /* ≤ 200 ms */
}
.lhn__btn:hover > .lhn__nhan,
.lhn__btn:focus-visible > .lhn__nhan { opacity: 1; }
@media (max-width: 720px) { .lhn__nhan { display: none; } }   /* điện thoại: không có rê chuột; tên đọc qua aria-label */
@media (prefers-reduced-motion: reduce) { .lhn__nhan { transition: none; } }

/* ===== 39·51 phương án màu HÃNG (phiếu 0093): nền + logo đúng mã chính thức của từng hãng ===== */
/* Zalo nền #0068FF (Simple Icons 16.36.0, nguồn zalo.me) · WhatsApp nền #25D366 + glyph trắng (gói Meta Brand Resource Center, Digital_Glyph_White_RGB_2026.svg) · KakaoTalk nền #FEE500, biểu tượng #000000 (developers.kakao.com/docs/en/kakaologin/design-guide) */
.lhn__zalo { background: #0068ff; color: #fff; }
.lhn__wa { background: #25d366; color: #fff; }
.lhn__kakao { background: #fee500; color: #000; }
/* Nhãn «Gọi» 4 tiếng: chỉ hiện chữ ứng với body[data-lang] */
.lhn__nhan > [data-g] { display: none; }
body[data-lang="vi"] .lhn__nhan > [data-g="vi"],
body[data-lang="en"] .lhn__nhan > [data-g="en"],
body[data-lang="ko"] .lhn__nhan > [data-g="ko"],
body[data-lang="ru"] .lhn__nhan > [data-g="ru"] { display: inline; }
