/* ==========================================================================
   Suong Mai Coffee Roasters — site-theme.css (FOUNDATION)
   Design system dung chung cho toan site: token, type, header/footer,
   preloader, grain, progress, toast, drawer, modal, badge, timeline,
   skeleton, buttons, forms, cards + responsive + reduced-motion.

   NGUYEN TAC QUAN TRONG:
   - Noi dung HIEN THI BINH THUONG theo mac dinh. Animation chi chay khi
     JS them class .sm-anim vao <html> (xem sm-motion.js). Tat JS / chan CDN /
     reduced-motion => trang van doc va mua hang duoc day du.
   - KHONG co global * margin/padding reset.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600;1,700&display=swap&subset=vietnamese');

/* ---------------------------------------------------------------- 1. Token */
:root {
  --ink: #1E2419;
  --forest: #2E3A2C;
  --forest-deep: #1C241C;
  --leaf: #5A6B52;
  --cream: #F4EFE5;
  --paper: #FBF9F4;
  --sand: #E6DECE;
  --clay: #B8875B;
  --rust: #7E5233;
  --gold: #D3B58F;
  --line: rgba(46, 58, 44, .18);
  --mist: rgba(244, 239, 229, .08);
  --success: #4c7049;
  --danger: #8d4435;
  --warning: #B07C2E;
  --info: #4A6B8A;
  --muted: #5C6154;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Be Vietnam Pro', 'Segoe UI', system-ui, sans-serif;
  --shell: 1240px;
  --shell-wide: 1440px;
  --header-h: 76px;
  --shadow: 0 24px 70px rgba(28, 36, 28, .14);
  --shadow-hover: 0 32px 90px rgba(28, 36, 28, .20);
  --shadow-soft: 0 8px 24px rgba(28, 36, 28, .08);
  --ease-spring: cubic-bezier(.22, 1, .36, 1);
  --radius-card: 16px;
  --radius-panel: 20px;
  color-scheme: light;
}

/* ---------------------------------------------------------------- 2. Base */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
body {
  min-width: 320px;
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
[hidden] { display: none !important; }
::selection { background: var(--clay); color: var(--forest-deep); }
:focus-visible { outline: 3px solid rgba(184, 135, 91, .8); outline-offset: 3px; }

h1, h2, h3, h4 {
  margin: 0 0 .6em;
  color: var(--forest);
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.02em;
  text-wrap: balance;
}
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: 24px; }
.shell-wide { width: 100%; max-width: var(--shell-wide); margin-inline: auto; padding-inline: 24px; }
.section-pad { padding-block: 120px; }

