/* =====================================================================
   Design tokens
   Sương sớm  #EEF0EB  nền chính (mist)
   Bazan      #261C17  chữ, nền tối (roast)
   Đất đỏ     #9E3B1F  nút, điểm nhấn (basalt soil)
   Lá cà phê  #2E4A3B  màu phụ (leaf)
   Hoa cà phê #FBFBF8  bề mặt thẻ (blossom)
   ===================================================================== */
:root {
  --mist: #EEF0EB;
  --mist-deep: #E1E5DD;
  --roast: #261C17;
  --roast-soft: #3A2D26;
  --soil: #9E3B1F;
  --soil-deep: #843018;
  --leaf: #2E4A3B;
  --leaf-soft: #4F6B5B;
  --blossom: #FBFBF8;
  --ink-muted: #5E5751;
  --line: #CDD2C8;
  --line-dark: rgba(251, 251, 248, .16);
  --gold: #C8A462;       /* vàng logo, dùng trên nền tối */
  --gold-deep: #A8833E;  /* vàng logo, dùng trên nền sáng */
  --font-script: "Cormorant Garamond", Georgia, serif;

  --font-display: "Prata", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Thang chữ cổ điển: 14 · 16 · 18 · 21 · 24 · 36 · 48 · 60 · 72 */
  --fs-sm: .875rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.3125rem;
  --fs-lg: 1.5rem;
  --fs-xl: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  --fs-hero: clamp(2.3rem, 1.2rem + 3.4vw, 3.75rem);

  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: clamp(4.5rem, 3rem + 6vw, 8.5rem);

  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --header-h: 76px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--roast);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }

:focus-visible { outline: 2px solid var(--soil); outline-offset: 3px; border-radius: 4px; }

.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--roast); color: var(--blossom); padding: 10px 16px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 640px) { .container { padding-inline: 32px; } }
@media (min-width: 1024px) { .container { padding-inline: 48px; } }

.section { padding-block: var(--space-6); }
.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  line-height: 1.15;
  letter-spacing: -.015em;
  font-weight: 400;
  text-wrap: balance;
}
.section-lead { margin-top: var(--space-2); color: var(--ink-muted); max-width: 46ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 50px; padding: 0 1.6rem;
  border-radius: var(--radius-pill); border: 1px solid transparent;
  font-size: .975rem; font-weight: 500; text-decoration: none; letter-spacing: .005em;
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out), border-color .2s var(--ease-out), transform .2s var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn .icon { width: 20px; height: 20px; }
.btn-primary { background: var(--soil); color: var(--blossom); }
.btn-primary:hover { background: var(--soil-deep); }
.btn-ghost { color: var(--roast); border-color: var(--line); background: transparent; }
.btn-ghost:hover { border-color: var(--roast); }
.btn-light { background: var(--blossom); color: var(--leaf); }
.btn-light:hover { background: var(--mist); }
.btn-outline-light { color: var(--blossom); border-color: rgba(251,251,248,.4); }
.btn-outline-light:hover { border-color: var(--blossom); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; border: 0; background: transparent;
  transition: background-color .2s var(--ease-out);
}
.icon-btn:hover { background: var(--mist-deep); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 40; height: var(--header-h);
  transition: background-color .3s var(--ease-out), box-shadow .3s var(--ease-out), transform .35s var(--ease-out);
}
.site-header.is-scrolled { background: rgba(238, 240, 235, .88); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 1px 0 var(--line); }
.site-header.is-hidden { transform: translateY(-100%); }
.header-inner { height: 100%; display: flex; align-items: center; gap: var(--space-3); }

.logo { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; margin-right: auto; }
.logo-mark { width: 34px; height: 41px; flex: none; fill: var(--gold-deep); }
.logo-text { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.logo-name { font-family: var(--font-display); font-size: 1.45rem; white-space: nowrap; font-weight: 400; letter-spacing: .32em; margin-right: -.32em; }
.logo-sub { font-size: .6rem; font-weight: 600; letter-spacing: .26em; margin-right: -.26em; text-transform: uppercase; color: var(--gold-deep); margin-top: 5px; white-space: nowrap; }
.slogan.logo-slogan { margin-top: 3px; gap: .45rem; font-size: .92rem; line-height: 1; color: var(--roast-soft); white-space: nowrap; }
.slogan.logo-slogan::before, .slogan.logo-slogan::after { width: .9rem; background: var(--gold-deep); }
@media (max-width: 420px) { .logo-name { font-size: 1.25rem; } .logo-sub { font-size: .55rem; } .slogan.logo-slogan { font-size: .82rem; } .logo { gap: .5rem; } .logo-mark { width: 28px; height: 34px; } }

.main-nav { display: none; gap: 2rem; }
.main-nav a { text-decoration: none; font-size: .95rem; padding-block: .5rem; position: relative; }
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .2rem; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease-out);
}
.main-nav a:hover::after, .main-nav a.is-current::after { transform: scaleX(1); transform-origin: left; }

