/* =====================================================================
   Trang dat mon (order.html) cung phong cach Nha Nang voi trang chu (xem brand.css):
   dai tieu de co anh nen, the mon anh lon dang luoi, nhan "Ban chay", nut tron vang nang, thanh gio hang nau dam.
   Moi quy tac nam duoi body.order-page nen khong anh huong trang nhan vien / quan ly.
   ===================================================================== */
.order-page .order-main { max-width: 1120px; }

/* Thanh tren */
.order-page .app-bar { background: rgba(252, 247, 233, .92); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.order-page .app-title strong { font-family: var(--display); font-size: 1.3rem; font-weight: 800; font-variation-settings: "SOFT" 100; }
.order-page .badge { background: var(--sun); color: var(--espresso); font-weight: 700; }
.order-page .app-bar .btn-ghost { border-width: 2px; }

/* Dai tieu de co anh nen */
.page-title {
  position: relative; max-width: 1096px; margin: 12px auto 0; padding: clamp(30px, 6vw, 64px) clamp(20px, 4vw, 48px);
  border-radius: var(--radius); color: var(--cream); overflow: hidden;
  background: linear-gradient(rgba(36, 20, 14, .55), rgba(36, 20, 14, .72)), url("../img/mac-dinh/hero-2.jpg") center / cover;
  margin-inline: max(12px, calc((100% - 1096px) / 2));
}
.page-title .script { margin: 0 0 6px; font-family: var(--script); font-style: italic; font-size: 1.15rem; color: var(--butter); }
.pt-title { margin: 0 0 18px; font-family: var(--display); font-size: clamp(2.3rem, 8vw, 4.4rem); font-weight: 800; line-height: .98; font-variation-settings: "SOFT" 100, "WONK" 1; }
.pt-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pt-perks li { padding: 6px 14px; border-radius: 999px; background: rgba(252, 247, 233, .16); border: 1px solid rgba(252, 247, 233, .3); font-size: .9rem; backdrop-filter: blur(4px); }

.order-page .banner { border-radius: 18px; max-width: 1096px; margin-inline: auto; }

/* Tim kiem + nhom mon */
.order-page .search input { border-radius: 999px; box-shadow: none; border: 2px solid var(--line-strong); background: var(--surface); }
.order-page .chips { top: 57px; background: var(--bg); gap: 8px; padding: 12px 0; }
.order-page .chip {
  min-height: 42px; padding: 0 18px; border: 2px solid var(--espresso); border-radius: 999px; background: transparent;
  font-family: var(--display); font-weight: 600; color: var(--espresso); transition: background .2s, color .2s;
}
.order-page .chip[aria-pressed="true"] { background: var(--espresso); color: var(--cream); box-shadow: none; }

/* Luoi the mon anh lon */
.order-page .cat-title { margin: 30px 0 14px; font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.4rem); color: var(--espresso); letter-spacing: -.02em; }
.order-page .cat-title::before { display: none; }
.dish-list { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .dish-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1000px) { .dish-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.order-page .product {
  display: flex; flex-direction: column; margin: 0; padding: 0; overflow: hidden;
  border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s;
}
.order-page .product:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.order-page .product .pic { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--butter); }
.order-page .product .thumb, .order-page .product .placeholder { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; transition: transform .8s; }
.order-page .product:hover .thumb { transform: scale(1.06); }
.order-page .placeholder { color: var(--sun-deep); background: var(--butter); }
.order-page .product .sticker.hot { position: absolute; left: 10px; top: 10px; font-size: .85rem; padding: .2em .8em; rotate: -6deg; }
.order-page .product > div:last-child { display: flex; flex-direction: column; flex: 1; padding: 12px 14px 14px; min-width: 0; }
.order-page .product h3 { font-size: 1.12rem; font-weight: 700; line-height: 1.2; margin: 0 0 .2em; }
.order-page .product .desc { font-size: .85rem; -webkit-line-clamp: 2; }
.order-page .product .row { flex-wrap: wrap; row-gap: 8px; }
.order-page .price { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--espresso); }
.order-page .btn-add { background: var(--sun); color: var(--espresso); box-shadow: none; min-height: 40px; }
.order-page .btn-add:hover { background: #ffcf5c; }
.order-page .stepper { background: var(--butter); }
.order-page .stepper button { color: var(--espresso); }
@media (max-width: 420px) {
  .order-page .product .row { flex-direction: column; align-items: stretch; }
  .order-page .product .row .btn-add { width: 100%; }
  .order-page .product .row .stepper { display: flex; width: 100%; justify-content: space-between; }
}

/* Thanh gio hang */
.order-page .cart-bar { background: linear-gradient(to top, var(--bg) 62%, transparent); }
.order-page .cart-bar .btn { background: var(--espresso); color: var(--cream); border: 0; box-shadow: 0 16px 34px rgba(59, 34, 25, .35); }
.order-page .cart-bar .btn:hover { background: var(--brand-strong); }
.order-page .cart-bar .count { background: var(--sun); color: var(--espresso); }

/* Cua so gio hang / form */
.order-page .sheet-panel { background: var(--cream); }
.order-page .sheet-head { background: var(--cream); }
.order-page .sheet-head h2 { font-size: 1.8rem; }
.order-page .field label { font-family: var(--display); font-weight: 600; }
.order-page .field input, .order-page .field textarea, .order-page .field select, .order-page .line input.note { border-radius: 16px; background: var(--surface); }
.order-page .radio-row label { border-radius: 18px; background: var(--surface); }
.order-page .summary .total { font-family: var(--display); font-weight: 800; color: var(--espresso); }

/* Theo doi don / thanh toan */
.order-page .track-card { border-radius: var(--radius); border-color: var(--line); background: var(--surface); }
.order-page .status-badge { font-family: var(--display); font-weight: 600; background: var(--butter); }
.order-page .qr { border-radius: 20px; }

/* ---------- Chuyen dong ---------- */
.page-title > * { animation: ptRise .8s cubic-bezier(.2, .8, .2, 1) both; }
.page-title > :nth-child(2) { animation-delay: .1s; }
.page-title > :nth-child(3) { animation-delay: .2s; }
.order-page .product { animation: ptRise .6s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 60ms); }
.order-page .sticker.hot { animation: hotWobble 3.5s ease-in-out infinite alternate; }
.order-page .cart-bar .btn.bump { animation: bump .45s cubic-bezier(.3, 1.6, .5, 1); }
.order-page .stepper output { display: inline-block; animation: pop .3s ease; }
@keyframes ptRise { from { opacity: 0; transform: translateY(26px); } }
@keyframes hotWobble { from { transform: rotate(-3deg); } to { transform: rotate(3deg) scale(1.05); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes pop { from { transform: scale(1.5); } }

/* Chon size / topping */
.opt-group { border: 0; margin: 0 0 14px; padding: 0; }
.opt-group legend { font-weight: 700; margin-bottom: 6px; }
.opt-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }

/* Dong y dung du lieu ca nhan khi dat online */
.consent-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-weight: 400; font-size: .92rem; line-height: 1.45; }
.consent-row input { width: 20px; height: 20px; margin-top: 2px; }
.consent-row a { color: var(--accent, inherit); text-decoration: underline; }

