/* Hiệu Vàng Nghĩa Tín — Di sản Kim hoàn Miền Trung Design System */
:root {
  --bg: #FCFBF8;
  --bg-subtle: #F3F2EE;
  --surface: #FFFFFF;
  --ink: #161412;
  --ink-muted: #55504A;
  --brand-red: #7E191B;
  --brand-red-hover: #611214;
  --brand-red-soft: rgba(126, 25, 27, 0.08);
  --gold: #9E741E;
  --gold-text: #7A5610;
  --gold-soft: rgba(158, 116, 30, 0.11);
  --buy: #1A4F8B;
  --sell: #1B6644;
  --border: #E4E0D8;
  --border-strong: #C9C2B4;
  --warn-bg: #FDF7EC;
  --warn-border: #C49334;
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --dur-fast: 130ms;
  --dur-mid: 220ms;
  --dur-panel: 300ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --container: 1200px;
}

[data-theme="dark"] {
  --bg: #100E0C;
  --bg-subtle: #171411;
  --surface: #1D1915;
  --ink: #F4F0E8;
  --ink-muted: #B6AEA2;
  --brand-red: #C84447;
  --brand-red-hover: #DF5A5D;
  --brand-red-soft: rgba(200, 68, 71, 0.16);
  --gold: #DFB24E;
  --gold-text: #E9C670;
  --gold-soft: rgba(223, 178, 78, 0.14);
  --buy: #79B2F2;
  --sell: #60C999;
  --border: #2C2721;
  --border-strong: #463E34;
  --warn-bg: #231C11;
  --warn-border: #B98A2B;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.68;
  overflow-x: clip;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-red-hover); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-red);
  color: #fff;
  padding: 10px 16px;
  z-index: 2000;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { left: 12px; top: 12px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Top policy strip */
.trust-strip {
  background: var(--brand-red);
  color: #FBF7F0;
  font-size: 0.84rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.trust-strip__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 20px;
  padding: 7px 0;
}
.trust-strip a { color: #FCE6B4; font-weight: 600; text-decoration: none; }
.trust-strip a:hover { text-decoration: underline; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 1;
  min-width: 0;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold);
  background: var(--brand-red);
  color: #F8E2A6;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-size: 1.16rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.brand-sub { font-size: 0.74rem; color: var(--ink-muted); white-space: nowrap; }

.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.site-nav a:hover, .site-nav a[aria-current="page"] {
  background: var(--brand-red-soft);
  color: var(--brand-red);
}

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { border-color: var(--gold); background: var(--bg-subtle); }
.nav-toggle { display: none; }

/* Typography */
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.22;
  margin-top: 0;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 700; margin-bottom: 16px; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2.05rem); font-weight: 700; margin-bottom: 14px; }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.35rem); font-weight: 600; margin-bottom: 10px; }
p { margin-top: 0; margin-bottom: 14px; }

.lead { font-size: 1.07rem; color: var(--ink-muted); max-width: 66ch; }
.prose { max-width: 68ch; min-width: 0; }
.prose p { line-height: 1.75; }
.num { font-variant-numeric: tabular-nums; }

/* Breadcrumb */
.breadcrumb {
  padding: 16px 0 0;
  font-size: 0.86rem;
  color: var(--ink-muted);
}
.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--border-strong); }
.breadcrumb a { color: var(--ink-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand-red); text-decoration: underline; }

/* Hero */
.hero {
  padding: 40px 0 36px;
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.95fr);
  gap: 32px;
  align-items: start;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-bottom: 14px;
}
.hero-meta strong { color: var(--ink); font-weight: 600; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn-primary { background: var(--brand-red); color: #fff; }
.btn-primary:hover { background: var(--brand-red-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--brand-red); color: var(--brand-red); }

/* Market Reference Aside */
.market-panel {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
}
.market-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.market-panel__title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin: 0; }
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sell);
}
.market-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.kpi-cell {
  background: var(--bg-subtle);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.kpi-label { font-size: 0.78rem; color: var(--ink-muted); display: block; margin-bottom: 4px; }
.kpi-val { font-size: 1.18rem; font-weight: 700; color: var(--ink); display: block; }
.kpi-sub { font-size: 0.76rem; color: var(--ink-muted); }

/* Price Board (Focal Moment) */
.section { padding: 48px 0; border-bottom: 1px solid var(--border); }
.section--subtle { background: var(--bg-subtle); }
.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}

.board-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.segmented {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.segmented button[aria-pressed="true"] {
  background: var(--brand-red);
  color: #fff;
}
.filter-input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  min-width: 210px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.price-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
.price-table thead th {
  text-align: left;
  padding: 13px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--bg-subtle);
  border-bottom: 2px solid var(--gold);
  white-space: nowrap;
}
.price-table thead th.col-num, .price-table tbody td.col-num { text-align: right; }
.price-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.price-table tbody tr:last-child { border-bottom: 0; }
.price-table tbody tr:hover { background: var(--gold-soft); }
.price-table td { padding: 14px 16px; vertical-align: middle; }
.gold-name { font-weight: 600; color: var(--ink); text-decoration: none; display: inline-block; }
.gold-name:hover { color: var(--brand-red); text-decoration: underline; }
.gold-meta { display: block; font-size: 0.8rem; color: var(--ink-muted); margin-top: 2px; }
.p-buy { color: var(--buy); font-weight: 700; font-size: 1.04rem; }
.p-sell { color: var(--sell); font-weight: 700; font-size: 1.04rem; }
.p-spread { color: var(--ink-muted); font-size: 0.9rem; }