.header-actions { display: flex; align-items: center; gap: .25rem; }
.lang-toggle, .cart-toggle, .menu-toggle {
  position: relative; display: inline-flex; align-items: center; gap: .35rem;
  min-width: 44px; height: 44px; padding: 0 .6rem; justify-content: center;
  border: 0; background: transparent; border-radius: var(--radius-pill);
  transition: background-color .2s var(--ease-out);
}
.lang-toggle:hover, .cart-toggle:hover, .menu-toggle:hover { background: var(--mist-deep); }
.lang-code { font-size: .82rem; font-weight: 600; letter-spacing: .02em; }
.cart-count {
  position: absolute; top: 3px; right: 1px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: var(--radius-pill); background: var(--soil); color: var(--blossom);
  font-size: .7rem; font-weight: 600; line-height: 19px; text-align: center;
  transform: scale(0); transition: transform .3s var(--ease-out);
}
.cart-count.has-items { transform: scale(1); }
.cart-count.bump { animation: bump .45s var(--ease-out); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

@media (max-width: 899px) {
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto; display: flex; flex-direction: column; gap: 0;
    background: var(--mist); padding: .5rem 16px 1.5rem; box-shadow: 0 1px 0 var(--line), 0 24px 40px -24px rgba(38,28,23,.25);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .25s var(--ease-out), transform .25s var(--ease-out), visibility 0s .25s;
  }
  .main-nav.is-open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
  .main-nav a { font-family: var(--font-display); font-size: 1.6rem; padding-block: .7rem; border-bottom: 1px solid var(--line); }
  .main-nav a::after { display: none; }
  .site-header:has(.main-nav.is-open) { background: var(--mist); }
}
@media (min-width: 900px) {
  .main-nav { display: flex; }
  .menu-toggle { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: calc(var(--header-h) + clamp(1.5rem, 4vw, 3.5rem)); padding-bottom: var(--space-5); overflow: hidden; isolation: isolate; }
.contours { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero .contours {
  -webkit-mask-image: radial-gradient(ellipse 42% 46% at 26% 52%, transparent 35%, #000 85%);
  mask-image: radial-gradient(ellipse 42% 46% at 26% 52%, transparent 35%, #000 85%);
}
@media (max-width: 899px) {
  .hero .contours {
    -webkit-mask-image: radial-gradient(ellipse 90% 34% at 40% 32%, transparent 45%, #000 100%);
    mask-image: radial-gradient(ellipse 90% 34% at 40% 32%, transparent 45%, #000 100%);
  }
}
.contours path { fill: none; stroke: var(--leaf); stroke-width: 1; opacity: .22; vector-effect: non-scaling-stroke; }
.contours path.major { opacity: .38; stroke-width: 1.2; }

.hero-grid { display: grid; gap: var(--space-4); align-items: end; }
.hero-altitude { display: inline-flex; align-items: center; gap: .5rem; font-size: var(--fs-sm); color: var(--leaf); margin-bottom: var(--space-3); }
.hero-altitude .icon { width: 18px; height: 18px; }
.hero-title {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  line-height: 1.12;
  letter-spacing: -.02em;
  font-weight: 400;
  max-width: 18ch;
  text-wrap: balance;
}
/* Khung cắt có lề để không cắt mất dấu tiếng Việt (móc ư/ơ, dấu mũ, dấu nặng) */
.hero-title .word { display: inline-block; overflow: hidden; vertical-align: top; padding: .14em .12em .1em 0; margin: -.14em -.12em -.1em 0; }
.hero-title .word > span { display: inline-block; }
.hero-lead { margin-top: var(--space-3); font-size: var(--fs-md); line-height: 1.55; color: var(--roast-soft); max-width: 36ch; font-weight: 400; }
.hero-ctas { margin-top: var(--space-4); display: flex; flex-wrap: wrap; gap: .75rem; }

.hero-media { position: relative; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 4 / 5; background: var(--roast); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 900px) {
  .hero { min-height: min(100svh, 980px); display: flex; align-items: center; padding-bottom: var(--space-5); }
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
  .hero-media { aspect-ratio: 3 / 4; max-height: 76svh; }
}

/* Hero load sequence: the one orchestrated moment */
.js .hero-title:not(.is-split) { visibility: hidden; }
.js .hero-title .word > span { transform: translateY(140%); }
.js .hero-altitude, .js .hero-lead, .js .hero-ctas { opacity: 0; transform: translateY(14px); }
.js .hero-media { clip-path: inset(100% 0 0 0 round var(--radius-md)); }
.js .hero-media img { transform: scale(1.12); }
.is-loaded .hero-title .word > span { transform: none; transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i) * 70ms + 250ms); }
.is-loaded .hero-altitude { opacity: 1; transform: none; transition: opacity .8s var(--ease-out) .1s, transform .8s var(--ease-out) .1s; }
.is-loaded .hero-lead { opacity: 1; transform: none; transition: opacity .9s var(--ease-out) .85s, transform .9s var(--ease-out) .85s; }
.is-loaded .hero-ctas { opacity: 1; transform: none; transition: opacity .9s var(--ease-out) 1s, transform .9s var(--ease-out) 1s; }
.is-loaded .hero-media { clip-path: inset(0 0 0 0 round var(--radius-md)); transition: clip-path 1.4s var(--ease-in-out) .2s; }
.is-loaded .hero-media img { transform: scale(1); transition: transform 2.2s var(--ease-out) .2s; }
.contours path.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.is-loaded .contours path.draw { stroke-dashoffset: 0; transition: stroke-dashoffset 2.6s var(--ease-out); transition-delay: calc(var(--i) * 90ms); }

/* ---------- Story ---------- */
.story-grid { display: grid; gap: var(--space-4); align-items: center; }
.story-media { border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 4 / 5; }
.story-media img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.story-body { margin-top: var(--space-3); color: var(--roast-soft); max-width: 52ch; }
.values { margin-top: var(--space-4); display: grid; gap: var(--space-3); border-top: 1px solid var(--line); padding-top: var(--space-3); }
.values li { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.value-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--blossom); color: var(--soil); box-shadow: inset 0 0 0 1px var(--line); }
.values h3 { font-family: var(--font-display); font-size: var(--fs-md); line-height: 1.3; font-weight: 400; }
.values p { color: var(--ink-muted); font-size: .95rem; margin-top: .15rem; }

@media (min-width: 900px) {
  .story-grid { grid-template-columns: 5fr 6fr; gap: clamp(3rem, 7vw, 7rem); }
  .story-media { aspect-ratio: 4 / 5; }
  .values { grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
  .values li { grid-template-columns: 1fr; gap: .8rem; }
}

/* ---------- Shop ---------- */
.shop { background: var(--blossom); }
.shop-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  min-height: 44px; padding: 0 1.1rem; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: transparent; font-size: .92rem;
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out), border-color .2s var(--ease-out);
}
.chip:hover { border-color: var(--roast); }
.chip.is-active { background: var(--roast); border-color: var(--roast); color: var(--blossom); }

/* Lưới sản phẩm: 2 cột (điện thoại), 3 cột (laptop), 4 cột (màn hình lớn) */
.product-grid { display: grid; gap: var(--space-4) 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4) var(--space-3); } }
@media (min-width: 1200px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.shop-empty { padding: var(--space-4) 0; color: var(--ink-muted); }

.product { position: relative; display: flex; flex-direction: column; }
.product.is-hidden { display: none; }
.product-visual {
  position: relative; aspect-ratio: 4 / 4.4; border-radius: var(--radius-md); overflow: hidden;
  background: var(--mist); display: grid; place-items: center;
  transition: background-color .4s var(--ease-out);
}
.product-visual::before {
  content: ""; position: absolute; width: 74%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--tint, #fff) 0%, transparent 70%); opacity: .3;
}
.product-visual svg.bag { position: relative; width: 56%; height: auto; filter: drop-shadow(0 18px 18px rgba(38,28,23,.22)); transition: transform .6s var(--ease-out); }
.product-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.product:hover .product-visual { background: var(--mist-deep); }
.product:hover .product-visual svg.bag { transform: translateY(-6px) rotate(-1.5deg); }
.product:hover .product-visual img { transform: scale(1.04); }
.product.is-soldout .product-visual { filter: grayscale(.6); opacity: .75; }
.product-badge {
  position: absolute; top: 12px; left: 12px; z-index: 1; padding: .28rem .7rem;
  border-radius: var(--radius-pill); background: var(--blossom); color: var(--leaf);
  font-size: .76rem; font-weight: 600;
}
.product-body { padding-top: 1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.product-name { font-family: var(--font-display); font-size: 1.32rem; line-height: 1.2; font-weight: 400; letter-spacing: -.01em; }
/* Nút tên sản phẩm phủ toàn thẻ: bấm vào bất kỳ đâu trên thẻ đều mở chi tiết */
.product-open { all: unset; cursor: pointer; text-wrap: balance; }
.product-open::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: var(--radius-md); }
.product-open:focus-visible::after { outline: 2px solid var(--soil); outline-offset: 4px; }
.product-notes-line { color: var(--ink-muted); font-size: .9rem; line-height: 1.45; }
.product-meta { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-top: .2rem; }
.product-price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 1rem; }
.product-price small { font-weight: 400; font-size: .8rem; color: var(--ink-muted); margin-right: .15rem; }
.btn-choose {
  margin-top: auto; min-height: 44px; font-size: .92rem; border: 1px solid var(--line); color: var(--roast);
  transition: background-color .25s var(--ease-out), color .25s var(--ease-out), border-color .25s var(--ease-out);
}
.product:hover .btn-choose { background: var(--soil); border-color: var(--soil); color: var(--blossom); }
.product-body > .btn-choose { margin-top: .75rem; }
@keyframes tick { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tick { animation: tick .35s var(--ease-out); display: inline-block; }

.product-notes { display: flex; flex-wrap: wrap; gap: .4rem; }
.product-notes li { font-size: .85rem; padding: .3rem .75rem; border-radius: var(--radius-pill); background: var(--mist); color: var(--roast-soft); }
.roast-dots { display: inline-flex; gap: 3px; }
.roast-dots i { width: 8px; height: 12px; border-radius: 50%; background: var(--line); transform: rotate(-25deg); }
.roast-dots i.on { background: var(--roast-soft); }

@media (max-width: 599px) {
  .product-visual { aspect-ratio: 1 / 1.1; }
  .product-badge { top: 8px; left: 8px; font-size: .7rem; padding: .22rem .55rem; }
  .product-name { font-size: 1.1rem; }
  .product-notes-line { font-size: .82rem; }
  .product-meta { flex-direction: column; align-items: flex-start; gap: .35rem; }
  .product-price { font-size: .95rem; }
  .btn-choose { min-height: 40px; font-size: .85rem; padding: 0 1rem; }
}

/* Lựa chọn trong khung chi tiết */
.option-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.opt-label { display: block; font-family: var(--font-body); font-size: .85rem; font-weight: 600; color: var(--roast-soft); margin: 0 0 .5rem; padding: 0; }
.segmented { display: flex; flex-wrap: wrap; gap: .5rem; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span {
  display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 52px; padding: .35rem 1.05rem;
  border-radius: var(--radius-sm); border: 1px solid var(--line); font-size: .95rem; font-weight: 600; cursor: pointer; line-height: 1.25;
  transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out), color .2s var(--ease-out);
}
.segmented span small { font-weight: 400; font-size: .78rem; color: var(--ink-muted); transition: color .2s var(--ease-out); }
.segmented label:hover span { border-color: var(--roast); }
.segmented input:checked + span { background: var(--roast); color: var(--blossom); border-color: var(--roast); }
.segmented input:checked + span small { color: rgba(251,251,248,.75); }
.segmented input:focus-visible + span { outline: 2px solid var(--soil); outline-offset: 2px; }
.select-wrap { position: relative; }
.select-wrap select {
  width: 100%; min-height: 46px; padding: 0 2.5rem 0 1rem; appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; font-size: .95rem; cursor: pointer;
}
.select-wrap::after { content: ""; position: absolute; right: 1rem; top: 50%; width: 8px; height: 8px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: translateY(-70%) rotate(45deg); pointer-events: none; }

/* Khung chi tiết sản phẩm: panel bên phải (máy tính), trượt từ dưới lên (điện thoại) */
.sheet {
  position: fixed; z-index: 70; display: flex; flex-direction: column; background: var(--blossom);
  top: 0; right: 0; bottom: 0; width: min(100%, 520px);
  transform: translateX(100%); transition: transform .45s var(--ease-out);
  box-shadow: -30px 0 60px -30px rgba(38,28,23,.35);
}
.sheet.is-open { transform: none; }
.sheet-close { position: absolute; top: 12px; right: 12px; z-index: 3; background: rgba(251,251,248,.9); }
.sheet-close:hover { background: var(--blossom); }
.sheet-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.sheet-visual {
  position: relative; display: grid; place-items: center; background: var(--mist);
  height: clamp(220px, 38vh, 340px); overflow: hidden;
}
.sheet-visual::before { content: ""; position: absolute; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, var(--tint, #fff) 0%, transparent 70%); opacity: .35; }
.sheet-visual svg.bag { position: relative; height: 80%; width: auto; filter: drop-shadow(0 22px 22px rgba(38,28,23,.24)); }
.sheet-visual img { width: 100%; height: 100%; object-fit: cover; }
.sheet-visual .product-badge { top: 16px; left: 16px; }
.sheet-info { padding: 1.5rem 1.5rem 2rem; display: grid; gap: 1.25rem; }
.sheet-title { font-family: var(--font-display); font-size: clamp(1.7rem, 1.4rem + 1vw, 2.1rem); line-height: 1.15; font-weight: 400; letter-spacing: -.01em; }
.sheet-facts { margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 2rem; }
.sheet-facts dt { font-size: .78rem; color: var(--ink-muted); }
.sheet-facts dd { margin: .15rem 0 0; font-weight: 600; font-size: .95rem; }
.sheet-desc { color: var(--roast-soft); line-height: 1.65; }
.sheet-block { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.sheet-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: end; }
.qty.qty-lg { margin-top: 0; }
.qty.qty-lg button { width: 44px; height: 44px; }
.qty.qty-lg output { min-width: 2rem; font-weight: 600; }
.sheet-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--blossom);
}
.sheet-total { display: grid; line-height: 1.2; }
.sheet-total span { font-size: .8rem; color: var(--ink-muted); }
.sheet-total strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; font-weight: 700; }
.sheet-foot .btn { flex: 1; max-width: 260px; }