/* Khach tai ban: muc "Gọi món" | "Chat với nhân viên" */
.order-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 14px 0 4px; padding: 5px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line-strong); }
.order-tabs [role="tab"] { position: relative; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--espresso); font: inherit; font-weight: 700; cursor: pointer; }
.order-tabs [role="tab"][aria-selected="true"] { background: var(--espresso); color: var(--cream); }
.tab-dot { position: absolute; top: 8px; right: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }

/* Chat voi nhan vien */
.chat-card { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.chat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chat-head h2 { margin: 0; font-family: var(--display); font-size: 1.4rem; color: var(--espresso); }
.chat-table { color: var(--muted); font-weight: 600; }
.chat-notice { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: .9rem; line-height: 1.45; background: var(--accent-soft); border: 1px solid var(--line-strong); }
.chat-list { list-style: none; margin: 0; padding: 4px 2px; display: flex; flex-direction: column; gap: 8px; max-height: min(52vh, 460px); overflow-y: auto; }
.chat-msg { max-width: 82%; display: flex; flex-direction: column; gap: 2px; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs { align-self: flex-start; }
.chat-who { font-size: .75rem; color: var(--muted); }
.chat-text { margin: 0; padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.chat-msg.mine .chat-text { background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 4px; }
.chat-msg.theirs .chat-text { background: var(--surface-2, #f3ebe0); color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-empty { color: var(--muted); text-align: center; padding: 18px 0; }
.chat-compose { display: flex; flex-direction: column; gap: 6px; }
.chat-input { width: 100%; box-sizing: border-box; resize: vertical; min-height: 52px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; }
.chat-compose-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chat-count { color: var(--muted); font-size: .8rem; }
.chat-ended { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: var(--muted); }
.chat-ended p { margin: 0; }

/* Mon trong gio vua het (order/stock-watch.js) */
.order-page .line.sold-out .name { text-decoration: line-through; color: var(--muted); }
.order-page .line-out { margin: 4px 0 0; color: var(--bad); font-size: .88rem; font-weight: 600; }
