:root {
  /* Bảng màu thương hiệu TeaGo: nâu - cam - xanh lá trà - nền kem */
  --bg: #fdf4e3;
  --card: #fffaf0;
  --brand: #4a2511;
  --brand-dark: #331708;
  --title: #5a2a10;
  --orange: #e8821c;
  --orange-dark: #b85c0d;
  --leaf: #6b7a2c;
  --line: #e3cfa9;
  --text: #3a1f0e;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
.container { width: min(1200px, 92%); margin: 0 auto; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.no-match { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[id] { scroll-margin-top: calc(120px + var(--sb, 0px)); }

/* Header */
.header {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg); /* trùng màu nền cream của images/image.jpg để logo hòa vào header */
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; padding: 8px 0; }
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; line-height: 1;
}
.logo img { display: block; height: auto; }
/* Khung cắt logo: ảnh images/image.jpg (1536x1024) có nhiều viền trống, cắt sát vùng logo (x 190-1386, y 54-864) */
.logo .logo-frame {
  position: relative; display: block; flex: none;
  height: 72px; aspect-ratio: 1196 / 810; overflow: hidden;
}
.logo .logo-frame img {
  position: absolute; left: -15.89%; top: -6.67%;
  width: 128.43%; height: auto; max-width: none;
}
.logo-crop { display: block; height: auto; aspect-ratio: 692 / 657; object-fit: contain; mix-blend-mode: multiply; }
.footer-word { display: block; width: 150px; height: auto; margin: 0 auto; }
.nav { flex: 1; display: flex; justify-content: center; gap: clamp(18px, 3.4vw, 52px); }
.nav a {
  position: relative; padding: 10px 2px;
  color: var(--brand); text-decoration: none; font-size: 1.1rem; font-weight: 700;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  border-radius: 3px; background: var(--orange);
  transform: scaleX(0); transition: transform .2s;
}
.nav a:hover, .nav a.active { color: var(--orange-dark); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; display: grid; place-items: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--brand);
}
.icon-btn:hover { background: rgba(232, 130, 28, .15); }
.icon-btn svg { width: 28px; height: 28px; }
.badge {
  position: absolute; top: 0; right: 0;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--orange-dark); color: #fff;
  font-size: .75rem; font-weight: 800; line-height: 20px; text-align: center;
}
.search-bar { border-top: 1px solid var(--line); background: var(--card); padding: 10px 0; }
.search-bar input {
  width: 100%; padding: 11px 18px; font: inherit;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text);
}

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #fff8ee 0%, #fdf0dc 100%);
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: right center;
}
.hero-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center; padding: 56px 0 48px;
}
.hero-copy { max-width: 46%; }
.hero-title {
  margin: 0 0 20px; text-transform: uppercase; color: var(--title);
  font-size: clamp(2.4rem, 5.4vw, 4.4rem); font-weight: 900; line-height: 1.1;
  text-shadow: 0 3px 0 rgba(74, 37, 17, .12);
}
.hero-title span { display: block; }
.lead { margin: 0 0 24px; max-width: 520px; font-size: 1.1rem; }
.page-title {
  color: var(--title); font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 800; margin: 36px 0 18px;
}
.about { padding: 10px 0 40px; }
.about h2 { color: var(--title); font-size: 1.6rem; font-weight: 800; margin: 0 0 10px; }
.about p { margin: 0 0 10px; max-width: 760px; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff;
  padding: 8px 14px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.btn {
  display: inline-block; background: var(--orange-dark); color: #fff;
  border: 0; padding: 11px 24px; border-radius: 999px;
  text-decoration: none; font-weight: 700;
}
.btn:hover { background: var(--brand); }
.btn.full { width: 100%; margin-top: 14px; }
.btn-lg {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 32px; font-size: 1.3rem;
  box-shadow: 0 6px 14px rgba(184, 92, 13, .35);
}
.btn-sm { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: .95rem; }

/* Sản phẩm nổi bật */
.featured { padding: 36px 0 8px; }
.featured-title {
  margin: 0 0 18px; color: var(--title);
  font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800;
}
.featured-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.feat-card {
  display: flex; align-items: center; gap: 18px; padding: 16px;
  background: #fffdf8; border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 6px 18px rgba(74, 37, 17, .1);
}
.feat-card img {
  flex: 0 0 38%; width: 38%; max-width: 160px; height: auto; aspect-ratio: 1; object-fit: cover;
  border-radius: 16px; background: var(--bg);
}
.feat-body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.feat-body h3 { margin: 0; color: var(--brand); font-size: 1.25rem; line-height: 1.25; }
.feat-body .price { margin: 0; font-size: 1.05rem; }
.feat-body .btn { margin-top: 6px; }

/* Màn hình máy tính: banner co theo chiều cao khung nhìn để thấy "Sản phẩm nổi bật" ngay lần đầu mở trang */
@media (min-width: 861px) {
  /* Hero: cao tối đa theo tỉ lệ banner.png (1920x819), nhưng luôn chừa ~320px cho "Sản phẩm nổi bật" để cả hai nằm gọn trong màn hình đầu.
     Ảnh dùng object-fit: contain (không cắt cốc), canh phải; mép trái ảnh mờ dần vào nền hero. */
  .hero { display: flex; align-items: center; height: clamp(280px, calc(100vh - 89px - 320px), 42.66vw); height: clamp(280px, calc(100svh - 89px - 320px), 42.66vw); }
  .hero-bg {
    inset: 0 0 0 auto; width: auto; max-width: 100%; height: 100%; aspect-ratio: 1920 / 819;
    object-fit: cover; object-position: right center;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16%); mask-image: linear-gradient(to right, transparent 0, #000 16%);
  }
  .hero-inner { padding: clamp(14px, 3.4vh, 36px) 0 clamp(12px, 3vh, 32px); }
  .hero-title { font-size: clamp(2rem, min(4.4vw, 7.6vh), 3.9rem); margin-bottom: clamp(10px, 2vh, 20px); }
  .lead { margin-bottom: clamp(12px, 2.4vh, 22px); font-size: clamp(1rem, 1.9vh, 1.1rem); }
  .btn-lg { padding: clamp(9px, 1.6vh, 14px) 30px; font-size: clamp(1.1rem, 2.3vh, 1.3rem); }
  .featured { padding-top: clamp(14px, 3vh, 32px); }
  .featured-title { margin-bottom: clamp(8px, 1.6vh, 16px); font-size: clamp(1.5rem, min(2.6vw, 4.4vh), 2.2rem); line-height: 1.3; }
}

/* Họa tiết trang trí (cố định vị trí, không bắt sự kiện chuột) */
.deco {
  position: absolute; display: block; z-index: 0; pointer-events: none;
  background-repeat: no-repeat; background-position: center; background-size: contain;
}
.deco-leaf { background-image: url(../images/deco-leaf.svg); width: clamp(34px, 3.6vw, 62px); aspect-ratio: 2 / 3; }
.deco-boba { background-image: url(../images/deco-boba.svg); width: clamp(90px, 9.5vw, 160px); aspect-ratio: 8 / 5; }
.deco-wave { background-image: url(../images/deco-wave.svg); width: clamp(150px, 15vw, 260px); aspect-ratio: 13 / 10; }
/* Sản phẩm nổi bật */
.featured-wrap { position: relative; overflow: hidden; padding-bottom: 40px; }
.featured-wrap > .featured { position: relative; z-index: 1; }
.feat-leaf-a { right: 3.6%; top: 28px; transform: rotate(25deg); }
.feat-leaf-b { left: max(2px, min(3.7%, calc((100% - min(1200px, 92%)) / 2 - 56px))); top: 108px; transform: rotate(-20deg); }
.feat-wave { left: 0; bottom: 0; -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%); mask-image: linear-gradient(to bottom, #000 60%, transparent 100%); }
.feat-boba { right: 0; bottom: 0; transform: scaleX(-1); }
@media (max-width: 1100px) {
  .feat-leaf-b, .feat-boba { display: none; }
}
@media (max-width: 860px) {
  .hero-bg { inset: auto 0 0 0; height: auto; object-fit: contain; }
  .hero-copy { max-width: 100%; }
  .deco-boba { width: 80px; }
  .deco-wave { width: 120px; }
}

/* Tabs */
/* Màn hình đầu tiên (máy tính): hero + "Sản phẩm nổi bật" lấp đầy khung nhìn, họa tiết chạm đáy, không lộ khoảng trắng */
@media (min-width: 861px) {
  .first-screen { display: flex; flex-direction: column; min-height: calc(100vh - 89px); min-height: calc(100svh - 89px); }
  .first-screen > .hero { flex: 0 0 auto; }
  .first-screen > .featured-wrap { flex: 1 0 auto; }
}
.tabs { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-start; margin-bottom: 24px; }
.tab {
  border: 1px solid var(--brand); background: transparent; color: var(--brand);
  padding: 7px 18px; border-radius: 999px; font-weight: 700;
}
.tab.active { background: var(--brand); color: #fff; }

/* Menu */
.section { margin-bottom: 30px; }
.section-title {
  display: inline-block; font-family: "Brush Script MT", cursive;
  font-size: 1.7rem; padding: 4px 26px; border-radius: 50%;
  border: 2px solid var(--orange); color: var(--brand); margin: 0 0 12px;
  transform: rotate(-3deg);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.card h3, .card h4 { margin: 0; color: var(--brand); font-size: 1.05rem; }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 300 / 220; object-fit: cover; border-radius: 8px; background: var(--bg); }
.price { font-size: .92rem; }
.price span { margin-right: 14px; }
.card .btn { margin-top: auto; padding: 8px 14px; font-size: .9rem; align-self: flex-start; }
.topping-note { margin: 10px 0 40px; padding: 14px 18px; border: 1px solid var(--brand); border-radius: 10px; }

/* Khuyến mãi */
.promo { padding: 10px 0 40px; }
.promo-list {
  list-style: none; margin: 0 0 18px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px;
}
.promo-list li {
  display: flex; flex-direction: column; gap: 2px; padding: 18px 20px;
  background: var(--brand); color: #fff3e0; border-radius: 18px;
}
.promo-list strong { color: #ffb877; font-size: 2rem; font-weight: 900; line-height: 1.1; }

/* Footer */
.footer { text-align: center; padding: 30px 0; border-top: 2px solid var(--brand); color: var(--brand); }
.footer h2 { margin: 0; font-family: "Baloo 2", Fredoka, "Arial Rounded MT Bold", "Trebuchet MS", Verdana, sans-serif; font-size: 2rem; font-weight: 800; letter-spacing: 1px; }
.footer p { margin: 4px 0; font-size: .9rem; }
.footer .contact-info { margin: 4px 0; font-size: .9rem; font-style: normal; }
.footer a { color: inherit; font-weight: 600; }

/* Modal */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal {
  background: var(--card); border-radius: 14px; padding: 22px;
  width: min(420px, 100%); max-height: 90vh; overflow: auto; position: relative;
}
.modal.center { text-align: center; }
.modal h3 { margin-top: 0; color: var(--brand); }
.close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 1.6rem; color: var(--brand); }
.label { font-weight: 600; margin: 12px 0 6px; }
.options { display: flex; gap: 8px; flex-wrap: wrap; }
.opt {
  border: 1px solid var(--brand); background: #fff; color: var(--brand);
  padding: 6px 14px; border-radius: 999px;
}
.opt.active { background: var(--brand); color: #fff; }
.qty-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.qty { display: flex; align-items: center; gap: 12px; }
.qty button {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--brand); background: #fff; color: var(--brand);
}

form label { display: block; font-weight: 600; margin-top: 10px; font-size: .9rem; }
form input, form textarea, form select {
  width: 100%; margin-top: 4px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff;
}
.error { color: #c00; min-height: 1.2em; margin: 8px 0 0; font-size: .85rem; }
.total-row { display: flex; justify-content: space-between; margin-top: 10px; }

/* Drawer */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%);
  background: var(--card); z-index: 40; box-shadow: -4px 0 20px rgba(0,0,0,.25);
  display: flex; flex-direction: column;
}
.drawer-head { padding: 14px 18px; border-bottom: 1px solid var(--line); position: relative; }
.drawer-head h3 { margin: 0; color: var(--brand); }
.drawer-body { flex: 1; overflow: auto; padding: 10px 18px; }
.drawer-foot { padding: 14px 18px; border-top: 1px solid var(--line); }
.cart-item { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.cart-item .top { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.cart-item .sub { font-size: .82rem; opacity: .8; }
.cart-item .row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.remove { border: 0; background: none; color: var(--brand); text-decoration: underline; font-size: .82rem; }
.empty { text-align: center; padding: 40px 0; opacity: .7; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 80px);
  background: var(--brand); color: #fff; padding: 10px 20px; border-radius: 999px;
  transition: transform .3s; z-index: 60;
}
.toast.show { transform: translate(-50%, 0); }

/* Khung thanh toán QR */
.pay-box { margin: 14px 0; padding: 14px; border: 1px dashed var(--brand); border-radius: 12px; background: #fff; text-align: left; }
.pay-title { margin: 0 0 8px; font-weight: 700; color: var(--brand); text-align: center; }
.pay-box .qr { width: min(220px, 70%); margin: 0 auto 10px; }
.pay-box .qr svg { display: block; width: 100%; height: auto; }
.pay-info { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.pay-info li { margin: 3px 0; }
.pay-note { margin: 10px 0 0; font-size: .82rem; opacity: .85; }

@media (max-width: 860px) {
  [id] { scroll-margin-top: calc(150px + var(--sb, 0px)); }
  .header-inner { flex-wrap: wrap; gap: 4px 12px; }
  .logo { order: 1; }
  .logo .logo-frame { height: 60px; }
  .header-actions { order: 2; margin-left: auto; }
  .nav {
    order: 3; flex: 1 0 100%; justify-content: flex-start; gap: 22px;
    overflow-x: auto; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; font-size: 1rem; }
  .hero-inner { padding: 32px 0 calc(44vw + 16px); }
}
@media (max-width: 560px) {
  .hero-title { font-size: 2.4rem; }
  .btn-lg { font-size: 1.1rem; padding: 12px 26px; }
  .featured-grid { grid-template-columns: 1fr; }
}
/* ===== Nhiều trang: chuyển ngôn ngữ, tiêu đề trang, nút phụ ===== */
.lang { display: inline-flex; overflow: hidden; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.lang button { border: 0; background: transparent; color: var(--brand); padding: 6px 12px; font-size: .85rem; font-weight: 800; }
.lang button:not(.active):hover { background: rgba(232, 130, 28, .15); }
.lang button.active { background: var(--brand); color: #fff; }

.page-hero { padding: 40px 0 20px; background: linear-gradient(180deg, #fff8ee 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); }
.page-hero h1 { margin: 0 0 8px; color: var(--title); font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 900; line-height: 1.15; }
.page-hero .lead { margin: 0; max-width: 680px; }
.page-section { padding: 36px 0; }
.page-section.alt { background: #fff8ee; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.page-section h2 { margin: 0 0 14px; color: var(--title); font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 800; }
.prose p { margin: 0 0 12px; max-width: 760px; }
.card p { margin: 0; font-size: .92rem; }
.steps { margin: 0; padding-left: 1.3rem; max-width: 760px; }
.steps li { margin: 0 0 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.btn-ghost { background: transparent; color: var(--brand); border: 2px solid var(--brand); padding: 9px 22px; }
.btn-ghost:hover { background: var(--brand); color: #fff; }
.section-sub { margin: -8px 0 16px; max-width: 640px; }

/* FAQ */
.faq { max-width: 820px; }
.faq-item { margin: 0 0 12px; padding: 0 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; cursor: pointer; list-style: none; color: var(--brand); font-weight: 800;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; flex: none; color: var(--orange-dark); font-size: 1.4rem; line-height: 1; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0 0 14px; }
.faq-item a { color: var(--orange-dark); font-weight: 700; }

/* Banner đối tác (web nhóm khác) */
.partners { padding: 10px 0 36px; }
.carousel { position: relative; }
.partner-track { display: flex; gap: 16px; padding: 4px 2px 10px; overflow-x: auto; scrollbar-width: none; }
.partner-track::-webkit-scrollbar { display: none; }
.partner-card {
  flex: 1 0 min(260px, 82%); max-width: 360px;
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: #fffdf8; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 4px 14px rgba(74, 37, 17, .08); color: var(--text); text-decoration: none;
}
a.partner-card { transition: transform .15s, border-color .15s; }
a.partner-card:hover { transform: translateY(-2px); border-color: var(--orange); }
.partner-card.is-soon { border-style: dashed; opacity: .85; }
.partner-logo {
  flex: none; display: grid; place-items: center; width: 56px; height: 56px; overflow: hidden;
  border-radius: 14px; background: var(--brand); color: #fff; font-size: 1.2rem; font-weight: 900;
}
.partner-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.partner-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.partner-body strong { color: var(--brand); }
.partner-desc { font-size: .85rem; opacity: .85; }
.partner-go { font-size: .85rem; font-weight: 800; color: var(--orange-dark); }
.carousel-ctl { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.carousel-ctl .icon-btn { border: 1px solid var(--line); background: #fff; font-size: 1.6rem; line-height: 1; }

/* Ô quảng cáo web nhóm khác */
.ads { padding: 0 0 40px; }
.ad-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.ad-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fffdf8; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 6px 18px rgba(74, 37, 17, .1);
}
.ad-media { position: relative; aspect-ratio: 16 / 7; min-height: 110px; background: var(--orange); }
.ad-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-tag {
  position: absolute; top: 10px; right: 10px; padding: 4px 12px; border-radius: 999px;
  background: #4a2511; color: #fff; border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
  font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2;
}
.ad-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 18px 18px; }
.ad-body h3 { margin: 0; color: var(--brand); font-size: 1.1rem; }
.ad-body p { margin: 0; font-size: .92rem; }
.ad-body .btn { margin-top: auto; }

/* Liên hệ + Google Map */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; align-items: start; }
.contact-card { padding: 20px 22px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.contact-card h2 { font-size: 1.3rem; }
.contact-card p { margin: 0 0 8px; }
.contact-list { list-style: none; margin: 0 0 8px; padding: 0; }
.contact-list li { margin: 0 0 8px; }
.contact-list address { display: inline; font-style: normal; }
.contact-list a { color: var(--orange-dark); font-weight: 700; }
.map-wrap { margin: 0 0 16px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.map-wrap iframe { display: block; width: 100%; height: clamp(280px, 50vw, 460px); border: 0; }

/* Chân trang: liên kết */
.footer-links { margin-top: 8px; }
.footer-links a { white-space: nowrap; }
#footContact:empty { display: none; }

/* Khung chat (nút nổi góc phải; thấp hơn giỏ hàng và hộp thoại để không che chúng) */
.chat { position: fixed; right: 16px; bottom: 16px; z-index: 35; }
.chat-fab {
  position: relative; display: grid; place-items: center; width: 56px; height: 56px;
  border: 0; border-radius: 50%; background: var(--orange-dark); color: #fff;
  box-shadow: 0 8px 22px rgba(74, 37, 17, .35);
}
.chat-fab:hover { background: var(--brand); }
.chat-fab svg { width: 28px; height: 28px; }
.chat-dot { position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: #d62828; }
.chat-panel {
  position: absolute; right: 0; bottom: 70px; display: flex; flex-direction: column; overflow: hidden;
  width: min(360px, calc(100vw - 32px)); height: min(520px, calc(100vh - 110px)); height: min(520px, calc(100svh - 110px));
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
}
.chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--brand); color: #fff; }
.chat-head strong { display: block; font-size: 1.05rem; }
.chat-head small { display: block; opacity: .85; font-size: .78rem; }
.chat-x { border: 0; background: none; padding: 0 4px; color: #fff; font-size: 1.6rem; line-height: 1; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px; overflow-y: auto; background: #fff8ee; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; font-size: .92rem; line-height: 1.4; overflow-wrap: anywhere; }
.msg a { color: var(--orange-dark); font-weight: 700; }
.msg-b, .msg-s { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-s { background: #f0f5dc; border-color: #cfdc9a; }
.msg-u { align-self: flex-end; background: var(--orange-dark); color: #fff; border-bottom-right-radius: 4px; }
.msg-u a { color: #fff; }
.msg.is-sending { opacity: .6; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; }
.chat-chip { padding: 4px 10px; border: 1px solid var(--brand); border-radius: 999px; background: #fff; color: var(--brand); font-size: .8rem; font-weight: 700; }
.chat-chip:hover { background: var(--brand); color: #fff; }
.chat-form { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 12px; }
.chat-form input { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text); font: inherit; font-size: .9rem; }
.chat-form .chat-contact { font-size: .8rem; }
.chat-row { display: flex; gap: 6px; }
.chat-form .chat-input { flex: 1; min-width: 0; }
.chat-send { border: 0; border-radius: 999px; padding: 8px 16px; background: var(--orange-dark); color: #fff; font-weight: 800; }
.chat-send:hover { background: var(--brand); }
.chat-send:disabled { opacity: .6; cursor: default; }

/* ===== Hiệu ứng tương tác (class fx-* do site.js thêm vào) ===== */
@keyframes fx-rise { from { opacity: 0; translate: 0 28px; } to { opacity: 1; translate: 0 0; } }
@keyframes fx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fx-pop { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fx-slide-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes fx-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes fx-bump { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.5); } }
@keyframes fx-ripple { from { transform: scale(0); opacity: .35; } to { transform: scale(1); opacity: 0; } }
@keyframes fx-hero-bg { from { scale: 1.06; } to { scale: 1; } }

/* Vào trang: tiêu đề + nút hero trồi lên lần lượt, ảnh nền thu nhẹ */
.hero-title, .hero-copy .lead, .hero-copy .btn, .page-hero h1, .page-hero .lead { animation: fx-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.hero-copy .lead, .page-hero .lead { animation-delay: .12s; }
.hero-copy .btn { animation-delay: .24s; }
.hero-bg { animation: fx-hero-bg 1.4s ease-out both; }

/* Hiện dần khi cuộn tới (JS gỡ class sau khi chạy xong) */
.fx-reveal { opacity: 0; }
.fx-reveal.fx-in { animation: fx-rise .65s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--fx-d, 0ms); }

/* Header đổ bóng khi cuộn, thanh tiến độ, nút lên đầu trang */
.header { transition: box-shadow .25s ease; }
.header.is-scrolled { box-shadow: 0 6px 18px rgba(74, 37, 17, .14); }
.fx-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; pointer-events: none;
  background: linear-gradient(90deg, var(--orange), var(--orange-dark));
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
}
.fx-top {
  position: fixed; right: 22px; bottom: 84px; z-index: 34;
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: var(--brand); color: #fff;
  box-shadow: 0 6px 16px rgba(74, 37, 17, .3);
  opacity: 0; visibility: hidden; translate: 0 12px;
  transition: opacity .25s, translate .25s, visibility .25s, background .2s;
}
.fx-top.show { opacity: 1; visibility: visible; translate: 0 0; }
.fx-top:hover { background: var(--orange-dark); }
.fx-top svg { width: 22px; height: 22px; }

/* Nút: nhấn lún xuống, gợn sóng tại điểm bấm */
.btn { position: relative; overflow: hidden; transition: background .2s, transform .15s, box-shadow .2s; }
.btn svg { transition: transform .2s; }
.fx-ripple { position: absolute; border-radius: 50%; background: currentColor; pointer-events: none; transform: scale(0); animation: fx-ripple .6s ease-out forwards; }
.tab, .opt, .icon-btn, .chat-chip, .chat-fab { transition: background .2s, color .2s, transform .15s; }
.tab:active, .opt:active, .icon-btn:active, .chat-chip:active { transform: scale(.94); }

/* Huy hiệu giỏ nảy lên khi thêm món; họa tiết lá bay nhẹ */
.badge.fx-bump { animation: fx-bump .4s ease; }
.deco-leaf { animation: fx-float 5s ease-in-out infinite; }
.feat-leaf-b { animation-delay: -2.2s; }

/* Hộp thoại, giỏ hàng, khung chat, tab thực đơn, FAQ: xuất hiện mượt */
.overlay { animation: fx-fade .2s ease-out; }
.modal { animation: fx-pop .25s cubic-bezier(.2, .8, .2, 1); }
.drawer { animation: fx-slide-in .3s cubic-bezier(.2, .8, .2, 1); }
.chat-panel { transform-origin: bottom right; animation: fx-pop .22s cubic-bezier(.2, .8, .2, 1); }
#menuSections .section { animation: fx-fade .35s ease-out; }
.faq-item { transition: border-color .2s, box-shadow .2s; }
.faq-item:hover { border-color: var(--orange); }
.faq-item[open] { box-shadow: 0 6px 16px rgba(74, 37, 17, .1); }
.faq-item[open] p { animation: fx-rise .35s ease-out both; }

/* Chỉ bật hiệu ứng rê chuột trên thiết bị có chuột (tránh "dính" hover trên điện thoại) */
@media (hover: hover) and (pointer: fine) {
  .feat-card, .card, .ad-card, .promo-list li { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
  .feat-card:hover, .card:hover, .ad-card:hover { transform: translateY(-6px); border-color: var(--orange); box-shadow: 0 16px 30px rgba(74, 37, 17, .18); }
  .promo-list li:hover { transform: translateY(-4px) rotate(-.8deg); box-shadow: 0 12px 24px rgba(74, 37, 17, .22); }
  .feat-card img, .card img, .ad-media img { transition: transform .4s ease; }
  .feat-card:hover img { transform: scale(1.05) rotate(-2deg); }
  .card:hover img { transform: scale(1.03); }
  .ad-card:hover .ad-media img { transform: scale(1.06); }
  .logo .logo-frame { transition: transform .3s ease; }
  .logo:hover .logo-frame { transform: scale(1.04) rotate(-1deg); }
  .btn:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(184, 92, 13, .32); }
  .btn-lg:hover svg { transform: translateX(4px); }
  .btn-sm:hover svg { transform: rotate(-12deg) scale(1.1); }
  .chat-fab:hover { transform: scale(1.08); }
  .tab:not(.active):hover { background: rgba(74, 37, 17, .08); }
}
.btn:not(:disabled):active { transform: scale(.96); }

@media print {
  .fx-reveal { opacity: 1; }
  .fx-progress, .fx-top { display: none; }
}

/* Người dùng chọn giảm chuyển động: tắt toàn bộ hiệu ứng ở trên */
@media (prefers-reduced-motion: reduce) {
  .hero-bg, .hero-title, .hero-copy .lead, .hero-copy .btn, .page-hero h1, .page-hero .lead,
  .deco-leaf, .overlay, .modal, .drawer, .chat-panel, #menuSections .section, .faq-item[open] p,
  .badge.fx-bump, .fx-reveal.fx-in { animation: none; }
  .fx-reveal { opacity: 1; }
  .feat-card, .card, .ad-card, .promo-list li, .feat-card img, .card img, .ad-media img,
  .btn, .btn svg, .fx-top, .header, .logo .logo-frame { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav a::after, .toast, a.partner-card { transition: none; }
}