@media (max-width: 699px) {
  .sheet {
    top: auto; left: 0; width: 100%; max-height: 92svh; border-radius: 20px 20px 0 0;
    transform: translateY(100%); box-shadow: 0 -20px 50px -20px rgba(38,28,23,.4);
  }
  .sheet::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: rgba(38,28,23,.18); z-index: 3; }
  .sheet-visual { height: clamp(180px, 28svh, 240px); border-radius: 20px 20px 0 0; }
  .sheet-info { padding: 1.25rem 16px 1.5rem; }
  .sheet-foot { padding-inline: 16px; }
  .sheet-row { grid-template-columns: 1fr; }
}

/* Flying bean on add-to-cart */
.fly-bean { position: fixed; z-index: 90; width: 22px; height: 22px; pointer-events: none; color: var(--soil); }
.fly-bean svg { width: 100%; height: 100%; fill: currentColor; stroke: var(--blossom); stroke-width: 1.2; }

/* ---------- Process (dark) ---------- */
.process { background: var(--roast); color: var(--blossom); }
.process .section-title { color: var(--blossom); }
.process-grid { display: grid; gap: var(--space-4); }
.process-index { display: none; }
.process-steps { display: grid; gap: var(--space-5); counter-reset: none; }
.step { display: grid; gap: var(--space-3); }
.step figure { border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 3 / 2; background: var(--roast-soft); }
.step img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); filter: saturate(.7) brightness(.8); transition: transform 1.4s var(--ease-out), filter 1s var(--ease-out); }
.step.is-active img { transform: scale(1); filter: none; }
.step-num { font-family: var(--font-body); font-weight: 600; letter-spacing: .04em; font-size: var(--fs-sm); color: #D98A64; }
.step h3 { font-family: var(--font-display); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); line-height: 1.15; margin-top: .35rem; font-weight: 400; }
.step p { margin-top: .75rem; color: rgba(251,251,248,.74); max-width: 48ch; }

