/**
 * Đồng Thuận — Base / foundation
 * Depends on: tokens.css
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: var(--font-body);
  font-size: var(--text-body-size);
  font-weight: 400;
  line-height: var(--text-body-lh);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button,
a.btn,
.chip,
.drawer-close,
.drawer-thumb,
.product-card-hit {
  touch-action: manipulation;
}

@media (max-width: 719px) {
  html {
    scroll-behavior: auto;
  }
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: color-mix(in srgb, var(--color-brand) 35%, transparent);
  color: var(--color-text);
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.u-hidden,
[hidden] {
  display: none !important;
}

.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(var(--width-wide), 100%);
  margin-inline: auto;
  padding-inline: var(--space-container-inline);
}

.container--narrow {
  width: min(var(--width-content), 100%);
}

.section {
  padding: var(--space-section) var(--space-container-inline);
}

.section--compact {
  padding-block: var(--space-section-compact);
}

.section-inner {
  max-width: var(--width-content);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-control-gap) var(--space-4);
}

/* Type utilities (opt-in) */
.text-display {
  font-family: var(--font-display);
  font-size: var(--text-display-size);
  line-height: var(--text-display-lh);
  font-weight: var(--text-display-weight);
  letter-spacing: var(--text-display-tracking);
}

.text-h1 {
  font-family: var(--font-display);
  font-size: var(--text-h1-size);
  line-height: var(--text-h1-lh);
  font-weight: var(--text-h1-weight);
}

.text-h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2-size);
  line-height: var(--text-h2-lh);
  font-weight: var(--text-h2-weight);
}

.text-h3 {
  font-family: var(--font-display);
  font-size: var(--text-h3-size);
  line-height: var(--text-h3-lh);
  font-weight: var(--text-h3-weight);
}

.text-body-lg {
  font-size: var(--text-body-lg-size);
  line-height: var(--text-body-lg-lh);
}

.text-caption {
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
}

.text-label {
  font-size: var(--text-label-size);
  font-weight: var(--text-label-weight);
  letter-spacing: var(--text-label-tracking);
}

.text-price {
  font-weight: var(--text-price-weight);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-price-size);
}

.text-muted {
  color: var(--color-text-muted);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