.eyebrow {
  margin: 0 0 1rem;
  color: var(--leaf);
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.text-link {
  color: var(--rust);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.text-link:hover { color: var(--forest); }

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--forest);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus-visible { top: 12px; }

/* ---------------------------------------------------------------- 3. Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 52px;
  padding: .8em 1.7em;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--forest);
  color: var(--paper);
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .25s var(--ease-spring), background-color .2s ease,
    border-color .2s ease, color .2s ease, box-shadow .25s ease;
}
.button:hover:not(:disabled) {
  background: #3d4c39;
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button-dark { background: var(--forest-deep); color: var(--paper); }
.button-dark:hover:not(:disabled) { background: var(--forest); }
.button-light, .button-cream { background: var(--cream); color: var(--forest); }
.button-light:hover:not(:disabled), .button-cream:hover:not(:disabled) { background: #fff; color: var(--forest-deep); }
.button-outline-light { border-color: rgba(251, 249, 244, .6); background: transparent; color: var(--paper); }
.button-outline-light:hover:not(:disabled) { background: rgba(251, 249, 244, .15); color: #fff; box-shadow: none; }
.button-outline, .button-quiet, .button-secondary, .secondary {
  border-color: rgba(46, 58, 44, .32);
  background: transparent;
  color: var(--forest);
}
.button-outline:hover:not(:disabled), .button-quiet:hover:not(:disabled),
.button-secondary:hover:not(:disabled), .secondary:hover:not(:disabled) {
  border-color: var(--forest);
  background: rgba(255, 255, 255, .55);
  color: var(--forest);
  box-shadow: none;
}
.button-danger { background: var(--danger); color: #fff; }
.button-danger:hover:not(:disabled) { background: #7a3a2d; }
.button-sm { min-height: 40px; padding: .55em 1.2em; font-size: .85rem; }
.button-block { display: flex; width: 100%; }
.button .spinner, button .spinner {
  width: 1.1em; height: 1.1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: sm-spin .7s linear infinite;
}
@keyframes sm-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- 4. Forms */
.field { display: grid; gap: .45rem; margin-bottom: 1.1rem; }
.field label { font-size: .9rem; font-weight: 600; color: var(--forest); }
.field .hint { margin: 0; font-size: .82rem; color: var(--muted); }
.field-error { display: none; margin: 0; font-size: .85rem; font-weight: 600; color: var(--danger); }
.field.is-invalid .field-error { display: flex; align-items: center; gap: .4em; }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: var(--danger); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="search"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 52px;
  padding: .7em 1em;
  border: 1px solid rgba(46, 58, 44, .26);
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--clay);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(184, 135, 91, .16);
  outline: none;
}
input::placeholder, textarea::placeholder { color: #8a8e80; opacity: 1; }
input[type="checkbox"], input[type="radio"] { width: 1.15em; height: 1.15em; accent-color: var(--forest); }

/* ---------------------------------------------------------------- 5. Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  width: 100%;
  border-bottom: 1px solid transparent;
  background: rgba(251, 249, 244, .9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background-color .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(251, 249, 244, .96);
  box-shadow: 0 8px 28px rgba(28, 36, 28, .08);
}
/* Trang co hero cinematic: header trong suot, chu trang */
.site-header.is-over-hero:not(.is-scrolled) { background: transparent; }
.site-header.is-over-hero:not(.is-scrolled) .primary-nav a:not(.nav-cart),
.site-header.is-over-hero:not(.is-scrolled) .wordmark,
.site-header.is-over-hero:not(.is-scrolled) .menu-toggle { color: var(--paper); }
.site-header.is-over-hero:not(.is-scrolled) .wordmark-sub { color: var(--gold); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: var(--header-h);
}
.wordmark { display: inline-flex; flex-direction: column; gap: 4px; text-decoration: none; flex-shrink: 0; }
.wordmark-name { font-family: var(--serif); font-size: 1.875rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--forest); }
.wordmark-sub { font-family: var(--sans); font-size: .6rem; font-weight: 700; letter-spacing: .24em; color: var(--leaf); }
.wordmark-light .wordmark-name { color: var(--paper); }
.wordmark-light .wordmark-sub { color: var(--gold); }
.wordmark-logo { height: 40px; width: auto; border-radius: 8px; }
.wordmark-with-logo { flex-direction: row; align-items: center; gap: 12px; }
.wordmark-stack { display: inline-flex; flex-direction: column; gap: 4px; }
.primary-nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.primary-nav a:not(.nav-cart) {
  position: relative;
  padding-block: 6px;
  color: #454b3e;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease;
}
.primary-nav a:not(.nav-cart)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--clay);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease-spring);
}
.primary-nav a:not(.nav-cart):hover, .primary-nav a:not(.nav-cart):focus-visible { color: var(--rust); }
.primary-nav a:not(.nav-cart):hover::after, .primary-nav a:not(.nav-cart):focus-visible::after { transform: scaleX(1); }
.primary-nav a[aria-current="page"] { color: var(--forest); font-weight: 700; }
.primary-nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav-logout {
  min-height: 38px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--forest);
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}
.nav-logout:hover:not(:disabled) { background: var(--cream); }
.nav-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .5em;
  min-height: 46px;
  padding: .6em 1.35em;
  border-radius: 999px;
  background: var(--forest);
  color: var(--paper);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .25s var(--ease-spring), box-shadow .25s ease, background-color .2s ease;
}
.nav-cart:hover { background: #3d4c39; box-shadow: var(--shadow-soft); transform: translateY(-2px); }
.nav-cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  height: 1.6em;
  padding-inline: .4em;
  border-radius: 999px;
  background: var(--clay);
  color: var(--forest-deep);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
}
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 46px; height: 46px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--forest);
}
.menu-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .25s ease, opacity .2s ease; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
body.menu-open { overflow: hidden; }
.account-nav-notice {
  margin: 0;
  padding: 10px 24px;
  background: var(--sand);
  color: var(--forest);
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
}