@media (min-width: 900px) {
  .process-grid { grid-template-columns: 4fr 7fr; gap: clamp(3rem, 7vw, 7rem); align-items: start; }
  .process-aside { position: sticky; top: calc(var(--header-h) + 3rem); }
  .process-index { display: grid; gap: .25rem; margin-top: var(--space-4); }
  .process-index li { display: flex; gap: 1rem; align-items: baseline; padding: .7rem 0; border-top: 1px solid var(--line-dark); color: rgba(251,251,248,.45); transition: color .4s var(--ease-out); }
  .process-index li span:first-child { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-sm); }
  .process-index li.is-active { color: var(--blossom); }
  .process-index li.is-active span:first-child { color: #D98A64; }
  .process-steps { gap: clamp(5rem, 10vw, 9rem); }
}

/* ---------- Brew ---------- */
.brew-grid { display: grid; gap: var(--space-4); }
.brew-tabs { position: relative; display: flex; gap: .25rem; margin-top: var(--space-4); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.brew-tabs::-webkit-scrollbar { display: none; }
.brew-tabs [role="tab"] {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 52px; padding: 0 1rem;
  border: 0; background: transparent; color: var(--ink-muted); font-size: .98rem; white-space: nowrap;
  transition: color .2s var(--ease-out);
}
.brew-tabs [role="tab"][aria-selected="true"] { color: var(--roast); }
.brew-tabs [role="tab"]:hover { color: var(--roast); }
.brew-tab-indicator { position: absolute; bottom: -1px; left: 0; height: 2px; width: 0; background: var(--soil); transition: transform .4s var(--ease-out), width .4s var(--ease-out); }

.brew-panel { background: var(--blossom); border-radius: var(--radius-md); padding: clamp(1.5rem, 4vw, 2.75rem); box-shadow: inset 0 0 0 1px var(--line); }
.brew-specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 0 0 var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid var(--line); }
.brew-specs dt { font-size: .8rem; color: var(--ink-muted); }
.brew-specs dd { margin: .2rem 0 0; font-family: var(--font-body); font-weight: 600; font-size: clamp(1rem, .85rem + .5vw, 1.25rem); white-space: nowrap; }
.brew-steps { counter-reset: brew; display: grid; gap: 1.1rem; }
.brew-steps li { counter-increment: brew; display: grid; grid-template-columns: 2.25rem 1fr; gap: .75rem; color: var(--roast-soft); }
.brew-steps li::before { content: counter(brew); display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1px solid var(--line); font-size: .85rem; color: var(--soil); font-weight: 600; }
.brew-panel.swap .brew-specs dd, .brew-panel.swap .brew-steps li { animation: tick .45s var(--ease-out) both; }
.brew-panel.swap .brew-steps li:nth-child(2) { animation-delay: .05s; }
.brew-panel.swap .brew-steps li:nth-child(3) { animation-delay: .1s; }

