:root {
  --bg: #fbf7f3;
  --card: #fff;
  --ink: #2d2926;
  --muted: #857a73;
  --line: #ece4dd;
  --accent: #a4505e;
  --accent-2: #8b3f4c;
  --accent-soft: #f7e9e7;
  --sage: #5f7d5c;
  --sage-soft: #eaf1e8;
  --warn: #a86a00;
  --dark: #2b2320;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.container { max-width: 1440px; margin: 0 auto; padding: 0 16px; }
@media (max-width: 860px) { .only-desktop { display: none !important; } }
@media (min-width: 861px) { .only-mobile { display: none !important; } }

/* ---------- Topbar ---------- */
.topbar { background: var(--dark); color: #eadfd8; font-size: 12.5px; }
.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 34px; padding-top: env(safe-area-inset-top); }
.tb-spacer { flex: 1; }
.tb-item { white-space: nowrap; }
a.tb-item:hover { color: #fff; }
@media (max-width: 560px) { #tbHours { display: none; } .topbar-in { justify-content: center; } .tb-spacer { display: none; } }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); }
.header-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; min-height: 84px; }
@media (max-width: 860px) { .header-in { min-height: 60px; grid-template-columns: 44px 1fr auto; } }
.logo { text-align: center; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.logo-name {
  font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: .3px; color: var(--accent);
  line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.logo-tag { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
@media (max-width: 860px) { .logo-name { font-size: 21px; } .logo-tag { display: none; } }

.search { position: relative; max-width: 300px; }
.search input, .m-search input {
  width: 100%; border: 1px solid var(--line); border-radius: 999px; padding: 9px 38px 9px 16px; background: var(--bg);
}
.search input:focus, .m-search input:focus { outline: none; border-color: var(--accent); background: #fff; }
.search svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.m-search { padding-bottom: 10px; }
.m-search input { padding-right: 16px; }

.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.h-link {
  position: relative; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none;
  padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
}
.h-link:hover { background: var(--accent-soft); color: var(--accent-2); }
.count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center;
}
.count:empty { display: none; }
@media (max-width: 860px) { .h-link .count { position: absolute; top: 2px; right: 0; } }
.icon-btn { border: 0; background: none; color: var(--ink); padding: 6px; border-radius: 8px; font-size: 16px; line-height: 1; }
.icon-btn:hover { background: var(--accent-soft); }

/* ---------- Nav ---------- */
.nav { border-top: 1px solid var(--line); background: #fff; }
.nav > .container { position: relative; } /* bảng "Bộ sưu tập" rộng bằng khung nội dung */
@media (max-width: 860px) { .nav { display: none; } }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; }
.nav-list > li > a {
  display: flex; align-items: center; gap: 7px; padding: 14px 15px; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px; color: var(--ink); transition: color 350ms ease-out;
}
.nav-list > li > a:hover, .nav-list > li > a:focus-visible, .nav-list > li > a.on, .nav-more:hover > a { color: var(--accent); }
.nav-list a.hot { color: var(--accent); }
.caret { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }

/* khung thả xuống: ẩn sẵn, rê chuột thì hiện mờ dần + trượt lên 15px (0.3s) */
.nav-more { position: relative; }
.nav-more.mega-wrap { position: static; }
.nav-drop {
  position: absolute; top: 100%; left: 0; z-index: 40; min-width: 200px; background: #fff; color: #222; text-align: left;
  box-shadow: 0 0 5px rgba(0,0,0,.24); border-radius: 0;
  opacity: 0; visibility: hidden; transform: translateY(15px);
  transition: all .3s cubic-bezier(.25,.46,.45,.94);
}
.mega-wrap .nav-drop { left: 16px; right: 16px; }
.nav-more:hover > .nav-drop, .nav-more:focus-within > .nav-drop { opacity: 1; visibility: visible; transform: none; }
/* vừa bấm chọn một mục: đóng menu ngay, dù chuột còn nằm trên menu (mở lại khi rê vào lần sau) */
.nav-more.closed > .nav-drop { opacity: 0; visibility: hidden; transform: translateY(15px); pointer-events: none; }
.nav-more.closed > a:not(.on) { color: var(--ink); }
.nav-more.simple > .nav-drop { padding: 20px; }
.nav-drop ul { list-style: none; margin: 0; padding: 0; }
.nav-drop li { padding: 3px 0; line-height: 30px; }
.nav-drop li a { display: block; color: #666; font-size: 14px; white-space: nowrap; transition: color .25s; }
.nav-drop li a:hover, .nav-drop li a.on { color: var(--accent); }

/* bảng lớn "Bộ sưu tập": danh sách · ảnh minh hoạ · sản phẩm mới */
.mega { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr) minmax(0, 1fr); gap: 30px; padding: 20px; }
.mega h4 { margin: 5px 0 10px; font-size: 14px; font-weight: 700; text-transform: uppercase; color: #222; }
.mega-links ul.two { columns: 2; column-gap: 20px; }
.mega-links li { break-inside: avoid; }
.mega-show { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; background: #f3ece6; }
.mega-show img, .mega-show .noimg { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s cubic-bezier(.25,.46,.45,.94); }
.mega-show:hover img { transform: scale(1.05); }
.mega-show.swap img, .mega-show.swap .noimg { animation: megaFade .4s ease; }
@keyframes megaFade { from { opacity: 0; } to { opacity: 1; } }
.mega-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 16px 14px; color: #fff; font-family: var(--serif); font-size: 20px;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
}
.mega-new { display: flex; flex-direction: column; gap: 14px; }
.mega-item { display: flex; gap: 14px; align-items: flex-start; }
.mega-item img { width: 100px; height: 130px; object-fit: cover; flex: none; }
.mega-name { display: block; font-size: 17px; font-weight: 300; line-height: 1.25; color: #555; margin-bottom: 8px; transition: color .25s; }
.mega-item:hover .mega-name { color: var(--accent); }
.mega-item b { color: #000; font-size: 15px; }
.menu-list small { color: var(--muted); font-weight: 400; margin-left: 4px; }

.who { text-align: center; margin: 0; padding: 8px 16px; background: var(--accent-soft); color: var(--accent-2); font-size: 13px; }

/* ---------- Menu mobile ---------- */
.menu {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); background: #fff; z-index: 50;
  display: flex; flex-direction: column; animation: slideL .2s ease-out;
}
@keyframes slideL { from { transform: translateX(-30px); opacity: .6; } to { transform: none; opacity: 1; } }
.menu-head { display: flex; justify-content: space-between; align-items: center; padding: calc(14px + env(safe-area-inset-top)) 16px 14px; border-bottom: 1px solid var(--line); }
.menu-list { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; }
.menu-list a { display: block; padding: 12px 18px; border-bottom: 1px solid #f5efea; }
.menu-list a.on { color: var(--accent); font-weight: 600; }
.menu-list .menu-h { padding: 14px 18px 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
/* nhóm thu gọn: bấm "Sản phẩm" / "Bộ sưu tập" để mở danh sách con */
.menu-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 12px 18px;
  border: 0; border-bottom: 1px solid #f5efea; background: none; text-align: left; font-size: inherit; color: var(--ink);
}
.menu-toggle .caret { transition: transform .3s; }
.menu-grp.open > .menu-toggle { color: var(--accent); font-weight: 600; }
.menu-grp.open > .menu-toggle .caret { transform: translateY(1px) rotate(225deg); }
.menu-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.menu-grp.open > .menu-sub { grid-template-rows: 1fr; }
.menu-sub > ul { list-style: none; margin: 0; padding: 0; overflow: hidden; min-height: 0; background: #fbf7f3; }
.menu-sub a { padding: 11px 18px 11px 34px; font-size: 14.5px; }

/* ---------- Bars ---------- */
.bar { display: flex; align-items: center; gap: 10px; border-radius: var(--radius); padding: 10px 12px; margin-top: 14px; }
.bar.install { background: #fff; border: 1px solid var(--line); }
.bar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bar-text b { font-size: 13px; }
.bar-text span { font-size: 12px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--accent); border-radius: 999px; padding: 10px 20px; font-weight: 600;
  background: var(--accent); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn.light { background: #fff; color: var(--ink); border-color: #fff; }
.btn.light:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.sm { padding: 6px 14px; font-size: 13px; }
button:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--accent-soft); }
.slides { display: flex; transition: transform .6s ease; }
@media (prefers-reduced-motion: reduce) { .slides { transition: none; } }
.slide {
  flex: 0 0 100%; position: relative; min-height: 380px; display: flex; align-items: center;
  background-size: cover; background-position: center;
}
.slide.tone-0 { background-image: radial-gradient(circle at 80% 30%, #f3d3d1 0, transparent 45%), linear-gradient(120deg, #f8ece8, #f1ddd6); }
.slide.tone-1 { background-image: radial-gradient(circle at 75% 60%, #dfe8d6 0, transparent 45%), linear-gradient(120deg, #f4f1e8, #e6ecdf); }
.slide.tone-2 { background-image: radial-gradient(circle at 80% 40%, #efdcc6 0, transparent 45%), linear-gradient(120deg, #faf2e8, #f1e2d2); }
.slide.has-img::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(43,35,32,.55), rgba(43,35,32,0) 70%); }
.slide-deco { position: absolute; right: 6%; top: 50%; transform: translateY(-50%); width: min(38vw, 360px); opacity: .9; pointer-events: none; }
.slide-in { position: relative; max-width: 1240px; width: 100%; margin: 0 auto; padding: 40px 16px; }
.slide-text { max-width: 540px; }
.slide h2 { font-family: var(--serif); font-size: clamp(28px, 4.4vw, 50px); line-height: 1.12; font-weight: 500; margin: 0 0 12px; }
.slide p { font-size: 16px; color: #5d524c; margin: 0 0 22px; }
.slide.has-img h2, .slide.has-img p { color: #fff; }
@media (max-width: 640px) {
  .slide { min-height: 260px; }
  .slide-deco { width: 46vw; right: -8%; opacity: .45; }
  .slide p { font-size: 14px; }
}
.hero-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.85); font-size: 24px; line-height: 1; display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.hero-nav.prev { left: 14px; } .hero-nav.next { right: 14px; }
@media (max-width: 640px) { .hero-nav { display: none !important; } }
.dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; }
.dots button { width: 8px; height: 8px; padding: 0; border-radius: 999px; border: 0; background: rgba(43,35,32,.25); transition: width .2s; }
.dots button.on { width: 24px; background: var(--accent); }

/* ---------- USP ---------- */
.usp {
  list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
.usp li { padding: 16px 18px; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.usp li:first-child { border-left: 0; }
.usp b { font-size: 14px; }
.usp span { color: var(--muted); font-size: 12.5px; }
@media (max-width: 860px) {
  .usp { grid-template-columns: repeat(2, 1fr); }
  .usp li:nth-child(3) { border-left: 0; }
  .usp li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .usp li { padding: 12px 14px; }
}

/* ---------- Tiêu đề khu vực ---------- */
.sec { margin-top: 44px; }
.sec-head { text-align: center; margin-bottom: 22px; }
.sec-title { font-family: var(--serif); font-weight: 500; font-size: clamp(24px, 3vw, 32px); margin: 0; line-height: 1.2; }
.sec-title a:hover { color: var(--accent); }
.sec-sub { color: var(--muted); margin: 6px 0 0; font-size: 13.5px; }
.sec-head::after { content: ""; display: block; width: 48px; height: 2px; background: var(--accent); margin: 12px auto 0; }
.sec-more { text-align: center; margin-top: 20px; }
@media (max-width: 560px) {
  .sec { margin-top: 34px; }
  .sec .grid .card:nth-child(n+5) { display: none; }
}

/* ---------- Ô danh mục ---------- */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 44px; }
.cat-tile {
  position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--accent-soft);
  display: flex; align-items: flex-end;
}
.cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.cat-tile:hover img { transform: scale(1.06); }
.cat-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(43,35,32,.62), transparent 60%); }
.cat-tile span { position: relative; z-index: 1; color: #fff; padding: 12px; font-weight: 600; line-height: 1.3; }
.cat-tile small { display: block; font-weight: 400; opacity: .85; font-size: 12px; }
.cat-tile .noimg { position: absolute; inset: 0; align-items: start; padding-top: 16%; }
.cat-tile .noimg svg { width: 38%; }
.cat-tile.plain::after { display: none; }
.cat-tile.plain span { color: var(--ink); }
.cat-tile.plain small { color: var(--muted); opacity: 1; }
@media (max-width: 560px) { .cat-tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; } .cat-tile span { font-size: 12.5px; padding: 8px; } }

/* ---------- Danh sách ---------- */
#listing { padding-bottom: 20px; }
/* banner tràn màn hình đầu trang danh mục / bộ sưu tập */
.page-hero { position: relative; overflow: hidden; min-height: 320px; display: flex; align-items: center; background: linear-gradient(135deg, #f3e1dd, #ecdcd0 55%, #e4d6c8); }
.page-hero-bg { position: absolute; inset: -20px; background: center / cover no-repeat; filter: blur(2px) brightness(.92); }
.page-hero .container { position: relative; width: 100%; padding-top: 40px; padding-bottom: 40px; }
.page-hero-box { display: inline-block; max-width: min(620px, 100%); background: #fff; padding: 26px 36px 28px; box-shadow: 0 8px 30px rgba(43,35,32,.08); }
.page-hero-box .crumbs { text-transform: uppercase; letter-spacing: .5px; }
.page-hero-box .crumbs span:last-child { color: var(--accent); }
.page-hero-box .page-title { font-size: clamp(30px, 4.2vw, 50px); line-height: 1.15; margin-top: 6px; }
.page-hero-box .list-desc { margin: 10px 0 0; }
.list-body { padding-top: 26px; }
@media (max-width: 640px) {
  .page-hero { min-height: 190px; }
  .page-hero .container { padding-top: 24px; padding-bottom: 24px; }
  .page-hero-box { padding: 16px 18px 18px; }
  .list-body { padding-top: 16px; }
}
.crumbs { font-size: 12.5px; color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs span { margin: 0 4px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.page-title { font-family: var(--serif); font-weight: 500; font-size: clamp(24px, 3vw, 32px); margin: 0; }
.sort { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.sort select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--ink); }
.list-desc { color: #4d4540; font-size: 14px; margin: 0 0 6px; max-width: 760px; white-space: pre-line; }
.info { font-size: 13px; color: var(--muted); margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 50px 10px; }
.empty a { color: var(--accent); text-decoration: underline; }

/* ---------- Trang danh sách: cột trái + nội dung ---------- */
.list-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start; }
.sidebar { position: sticky; top: 150px; display: flex; flex-direction: column; gap: 22px; }
.side-box { border: 1px solid var(--line); background: #fff; padding: 18px 20px; }
.side-box h3 { margin: 0 0 12px; font-family: var(--serif); font-size: 21px; font-weight: 500; }
.side-box h3::after { content: ""; display: block; width: 28px; height: 2px; background: var(--accent); margin-top: 8px; }
.side-box ul { list-style: none; margin: 0; padding: 0; }
.side-box li a {
  display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; color: #666; font-size: 14px;
  transition: color .25s, padding-left .25s;
}
.side-box li a small { color: var(--muted); }
.side-box li a:hover, .side-box li a.on { color: var(--accent); padding-left: 6px; }
.side-box li a.on { font-weight: 600; }
.side-item { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px dashed var(--line); }
.side-item:first-of-type { border-top: 0; padding-top: 0; }
.side-item img { width: 64px; height: 84px; object-fit: cover; flex: none; transition: opacity .25s; }
.side-item:hover img { opacity: .8; }
.side-name { display: block; font-size: 13.5px; line-height: 1.35; margin-bottom: 4px; color: #444; transition: color .25s; }
.side-item:hover .side-name { color: var(--accent); }
.side-item b { font-size: 13.5px; }

/* thanh công cụ: Lọc theo · thông tin · lưới/danh sách */
.list-head { display: flex; align-items: center; gap: 14px 20px; flex-wrap: wrap; margin: 0 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.list-head .sort { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink); }
.list-head .sort select { text-transform: none; letter-spacing: 0; font-weight: 400; min-width: 190px; border-radius: 0; padding: 8px 10px; }
.list-head .info { flex: 1; min-width: 180px; }
.view-switch { display: flex; gap: 6px; }
.view-switch button {
  width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; color: #aaa;
  transition: color .25s, border-color .25s, background .25s;
}
.view-switch button:hover { color: var(--ink); border-color: var(--ink); }
.view-switch button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* dạng danh sách: ảnh trái, thông tin phải */
.grid.as-list { grid-template-columns: 1fr; gap: 22px; }
.grid.as-list .card { flex-direction: row; align-items: stretch; }
.grid.as-list .thumb { width: 32%; max-width: 300px; flex: none; align-self: flex-start; }
.grid.as-list .card-body { text-align: left; padding: 22px 26px; gap: 6px; justify-content: flex-start; }
.grid.as-list .p-name { text-align: left; min-height: 0; font-family: var(--serif); font-size: 22px; line-height: 1.3; }
.grid.as-list .p-price b { font-size: 20px; }
.grid.as-list .p-desc {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin: 6px 0 0; color: #777; font-size: 14px; line-height: 1.6;
}
.grid.as-list .action { margin-top: 14px; max-width: 260px; }
.grid.as-list .line-total { text-align: left; }
.p-desc { display: none; }

/* thẻ hiện dần lần lượt khi đổi trang / sắp xếp / kiểu hiển thị */
.grid.reveal .card { animation: cardIn .5s cubic-bezier(.25,.46,.45,.94) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }

/* phân trang */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 34px 0 10px; flex-wrap: wrap; }
.pager button {
  min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--line); background: #fff; color: #555; font-weight: 600;
  transition: all .25s;
}
.pager button:hover:not(:disabled):not(.on) { border-color: var(--ink); color: var(--ink); }
.pager button.on { background: var(--ink); border-color: var(--ink); color: #fff; cursor: default; }
.pager button:disabled { opacity: .35; cursor: default; }
.pager .gap { padding: 0 4px; color: var(--muted); }

@media (max-width: 980px) {
  .list-body { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
@media (max-width: 640px) {
  .list-head .info { order: 3; flex-basis: 100%; }
  .list-head .sort { flex: 1; }
  .list-head .sort select { min-width: 0; width: 100%; }
  .grid.as-list .thumb { width: 38%; }
  .grid.as-list .card-body { padding: 12px 14px; }
  .grid.as-list .p-name { font-size: 16px; }
  .grid.as-list .p-desc { -webkit-line-clamp: 2; font-size: 13px; }
  .grid.as-list .p-rule { display: none; }
}

/* ---------- Lưới & thẻ sản phẩm ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px 16px; }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; } }

.card { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid transparent; transition: border-color .2s; }
.card.in-cart { border-color: var(--accent); }
.thumb { position: relative; aspect-ratio: 3 / 4; background: #f3ece6; overflow: hidden; display: block; width: 100%; border: 0; padding: 0; }
.thumb-link { position: absolute; inset: 0; display: block; perspective: 500px; }
/* lớp tối 30% phủ lên ảnh */
.thumb-link::before {
  content: ""; position: absolute; inset: 0; z-index: 2; background: rgba(0,0,0,.3);
  opacity: 0; visibility: hidden; transition: all .4s cubic-bezier(.25,.46,.45,.94);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: all .7s cubic-bezier(.25,.46,.45,.94); }
/* ảnh thứ hai: lật 3D từ -90° về 0° */
.thumb img.flip {
  position: absolute; inset: 0; z-index: 1; opacity: 0; visibility: hidden;
  transform: rotateY(-90deg); transform-style: preserve-3d; transition: all .6s ease-in-out;
}
.card:hover .thumb img.flip { opacity: 1; visibility: visible; transform: rotateY(0); }
/* nút vuông trắng ở góc dưới, trượt từ phải sang */
.thumb-tools { position: absolute; left: 0; right: 0; bottom: 16px; z-index: 3; display: flex; justify-content: center; gap: 1px; pointer-events: none; }
.thumb-tools .tool { pointer-events: auto; }
.thumb-tools .tool {
  width: 44px; height: 44px; border: 0; border-radius: 0; display: grid; place-items: center; padding: 0;
  background: #fff; color: #666; transition: all .3s ease;
}
.thumb-tools .tool:hover { background: #3f3f3f; color: #fff; }
.badges { z-index: 3; }
@media (min-width: 992px) {
  .thumb-tools { opacity: 0; visibility: hidden; transform: translateX(50px); transition: all .4s cubic-bezier(.25,.46,.45,.94); }
  .card:hover .thumb-tools, .thumb-tools:focus-within { opacity: 1; visibility: visible; transform: none; }
  .card:hover .thumb-link::before { opacity: 1; visibility: visible; }
  .card:hover .thumb img:not(.flip) { transform: scale(1.1); }
}
@media (max-width: 991px) { .thumb-tools { display: none; } }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(150deg, #f8ece8, #efe3da); }
.noimg svg { width: 42%; max-width: 110px; opacity: .8; }
.badges { z-index: 1; position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.badge {
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  white-space: nowrap;
}
.badge.plain { background: rgba(255,255,255,.92); color: var(--ink); }
.badge.out { background: #6f6763; }
.badge.mine { background: var(--sage); }
.badge.sale { background: #c0392b; }

.card-body { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; text-align: center; }
.p-cat { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.p-name { font-size: 14px; line-height: 1.4; font-weight: 500; min-height: 2.8em; border: 0; background: none; padding: 0; text-align: center; }
.p-name { transition: color .2s; }
.card:hover .p-name, .p-name:hover { color: var(--accent); }
.p-code { color: var(--muted); font-size: 11.5px; }
.p-price { margin-top: 2px; }
.p-price b { color: var(--accent); font-size: 17px; font-weight: 700; }
.p-price small { color: var(--muted); font-size: 11.5px; margin-left: 3px; }
.p-price s, .pd-price s, .row-meta s { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.pd-price s { font-size: 17px; margin-left: 10px; }
.pd-save { display: inline-block; margin-left: 10px; padding: 2px 8px; border-radius: 4px; background: #fdecea; color: #c0392b; font-size: 13px; font-weight: 600; vertical-align: middle; }
.p-rule { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.p-rule b { color: var(--ink); font-weight: 600; }
.action { margin-top: auto; padding-top: 10px; }
.btn-add {
  width: 100%; border: 1px solid var(--ink); border-radius: 999px; padding: 9px; font-weight: 600; font-size: 13px;
  background: #fff; color: var(--ink); transition: background .15s, color .15s;
}
.btn-add { position: relative; overflow: hidden; isolation: isolate; }
.btn-add::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink);
  transform: translateX(-101%); transition: transform .4s cubic-bezier(.25,.46,.45,.94);
}
.btn-add:hover:not(:disabled) { color: #fff; }
.btn-add:hover:not(:disabled)::before { transform: none; }
.btn-add:disabled { border-color: var(--line); color: var(--muted); background: #f6f2ee; }

.stepper { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.stepper button { width: 40px; border: 0; background: var(--accent-soft); color: var(--accent-2); font-size: 18px; line-height: 1; }
.stepper button:hover { background: #efd9d6; }
.stepper input {
  flex: 1; min-width: 0; width: 100%; border: 0; text-align: center; font-weight: 700; padding: 8px 0;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.line-total { font-size: 11.5px; color: var(--muted); margin-top: 5px; text-align: center; }
.line-total b { color: var(--ink); }
.line-total .warn { color: var(--warn); }

/* ---------- Overlay (menu, drawer) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(30,24,22,.45); z-index: 40; }

/* ---------- Trang chi tiết sản phẩm ---------- */
#detail { padding-top: 18px; padding-bottom: 20px; }
a.p-name { display: block; }
.pd { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 44px; margin: 14px 0 10px; align-items: start; }
.pd-gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.pd-gallery.multi { grid-template-columns: minmax(0, 1fr) 88px; }
.pd-main { position: relative; aspect-ratio: 3 / 4; background: #f3ece6; border-radius: var(--radius); overflow: hidden; }
.pd-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.pd-track::-webkit-scrollbar { display: none; }
.pd-track > * { flex: 0 0 100%; height: 100%; scroll-snap-align: start; }
.pd-track img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.9); font-size: 24px; line-height: 1; color: var(--ink); box-shadow: 0 2px 10px rgba(0,0,0,.12);
  opacity: 0; transition: opacity .2s;
}
.pd-nav.prev { left: 12px; }
.pd-nav.next { right: 12px; }
.pd-main:hover .pd-nav, .pd-nav:focus-visible { opacity: 1; }
@media (hover: none) { .pd-nav { display: none; } }
.pd-count { position: absolute; right: 12px; bottom: 12px; background: rgba(43,35,32,.6); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
/* dải ảnh nhỏ: không làm cao thêm khung ảnh lớn */
.pd-thumbs { position: relative; }
.pd-thumbs-in { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; }
.pd-tlist { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; scrollbar-width: none; }
.pd-tlist::-webkit-scrollbar { display: none; }
.pd-t { flex: 0 0 auto; aspect-ratio: 3 / 4; width: 100%; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #f3ece6; opacity: .65; transition: opacity .15s, border-color .15s; }
.pd-t img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-t:hover { opacity: 1; }
.pd-t.on { border-color: var(--accent); opacity: 1; }
.pd-tnav { flex: 0 0 26px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); font-size: 16px; line-height: 1; }
.pd-tnav:hover { color: var(--accent); border-color: var(--accent); }

.pd-info { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 16px; }
.pd-info .p-cat a:hover { color: var(--accent); }
.pd-info h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3.2vw, 38px); margin: 0; line-height: 1.2; }
.pd-meta { font-size: 13px; color: var(--muted); }
.pd-meta b { color: var(--ink); }
.pd-meta a { color: var(--accent); }
.pd-meta a:hover { text-decoration: underline; }
.pd-price { font-size: 28px; font-weight: 700; color: var(--accent); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pd-price small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.pd-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pd-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.pd-table td:last-child { text-align: right; font-weight: 600; }
.pd-info .action { max-width: 340px; margin-top: 4px; padding-top: 4px; }
.pd-info .btn-add { padding: 13px; font-size: 14px; background: var(--ink); color: #fff; }
.pd-info .btn-add::before { background: var(--accent-2); }
.pd-info .btn-add:hover:not(:disabled) { border-color: var(--accent-2); }
.pd-info .stepper button { width: 48px; }
.pd-info .stepper input { padding: 11px 0; font-size: 15px; }
.pd-info .line-total { text-align: left; font-size: 12.5px; }
.pd-desc { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.pd-desc h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; margin: 0 0 8px; }
.pd-desc p { margin: 0; font-size: 14px; color: #4d4540; white-space: pre-line; }

@media (max-width: 860px) {
  .pd { grid-template-columns: 1fr; gap: 20px; }
  .pd-info { position: static; }
  .pd-info .action { max-width: none; }
  /* mobile: ảnh lớn trên, dải ảnh nhỏ nằm ngang bên dưới */
  .pd-gallery.multi { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pd-thumbs-in { position: static; flex-direction: row; }
  .pd-tlist { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .pd-t { width: 64px; }
  .pd-tnav { display: none; }
  .pd-main { margin: 0 -16px; border-radius: 0; }
}

/* ---------- Tin tức ---------- */
.news-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; padding-top: 30px; }
.news-side { top: 150px; }
.side-post img, .side-noimg { width: 72px; height: 54px; object-fit: cover; flex: none; }
.side-noimg { display: grid; place-items: center; background: #f3ece6; }
.side-noimg svg { width: 26px; }
.side-post small { color: var(--muted); font-size: 12px; }
.side-post.on .side-name { color: var(--accent); font-weight: 600; }

/* danh sách bài: ảnh trái, chữ phải */
.post-list { display: flex; flex-direction: column; gap: 30px; }
.post-card {
  display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 26px; align-items: start;
  padding-bottom: 30px; border-bottom: 1px solid var(--line);
  animation: cardIn .5s cubic-bezier(.25,.46,.45,.94) both; animation-delay: calc(var(--i, 0) * 60ms);
}
.post-img { display: block; overflow: hidden; aspect-ratio: 4 / 3; background: #f3ece6; }
.post-img img, .post-img .noimg { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s cubic-bezier(.25,.46,.45,.94); }
.post-card:hover .post-img img { transform: scale(1.06); }
.post-body h2 { margin: 0 0 8px; font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 1.3; }
.post-body h2 a { transition: color .25s; }
.post-body h2 a:hover { color: var(--accent); }
.post-meta { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.post-meta b { color: var(--ink); font-weight: 600; }
.post-sum { margin: 0 0 16px; color: #555; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post-more {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  border-bottom: 1px solid var(--ink); padding-bottom: 3px; transition: color .25s, border-color .25s, gap .25s;
}
.post-more:hover { color: var(--accent); border-color: var(--accent); gap: 12px; }

/* bài viết */
.post { max-width: 820px; }
.post-title { margin: 0 0 8px; font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3vw, 36px); line-height: 1.25; }
.post-cover { margin: 18px 0 22px; }
.post-cover img { width: 100%; max-height: 560px; object-fit: cover; display: block; }
.post-lead { font-size: 17px; line-height: 1.75; color: #444; font-style: italic; margin: 0 0 18px; }
.post-content { font-size: 16px; line-height: 1.85; color: #333; }
.post-content p { margin: 0 0 16px; }
.post-content h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 34px 0 12px; line-height: 1.3; }
.post-content h3 { font-size: 19px; margin: 26px 0 10px; }
.post-content ul, .post-content ol { margin: 0 0 18px; padding-left: 24px; }
.post-content li { margin-bottom: 6px; }
.post-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-content blockquote { margin: 0 0 18px; padding: 12px 20px; border-left: 3px solid var(--accent); background: var(--accent-soft); font-style: italic; }
.post-content hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.post-content figure { margin: 22px 0; }
.post-content figure img { width: 100%; height: auto; display: block; }
.post-content figcaption { text-align: center; font-size: 13px; color: var(--muted); margin-top: 8px; font-style: italic; }
.post-share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.post-share a, .post-share button {
  border: 1px solid var(--line); background: #fff; padding: 6px 14px; font-size: 13px; color: var(--ink); transition: all .25s;
}
.post-share a:hover, .post-share button:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; }
.post-nav a { display: block; padding: 14px 16px; border: 1px solid var(--line); background: #fff; transition: border-color .25s, color .25s; line-height: 1.4; }
.post-nav a:hover { border-color: var(--accent); color: var(--accent); }
.post-nav a.next { text-align: right; grid-column: 2; }
.post-nav small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }

@media (max-width: 980px) {
  .news-body { grid-template-columns: 1fr; }
  .news-side { position: static; display: flex; }
}
@media (max-width: 640px) {
  .post-card { grid-template-columns: 1fr; gap: 14px; }
  .post-body h2 { font-size: 20px; }
  .post-content { font-size: 15.5px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav a.next { grid-column: auto; }
}

/* ---------- Trang liên hệ ---------- */
#contact { padding-top: 18px; padding-bottom: 20px; }
.ct-map { margin-top: 14px; height: 420px; background: #eee6df; }
.ct-map iframe { width: 100%; height: 100%; border: 0; display: block; }
.ct-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 48px; margin-top: 36px; }
.ct-title { margin: 0 0 8px; font-size: 26px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.ct-social { margin: 0 0 22px; font-size: 13.5px; color: var(--muted); }
.ct-social a { transition: color .25s; }
.ct-social a:hover { color: var(--accent); }
.ct-social span { margin: 0 8px; color: var(--line); }
.ct-shop { margin: 0 0 6px; font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--accent); }
.ct-tagline { margin: 0 0 20px; color: var(--muted); }
.ct-list { list-style: none; margin: 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.ct-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.5; }
.ct-list svg { flex: none; margin-top: 2px; color: var(--accent); }
.ct-list a { transition: color .25s; }
.ct-list a:hover { color: var(--accent); }

.ct-form { display: flex; flex-direction: column; gap: 16px; }
.ct-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ct-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.ct-form input, .ct-form textarea {
  width: 100%; border: 1px solid #ddd3cb; border-radius: 0; background: #fff; padding: 11px 12px; font-size: 14px;
  transition: border-color .25s, box-shadow .25s;
}
.ct-form textarea { resize: vertical; min-height: 150px; }
.ct-form input:focus, .ct-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ct-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ct-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ct-send {
  position: relative; overflow: hidden; isolation: isolate; border: 1px solid var(--ink); background: #fff; color: var(--ink);
  padding: 12px 30px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; transition: color .3s;
}
.ct-send::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: translateX(-101%); transition: transform .4s cubic-bezier(.25,.46,.45,.94); }
.ct-send:hover:not(:disabled) { color: #fff; }
.ct-send:hover:not(:disabled)::before { transform: none; }
.ct-send:disabled { opacity: .6; cursor: wait; }
.ct-status { font-size: 13.5px; color: var(--muted); }
.ct-status.ok { color: var(--sage); font-weight: 600; }
.ct-status.err { color: #b3261e; }
@media (max-width: 860px) {
  .ct-map { height: 280px; margin-left: -16px; margin-right: -16px; }
  .ct-grid { grid-template-columns: 1fr; gap: 28px; margin-top: 24px; }
  .ct-row { grid-template-columns: 1fr; }
}

/* ---------- Máy chủ đang khởi động ---------- */
.waking { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(251,247,243,.88); backdrop-filter: blur(3px); animation: fadeIn .3s ease; }
.waking-box { background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(43,35,32,.12); padding: 26px 30px; max-width: 360px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.waking-box b { font-family: var(--serif); font-size: 20px; font-weight: 500; }
.waking-box span:last-child { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.waking-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .9s linear infinite; margin-bottom: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Footer ---------- */
.footer { background: var(--dark); color: #d9cec7; margin-top: 64px; font-size: 13.5px; }
.footer-in { display: grid; grid-template-columns: 1.2fr 1fr 1.3fr 1fr; gap: 28px; padding-top: 44px; padding-bottom: 36px; }
@media (max-width: 860px) { .footer-in { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-in { grid-template-columns: 1fr; gap: 22px; } }
.f-logo { font-family: var(--serif); font-size: 26px; color: #fff; }
.f-muted { color: #a99d96; margin: 8px 0 0; }
.footer h4 { color: #fff; margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.f-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.f-list.cols { grid-template-columns: 1fr 1fr; column-gap: 12px; }
.f-list.steps { list-style: decimal; padding-left: 18px; }
.f-list a:hover { color: #fff; text-decoration: underline; }
.f-list b { color: #fff; font-weight: 600; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); font-size: 12px; color: #a99d96; }

/* ---------- Nút nổi ---------- */
.float-contact { position: fixed; left: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 25; display: flex; flex-direction: column; gap: 10px; }
.fc { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.18); font-weight: 700; font-size: 12px; }
@media (max-width: 560px) {
  .float-contact { left: 10px; gap: 8px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .fc { width: 40px; height: 40px; font-size: 11px; }
}
.fc.zalo { background: #0068ff; }
.fc.call { background: #e53935; border: 0; cursor: pointer; }
.fc.call:hover { background: #c62828; }

/* vòng sóng lan toả quanh nút (điện thoại, Messenger) */
.pulse { position: relative; }
.pulse::before, .pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; z-index: -1;
  animation: ring 2s ease-out infinite;
}
.pulse::after { animation-delay: 1s; }
@keyframes ring { from { transform: scale(1); opacity: .55; } to { transform: scale(1.8); opacity: 0; } }
.pulse svg { animation: wiggle 2s ease-in-out infinite; }
@keyframes wiggle { 0%, 60%, 100% { transform: rotate(0); } 65%, 75%, 85% { transform: rotate(-14deg); } 70%, 80% { transform: rotate(14deg); } }

/* nút Messenger góc phải; khi đang có đơn (nút giỏ hiện) thì nhích lên trên */
.fc-msg {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 25;
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 110%, #ffb03a 0, #ff5a6e 30%, #a334fa 60%, #0695ff 100%);
  box-shadow: 0 8px 20px rgba(80,60,200,.35); transition: transform .2s, bottom .3s;
}
.fc-msg:hover { transform: scale(1.08); }
.fab:not([hidden]) + .fc-msg { bottom: calc(80px + env(safe-area-inset-bottom)); }
@media (max-width: 560px) {
  .fc-msg { width: 46px; height: 46px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .fab:not([hidden]) + .fc-msg { bottom: calc(136px + env(safe-area-inset-bottom)); }
}

/* popup liên hệ */
.call-pop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(30,24,22,.45); animation: fadeIn .2s ease; }
.call-box {
  position: relative; width: min(560px, 100%); background: #fff; border-radius: 14px; padding: 30px 32px 26px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: popIn .25s cubic-bezier(.25,.46,.45,.94);
}
@keyframes popIn { from { transform: translateY(12px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.call-x { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 18px; line-height: 1; padding: 6px; color: #333; }
.call-x:hover { color: var(--accent); }
.call-title { margin: 0; text-align: center; font-size: 24px; font-weight: 700; text-transform: uppercase; color: var(--accent-2); letter-spacing: .3px; }
.call-sub { margin: 6px 0 20px; text-align: center; color: #555; }
.call-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.call-name { font-size: 15.5px; line-height: 1.45; }
.call-name small { display: block; color: var(--muted); font-size: 13px; }
.call-hot, .call-zalo { font-weight: 700; white-space: nowrap; font-size: 15.5px; }
.call-hot { color: #e53935; }
.call-zalo { color: #0068ff; }
.call-hot:hover, .call-zalo:hover { text-decoration: underline; }
.call-foot { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.call-ico { color: var(--accent-2); flex: none; }
.call-note { flex: 1; line-height: 1.4; }
.call-note b { display: block; font-size: 15px; }
.call-note i { color: #555; font-size: 13.5px; }
.call-cta {
  flex: none; padding: 12px 26px; border-radius: 999px; background: var(--accent-2); color: #fff;
  font-weight: 700; text-transform: uppercase; letter-spacing: .4px; transition: background .2s, transform .2s;
}
.call-cta:hover { background: var(--accent); transform: translateY(-1px); }
@media (max-width: 480px) {
  .call-box { padding: 26px 18px 20px; }
  .call-title { font-size: 20px; }
  .call-row { flex-direction: column; gap: 6px; }
  .call-foot { flex-wrap: wrap; }
  .call-cta { width: 100%; text-align: center; }
}
.fab {
  position: fixed; right: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 25;
  border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600;
  padding: 13px 20px; box-shadow: 0 8px 22px rgba(164,80,94,.38);
}
.fab:hover { background: var(--accent-2); }

/* ---------- Drawer ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: #fff; z-index: 50;
  display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(0,0,0,.15);
  animation: slide .2s ease-out;
}
@keyframes slide { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer, .menu { animation: none; } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 21px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); }

.row { display: grid; grid-template-columns: 60px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row img, .row .noimg { width: 60px; height: 78px; object-fit: cover; border-radius: 8px; }
.row-name { font-size: 13.5px; font-weight: 500; }
.row-meta { font-size: 12px; color: var(--muted); }
.row-ctl { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.row-ctl .stepper { width: 130px; }
.row-ctl .stepper button { width: 34px; }
.row-ctl .stepper input { padding: 5px 0; }
.row-total { margin-left: auto; font-weight: 700; }
.link-btn { border: 0; background: none; color: var(--accent); font-size: 12px; padding: 2px 0; }

.summary { background: var(--bg); border-radius: var(--radius); padding: 12px 14px; margin: 14px 0; font-size: 13px; }
.summary div { display: flex; justify-content: space-between; }
.summary .grand { font-size: 16px; font-weight: 700; margin-top: 4px; }
.summary .grand span:last-child { color: var(--accent); }

.form label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.form input, .form textarea {
  display: block; width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  color: var(--ink); background: #fff;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form textarea { min-height: 64px; resize: vertical; }
.form-actions { display: flex; gap: 8px; margin-top: 12px; }
.form-actions .btn { flex: 1; }
.pay { margin-top: 12px; font-size: 13px; }
.form .pay-opt { display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; padding: 10px 12px; border: 1.5px solid var(--accent); border-radius: var(--radius); background: var(--bg); cursor: default; }
.form .pay-opt input { width: auto; flex: none; margin: 3px 0 0; padding: 0; accent-color: var(--accent); }
.pay-opt small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
.editing-note { background: #fff7e6; border: 1px solid #f3dcaa; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin-bottom: 8px; }

.order { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-head b { font-size: 14px; }
.order-items { font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.order-foot { display: flex; align-items: center; gap: 8px; }
.order-foot .sum { margin-right: auto; font-weight: 700; }
.st { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eee; }
.st.PENDING { background: #fff3cd; color: #8a6100; }
.st.CONFIRMED { background: #e3f0ff; color: #0d4f9c; }
.st.SHIPPING { background: #ede7fb; color: #5b3aa8; }
.st.COMPLETED { background: var(--sage-soft); color: var(--sage); }
.st.CANCELLED { background: #f3f3f3; color: #888; }

.done { text-align: center; padding: 24px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.done .big { font-size: 40px; }
.done h3 { margin: 4px 0; font-family: var(--serif); font-weight: 500; font-size: 22px; }
.done p { margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--dark); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; opacity: 0;
  pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