/* ---------------------------------------------------------------- 6. Footer */
.site-footer { background: var(--forest-deep); color: var(--paper); }
.footer-main {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-block: 72px 48px;
}
.footer-brand p { margin-top: 16px; max-width: 300px; color: rgba(251, 249, 244, .72); font-size: .95rem; }
.footer-column h2, .footer-column h3 {
  margin: 0 0 18px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.footer-column a, .footer-column p {
  display: block;
  margin: 0 0 12px;
  color: rgba(251, 249, 244, .75);
  font-size: .95rem;
  text-decoration: none;
}
.footer-column a { transition: color .18s ease, transform .18s ease; }
.footer-column a:hover { color: #fff; transform: translateX(4px); }
.footer-social { display: flex; gap: 12px; margin-top: 20px; }
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  margin: 0;
  border: 1px solid rgba(251, 249, 244, .25);
  border-radius: 50%;
  color: var(--paper);
  transform: none;
}
.footer-social a:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }
.footer-social svg { width: 18px; height: 18px; fill: currentColor; }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-block: 22px;
  border-top: 1px solid rgba(251, 249, 244, .14);
  color: rgba(251, 249, 244, .62);
  font-size: .8rem;
  letter-spacing: .06em;
}
.footer-bottom a { color: rgba(251, 249, 244, .8); text-decoration: none; }
.footer-bottom a:hover { color: var(--gold); }

/* ---------------------------------------------------------------- 7. Breadcrumb */
.breadcrumb { margin: 0 0 12px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--leaf); }
.breadcrumb li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb li + li::before { content: "/"; color: var(--clay); }
.breadcrumb a { color: var(--leaf); text-decoration: none; }
.breadcrumb a:hover { color: var(--rust); }
.breadcrumb [aria-current="page"] { color: var(--forest); }

/* ---------------------------------------------------------------- 8. Preloader */
.sm-preloader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--forest-deep);
  color: var(--paper);
  transition: opacity .6s ease, visibility .6s ease;
}
.sm-preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.sm-preloader-brand { font-family: var(--serif); font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 700; letter-spacing: -.02em; }
.sm-preloader-brand .ch { display: inline-block; }
.sm-preloader-sub { color: var(--gold); font-size: .85rem; letter-spacing: .18em; text-transform: uppercase; }
.sm-preloader-bar { width: min(240px, 60vw); height: 2px; border-radius: 2px; background: rgba(251, 249, 244, .18); overflow: hidden; }
.sm-preloader-bar i { display: block; height: 100%; width: 30%; border-radius: 2px; background: var(--clay); animation: sm-preload-slide 1.1s ease-in-out infinite alternate; }
@keyframes sm-preload-slide { from { transform: translateX(-40px); } to { transform: translateX(min(200px, 50vw)); } }

/* ---------------------------------------------------------------- 9. Grain + progress + to-top */
.sm-grain {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}
.sm-progress {
  position: fixed;
  top: 0; left: 0;
  z-index: 150;
  width: 100%;
  height: 3px;
  background: transparent;
  pointer-events: none;
}
.sm-progress i { display: block; height: 100%; width: 100%; background: var(--clay); transform: scaleX(0); transform-origin: left; }
.sm-to-top {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 110;
  display: inline-flex;
  align-items: center;
  gap: .5em;
  min-height: 48px;
  padding: .6em 1.2em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 249, 244, .94);
  backdrop-filter: blur(12px);
  color: var(--forest);
  font-size: .85rem;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .3s ease, transform .3s var(--ease-spring), visibility .3s ease;
}
.sm-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.sm-to-top:hover { background: var(--forest); color: var(--paper); }