@media (min-width: 900px) {
  .brew-grid { grid-template-columns: 5fr 7fr; gap: clamp(3rem, 7vw, 7rem); align-items: start; }
}

/* ---------- Quote band ---------- */
.quote-band { position: relative; min-height: clamp(420px, 70vh, 680px); display: flex; align-items: flex-end; color: var(--blossom); overflow: hidden; isolation: isolate; }
.quote-band > img { position: absolute; inset: -8% 0; width: 100%; height: 116%; object-fit: cover; z-index: -2; will-change: transform; }
.quote-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background:
    linear-gradient(90deg, rgba(38,28,23,.72) 0%, rgba(38,28,23,.35) 45%, rgba(38,28,23,0) 70%),
    linear-gradient(180deg, rgba(38,28,23,0) 35%, rgba(38,28,23,.7) 100%); }
.quote-band blockquote { margin: 0; padding-block: var(--space-5); max-width: 30ch; }
.quote-band p { font-family: var(--font-display); font-size: clamp(1.75rem, 1.2rem + 2.2vw, 3rem); line-height: 1.15; letter-spacing: -.015em; font-weight: 400; text-wrap: balance; }
.quote-band footer { margin-top: var(--space-2); font-size: .95rem; opacity: .8; }

/* ---------- Reviews ---------- */
.review-list { margin-top: var(--space-4); display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.review { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--roast); }
.review p { font-family: var(--font-display); font-size: var(--fs-md); line-height: 1.45; font-weight: 400; }
.review footer { margin-top: auto; font-size: .9rem; color: var(--ink-muted); }
.review footer strong { color: var(--roast); font-weight: 600; }

