/* TMT Innovation — Design Tokens
 * CONFIRMED from the brand logo (2026-08-25): teal #60A6A8, grey #545454.
 * IMPORTANT: #60A6A8 with white text = 2.79:1 and FAILS contrast.
 * Use --tmt-brand-500 as a surface with ink text on top,
 * or --tmt-brand-600 when the element needs white text.
 */

:root {
  /* Brand — all derived from the logo teal, hue held at 181deg */
  --tmt-brand-700: #2F5556;  /* hover/active        white 8.22 */
  --tmt-brand-600: #3A6869;  /* primary button      white 6.24 */
  --tmt-brand-500: #60A6A8;  /* THE LOGO COLOUR — surfaces only, ink text 5.07 */
  --tmt-brand-200: #A3CBCC;  /* decorative borders */
  --tmt-brand-100: #D1E5E6;  /* selected chip       ink 10.83 */
  --tmt-brand-50:  #EBF4F4;  /* soft panel          ink 12.66 */

  /* Neutrals */
  --tmt-ink:         #2B2B2B;  /* white 14.16 */
  --tmt-ink-muted:   #545454;  /* logo grey, white 7.57 — lightest permitted text */
  --tmt-border:      #E3E7E7;
  --tmt-surface:     #FFFFFF;
  --tmt-surface-alt: #F3F9F9;

  /* Stock status — always pair with the Thai word, never colour alone */
  --tmt-in-stock:  #1E7A3D;
  --tmt-low-stock: #B45309;
  --tmt-out-stock: #B42318;

  /* Channel — for that platform's button/icon only */
  --tmt-line:   #06C755;  /* never white text on this — 2.26 */
  --tmt-shopee: #EE4D2D;
  --tmt-lazada: #0F146D;

  /* Type */
  --tmt-font-thai: "IBM Plex Sans Thai", "Noto Sans Thai", "Sarabun", system-ui, sans-serif;
  --tmt-text-body:  1rem;      /* 16px floor for Thai */
  --tmt-text-small: 0.875rem;
  --tmt-text-price: 1.5rem;
  --tmt-leading-body: 1.75;    /* Thai needs room for stacked marks */
  --tmt-leading-head: 1.4;

  /* Spacing */
  --tmt-space-1: 4px;
  --tmt-space-2: 8px;
  --tmt-space-3: 12px;
  --tmt-space-4: 16px;
  --tmt-space-5: 24px;
  --tmt-space-6: 32px;
  --tmt-space-7: 48px;
  --tmt-space-8: 64px;

  /* Radius */
  --tmt-radius-sm:   6px;
  --tmt-radius-md:   10px;
  --tmt-radius-lg:   14px;
  --tmt-radius-full: 999px;

  /* Elevation */
  --tmt-shadow-card:   0 1px 3px rgba(43, 43, 43, .08);
  --tmt-shadow-sticky: 0 -2px 12px rgba(43, 43, 43, .12);

  /* Interaction */
  --tmt-tap-min: 44px;
  --tmt-btn-h:   48px;
}

body,
.tmt-scope {
  font-family: var(--tmt-font-thai);
  font-size: var(--tmt-text-body);
  line-height: var(--tmt-leading-body);
  color: var(--tmt-ink);
}

/* Thai must never be letter-spaced, uppercased, or justified */
.tmt-scope :is(h1, h2, h3, h4, p, li, a, button, label) {
  letter-spacing: normal;
  text-transform: none;
  text-align: start;
}

/* Buttons — one Primary per viewport */
.tmt-btn {
  min-height: var(--tmt-btn-h);
  padding: 0 var(--tmt-space-5);
  border-radius: var(--tmt-radius-md);
  font: 600 1rem/1.2 var(--tmt-font-thai);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tmt-space-2);
  cursor: pointer;
}

.tmt-btn--primary {
  background: var(--tmt-brand-600);
  color: #fff;
  border: none;
}
.tmt-btn--primary:hover { background: var(--tmt-brand-700); }

.tmt-btn--secondary {
  background: transparent;
  color: var(--tmt-brand-600);
  border: 1.5px solid var(--tmt-brand-600);
}

.tmt-btn--on-brand {          /* button sitting on a --tmt-brand-500 surface */
  background: #fff;
  color: var(--tmt-brand-700);
  border: none;
}

/* Brand surface: logo teal takes INK text, never white */
.tmt-brand-surface {
  background: var(--tmt-brand-500);
  color: var(--tmt-ink);
}

.tmt-btn--tertiary {
  background: none;
  border: none;
  color: var(--tmt-brand-600);
  padding: 0;
  min-height: var(--tmt-tap-min);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--tmt-brand-600);
  outline-offset: 2px;
}

/* Variant chips — selected state is never colour alone */
.tmt-chip {
  min-height: var(--tmt-tap-min);
  padding: 0 var(--tmt-space-4);
  margin: 0 var(--tmt-space-2) var(--tmt-space-2) 0;
  border: 1px solid var(--tmt-border);
  border-radius: var(--tmt-radius-sm);
  background: var(--tmt-surface);
}
.tmt-chip[aria-pressed="true"] {
  background: var(--tmt-brand-100);
  border: 1.5px solid var(--tmt-brand-600);
  font-weight: 600;
}
.tmt-chip[aria-disabled="true"] {
  opacity: .45;
  text-decoration: line-through;
  pointer-events: none;
}

/* Mobile sticky purchase bar — mobile only */
.tmt-sticky-buy {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  height: 64px;
  padding: 0 var(--tmt-space-4);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--tmt-surface);
  box-shadow: var(--tmt-shadow-sticky);
  z-index: 90;
}
@media (min-width: 768px) {
  .tmt-sticky-buy { display: none; }
}

/* Comparison table — first column frozen */
.tmt-table-wrap { overflow-x: auto; }
.tmt-table-wrap th:first-child,
.tmt-table-wrap td:first-child {
  position: sticky;
  inset-inline-start: 0;
  background: var(--tmt-surface);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
