/* Organic design system — tokens, components, and the dalifoods.vn site chrome.
   Ported from the Claude Design "Organic" system with the project's font overrides
   (Baloo 2 / Be Vietnam Pro) folded in. Font files are linked from each page head. */

:root {
  --color-bg: #f5ead8;
  --color-surface: #ebddc5;
  --color-text: #201e1d;
  --color-accent: #c67139;
  --color-accent-2: #7a8a5e;
  --color-divider: color-mix(in srgb, #201e1d 16%, transparent);
  --color-danger: #b3261e;

  --color-neutral-100: #f9f4ed;
  --color-neutral-200: #eee7db;
  --color-neutral-300: #dcd3c4;
  --color-neutral-400: #c0b6a5;
  --color-neutral-500: #a19786;
  --color-neutral-600: #82796a;
  --color-neutral-700: #645c50;
  --color-neutral-800: #474238;
  --color-neutral-900: #2e2b25;

  --color-accent-100: #fff2eb;
  --color-accent-200: #ffe1d0;
  --color-accent-300: #ffc6a5;
  --color-accent-400: #f6a06b;
  --color-accent-500: #d67f48;
  --color-accent-600: #b2622d;
  --color-accent-700: #8c491a;
  --color-accent-800: #643312;
  --color-accent-900: #402310;

  --color-accent-2-100: #f0fae1;
  --color-accent-2-200: #e1eecc;
  --color-accent-2-300: #ccdbb2;
  --color-accent-2-400: #aebf92;
  --color-accent-2-500: #8fa073;
  --color-accent-2-600: #728157;
  --color-accent-2-700: #56633f;
  --color-accent-2-800: #3d472b;
  --color-accent-2-900: #272e1b;

  --font-heading: 'Baloo 2', system-ui, sans-serif;
  --font-heading-weight: 800;
  --font-body: 'Be Vietnam Pro', system-ui, sans-serif;

  --space-1: 4.4px;
  --space-2: 8.8px;
  --space-3: 13.2px;
  --space-4: 17.6px;
  --space-6: 26.4px;
  --space-8: 35.2px;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #2e2b25 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2e2b25 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2e2b25 22%, transparent);

  /* Horizontal gutter for every page section; narrows on small screens. */
  --gutter: 48px;
}

/* ── base ───────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }

p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent-700); text-underline-offset: 3px; }
a:hover { color: var(--color-accent-800); }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 11px;
  margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}

.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

.washed { filter: saturate(0.6) contrast(0.85) brightness(1.1) opacity(0.94); }

.hr { height: 1px; border: 0; margin: var(--space-4) 0; background: var(--color-divider); }

/* Visible only to screen readers — used for skip links and icon-button labels. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: 999px;
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); color: var(--color-bg); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); color: var(--color-text); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); color: var(--color-text); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); }

/* ── forms ──────────────────────────────────────────────────────────────── */

.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 14px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: 999px;
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; border-radius: var(--radius-lg); }
select.input { appearance: none; cursor: pointer; }

.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--color-divider);
}
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: 999px;
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked) { background: var(--color-accent); color: var(--color-bg); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }
/* Narrow phones: let the segmented control wrap instead of overflowing the card. */
@media (max-width: 420px) {
  .seg { max-width: 100%; flex-wrap: wrap; border-radius: var(--radius-md); }
}

.checkbox { display: inline-flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13.5px; }
.checkbox input { margin: 3px 0 0; accent-color: var(--color-accent); flex: none; }

/* ── cards ──────────────────────────────────────────────────────────────── */

.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3);
  border-radius: calc(var(--radius-lg) * 1.15);
  background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; line-height: 1.2;
}
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* ── tags ───────────────────────────────────────────────────────────────── */

.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px; border-radius: 999px;
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }

/* ── tables ─────────────────────────────────────────────────────────────── */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 1px solid var(--color-divider);
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* ── page layout helpers ────────────────────────────────────────────────── */

.section { max-width: 1200px; margin: 0 auto; padding-inline: var(--gutter); }

.eyebrow {
  margin: 0 0 10px; font-size: 12.5px; letter-spacing: 0.08em;
  text-transform: uppercase; font-weight: 700; color: var(--color-accent-700);
}
.eyebrow-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }

.section-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 24px; margin-bottom: 28px;
}
.section-head h2 { font-size: 36px; margin: 0; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 700; font-size: 14.5px; white-space: nowrap;
}

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── site navigation ────────────────────────────────────────────────────── */

.site-nav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: var(--space-4);
  flex-wrap: wrap; row-gap: 6px;
  padding: 12px var(--gutter);
  background: var(--color-bg);
}
.site-nav__brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  text-decoration: none; margin-right: 10px;
}
.site-nav__brand img { height: 42px; width: auto; }
.site-nav__tagline {
  font-size: 9px; letter-spacing: 0.05em; text-transform: uppercase;
  font-weight: 700; color: var(--color-accent-700);
}
.site-nav__spacer { flex: 1; }
.site-nav__links { display: contents; }
.site-nav__links a {
  color: inherit; text-decoration: none; font-size: 14px; white-space: nowrap;
}
.site-nav__links a:hover,
.site-nav__links a[aria-current='page'] { color: var(--color-accent); }
.site-nav__cta { text-decoration: none; white-space: nowrap; }
.site-nav__toggle {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  background: transparent; border: 1px solid var(--color-divider);
  border-radius: 999px; color: inherit; cursor: pointer;
}