/* ---------- Visit (leaf) ---------- */
.visit { position: relative; background: var(--leaf); color: var(--blossom); overflow: hidden; isolation: isolate; }
.visit .section-title { color: var(--blossom); }
.visit .section-lead { color: rgba(251,251,248,.78); }
.visit-grid { display: grid; gap: var(--space-4); }
.visit-ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: var(--space-4); }
.visit-info { margin: 0; display: grid; gap: var(--space-3); align-content: start; }
.visit-info > div { padding-top: var(--space-2); border-top: 1px solid rgba(251,251,248,.22); }
.visit-info dt { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: rgba(251,251,248,.7); }
.visit-info dt .icon { width: 18px; height: 18px; }
.visit-info dd { margin: .35rem 0 0; font-family: var(--font-body); font-weight: 600; font-size: var(--fs-md); line-height: 1.35; }
.visit-info a { text-decoration: none; border-bottom: 1px solid rgba(251,251,248,.35); }
.visit-info a:hover { border-color: var(--blossom); }
.branches { display: grid; gap: 1.1rem; }
.branches li { display: grid; gap: .15rem; }
.branch-label { font-family: var(--font-body); font-size: .85rem; font-weight: 600; color: #E9B89E; }
.branch-address { display: block; }
.visit-info a.branch-map { justify-self: start; font-family: var(--font-body); font-size: .85rem; margin-top: .2rem; color: rgba(251,251,248,.8); }
.contours-footer path { stroke: var(--blossom); opacity: .09; }
.contours-footer path.major { opacity: .14; }
@media (min-width: 900px) {
  .visit-grid { grid-template-columns: 6fr 5fr; gap: clamp(3rem, 7vw, 7rem); }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--roast); color: rgba(251,251,248,.7); padding-block: var(--space-4); font-size: .9rem; }