/* ---------------------------------------------------------------- 10. Toast */
.sm-toasts {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 250;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(380px, calc(100vw - 32px));
}
.sm-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--forest-deep);
  color: var(--paper);
  box-shadow: var(--shadow);
  font-size: .92rem;
  line-height: 1.5;
}
.sm-toast-icon { flex-shrink: 0; font-size: 1.1rem; line-height: 1.4; }
.sm-toast-body { flex: 1; min-width: 0; }
.sm-toast-message { margin: 0; }
.sm-toast-action {
  margin: 8px 8px 0 0;
  padding: 6px 14px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: transparent;
  color: var(--gold);
  font-size: .82rem;
  font-weight: 700;
}
.sm-toast-action:hover { background: var(--gold); color: var(--forest-deep); }
.sm-toast-close {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(251, 249, 244, .7);
  font-size: 1rem;
  line-height: 1;
}
.sm-toast-close:hover { background: rgba(251, 249, 244, .14); color: #fff; }
.sm-toast.is-success .sm-toast-icon { color: #9cc79a; }
.sm-toast.is-error .sm-toast-icon { color: #e0a191; }
.sm-toast.is-warning .sm-toast-icon { color: var(--gold); }
.sm-toast.is-info .sm-toast-icon { color: #a9c4d8; }

/* ---------------------------------------------------------------- 11. Drawer */
.sm-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 180;
  background: rgba(28, 36, 28, .5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.sm-drawer-backdrop.is-open { opacity: 1; visibility: visible; }
.sm-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 190;
  display: flex;
  flex-direction: column;
  width: min(440px, 100vw);
  background: var(--paper);
  box-shadow: var(--shadow-hover);
  transform: translateX(100%);
  transition: transform .35s var(--ease-spring);
}
.sm-drawer.is-open { transform: none; }
.sm-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.sm-drawer-head h2 { margin: 0; font-family: var(--sans); font-size: 1.1rem; font-weight: 700; letter-spacing: 0; }
.sm-drawer-close {
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--forest);
  font-size: 1.1rem;
  line-height: 1;
}
.sm-drawer-close:hover { background: var(--cream); }
.sm-drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.sm-drawer-foot {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  background: var(--cream);
}

/* ---------------------------------------------------------------- 12. Modal */
.sm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(28, 36, 28, .55);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.sm-modal-backdrop.is-open { opacity: 1; visibility: visible; }
.sm-modal {
  width: min(480px, 100%);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 32px;
  border-radius: var(--radius-panel);
  background: var(--paper);
  box-shadow: var(--shadow-hover);
  transform: translateY(16px) scale(.98);
  transition: transform .35s var(--ease-spring);
}
.sm-modal-backdrop.is-open .sm-modal { transform: none; }
.sm-modal h2 { margin: 0 0 12px; font-family: var(--serif); font-size: 1.6rem; }
.sm-modal p { color: var(--ink); font-size: .98rem; }
.sm-modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 13. Badges */
.sm-badge {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  padding: .35em .9em;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid transparent;
}
.sm-badge-icon { font-size: .95em; line-height: 1; font-style: normal; }
.sm-badge-warning { background: rgba(176, 124, 46, .14); border-color: rgba(176, 124, 46, .45); color: #7c5a1e; }
.sm-badge-info { background: rgba(74, 107, 138, .12); border-color: rgba(74, 107, 138, .4); color: #33506e; }
.sm-badge-clay { background: rgba(184, 135, 91, .18); border-color: rgba(184, 135, 91, .5); color: var(--rust); }
.sm-badge-success { background: rgba(76, 112, 73, .12); border-color: rgba(76, 112, 73, .42); color: #38573a; }
.sm-badge-danger { background: rgba(141, 68, 53, .1); border-color: rgba(141, 68, 53, .4); color: var(--danger); }
.sm-badge-gray { background: rgba(46, 58, 44, .08); border-color: rgba(46, 58, 44, .25); color: var(--muted); }
.sm-badge-solid-forest { background: var(--forest); border-color: var(--forest); color: var(--cream); }
.sm-badge-solid-clay { background: var(--clay); border-color: var(--clay); color: var(--forest-deep); }

/* ---------------------------------------------------------------- 14. Order timeline */
.sm-timeline { margin: 0; padding: 0; list-style: none; }
.sm-timeline-step { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 16px; padding-bottom: 28px; }
.sm-timeline-step:last-child { padding-bottom: 0; }
.sm-timeline-dot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 2px solid rgba(46, 58, 44, .25);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  font-size: 1rem;
}
.sm-timeline-step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 44px; bottom: 2px; left: 19px;
  width: 2px;
  background: rgba(46, 58, 44, .16);
}
.sm-timeline-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 44px; bottom: 2px; left: 19px;
  width: 2px;
  background: var(--forest);
  transform: scaleY(0);
  transform-origin: top;
}
.sm-timeline-step.is-done .sm-timeline-dot { border-color: var(--forest); background: var(--forest); color: var(--paper); }
.sm-timeline-step.is-done:not(:last-child)::after { transform: scaleY(1); }
.sm-timeline-step.is-current .sm-timeline-dot { border-color: var(--clay); background: var(--clay); color: var(--forest-deep); box-shadow: 0 0 0 6px rgba(184, 135, 91, .2); }
.sm-timeline-step.is-cancelled .sm-timeline-dot { border-color: var(--danger); background: var(--danger); color: #fff; }
.sm-timeline-name { margin: 0; font-size: 1rem; font-weight: 700; color: var(--forest); }
.sm-timeline-step.is-todo .sm-timeline-name { color: var(--muted); font-weight: 600; }
.sm-timeline-desc { margin: 2px 0 0; font-size: .88rem; color: var(--muted); }
.sm-timeline-time { margin: 2px 0 0; font-size: .8rem; font-weight: 600; color: var(--leaf); }
/* Fill animation chi chay khi JS them .sm-anim vao <html> */
html.sm-anim .sm-timeline-step.is-done:not(:last-child)::after { transition: transform .8s var(--ease-spring) .15s; }

/* ---------------------------------------------------------------- 15. Skeleton */
.sm-skeleton { position: relative; overflow: hidden; background: var(--sand); border-radius: 8px; color: transparent !important; pointer-events: none; }
.sm-skeleton * { visibility: hidden; }
.sm-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(251, 249, 244, .75) 50%, transparent 80%);
  animation: sm-shimmer 1.4s ease-in-out infinite;
}
@keyframes sm-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.sm-skeleton-card { border-radius: var(--radius-card); background: var(--paper); border: 1px solid var(--line); padding: 16px; }
.sm-skeleton-line { height: 14px; margin-bottom: 10px; }
.sm-skeleton-line:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- 16. Panels + cards */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 40px);
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--paper);
  box-shadow: 0 15px 38px rgba(28, 36, 28, .07);
  transition: transform .3s var(--ease-spring), box-shadow .3s ease, border-color .3s ease;
}
.card-hover:hover { border-color: rgba(184, 135, 91, .45); box-shadow: var(--shadow-hover); transform: translateY(-6px); }
.status {
  padding: 14px 18px;
  border-left: 4px solid var(--clay);
  border-radius: 12px;
  background: rgba(251, 249, 244, .85);
  color: var(--muted);
  font-size: .92rem;
}
.status.error { border-left-color: var(--danger); color: var(--danger); }
.status.success { border-left-color: var(--success); color: var(--success); }

