/* Chip storefront — ngôn ngữ thiết kế kính (glass) theo màu logo: nâu cacao · cam hạt điều · đào · kem */
:root {
  --brown-900: #3A1D0A; --brown-800: #52290F; --primary: #6B3E1F; --primary-dark: #4E2A12; --brown-500: #8A5229;
  --accent: #E8873A; --accent-dark: #C9681F; --peach: #F4B38B; --peach-200: #FAD9C1; --peach-100: #FDEBDD;
  --cream-50: #FFFCF7; --bg: #FCF6EA; --cream-200: #F6E8D6; --surface: #FFFFFF;
  --text: #2E1D10; --muted: #8A6A52; --line: rgba(107, 62, 31, .12); --line-strong: rgba(107, 62, 31, .22);
  --ok: #2F7D4F; --err: #B8321F;
  --glass: rgba(255, 251, 245, .68); --glass-strong: rgba(255, 251, 245, .86);
  --glass-border: rgba(255, 255, 255, .75);
  --blur: blur(18px) saturate(1.5);
  --sh-1: 0 1px 2px rgba(82, 41, 15, .06), 0 2px 8px -2px rgba(82, 41, 15, .08);
  --sh-2: 0 1px 3px rgba(82, 41, 15, .05), 0 10px 28px -8px rgba(82, 41, 15, .20);
  --sh-3: 0 2px 6px rgba(82, 41, 15, .06), 0 28px 60px -16px rgba(82, 41, 15, .34);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .85);
  --r-sm: 12px; --radius: 18px; --r-lg: 26px; --pill: 999px;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(16px, 4vw, 32px);
  --hdr: 64px;
  --grad-brand: linear-gradient(135deg, #7A4522 0%, var(--primary) 45%, var(--brown-800) 100%);
  --grad-accent: linear-gradient(135deg, #F29A50 0%, var(--accent) 50%, var(--accent-dark) 100%);
  --grad-warm: linear-gradient(160deg, var(--cream-50) 0%, var(--peach-100) 100%);
}

* { box-sizing: border-box; }
html { overflow-x: hidden; overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--hdr) + 64px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  font-size: clamp(15px, .9rem + .15vw, 16.5px); line-height: 1.55; min-height: 100dvh;
  display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; overflow-x: hidden; overflow-x: clip;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { line-height: 1.25; text-wrap: balance; letter-spacing: -.01em; }
p, li, .desc, small { text-wrap: pretty; }
.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right)); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
.footer :focus-visible, .cartpill:focus-visible, .groupbar :focus-visible { outline-color: #FFE7D2; }

/* Nền gradient + đốm màu mờ tạo chiều sâu cho lớp kính */
.bg-blobs { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(120% 80% at 50% -10%, #FFF8EE 0%, var(--bg) 55%); overflow: hidden; }
.bg-blobs i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.bg-blobs i:nth-child(1) { width: 46vmax; height: 46vmax; left: -14vmax; top: -12vmax; background: var(--peach-200); }
.bg-blobs i:nth-child(2) { width: 38vmax; height: 38vmax; right: -12vmax; top: 18vh; background: #FBD2A9; opacity: .45; }
.bg-blobs i:nth-child(3) { width: 40vmax; height: 40vmax; left: 20vw; bottom: -20vmax; background: #F7DCC8; opacity: .5; }

/* Kính dùng chung */
.glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-border); box-shadow: var(--sh-2), var(--hi); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { :root { --glass: rgba(255, 251, 245, .97); --glass-strong: #FFFBF5; } }
@media (prefers-reduced-transparency: reduce) { :root { --glass: rgba(255, 251, 245, .98); --glass-strong: #FFFBF5; } }
@media (prefers-contrast: more) { :root { --glass: #FFFBF5; --muted: #6A4A32; --line: rgba(107, 62, 31, .3); } }

/* Nút */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: var(--pill); border: 1px solid transparent; font-weight: 700; letter-spacing: .005em; transition: transform .15s, box-shadow .2s, background .2s; white-space: nowrap; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad-brand); color: #FFF7EE; box-shadow: 0 8px 20px -8px rgba(82, 41, 15, .6), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 12px 28px -10px rgba(82, 41, 15, .7), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn-accent { background: var(--grad-accent); color: #fff; box-shadow: 0 8px 20px -8px rgba(201, 104, 31, .7), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-ghost { background: var(--glass-strong); border-color: var(--line-strong); color: var(--primary); box-shadow: var(--sh-1); }
.btn-ghost:hover { background: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .9em; }
.link-btn { background: none; border: 0; color: var(--primary); font-weight: 700; padding: 6px 0; display: inline-flex; align-items: center; gap: 4px; }

/* Topbar + header kính dính */
.topbar { background: var(--grad-brand); color: #FDE9D6; text-align: center; font-size: .85em; font-weight: 600; padding: 7px var(--gutter); }
.topbar:empty { display: none; }
.header { position: sticky; top: 0; z-index: 40; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: 1px solid var(--glass-border); box-shadow: 0 6px 24px -14px rgba(82, 41, 15, .35); }
.header-in { display: flex; align-items: center; gap: 20px; height: var(--hdr); }
.logo { display: flex; align-items: center; font-weight: 800; font-size: 1.2em; color: var(--primary); }
.logo img { height: 46px; width: auto; mix-blend-mode: multiply; }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a { color: var(--text); font-weight: 600; padding: 8px 14px; border-radius: var(--pill); transition: background .2s; }
.nav a:hover { background: rgba(255, 255, 255, .7); }
.cart-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: var(--pill); border: 1px solid var(--glass-border); background: rgba(255, 255, 255, .72); box-shadow: var(--sh-1), var(--hi); color: var(--primary); font-weight: 700; }
.cart-btn .badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--pill); background: var(--grad-accent); color: #fff; font-size: 11px; line-height: 20px; text-align: center; box-shadow: 0 2px 6px rgba(201, 104, 31, .5); }
.cart-btn .badge:empty, .cart-btn .badge[data-n="0"] { display: none; }
@media (max-width: 760px) { .nav { display: none; } .cart-btn { margin-left: auto; } .cart-total { display: none; } :root { --hdr: 58px; } .logo img { height: 40px; } }

.groupbar { position: sticky; top: var(--hdr); z-index: 35; background: var(--grad-accent); color: #fff; font-size: .88em; font-weight: 600; }
.groupbar .wrap { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding-block: 8px; }
.groupbar button { background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .4); color: #fff; border-radius: var(--pill); padding: 4px 12px; font-weight: 700; }

/* Hero */
.hero { padding-top: clamp(14px, 2.5vw, 28px); }
.slider { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 21 / 8; background: var(--cream-200); box-shadow: var(--sh-3); isolation: isolate; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease; display: block; }
.slide.on { opacity: 1; z-index: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide .bg { position: absolute; inset: 0; filter: blur(26px) saturate(1.2); transform: scale(1.2); opacity: 0; }
.slide.portrait .bg { opacity: .9; }
.slide.portrait .fg { position: relative; object-fit: contain; }
.slide .cap { position: absolute; left: clamp(16px, 4vw, 48px); bottom: clamp(16px, 4vw, 44px); max-width: min(520px, 70%); padding: clamp(14px, 2vw, 22px) clamp(16px, 2.4vw, 26px); border-radius: var(--radius); color: var(--text); }
.slide .cap h2 { margin: 0 0 4px; font-size: clamp(1.15rem, 1rem + 1.6vw, 2.1rem); color: var(--primary); }
.slide .cap p { margin: 0; color: var(--muted); font-weight: 500; }
.dots { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; padding: 6px 8px; border-radius: var(--pill); }
.dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: rgba(107, 62, 31, .3); transition: width .3s, background .3s; }
.dots button.on { width: 22px; border-radius: 4px; background: var(--primary); }
@media (max-width: 640px) { .slider { aspect-ratio: 16 / 9; border-radius: var(--radius); } .slide .cap { max-width: 86%; } }
.hero-fallback { border-radius: var(--r-lg); padding: clamp(28px, 6vw, 64px); background: var(--grad-warm); box-shadow: var(--sh-3); }
.hero-fallback h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 1.2rem + 3vw, 3.2rem); color: var(--primary); }

.usps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.usp { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); font-size: .9em; line-height: 1.35; }
.usp i { font-style: normal; font-size: 22px; width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--grad-warm); box-shadow: var(--hi), 0 2px 6px rgba(82, 41, 15, .08); }
.usp b { display: block; color: var(--primary); }
.usp span { color: var(--muted); }
@media (max-width: 900px) { .usps { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scrollbar-width: none; } .usps::-webkit-scrollbar { display: none; } .usp { flex: 0 0 auto; min-width: 200px; scroll-snap-align: start; } }

/* Section */
.section { margin-top: clamp(28px, 5vw, 52px); }
.section-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-h h2 { margin: 0; font-size: clamp(1.3rem, 1.05rem + 1.1vw, 1.85rem); color: var(--primary-dark); }
.section-h p { margin: 2px 0 0; color: var(--muted); font-size: .92em; }
.more { font-weight: 700; color: var(--primary); display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: var(--pill); background: rgba(255, 255, 255, .6); border: 1px solid var(--glass-border); box-shadow: var(--sh-1); white-space: nowrap; }

/* Tabs danh mục dính */
.tabs-wrap { position: sticky; top: calc(var(--hdr) + 8px); z-index: 30; margin-top: clamp(24px, 4vw, 40px); }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 6px; border-radius: var(--pill); width: max-content; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; padding: 9px 18px; border-radius: var(--pill); font-weight: 700; color: var(--muted); white-space: nowrap; transition: background .25s, color .25s; }
.tab.on { background: var(--grad-brand); color: #FFF4E8; box-shadow: 0 6px 14px -6px rgba(82, 41, 15, .6); }

/* Lưới sản phẩm: desktop 4 cột × 2 hàng; mobile cuộn ngang 2 hàng có điểm dừng */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); }
.grid.all { grid-template-columns: repeat(auto-fill, minmax(min(220px, 44vw), 1fr)); }
@media (max-width: 1000px) and (min-width: 721px) { .grid:not(.all) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .grid.rail { grid-template-columns: none; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: calc((100% - 12px) / 2.15); overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter) 14px; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .grid.rail::-webkit-scrollbar { display: none; }
  .grid.rail > * { scroll-snap-align: start; }
  .grid.all { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.card { position: relative; display: flex; flex-direction: column; border-radius: var(--radius); background: rgba(255, 255, 255, .78); border: 1px solid var(--glass-border); box-shadow: var(--sh-2), var(--hi); overflow: hidden; cursor: pointer; transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s; }
@media (hover: hover) { .card:hover { transform: translateY(-4px); box-shadow: var(--sh-3), var(--hi); } .card:hover .thumb img { transform: scale(1.04); } }
.card .thumb { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--grad-warm); }
.card .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.tag { position: absolute; top: 10px; left: 10px; z-index: 1; padding: 4px 10px; border-radius: var(--pill); font-size: 11.5px; font-weight: 800; color: #fff; background: var(--grad-accent); box-shadow: 0 4px 10px -4px rgba(201, 104, 31, .7); }
.tag.sale { left: auto; right: 10px; background: var(--grad-brand); }
.tag.mine { background: linear-gradient(135deg, #2F7D4F, #23603C); }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card h3 { margin: 0; font-size: 1em; font-weight: 700; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .desc { color: var(--muted); font-size: .84em; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.price { font-weight: 800; color: var(--primary); font-size: 1.05em; font-variant-numeric: tabular-nums; }
.old { margin-left: 6px; color: var(--muted); text-decoration: line-through; font-size: .82em; font-weight: 500; }
.add { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--grad-brand); color: #FFF4E8; font-size: 22px; line-height: 1; display: grid; place-items: center; box-shadow: 0 6px 14px -6px rgba(82, 41, 15, .7); transition: transform .15s; }
.add:active { transform: scale(.9); }
.ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 42px; font-weight: 800; color: var(--peach); background: var(--grad-warm); }

/* Trang danh mục */
.page-h { display: flex; align-items: center; gap: 12px; margin: clamp(18px, 3vw, 28px) 0 16px; }
.page-h h1 { margin: 0; font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); color: var(--primary-dark); }
.back { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--primary); }

/* Cửa hàng */
.store { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); border-radius: var(--r-lg); overflow: hidden; }
.store .info { padding: clamp(20px, 3vw, 32px); }
.store .info h2 { margin: 0 0 12px; color: var(--primary); }
.contact { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.contact li { display: flex; gap: 10px; align-items: flex-start; }
.contact .ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--grad-warm); box-shadow: var(--hi); }
.contact a { font-weight: 700; }
.phones { display: flex; flex-wrap: wrap; gap: 8px; }
.phones a { padding: 4px 12px; border-radius: var(--pill); background: rgba(255, 255, 255, .8); border: 1px solid var(--line-strong); white-space: nowrap; }
.store .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.store .map { min-height: 340px; position: relative; z-index: 0; }
.store .map > div, #storeMap { width: 100%; height: 100%; min-height: 340px; }
@media (max-width: 800px) { .store { grid-template-columns: 1fr; } .store .map, #storeMap { min-height: 280px; } }

/* Footer */
.footer { margin-top: clamp(40px, 6vw, 72px); padding: 36px 0 calc(28px + env(safe-area-inset-bottom)); background: var(--grad-brand); color: #F5DEC8; }
.footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.footer h4 { margin: 0 0 10px; color: #fff; }
.footer p { margin: 4px 0; }
.footer a { color: #FAD9C1; display: block; padding: 3px 0; }
@media (max-width: 700px) { .footer .cols { grid-template-columns: 1fr; } }

/* Lớp phủ, sheet (giỏ hàng), modal sản phẩm */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(58, 29, 10, .32); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; z-index: 70; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--sh-3); display: flex; flex-direction: column; }
.drawer { top: 0; right: 0; height: 100dvh; width: min(440px, 100vw); border-radius: var(--r-lg) 0 0 var(--r-lg); transform: translateX(105%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); border-left: 1px solid var(--glass-border); }
.drawer.open { transform: none; }
.grab { display: none; }
@media (max-width: 720px) {
  .drawer { top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: auto; max-height: 90dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; transform: translateY(105%); border-left: 0; border-top: 1px solid var(--glass-border); }
  .grab { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; flex: none; }
  .sheet-drag { touch-action: none; }
}
.sheet-h { display: flex; align-items: center; gap: 8px; padding: 14px 18px 10px; }
.sheet-h h3 { margin: 0; font-size: 1.15em; flex: 1; }
.sheet-b { overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 12px; flex: 1; }
.sheet-f { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .55); }
.x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .85); font-size: 22px; line-height: 1; display: grid; place-items: center; color: var(--primary); flex: none; }
.line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line .t { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; position: relative; background: var(--grad-warm); box-shadow: var(--sh-1); }
.line .t img { width: 100%; height: 100%; object-fit: cover; }
.line b { display: block; font-size: .95em; line-height: 1.3; }
.line small { display: block; color: var(--muted); font-size: .8em; line-height: 1.35; }
.line .acts { display: flex; gap: 12px; margin-top: 2px; }
.line .acts button { background: none; border: 0; padding: 2px 0; font-size: .8em; font-weight: 700; color: var(--accent-dark); }
.line .acts button.rm { color: var(--muted); }
.qty { display: inline-flex; align-items: center; border-radius: var(--pill); background: rgba(255, 255, 255, .9); border: 1px solid var(--line-strong); box-shadow: var(--hi); }
.qty button { width: 36px; height: 36px; border: 0; background: none; font-size: 18px; font-weight: 700; color: var(--primary); }
.qty span { min-width: 22px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.sum { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.sum.total { font-size: 1.15em; font-weight: 800; color: var(--primary-dark); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.progress { margin: 12px 0 4px; font-size: .86em; }
.progress .bar { height: 8px; border-radius: 4px; background: var(--cream-200); overflow: hidden; margin-top: 6px; box-shadow: inset 0 1px 2px rgba(82, 41, 15, .12); }
.progress .bar i { display: block; height: 100%; border-radius: 4px; background: var(--grad-accent); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.tips { display: grid; gap: 8px; margin: 10px 0 4px; }
.tip { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: linear-gradient(135deg, #FFF3E6, #FDE4CE); border: 1px solid rgba(232, 135, 58, .3); font-size: .86em; line-height: 1.4; }
.tip .em { font-size: 20px; }
.tip > div { flex: 1; }
.tip .btn { min-height: 34px; padding: 4px 12px; font-size: .9em; }

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(58, 29, 10, .34); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .25s; }
.modal-box { position: relative; width: min(920px, 100%); max-height: min(720px, calc(100dvh - 40px)); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; animation: pop .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-box > .x { position: absolute; top: 12px; right: 12px; z-index: 3; }
.pd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 0; flex: 1; }
.pd .gallery { position: relative; background: var(--grad-warm); min-height: 100%; }
.pd .gallery img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pd .info { display: flex; flex-direction: column; min-height: 0; }
.pd .scroll { overflow-y: auto; overscroll-behavior: contain; padding: 24px 24px 12px; display: grid; gap: 14px; align-content: start; }
.pd h2 { margin: 0; padding-right: 44px; font-size: clamp(1.2rem, 1rem + .9vw, 1.6rem); color: var(--primary-dark); }
.pd .desc { color: var(--muted); font-size: .92em; white-space: pre-line; text-align: left; }
.combo-list { margin: 0; padding-left: 18px; }
.opt h4 { margin: 0 0 8px; font-size: .92em; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.opt h4 small { font-weight: 500; color: var(--accent-dark); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 8px 16px; border-radius: var(--pill); border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .85); font-weight: 600; font-size: .92em; transition: all .2s; }
.chip small { color: var(--muted); font-weight: 600; }
.chip.on { background: var(--grad-brand); color: #FFF4E8; border-color: transparent; box-shadow: 0 6px 14px -8px rgba(82, 41, 15, .8); }
.chip.on small { color: #FAD9C1; }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.opt-sels { display: grid; gap: 8px; }
.opt-sel { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 8px; font-weight: 600; font-size: .9em; }
.pd-cta { display: flex; gap: 12px; align-items: center; padding: 12px 24px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .6); }
.pd-cta .btn { flex: 1; }
@media (max-width: 720px) {
  .modal { padding: 0; place-items: end stretch; }
  .modal-box { width: 100%; max-height: 92dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; animation: up .35s cubic-bezier(.2, .8, .2, 1); }
  @keyframes up { from { transform: translateY(40%); opacity: .4; } }
  .pd { grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; overflow-y: auto; }
  .pd .gallery { height: min(72vw, 36dvh); min-height: 0; }
  .pd .info { min-height: auto; }
  .pd .scroll { overflow: visible; padding: 18px 18px 8px; }
  .pd-cta { position: sticky; bottom: 0; padding-inline: 18px; }
}

/* Form */
.input { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .9); box-shadow: inset 0 1px 2px rgba(82, 41, 15, .06); transition: border .2s, box-shadow .2s; font-size: 16px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(232, 135, 58, .18); }
textarea.input { resize: vertical; min-height: 70px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field > label, .lbl { font-weight: 700; font-size: .88em; color: var(--primary-dark); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }
.panel { border-radius: var(--r-lg); padding: clamp(18px, 3vw, 26px); }
.panel h3 { margin: 0 0 14px; color: var(--primary-dark); display: flex; align-items: center; gap: 10px; }
.panel h3 .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-brand); color: #fff; font-size: .8em; flex: none; }
.center { max-width: 560px; margin: clamp(20px, 5vw, 48px) auto; }

/* Checkout */
.checkout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; margin-top: clamp(16px, 3vw, 28px); align-items: start; }
.checkout .side { position: sticky; top: calc(var(--hdr) + 16px); }
@media (max-width: 900px) { .checkout { grid-template-columns: minmax(0, 1fr); } .checkout .side { position: static; } }
.checkout > *, .panel { min-width: 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 16px; background: var(--cream-200); box-shadow: inset 0 1px 3px rgba(82, 41, 15, .12); margin-bottom: 14px; }
.seg button { min-height: 44px; border: 0; border-radius: 12px; background: transparent; font-weight: 700; color: var(--muted); }
.seg button.on { background: #fff; color: var(--primary); box-shadow: var(--sh-1); }
.days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.day { flex: none; min-width: 78px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .85); text-align: center; line-height: 1.25; }
.day b { display: block; } .day small { color: var(--muted); }
.day.on { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: 0 6px 14px -8px rgba(82, 41, 15, .8); }
.day.on small { color: #FAD9C1; }
.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.slot { padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .85); text-align: left; line-height: 1.3; }
.slot b { display: block; }
.slot small { color: var(--muted); }
.slot.on { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(107, 62, 31, .18); background: #fff; }
#map { height: 260px; border-radius: 16px; margin: 8px 0; z-index: 0; box-shadow: var(--sh-1); }
.suggest { border-radius: 14px; overflow: hidden; margin-top: 4px; }
.suggest button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .9); font-size: .9em; }
.ship-info { font-size: .9em; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); line-height: 1.45; }
.ship-info.err { background: #FDECE8; color: var(--err); border-color: rgba(184, 50, 31, .25); }
.ship-info.good { background: #EAF6EE; border-color: rgba(47, 125, 79, .25); }
.groupopt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, #FFF3E6, #FDE4CE); border: 1px solid rgba(232, 135, 58, .3); margin-top: 12px; cursor: pointer; font-size: .9em; }
.groupopt input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--primary); }
.pay { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .8); margin-bottom: 8px; cursor: pointer; }
.pay input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--primary); }
.voucher { display: flex; gap: 8px; }
.voucher .btn { flex: none; }
.msg-ok { color: var(--ok); font-size: .88em; font-weight: 600; }
.msg-err { color: var(--err); font-size: .88em; font-weight: 600; }