.footer-inner { display: grid; gap: var(--space-3); align-items: center; }
.footer-brand { display: flex; flex-direction: column; align-items: center; justify-self: start; color: var(--gold); text-align: center; }
.footer-mark { width: 40px; height: 48px; fill: var(--gold); margin-bottom: .9rem; }
.footer-name { font-family: var(--font-display); font-size: 2.4rem; line-height: 1; letter-spacing: .38em; margin-right: -.38em; }
.footer-sub { margin-top: .6rem; font-size: .72rem; font-weight: 600; letter-spacing: .3em; margin-right: -.3em; text-transform: uppercase; }
.slogan { display: flex; align-items: center; gap: .8rem; margin-top: .55rem; font-family: var(--font-script); font-style: italic; font-size: 1.2rem; color: var(--gold); }
.slogan::before, .slogan::after { content: ""; width: 1.6rem; height: 1px; background: currentColor; opacity: .6; }
.footer-site { color: var(--blossom); text-decoration: none; border-bottom: 1px solid var(--line-dark); }
.footer-site:hover { border-color: var(--gold); color: var(--gold); }
.socials { display: flex; gap: .25rem; }
.socials a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--blossom); transition: background-color .2s var(--ease-out); }
.socials a:hover { background: rgba(251,251,248,.1); }
.footer-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
@media (min-width: 900px) {
  .footer-inner { grid-template-columns: 1fr auto; }
  .footer-meta { grid-column: 1 / -1; padding-top: var(--space-3); border-top: 1px solid var(--line-dark); }
}