@keyframes valuePulse {
  0% { background-color: var(--gold-soft); }
  100% { background-color: transparent; }
}
.value-updated { animation: valuePulse var(--dur-mid) var(--ease-out); }

.notice-box {
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-left: 4px solid var(--brand-red);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}
.notice-box strong { color: var(--brand-red); }

/* Architectural Hairline Grids (avoiding generic SaaS card clones) */
.ruled-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border-strong);
  border-left: 1px solid var(--border);
  background: var(--surface);
}
.ruled-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ruled-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.ruled-cell {
  padding: 22px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.ruled-cell h3 { margin-bottom: 6px; font-size: 1.12rem; }
.ruled-cell p { font-size: 0.91rem; color: var(--ink-muted); margin-bottom: 0; }
.cell-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-red);
  text-decoration: none;
  margin-top: 6px;
  display: inline-block;
}
.cell-link:hover { text-decoration: underline; }

/* Media Gallery */
.media-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.media-figure {
  margin: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.media-figure img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.media-figure figcaption {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--border);
}

/* Interactive Tool Shell */
.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 28px;
  align-items: start;
  margin: 24px 0 36px;
}
.tool-box, .result-box {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 24px;
}
.result-box {
  border-top: 3px solid var(--gold);
  background: var(--bg-subtle);
}
.field-group { margin-bottom: 16px; }
.field-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tool-input, .tool-select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-variant-numeric: tabular-nums;
}
.tool-input:focus, .tool-select:focus { border-color: var(--brand-red); outline: none; }

.res-main {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.res-main__label { font-size: 0.84rem; color: var(--ink-muted); display: block; }
.res-main__value {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 700;
  color: var(--brand-red);
  display: block;
  margin-top: 4px;
}
.res-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.res-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.res-list li:last-child { border-bottom: 0; }

/* Article / Wiki Content */
.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 36px;
  align-items: start;
}
.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand-red);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.sidebar-box h3 { font-size: 1.08rem; margin-bottom: 10px; }
.sidebar-links {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-links li { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.sidebar-links li:last-child { border-bottom: 0; }
.sidebar-links a { text-decoration: none; color: var(--ink); }
.sidebar-links a:hover { color: var(--brand-red); text-decoration: underline; }

.aeo-block {
  padding: 18px 20px;
  background: var(--bg-subtle);
  border-left: 3px solid var(--gold);
  margin: 18px 0 22px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.check-list {
  padding-left: 20px;
  margin: 12px 0 20px;
}
.check-list li { margin-bottom: 8px; }

/* Compare Table */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  min-width: 520px;
}
.compare-table th, .compare-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.93rem;
}
.compare-table th { background: var(--bg-subtle); font-weight: 600; }

/* FAQ Details */
.faq-list { border-top: 1px solid var(--border-strong); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  list-style: none;
  padding: 16px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.02rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.25rem; color: var(--gold-text); flex-shrink: 0; }
.faq-item[open] summary::after { content: "−"; }
.faq-item__body { padding: 0 0 18px; color: var(--ink-muted); max-width: 68ch; }

/* Chart SVG */
.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 18px;
}
.chart-caption { font-size: 0.82rem; color: var(--ink-muted); margin-top: 8px; margin-bottom: 0; }

/* Branches & Footer */
.branch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.branch-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--brand-red);
  border-radius: var(--radius-sm);
  padding: 24px;
}
.branch-phone {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--brand-red);
  text-decoration: none;
}

.site-footer {
  background: #14110F;
  color: #E7E1D6;
  padding: 48px 0 28px;
  border-top: 3px solid var(--gold);
}
.site-footer a { color: #DFD6C5; text-decoration: none; }
.site-footer a:hover { color: #F2CC74; text-decoration: underline; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-title {
  font-family: var(--font-display);
  color: #F2CC74;
  font-size: 1.08rem;
  margin-bottom: 12px;
}
.footer-links { list-style: none; padding: 0; margin: 0; font-size: 0.88rem; }
.footer-links li { margin-bottom: 7px; }
.footer-bottom {
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  font-size: 0.82rem;
  color: #AAA092;
}

/* Pill Links */
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.pill-list a {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
  text-decoration: none;
}
.pill-list a:hover { border-color: var(--brand-red); color: var(--brand-red); }

/* Responsive */
@media (max-width: 1024px) {
  .hero-grid, .content-layout, .tool-layout { grid-template-columns: minmax(0, 1fr); }
  .ruled-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1120px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border-strong);
    padding: 12px 24px 18px;
    flex-direction: column;
    align-items: stretch;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 10px 8px; border-bottom: 1px solid var(--border); }
  .site-nav a:last-child { border-bottom: 0; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .brand-mark { width: 32px; height: 32px; font-size: 0.92rem; }
  .brand-name { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-sub { display: none; }
  .icon-btn { padding: 0 10px; font-size: 0.8rem; height: 34px; }
  .ruled-grid, .ruled-grid--3, .ruled-grid--2, .branch-grid, .media-strip, .field-row, .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .market-kpis { grid-template-columns: minmax(0, 1fr); }
  .filter-input { min-width: 0; width: 100%; }
  .price-table { min-width: 520px; }
}

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