/* Đơn hàng */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 16px 0; }
.step { text-align: center; font-size: .78em; color: var(--muted); display: grid; gap: 4px; justify-items: center; }
.step span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--cream-200); color: var(--primary); font-weight: 800; }
.step.on { color: var(--primary); font-weight: 700; }
.step.on span { background: var(--grad-brand); color: #fff; }
.pay-qr { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border-radius: 18px; background: var(--grad-warm); margin-top: 14px; text-align: center; }
.pay-qr img { width: min(280px, 100%); height: auto; border-radius: 14px; background: #fff; box-shadow: var(--sh-2); }
.pay-rows { width: 100%; max-width: 360px; display: grid; gap: 6px; font-size: .9em; text-align: left; }
.pay-rows > div { display: flex; align-items: center; gap: 8px; }
.pay-rows span { color: var(--muted); margin-right: auto; }
.pay-rows .chip { min-height: 30px; padding: 3px 10px; font-size: 12px; }
.share { margin-top: 14px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, #FFF3E6, #FDE4CE); border: 1px solid rgba(232, 135, 58, .3); }
.share code { display: block; padding: 10px 12px; margin: 8px 0; border-radius: 12px; background: #fff; word-break: break-all; font-size: .88em; }
.share .acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* Nổi: giỏ hàng, về đầu trang, chat */
.cartpill { position: fixed; z-index: 50; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(460px, calc(100vw - 2 * var(--gutter))); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 10px; border-radius: var(--pill); border: 1px solid rgba(255, 255, 255, .25); background: rgba(78, 42, 18, .86); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: #FFF4E8; box-shadow: 0 16px 40px -12px rgba(58, 29, 10, .7), inset 0 1px 0 rgba(255, 255, 255, .15); animation: up2 .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes up2 { from { transform: translate(-50%, 120%); } }
.cartpill .cp-n { min-width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-accent); font-weight: 800; }
.cartpill .cp-t { flex: 1; text-align: left; font-weight: 700; }
.cartpill b { padding: 8px 16px; border-radius: var(--pill); background: rgba(255, 255, 255, .14); }
@media (min-width: 721px) { .cartpill { display: none !important; } }
.fab { position: fixed; z-index: 45; right: max(16px, env(safe-area-inset-right)); width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--glass-border); display: grid; place-items: center; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: var(--primary); box-shadow: var(--sh-2), var(--hi); transition: transform .2s, bottom .3s; }
.fab:active { transform: scale(.92); }
.chat-fab { bottom: calc(18px + env(safe-area-inset-bottom)); background: var(--grad-accent); color: #fff; border-color: transparent; }
.totop { bottom: calc(80px + env(safe-area-inset-bottom)); width: 44px; height: 44px; right: max(20px, env(safe-area-inset-right)); }
.totop.solo { bottom: calc(18px + env(safe-area-inset-bottom)); }
body.has-pill .chat-fab { bottom: calc(80px + env(safe-area-inset-bottom)); }
body.has-pill .totop { bottom: calc(142px + env(safe-area-inset-bottom)); }
body.has-pill .totop.solo { bottom: calc(80px + env(safe-area-inset-bottom)); }
@media (min-width: 721px) { body.has-pill .chat-fab { bottom: calc(18px + env(safe-area-inset-bottom)); } body.has-pill .totop { bottom: calc(80px + env(safe-area-inset-bottom)); } body.has-pill .totop.solo { bottom: calc(18px + env(safe-area-inset-bottom)); } }

.toast { position: fixed; z-index: 100; left: 50%; top: calc(var(--hdr) + 12px); transform: translateX(-50%); padding: 10px 18px; border-radius: var(--pill); background: rgba(58, 29, 10, .9); color: #FFF4E8; font-weight: 600; font-size: .9em; box-shadow: var(--sh-3); white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; animation: fade .2s; }

/* Popup */
.popup { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(58, 29, 10, .4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.popup-box { position: relative; width: min(400px, 100%); border-radius: var(--r-lg); overflow: hidden; animation: pop .3s; }
.popup-box > .x { position: absolute; top: 10px; right: 10px; z-index: 2; }
.popup-box img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.popup-box .in { padding: 20px; text-align: center; }
.popup-box h3 { margin: 0 0 6px; color: var(--primary); }
.popup-box p { margin: 0 0 12px; color: var(--muted); }
.popup-box .code { display: inline-block; margin-bottom: 14px; padding: 8px 18px; border: 2px dashed var(--accent); border-radius: 12px; font-weight: 800; letter-spacing: .12em; color: var(--accent-dark); cursor: pointer; background: #FFF6EE; }

/* Chat */
.chat { position: fixed; z-index: 85; right: max(16px, env(safe-area-inset-right)); bottom: calc(80px + env(safe-area-inset-bottom)); width: min(360px, calc(100vw - 32px)); height: min(500px, 70dvh); border-radius: var(--r-lg); display: flex; flex-direction: column; overflow: hidden; }
.chat-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 10px 16px; background: var(--grad-brand); color: #fff; }
.chat-h .x { width: 34px; height: 34px; font-size: 18px; }
.chat-b { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.bub { max-width: 80%; padding: 8px 12px; border-radius: 16px; font-size: .9em; background: rgba(255, 255, 255, .9); box-shadow: var(--sh-1); align-self: flex-start; }
.bub.in { align-self: flex-end; background: var(--grad-brand); color: #fff; }
.chat-f { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.chat-f .input { min-height: 40px; }

/* Leaflet trong lớp kính */
.leaflet-container { font-family: var(--font); border-radius: inherit; }
.leaflet-control-zoom a { color: var(--primary) !important; }

/* Trang ngắn (tra cứu đơn): vừa 1 màn hình, không cuộn */
body.compact .footer, body.compact .topbar { display: none; }
body.compact main { display: grid; align-content: center; }
body.compact .center { margin-block: 16px; }

/* ---- Vòng chỉnh 2 ---- */
/* Topbar: mỗi ý 1 cụm không ngắt; màn hẹp chỉ giữ ý chính cho gọn 1 dòng */
.topbar { text-wrap: balance; }
.topbar .tb { white-space: nowrap; }
@media (max-width: 640px) { .topbar .tb-x { display: none; } }

/* Ô thông tin: mobile xếp 2×2 gọn, không bị cắt khi cuộn ngang */
@media (max-width: 900px) {
  .usps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; margin-inline: 0; padding: 0; gap: 10px; }
  .usp { min-width: 0; padding: 10px; gap: 10px; font-size: .82em; }
  .usp i { width: 36px; height: 36px; font-size: 18px; border-radius: 10px; }
  .usp b { white-space: normal; } /* không cắt chữ ("Giao 2 khung/ngày", "Đặt nhóm, chia ship"): thiếu chỗ thì cả cụm xuống dòng */
}
@media (max-width: 340px) { .usps { grid-template-columns: 1fr; } }

/* Dải sản phẩm mobile: đúng 2 cột/trang, lề trái-phải bằng nhau, vuốt 1 lần qua 1 trang */
@media (max-width: 720px) {
  .grid.rail { grid-auto-columns: calc((100% - 12px) / 2); gap: 12px; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .grid.rail > :not(:nth-child(4n+1)) { scroll-snap-align: none; }
}
.rdots { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
.rdots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--line-strong); transition: width .3s, background .3s; }
.rdots button.on { width: 20px; border-radius: 4px; background: var(--primary); }

/* Cuộn dọc "bắt dính" từng nhóm: 1 lần vuốt = 1 nhóm, mép trên nằm ngay dưới thanh tab */
html { scroll-padding-top: calc(var(--hdr) + 76px); }
@media (max-width: 720px) and (pointer: coarse) { html:has(.cat-sec) { scroll-snap-type: y mandatory; } }
.hero, .section, .cat-sec, #store, .footer { scroll-snap-align: start; }
.footer { scroll-snap-align: end; }
.cat-sec { scroll-margin-top: calc(var(--hdr) + 76px); }

/* Chữ ký thương hiệu giữa trang */
.footer .sign { margin-top: 28px; padding-top: 22px; border-top: 1px solid rgba(250, 217, 193, .2); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 13px; color: #F1D3B8; }
.footer .sign img { height: 38px; width: auto; border-radius: 10px; margin-bottom: 6px; opacity: .95; }

/* Bảng chọn nhanh khi bấm "+" */
.modal-box.quick { width: min(480px, 100%); }
.modal-box.quick .pd { grid-template-columns: minmax(0, 1fr); }
.qhead { display: flex; gap: 12px; align-items: center; padding-right: 44px; }
.qthumb { width: 64px; height: 64px; flex: none; border-radius: 14px; overflow: hidden; position: relative; background: var(--grad-warm); box-shadow: var(--sh-1); }
.qthumb img { width: 100%; height: 100%; object-fit: cover; }
.qhead h2 { font-size: 1.05em; padding: 0; margin: 0 0 2px; }
.qnote { margin: -4px 0 0; font-size: .84em; color: var(--muted); }
.qnote .link-btn { padding: 0; font-size: 1em; }

/* Gợi ý địa chỉ khi gõ */
.field.addr { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 4px; max-height: 300px; overflow-y: auto; box-shadow: var(--sh-3); }
.suggest button { display: grid; gap: 1px; padding: 10px 14px; line-height: 1.3; }
.suggest button b { font-weight: 600; font-size: .95em; }
.suggest button small { color: var(--muted); font-size: .8em; }
.suggest button.hi, .suggest button:hover { background: var(--peach-100); }
.input.busy { background-image: linear-gradient(90deg, transparent, rgba(232, 135, 58, .18), transparent); background-size: 200% 100%; animation: shimmer 1s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.loc-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Link nhóm hiện ngay khi tích */
.grouplink { margin-top: 8px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px dashed var(--accent); display: grid; gap: 6px; }
.copyrow { display: flex; gap: 6px; }
.copyrow .input { min-height: 40px; font-size: 14px; color: var(--primary); font-weight: 600; }
.banknote { margin: 4px 0 8px; padding: 12px 14px; border-radius: 14px; background: var(--grad-warm); border: 1px solid var(--line); font-size: .9em; line-height: 1.5; }
.acts-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Hoá đơn dạng tờ giấy in */
.inv-wrap { width: min(420px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; gap: 12px; animation: pop .3s; }
.receipt { overflow-y: auto; background: #FFFDF8; color: #2B1B0E; padding: 24px 22px 28px; border-radius: 6px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45); font-size: 13.5px; line-height: 1.45;
  -webkit-mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 16px 100% repeat-x; mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 16px 100% repeat-x; }
.r-head { text-align: center; color: #6A513D; font-size: 12px; }
.r-head img { height: 48px; width: auto; margin: 0 auto 6px; }
.r-title { margin: 14px 0 10px; padding: 8px 0; text-align: center; font-weight: 800; letter-spacing: .14em; border-block: 1px dashed #C9B49F; }
.r-meta { display: grid; gap: 3px; }
.r-meta div, .r-sum div { display: flex; justify-content: space-between; gap: 12px; }
.r-meta span, .r-sum span:first-child { color: #7A6250; flex: none; }
.r-meta b { text-align: right; font-weight: 600; }
.r-items { width: 100%; border-collapse: collapse; margin: 12px 0; }
.r-items th { text-align: left; font-size: 11px; color: #7A6250; border-bottom: 1px dashed #C9B49F; padding: 6px 0; }
.r-items td { padding: 7px 0; vertical-align: top; border-bottom: 1px dotted #E3D5C6; }
.r-items td small { display: block; color: #8A7360; font-size: 11.5px; }
.r-items th:nth-child(2), .r-items td:nth-child(2) { text-align: center; width: 36px; }
.r-items th:last-child, .r-items td:last-child { text-align: right; white-space: nowrap; }
.r-sum { display: grid; gap: 4px; }
.r-total { margin: 6px 0; padding: 8px 0; border-block: 1px dashed #C9B49F; font-weight: 800; font-size: 16px; }
.r-total span:first-child { color: #2B1B0E !important; }
.r-foot { margin-top: 16px; text-align: center; color: #6A513D; font-size: 12.5px; }
.inv-acts { display: flex; gap: 8px; justify-content: center; }
@media print { body > *:not(#popup) { display: none !important; } #popup { position: static; background: none; backdrop-filter: none; padding: 0; } .inv-acts { display: none; } .receipt { box-shadow: none; -webkit-mask: none; mask: none; max-height: none; overflow: visible; } }

/* Tra cứu theo SĐT */
.lh { margin: 18px 0 8px; font-size: .95em; color: var(--primary-dark); }
.ord { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 8px; border-radius: 14px; background: rgba(255, 255, 255, .8); border: 1px solid var(--line); color: var(--text); }
.ord small { display: block; color: var(--muted); font-size: .8em; margin-top: 2px; }
.badge-st { font-size: .72em; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--peach-100); color: var(--accent-dark); }
.badge-st.done { background: #E6F4EA; color: var(--ok); } .badge-st.cancelled { background: #FBE9E5; color: var(--err); }

/* ---- Vòng chỉnh 3 ---- */
/* Mỗi câu là 1 khối: câu sau thiếu chỗ thì xuống dòng nguyên câu, không vắt nửa câu */
.sent { display: inline-block; max-width: 100%; text-wrap: pretty; }
.note { font-size: .85em; line-height: 1.55; margin: 10px 0 0; }
.steps-mini { margin: 4px 0 0; padding-left: 18px; font-size: .84em; color: var(--muted); line-height: 1.5; display: grid; gap: 2px; }
.sum.sub { font-size: .85em; color: var(--muted); padding-top: 0; }

/* Ảnh sản phẩm vuông đồng bộ toàn site */
.card .thumb { aspect-ratio: 1 / 1; }
.card .thumb img { object-position: 50% 50%; }
.popup-box img { aspect-ratio: 1 / 1; max-height: 42dvh; object-fit: cover; }

/* Nhắc đơn chưa hoàn tất: nhãn bám mép phải, đi theo khi cuộn */
.resume { position: fixed; z-index: 44; right: 0; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 10px; max-width: 300px; padding: 12px 14px 12px 12px;
  border-radius: 18px 0 0 18px; border-right: 0; text-align: left; color: var(--text); cursor: pointer; animation: slideIn .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes slideIn { from { transform: translate(100%, -50%); } }
.resume .rs-ic { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--grad-accent); font-size: 18px; box-shadow: 0 4px 10px -4px rgba(201, 104, 31, .7); }
.resume b { display: block; font-size: .88em; color: var(--primary-dark); }
.resume small { color: var(--muted); font-size: .8em; }
.resume .rs-go { font-weight: 800; font-size: .85em; color: var(--accent-dark); white-space: nowrap; }
.resume:hover .rs-go { text-decoration: underline; }
.cartpill.pending { background: linear-gradient(135deg, rgba(232, 135, 58, .95), rgba(201, 104, 31, .95)); }
.cartpill.pending .cp-n { background: rgba(255, 255, 255, .25); }

/* ---- Vòng chỉnh 4: sau đánh giá chuyên gia & khách hàng ---- */
:root { --accent-ink: #9A4A10; --grad-accent-deep: linear-gradient(135deg, #B85A14 0%, #A4500F 55%, #8F4409 100%); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 700; transition: top .2s; }
.skip:focus { top: 12px; }
main:focus { outline: none; }

/* Tương phản chữ ≥ 4.5:1: nhãn cam, nút cam, chữ cam trên nền kem */
.tag, .btn-accent, .cart-btn .badge, .groupbar, .cartpill.pending { background: var(--grad-accent-deep); }
.line .acts button, .opt h4 small, .resume .rs-go, .popup-box .code, .badge-st { color: var(--accent-ink); }
.popup-box .code { border-color: var(--accent-ink); }

/* Thẻ sản phẩm: giá cũ xuống dòng dưới giá mới, nút "+" không bao giờ bị đẩy ra ngoài (chữ to, màn 360–390) */
.card .row { align-items: flex-end; }
.card .row > div { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.card .row .old { margin-left: 0; margin-top: 2px; }

/* Giỏ hàng: vùng bấm Sửa/Xoá và +/- đủ lớn, cách xa nhau */
.line .acts { gap: 6px; margin-top: 4px; }
.line .acts button { min-height: 32px; padding: 6px 10px; border-radius: 10px; font-size: .82em; }
.line .acts button:hover { background: var(--peach-100); }
.line .acts button.rm { margin-left: 4px; }
.qty button { width: 40px; height: 40px; }

/* Chấm trang và thanh kéo: vùng chạm 24px dù chấm nhỏ */
.rdots { gap: 0; }
.rdots button, .dots button { box-sizing: content-box; padding: 8px; background-clip: content-box; }
.dots { gap: 0; padding: 0 4px; }
.grab { box-sizing: content-box; padding: 10px 28px; margin: 0 auto !important; background-clip: content-box; touch-action: none; cursor: grab; }

/* Header mobile: thêm nút tra cứu đơn cạnh giỏ */
.hdr-ic { display: none; width: 44px; height: 44px; border-radius: 50%; place-items: center; color: var(--primary); background: rgba(255, 255, 255, .72); border: 1px solid var(--glass-border); box-shadow: var(--sh-1), var(--hi); }
@media (max-width: 760px) { .hdr-ic { display: grid; margin-left: auto; } .hdr-ic + .cart-btn { margin-left: 8px; } }

/* Thanh tab danh mục chỉ dính trong vùng thực đơn, nền đặc hơn để không lẫn chữ bên dưới */
.menu-area { position: relative; }
.tabs { background: var(--glass-strong); }

/* Nút nổi không che nội dung: chừa chỗ cuối trang, ẩn chat ở trang thanh toán/đơn/tra cứu, mờ đi khi đang cuộn */
body.no-chat .chat-fab { display: none; }
body.no-chat .totop:not(.solo) { bottom: calc(18px + env(safe-area-inset-bottom)); }
body.no-chat.has-pill .totop:not(.solo) { bottom: calc(80px + env(safe-area-inset-bottom)); }
@media (max-width: 1024px) {
  main { padding-bottom: 76px; }
  body.has-pill main, body.has-ckbar main { padding-bottom: 140px; }
  body.has-pill .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body.scrolling .chat-fab, body.scrolling .totop { opacity: 0; pointer-events: none; transform: scale(.8); }
  .fab { transition: transform .2s, bottom .3s, opacity .2s; }
}

/* Toast có nút Hoàn tác */
.toast.has-act { display: flex; align-items: center; gap: 12px; white-space: normal; }
.toast button { flex: none; border: 0; border-radius: 999px; padding: 6px 12px; background: #FFE7D2; color: var(--brown-800); font-weight: 800; }

/* Popup: mã giảm giá là nút bấm, có hướng dẫn */
.popup-box .code { display: grid; gap: 2px; margin: 0 auto 14px; font: inherit; font-weight: 800; letter-spacing: .12em; }
.popup-box .code small { letter-spacing: 0; font-weight: 600; font-size: .72em; color: var(--muted); }

/* Combo tự chọn: ô chưa chọn vị nổi bật */
.opt-sel { grid-template-columns: 56px minmax(0, 1fr); }
.opt-sel select { font-size: 14px; text-overflow: ellipsis; }
.opt-sel select.need { border-color: var(--accent); background: #FFF6EE; color: var(--accent-ink); font-weight: 700; }

/* Checkout: báo lỗi tại chỗ, chip ngày xuống dòng thay vì bị cắt, thanh tổng dính đáy */
.field-err { margin: 2px 0 0; color: var(--err); font-size: .85em; font-weight: 600; }
.invalid .input, .input.invalid { border-color: var(--err); box-shadow: 0 0 0 3px rgba(184, 50, 31, .12); }
#slots.invalid, #days.invalid { outline: 2px solid rgba(184, 50, 31, .4); outline-offset: 4px; border-radius: 14px; }
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); overflow: visible; padding-bottom: 2px; }
.day { min-width: 0; }
.map-hint { display: block; margin-top: -2px; font-size: .8em; }
#comboNudge .tip { margin-top: 12px; }
.ck-bar { position: fixed; z-index: 48; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px max(var(--gutter), env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }
.ck-bar small { display: block; color: var(--muted); font-size: .78em; }
.ck-bar b { font-size: 1.15em; color: var(--primary-dark); }
.ck-bar .btn { min-width: 150px; }
@media (min-width: 901px) { .ck-bar { display: none !important; } }

/* Trang đơn: tiêu đề h1, bước tiến trình không gãy chữ xấu, QR xem lại, chip thanh toán */
.h-ok, .h-ord { margin: 0 0 6px; font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem); }
.h-ok { color: var(--primary); }
.steps { list-style: none; padding: 0; }
.step { font-size: clamp(.7em, 2.6vw, .78em); line-height: 1.25; }
.qr-again { margin-top: 10px; }
.qr-again summary { cursor: pointer; font-weight: 700; color: var(--primary); padding: 6px 0; }
.share { display: grid; gap: 6px; }
.badge-pay { font-size: .72em; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #F3ECE4; color: var(--primary); }
.badge-pay.claimed { background: #FFF1DC; color: var(--accent-ink); } .badge-pay.paid { background: #E6F4EA; color: var(--ok); } .badge-pay.unpaid { background: #FBE9E5; color: var(--err); }
.lh { font-size: .95em; }

/* ---- Vòng chỉnh 5 ---- */
/* Banner có chữ: chữ đặt trên khoảng tường trống bên trái, không khung che sản phẩm */
.slide.has-cap .fg { object-position: 50% 72%; }
.slide.has-cap { background: linear-gradient(180deg, #E6D9C8 0%, #EFE3D3 60%, #F2E5D5 100%); }
.slide.has-cap::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(240, 228, 212, .92) 0%, rgba(240, 228, 212, .7) 22%, rgba(240, 228, 212, 0) 42%); }
.cap2 { position: absolute; z-index: 2; left: clamp(20px, 4.5vw, 64px); top: 50%; transform: translateY(-50%); width: min(36%, 440px); color: var(--brown-900); }
.cap2 .eyebrow { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--brown-800); color: #FFE7D2; font-size: clamp(10px, .55rem + .3vw, 13px); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.cap2 h2 { margin: .45em 0 .35em; font-size: clamp(1.5rem, .9rem + 2.6vw, 3.4rem); line-height: 1.04; letter-spacing: -.025em; font-weight: 800; color: var(--primary-dark); text-wrap: balance; }
.cap2 h2 em { display: block; font-style: normal; color: var(--accent-ink); background: linear-gradient(transparent 62%, rgba(232, 135, 58, .28) 62%); width: fit-content; }
.cap2 ul { list-style: none; margin: 0 0 1em; padding: 0; display: grid; gap: 4px; font-size: clamp(.8rem, .7rem + .35vw, 1.05rem); font-weight: 600; color: var(--brown-800); }
.cap2 li { display: flex; gap: 8px; align-items: baseline; }
.cap2 li::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); transform: translateY(-2px); }
.cap2 .cta { display: inline-flex; align-items: center; gap: 8px; padding: .62em 1.3em; border-radius: 999px; background: var(--grad-brand); color: #FFF4E8; font-weight: 700; font-size: clamp(.8rem, .7rem + .3vw, 1rem); box-shadow: 0 10px 22px -10px rgba(82, 41, 15, .7); transition: transform .2s; }
.cap2 .cta i { font-style: normal; transition: transform .2s; }
.slide:hover .cap2 .cta i { transform: translateX(4px); }
@media (max-width: 640px) {
  /* Màn hẹp: khung cao hơn, ảnh nằm dưới, chữ ở phần tường phía trên — không đè lên chai */
  .slider:has(.slide.has-cap) { aspect-ratio: 4 / 3.6; }
  .slider:has(.slide.has-cap) .slide:not(.has-cap):not(.portrait) .fg { object-fit: cover; object-position: center; }
  .slide.has-cap .fg { position: absolute; left: 0; right: 0; bottom: 0; top: auto; width: 100%; height: auto; aspect-ratio: 1920 / 1072; object-fit: cover;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%); mask-image: linear-gradient(180deg, transparent 0, #000 22%); }
  .slide.has-cap::after { background: linear-gradient(180deg, rgba(240, 228, 212, .0) 0%, rgba(240, 228, 212, 0) 100%); }
  .cap2 { left: 18px; right: 18px; top: 16px; transform: none; width: auto; }
  .cap2 h2 { margin: .35em 0 .2em; font-size: clamp(1.45rem, 1rem + 3.4vw, 1.9rem); }
  .cap2 h2 em { display: inline; }
  .cap2 ul { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-bottom: .7em; font-size: .8rem; }
  .cap2 .cta { padding: .5em 1.1em; font-size: .82rem; }
}

/* Nút chuyển banner: chấm tròn tách rời, không khung kính (hết hở viền) */
.dots { left: auto; right: clamp(14px, 2.5vw, 28px); bottom: clamp(12px, 2vw, 22px); transform: none; gap: 2px; padding: 0; background: none; border: 0; box-shadow: none; }
.dots button { box-sizing: content-box; width: 8px; height: 8px; padding: 8px 4px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .85); background-clip: content-box;
  filter: drop-shadow(0 1px 2px rgba(58, 29, 10, .35)); transition: width .3s, background-color .3s; }
.dots button.on { width: 26px; background-color: var(--primary); }
@media (max-width: 640px) { .dots { right: 50%; transform: translateX(50%); bottom: 6px; } }

/* Trang chủ: mỗi nhóm 1 hàng 4 món (mobile vuốt ngang 2 món/khung), còn lại ở "Xem thêm" */
@media (max-width: 1000px) and (min-width: 721px) { .grid.rail { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .grid.rail { grid-template-rows: auto; }
  .grid.rail > * { scroll-snap-align: none; }
  .grid.rail > :nth-child(2n+1) { scroll-snap-align: start; }
}

/* Đơn chờ chuyển khoản, nút giữa khung */
.paywait { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border-radius: 18px; background: #FFF4E6; border-color: rgba(232, 135, 58, .35); font-size: .92em; }
.paywait .btn { margin-left: auto; }
.center-row { justify-content: center; }
ol.steps-mini { padding-left: 20px; }
/* Chấm đang chọn: giữ nền trong phần lõi (không tràn ra vùng chạm) */
.dots button.on, .rdots button.on { background-color: var(--primary); background-clip: content-box; }
.rdots button { background-color: var(--line-strong); background-clip: content-box; }

/* ---- Vòng chỉnh 6: 2 bước xác nhận/chuyển khoản, trang đơn căn giữa ---- */
.order-panel { position: relative; }
.order-panel > h1, .order-panel > .lead { text-align: center; }
.order-panel > .lead { margin: 0 auto 10px; max-width: 34em; }
.order-panel > .lead.note { margin-top: -2px; }
.panel-x { position: absolute; top: 12px; right: 12px; }
.order-panel > h1.h-ok { padding-inline: 40px; }
.rv-info { display: grid; gap: 6px; margin: 14px 0; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); font-size: .92em; }
.rv-info > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
.rv-info span { color: var(--muted); }
.rv-info b { font-weight: 600; }
.rv-lines { margin-bottom: 6px; }
.inv-ok { text-align: center; padding: 12px 16px; border-radius: 16px; background: var(--grad-brand); color: #FFF4E8; font-weight: 800; font-size: 1.15em; box-shadow: var(--sh-2); animation: pop .35s; }
.resume { max-width: 320px; }
.resume b { text-wrap: balance; }
.resume small { display: block; }
.order-panel > h1.h-ok { padding-inline: 36px; font-size: clamp(1.2rem, 1rem + 1.4vw, 1.7rem); }
/* Hoá đơn hiện trọn, không cuộn trong khung (JS thu nhỏ vừa màn hình) */
.inv-wrap { max-height: none; }
.receipt { overflow: visible; flex: none; }
@media (max-height: 760px) {
  .receipt { padding: 16px 18px 22px; line-height: 1.35; }
  .r-head img { height: 40px; margin-bottom: 4px; }
  .r-title { margin: 10px 0 8px; padding: 6px 0; }
  .r-items { margin: 8px 0; } .r-items td { padding: 5px 0; } .r-foot { margin-top: 10px; }
}
.inv-wrap { align-items: center; } .inv-acts { align-self: stretch; }
.receipt { width: 100%; } .inv-ok { align-self: stretch; }

/* ---- Vòng chỉnh 7: tiêu đề bước căn giữa, icon treo, không đụng nút X ---- */
.order-panel > h1.h-step { text-align: center; text-wrap: balance; padding-inline: 46px; margin: 2px 0 8px; font-size: clamp(1.2rem, 1rem + 1.4vw, 1.7rem); line-height: 1.25; }
.h-step .hk { position: relative; display: inline-block; max-width: 100%; text-wrap: balance; }
.h-step .hk i { position: absolute; right: 100%; top: 50%; transform: translate(-8px, -50%); font-style: normal; font-size: .95em; line-height: 1; }
.order-panel > h1.h-ok { color: var(--primary); }
.panel-x { top: 10px; right: 10px; }
/* Cụm chữ tự động: khối liền, quá rộng thì tự xuống dòng bên trong */
.sent { display: inline-block; max-width: 100%; }
/* Cụm chữ tự xuống dòng bên trong thì chia cân đối (không để 1 chữ lẻ dòng dưới) */
.sent { text-wrap: balance; }
p .sent, li .sent, .note .sent { text-wrap: pretty; }
.h-step .hk { text-wrap: balance; }
.pay-rows > div { flex-wrap: wrap; row-gap: 2px; }
.pay-rows b { overflow-wrap: anywhere; }
.order-panel > h1.h-step { padding-inline: 42px; font-size: clamp(1.12rem, .86rem + 1.45vw, 1.7rem); }
.chips + .chips { margin-top: 8px; }
/* Topping: 2 loại thạch chung 1 hàng (2 cột), giá cộng thêm nằm dưới tên */
.chips.chips-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 420px; }
.chips-2 .chip { padding: 8px 12px; line-height: 1.25; }
.chips-2 .chip small { display: block; font-size: .82em; }
/* Tên món trên thẻ: mã vị + tên vị xuống dòng nguyên khối */
.ct-code { white-space: nowrap; }
@media (max-width: 480px) { .card h3, .card .desc { -webkit-line-clamp: 3; } } /* thẻ hẹp: đủ chỗ cho cả tên vị, không cắt "…" giữa chữ */
@media (max-width: 340px) { .card h3 { -webkit-line-clamp: 4; } }
/* Chân trang: icon mạng xã hội thay chữ */
.footer .socials { display: flex; gap: 10px; flex-wrap: wrap; }
.footer .soc { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18); transition: transform .15s; }
.footer .soc:hover { transform: translateY(-2px); }
.footer .soc-facebook { background: #1877F2; }
.footer .soc-zalo { background: #0068FF; }
.footer .soc-tiktok { background: #111; }
.footer .soc-instagram { background: radial-gradient(circle at 30% 107%, #FDD86A 0, #F5813A 35%, #D6296B 65%, #8A3AB9 100%); }