/* ---------- Cart drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(38,28,23,.42); opacity: 0; transition: opacity .3s var(--ease-out); }
.drawer-backdrop.is-open { opacity: 1; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(100%, 440px);
  display: flex; flex-direction: column; background: var(--blossom);
  transform: translateX(100%); transition: transform .4s var(--ease-out);
  box-shadow: -30px 0 60px -30px rgba(38,28,23,.35);
}
.cart-drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1rem 1rem 1.5rem; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-family: var(--font-display); font-size: var(--fs-lg); }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; overscroll-behavior: contain; }
.drawer-foot { padding: 1rem 1.5rem 1.5rem; border-top: 1px solid var(--line); display: grid; gap: .6rem; background: var(--blossom); }
.cart-empty { text-align: center; display: grid; justify-items: center; gap: 1.25rem; padding-block: 3rem; color: var(--ink-muted); }
.cart-empty-art { width: 96px; height: 96px; }
.cart-empty-art ellipse { fill: var(--mist-deep); }
.cart-empty-art path { fill: none; stroke: var(--line); stroke-width: 3; stroke-linecap: round; }
.cart-items { display: grid; gap: 1rem; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: .9rem; align-items: start; padding-bottom: 1rem; border-bottom: 1px solid var(--line); animation: tick .35s var(--ease-out); }
.cart-thumb { width: 64px; height: 72px; border-radius: var(--radius-sm); background: var(--mist); display: grid; place-items: center; overflow: hidden; }
.cart-thumb svg { width: 70%; height: auto; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item h3 { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.25; font-weight: 400; }
.cart-item .meta { font-size: .82rem; color: var(--ink-muted); }
.qty { display: inline-flex; align-items: center; margin-top: .5rem; border: 1px solid var(--line); border-radius: var(--radius-pill); }
.qty button { width: 36px; height: 36px; border: 0; background: transparent; display: grid; place-items: center; border-radius: 50%; }
.qty button:hover { background: var(--mist); }
.qty .icon { width: 16px; height: 16px; }
.qty output { min-width: 1.75rem; text-align: center; font-variant-numeric: tabular-nums; font-size: .92rem; }
.cart-item-side { text-align: right; display: grid; justify-items: end; gap: .3rem; }
.cart-item-side strong { font-variant-numeric: tabular-nums; font-size: .95rem; }
.remove-btn { border: 0; background: transparent; color: var(--ink-muted); font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; min-height: 32px; padding: 0 .25rem; }
.remove-btn:hover { color: var(--soil); }

.cart-form { margin-top: 1.75rem; display: grid; gap: .9rem; }
.cart-form h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 400; }
.field { display: grid; gap: .3rem; }
.field label { font-size: .85rem; color: var(--roast-soft); font-weight: 500; }
.field input, .field textarea {
  width: 100%; min-height: 46px; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; font-size: 1rem; transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(46,74,59,.15); }
.field input[aria-invalid="true"] { border-color: var(--soil); }
.form-error { color: var(--soil); font-size: .88rem; min-height: 0; }
.form-error:empty { display: none; }
.order-fallback { width: 100%; font-size: .85rem; padding: .7rem; border-radius: var(--radius-sm); border: 1px dashed var(--line); background: var(--mist); }
.subtotal { display: flex; justify-content: space-between; align-items: baseline; font-size: 1rem; }
.subtotal strong { font-family: var(--font-body); font-weight: 700; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.ship-note { font-size: .85rem; color: var(--leaf); display: flex; align-items: center; gap: .4rem; }
.ship-note:empty { display: none; }
.ship-note .icon { width: 18px; height: 18px; }
.help { font-size: .8rem; color: var(--ink-muted); line-height: 1.5; }
.drawer-foot.is-empty { display: none; }
.cart-form.is-empty { display: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 95; max-width: calc(100% - 32px);
  padding: .85rem 1.25rem; border-radius: var(--radius-pill); background: var(--roast); color: var(--blossom);
  font-size: .92rem; box-shadow: 0 12px 30px -10px rgba(38,28,23,.5);
  transform: translate(-50%, 140%); opacity: 0; transition: transform .4s var(--ease-out), opacity .4s var(--ease-out);
  pointer-events: none;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .hero-title .word > span, .js .hero-altitude, .js .hero-lead, .js .hero-ctas { transform: none; opacity: 1; }
  .js .hero-media { clip-path: none; }
  .js .hero-media img, .step img { transform: none; }
  .contours path.draw { stroke-dashoffset: 0; }
}

/* Chữ số trong tên sản phẩm dùng font nội dung (số 1 của Prata dễ nhầm với chữ l) */
.num { font-family: var(--font-body); font-weight: 500; font-size: .9em; letter-spacing: 0; }

/* Điện thoại: nút lọc nằm trên một hàng, vuốt ngang khi nhiều nhóm */
@media (max-width: 599px) {
  .shop-head { margin-bottom: var(--space-3); }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}

/* Tiêu đề nhóm khối lượng: không để đường viền chạy ngang qua chữ */
fieldset.sheet-block > legend { float: left; width: 100%; }
fieldset.sheet-block > legend + * { clear: both; }