/* ---------------------------------------------------------------- 17. Reveal (mac dinh HIEN — chi an khi .sm-anim) */
/* Trang van day du noi dung khi khong co JS hoac CDN bi chan. */
.reveal { opacity: 1; transform: none; }
html.sm-anim .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s var(--ease-spring); }
html.sm-anim .reveal.is-visible { opacity: 1; transform: none; }
html.sm-anim .sm-toast, html.sm-anim .sm-drawer, html.sm-anim .sm-modal, html.sm-anim .sm-to-top { transition-timing-function: var(--ease-spring); }

/* Lenis bat smooth scroll rieng: tat CSS smooth de tranh double-smoothing. */
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* ---------------------------------------------------------------- 18. Responsive */
@media (max-width: 1050px) {
  .shell, .shell-wide { padding-inline: 20px; }
  .section-pad { padding-block: 96px; }
  .primary-nav { gap: 18px; }
  .primary-nav a:not(.nav-cart) { font-size: .86rem; }
  .wordmark-name { font-size: 1.6rem; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 700px) {
  :root { --header-h: 68px; }
  body { font-size: 1rem; }
  .shell, .shell-wide { padding-inline: 16px; }
  .section-pad { padding-block: 72px; }
  .header-inner { gap: 16px; }
  .menu-toggle { display: inline-flex; }
  /* Mobile overlay menu fullscreen. Dung absolute (khong fixed) vi
     backdrop-filter cua header tao containing block cho fixed descendant. */
  .primary-nav {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 95;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 96px 32px 48px;
    background: var(--forest-deep);
    visibility: hidden;
    opacity: 0;
    transition: opacity .35s ease, visibility .35s ease;
  }
  .primary-nav.is-open { visibility: visible; opacity: 1; }
  .primary-nav a:not(.nav-cart) {
    padding-block: 10px;
    color: var(--paper);
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -.01em;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .4s ease, transform .45s var(--ease-spring), color .2s ease;
  }
  .primary-nav a:not(.nav-cart)::after { display: none; }
  .primary-nav a:not(.nav-cart):hover, .primary-nav a[aria-current="page"] { color: var(--gold); }
  .primary-nav.is-open a:not(.nav-cart) { opacity: 1; transform: none; }
  .primary-nav.is-open a:not(.nav-cart):nth-child(1) { transition-delay: .05s; }
  .primary-nav.is-open a:not(.nav-cart):nth-child(2) { transition-delay: .1s; }
  .primary-nav.is-open a:not(.nav-cart):nth-child(3) { transition-delay: .15s; }
  .primary-nav.is-open a:not(.nav-cart):nth-child(4) { transition-delay: .2s; }
  .primary-nav.is-open a:not(.nav-cart):nth-child(5) { transition-delay: .25s; }
  .primary-nav.is-open a:not(.nav-cart):nth-child(6) { transition-delay: .3s; }
  .primary-nav.is-open a:not(.nav-cart):nth-child(7) { transition-delay: .35s; }
  .primary-nav.is-open a:not(.nav-cart):nth-child(8) { transition-delay: .4s; }
  .primary-nav .nav-cart { margin-top: 18px; }
  .primary-nav .nav-logout { margin-top: 12px; border-color: rgba(251, 249, 244, .4); color: var(--paper); }
  /* Khi menu mo, nut toggle noi len tren overlay */
  body.menu-open .menu-toggle { position: relative; z-index: 96; border-color: rgba(251, 249, 244, .4); color: var(--paper); }
  .footer-main { grid-template-columns: 1fr; gap: 28px; padding-block: 56px 36px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .sm-toasts { right: 16px; left: 16px; bottom: 16px; width: auto; }
  .sm-to-top { right: 16px; bottom: 16px; }
  .sm-modal { padding: 24px; }
  .sm-timeline-step { grid-template-columns: 34px 1fr; gap: 12px; }
  .sm-timeline-dot { width: 34px; height: 34px; font-size: .9rem; }
  .sm-timeline-step:not(:last-child)::before, .sm-timeline-step:not(:last-child)::after { left: 16px; top: 38px; }
}
@media (max-width: 390px) {
  .wordmark-name { font-size: 1.45rem; }
  .wordmark-sub { font-size: .52rem; letter-spacing: .2em; }
  .nav-cart { min-height: 42px; padding: .55em 1em; font-size: .82rem; }
  .sm-modal-actions .button { flex: 1; }
}

/* ---------------------------------------------------------------- 19. Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.sm-anim .reveal { opacity: 1; transform: none; transition: none; }
  .sm-toast, .sm-drawer, .sm-modal, .sm-modal-backdrop, .sm-drawer-backdrop,
  .sm-to-top, .primary-nav, .primary-nav a, .button, .card, .sm-preloader {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .sm-skeleton::after, .sm-preloader-bar i { animation: none !important; }
  .sm-drawer { transform: none; }
  .sm-drawer:not(.is-open) { visibility: hidden; }
}

/* ---------------------------------------------------------------- 20. Tuong thich page CSS hien co (tam thoi) */
/* Giu cac trang cu khong vo layout truoc khi page builders redesign. */
.brand { color: var(--forest); font-family: var(--serif); font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; text-decoration: none; }
.brand span { display: block; margin-top: 5px; color: var(--leaf); font: 700 .52rem/1 var(--sans); letter-spacing: .23em; }
body > header:not(.site-header) { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--header-h); padding-inline: max(16px, calc((100% - var(--shell)) / 2)); border-bottom: 1px solid var(--line); background: var(--paper); }
body > header:not(.site-header) > a { color: var(--forest); font-family: var(--serif); font-size: 1.65rem; font-weight: 700; text-decoration: none; }
body > header:not(.site-header) > a span { display: block; margin-top: 5px; font: 700 .52rem/1 var(--sans); letter-spacing: .23em; color: var(--leaf); }
body > header:not(.site-header) nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
body > header:not(.site-header) nav a { color: #454b3e; font-size: .9rem; font-weight: 600; text-decoration: none; }
body > header:not(.site-header) nav a:hover { color: var(--rust); }
body > footer:not(.site-footer) { margin-top: auto; padding: 22px max(16px, calc((100% - var(--shell)) / 2)); background: var(--forest-deep); color: rgba(255, 255, 255, .72); font-size: .8rem; }
.account-main, .cart-main, body > main.page { padding-block: 72px 96px; }
.catalog-heading, .checkout-heading { padding-top: 72px; }
.catalog-heading h1, .checkout-heading h1, .account-main h1, .cart-main h1, body > main.page h1 { font-size: clamp(2.75rem, 5.5vw, 4.75rem); line-height: 1.06; }
.catalog-toolbar, .detail-panel, .checkout-panel, .order-summary, .order-card, .admin-grid > section, .inventory-panel { border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--paper); box-shadow: var(--shadow); }
.product-placeholder { aspect-ratio: 1; min-height: 0; background: linear-gradient(145deg, #ded8c9, #eee9dd 52%, #c7baa1); color: var(--forest); }
.product-card, .order-card, .inventory-row, .cart-line { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