/* ── site footer ────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--color-neutral-900); color: var(--color-neutral-100);
  border-radius: 40px 40px 0 0;
  padding: 64px var(--gutter) 28px;
  margin-top: 96px;
}
.site-footer__inner { max-width: 1200px; margin: 0 auto; }
.site-footer__grid {
  display: grid; grid-template-columns: 1.5fr 1fr 0.9fr 1fr;
  gap: 44px; align-items: start;
}
.site-footer__col { display: flex; flex-direction: column; gap: 10px; }
.site-footer__logo {
  background: #fff; border-radius: 14px; padding: 12px 18px;
  display: inline-flex; align-self: flex-start;
}
.site-footer__logo img { height: 40px; width: auto; }
.site-footer__head {
  margin: 0 0 4px; font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; font-weight: 700; color: var(--color-accent-300);
}
.site-footer p { color: rgba(245, 234, 216, 0.75); }
.site-footer__lede { margin: 0; font-size: 13.5px; line-height: 1.65; }
.site-footer__meta { margin: 0; font-size: 13px; line-height: 1.7; color: rgba(245, 234, 216, 0.6); }
.site-footer__contact { margin: 0; font-size: 13.5px; line-height: 1.9; color: rgba(245, 234, 216, 0.82); }
.site-footer__contact strong { color: var(--color-neutral-100); }
.site-footer__links { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.site-footer__links a { color: rgba(245, 234, 216, 0.82); text-decoration: none; }
.site-footer__links a:hover { color: var(--color-accent-300); }
.site-footer__note {
  border: 1px dashed rgba(245, 234, 216, 0.35); border-radius: 14px;
  padding: 10px 14px; font-size: 12px; line-height: 1.5;
  color: rgba(245, 234, 216, 0.6);
}
.site-footer__divider { height: 1px; background: rgba(245, 234, 216, 0.16); margin: 40px 0 20px; }
.site-footer__legal {
  margin: 0 0 8px; font-size: 12.5px; line-height: 1.7;
  color: rgba(245, 234, 216, 0.55); max-width: 980px;
}
.site-footer__copyright { margin: 0; font-size: 12.5px; color: rgba(245, 234, 216, 0.45); }

/* ── floating hotline / Zalo (mobile brief) ─────────────────────────────── */

.floating-actions {
  position: fixed; right: 16px; bottom: 18px; z-index: 70;
  display: none; flex-direction: column; gap: 10px;
}
.fab {
  display: grid; place-content: center; border-radius: 50%;
  color: var(--color-neutral-100); text-decoration: none;
  box-shadow: var(--shadow-lg);
}
.fab:hover { color: var(--color-neutral-100); }
.fab--zalo {
  width: 46px; height: 46px; background: var(--color-accent-2);
  font-size: 10px; font-weight: 800;
}
.fab--call { width: 54px; height: 54px; background: var(--color-accent); }

/* ── responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  :root { --gutter: 32px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}

@media (max-width: 860px) {
  .site-nav { gap: 12px; }
  .site-nav__toggle { display: inline-flex; order: 3; }
  .site-nav__spacer { display: none; }
  .site-nav__links {
    display: none; order: 4; width: 100%;
    flex-direction: column; align-items: flex-start; gap: 2px;
    padding: 8px 0 4px; border-top: 1px solid var(--color-divider);
  }
  .site-nav__links a { display: block; width: 100%; padding: 9px 2px; font-size: 15px; }
  .site-nav[data-open='true'] .site-nav__links { display: flex; }
  .site-nav__cta { order: 2; margin-left: auto; font-size: 13px; }

  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  /* !important: per-heading display sizes live in inline styles, which otherwise win here. */
  h1 { font-size: 34px !important; }
  h2 { font-size: 27px !important; }
}

@media (max-width: 640px) {
  h1 { font-size: 29px !important; }
  h2 { font-size: 23px !important; }
}

@media (max-width: 640px) {
  :root { --gutter: 20px; }

  /* Brand, CTA and toggle must share one row: the tagline is what widens the
     brand column past the budget, and it repeats the hero's trust line anyway. */
  .site-nav { gap: 10px; }
  .site-nav__brand { margin-right: 0; }
  .site-nav__brand img { height: 36px; }
  .site-nav__tagline { display: none; }
  /* Buy the last few px for the logo back from the CTA, not the other way round. */
  .site-nav__cta { padding-inline: 13px; }

  .floating-actions { display: flex; }

  /* Mobile brief: single-column stacks, 2-up product grid, full-width CTAs. */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  /* !important: asymmetric ratios live in inline styles, which otherwise win here. */
  .grid-stack, .grid-2.grid-stack, .grid-3.grid-stack, .grid-4.grid-stack {
    grid-template-columns: 1fr !important;
  }

  .site-footer { padding-top: 44px; border-radius: 28px 28px 0 0; margin-top: 64px; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 28px; }

  .btn { width: 100%; }
  .btn-inline { width: auto; }

  /* Leave room for the floating call button above the fold end. */
  body { padding-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Admin-authored article bodies — news/article_detail.html. */
.prose { font-size: 16px; line-height: 1.75; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 24px; margin-top: 1.6em; }
.prose h3 { font-size: 19px; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose blockquote { margin-left: 0; padding-left: 16px; border-left: 3px solid var(--color-accent-200); }

/* Lead form validation messages — rendered by templates/pages/contact.html
   and templates/pages/dealer.html. */
.form-error {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-danger);
}