/* ==========================================================================
   BÓNG BAY TIẾN HÀ — DEMO UI KIT (base.css)
   Nền tảng dùng chung cho 5 mẫu giao diện.
   Mọi thông số thương hiệu nằm trong :root của từng file demo-0x.css
   ========================================================================== */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }
img, svg, picture, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
:focus-visible { outline: 2px solid var(--c-focus, #2f6df6); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--c-primary-soft, #f3e6ff); color: var(--c-ink, #211d2b); }

/* ---------- 2. Tokens mặc định (theme sẽ ghi đè) ---------- */
:root {
  --container: 1180px;
  --gutter: clamp(18px, 4vw, 40px);

  --r-xs: 8px;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --r-xl: 34px;
  --r-pill: 999px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --sp-9: 96px; --sp-10: 128px;

  --c-bg: #ffffff;
  --c-surface: #ffffff;
  --c-soft: #f6f5f3;
  --c-ink: #1d1d1f;
  --c-muted: #6f6b78;
  --c-line: #e8e5ee;
  --c-primary: #6c5ce7;
  --c-primary-soft: #efecff;
  --c-on-primary: #ffffff;
  --c-accent: #f7b267;
  --c-focus: #2f6df6;

  --shadow-xs: 0 1px 2px rgba(28, 22, 40, .05);
  --shadow-sm: 0 2px 6px rgba(28, 22, 40, .05), 0 10px 24px rgba(28, 22, 40, .05);
  --shadow-md: 0 6px 18px rgba(28, 22, 40, .07), 0 24px 48px rgba(28, 22, 40, .07);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .38s;

  --font-sans: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-sans);
}

/* ---------- 3. Typography ---------- */
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.d1, .d2, .h1, .h2, .h3, .h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.028em;
  text-wrap: balance;
}
.d1 { font-size: clamp(2.6rem, 6.4vw, 4.4rem); }
.d2 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); }
.h1 { font-size: clamp(1.9rem, 3.8vw, 2.6rem); }
.h2 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); line-height: 1.2; }
.h3 { font-size: clamp(1.15rem, 1.8vw, 1.35rem); line-height: 1.3; letter-spacing: -.015em; }
.h4 { font-size: 1.02rem; line-height: 1.35; letter-spacing: -.01em; }

.lead { font-size: clamp(1.02rem, 1.5vw, 1.15rem); line-height: 1.7; color: var(--c-muted); }
.muted { color: var(--c-muted); }
.small { font-size: .86rem; line-height: 1.6; }
.tiny { font-size: .76rem; letter-spacing: .02em; }
.strong { font-weight: 600; }
.balance { text-wrap: balance; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--c-primary);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1.5px;
  background: currentColor;
  opacity: .55;
}
.eyebrow.is-plain::before { display: none; }

/* ---------- 4. Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { --container: 1380px; }
.container--narrow { --container: 880px; }

.section { padding-block: clamp(56px, 8vw, 108px); }
.section--tight { padding-block: clamp(36px, 5vw, 64px); }
.section--soft { background: var(--c-soft); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 48px);
  flex-wrap: wrap;
}
.section-head p { max-width: 52ch; }
.section-head--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.section-head--center p { margin-inline: auto; }

.stack > * + * { margin-top: var(--stack, 16px); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--gap, 12px); align-items: center; }
.split { display: flex; flex-wrap: wrap; gap: var(--gap, 24px); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* ---------- 5. Buttons ---------- */
.btn {
  --btn-bg: var(--c-primary);
  --btn-ink: var(--c-on-primary);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-ink);
  border: 1px solid var(--btn-border);
  font-size: .94rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -12px rgba(28, 22, 40, .5); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--ghost {
  --btn-bg: transparent;
  --btn-ink: var(--c-ink);
  --btn-border: var(--c-line);
}
.btn--ghost:hover { background: var(--c-surface); border-color: var(--c-ink); }

.btn--soft {
  --btn-bg: var(--c-primary-soft);
  --btn-ink: var(--c-primary);
}
.btn--dark {
  --btn-bg: var(--c-ink);
  --btn-ink: #fff;
}
.btn--white {
  --btn-bg: #fff;
  --btn-ink: var(--c-ink);
}
.btn--sm { padding: 10px 18px; font-size: .84rem; }
.btn--lg { padding: 17px 30px; font-size: 1rem; }
.btn--block { width: 100%; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--c-ink);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), gap var(--dur) var(--ease);
}
.link-arrow:hover { border-color: currentColor; gap: 12px; }
.link-arrow svg { width: 16px; height: 16px; }

/* ---------- 6. Chips / badges / rating ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  font-size: .84rem;
  font-weight: 500;
  color: var(--c-ink);
  transition: all var(--dur) var(--ease);
}
.chip:hover, .chip[aria-selected="true"], .chip.is-active {
  border-color: var(--c-ink);
  background: var(--c-ink);
  color: #fff;
}
.chip--soft { background: var(--c-primary-soft); border-color: transparent; color: var(--c-primary); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.badge--accent { background: var(--c-accent); color: #38260e; }
.badge--ink { background: var(--c-ink); color: #fff; }
.badge--sale { background: #ffe9e3; color: #c4462b; }

.rating { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--c-muted); }
.rating svg { width: 14px; height: 14px; fill: #f5b544; }

/* ---------- 7. Media & cards ---------- */
.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--c-soft);
  aspect-ratio: var(--ratio, 4 / 5);
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease);
}
.media--wide { --ratio: 16 / 10; }
.media--square { --ratio: 1; }
.media--tall { --ratio: 3 / 4; }
a:hover > .media img, .card:hover .media img, .media:hover img { transform: scale(1.045); }

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }

.price { font-weight: 700; letter-spacing: -.02em; }
.price del { font-weight: 500; color: var(--c-muted); opacity: .75; font-size: .84em; margin-left: 8px; }

.hairline { height: 1px; background: var(--c-line); border: 0; }

/* ---------- 8. Forms ---------- */
.field { display: grid; gap: 8px; }
.field > label { font-size: .82rem; font-weight: 600; color: var(--c-ink); }
.input, .select, .textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  font-size: .92rem;
  color: var(--c-ink);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--c-muted); opacity: .8; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px var(--c-primary-soft);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236f6b78' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 42px;
}

/* ---------- 9. Utilities ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 999;
  padding: 12px 20px;
  background: var(--c-ink);
  color: #fff;
  border-radius: var(--r-sm);
  transform: translateY(-160%);
  transition: transform .25s var(--ease);
}
.skip-link:focus { transform: translateY(0); }
.gap-0 { gap: 0; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.text-center { text-align: center; }

/* ---------- 10. Reveal on scroll ---------- */
/* Chỉ ẩn khi JS đã chạy (class .js trên <html>) → không JS vẫn đọc được nội dung */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  will-change: opacity, transform;
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- 11. Header / drawer dùng chung ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--c-bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  transition: box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--c-line), 0 12px 28px -24px rgba(20, 16, 30, .5); }

.nav-list { display: flex; align-items: center; gap: 26px; }
.nav-list a {
  position: relative;
  font-size: .9rem;
  font-weight: 500;
  color: var(--c-ink);
  padding-block: 6px;
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav-list a:hover::after, .nav-list a[aria-current="page"]::after { transform: scaleX(1); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: var(--r-pill);
  color: var(--c-ink);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--c-soft); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; }

.cart-btn { position: relative; }
.cart-btn .count {
  display: none;
  position: absolute;
  top: -2px; right: -2px;
  min-width: 18px; height: 18px;
  place-items: center;
  padding-inline: 4px;
  border-radius: var(--r-pill);
  background: var(--c-primary);
  color: var(--c-on-primary);
  font-size: .64rem;
  font-weight: 700;
  line-height: 1;
}
.cart-btn.has-items .count { display: grid; }

.nav-toggle { display: none; }

.mobile-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(360px, 86vw);
  background: var(--c-surface);
  z-index: 90;
  transform: translateX(102%);
  transition: transform .4s var(--ease);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  box-shadow: -20px 0 60px rgba(20, 16, 30, .12);
}
.mobile-drawer.is-open { transform: none; }
.mobile-drawer nav a {
  display: flex;
  justify-content: space-between;
  padding: 14px 4px;
  border-bottom: 1px solid var(--c-line);
  font-size: 1rem;
  font-weight: 500;
}
.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(24, 20, 32, .4);
  backdrop-filter: blur(3px);
  z-index: 85;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease);
}
.drawer-scrim.is-open { opacity: 1; pointer-events: auto; }

@media (max-width: 1200px) {
  .nav-list { display: none; }
  .nav-toggle { display: inline-grid; }
}

/* ---------- 12. Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  translate: -50% 140%;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: var(--r-pill);
  background: var(--c-ink);
  color: #fff;
  font-size: .86rem;
  font-weight: 500;
  box-shadow: 0 20px 40px -18px rgba(20, 16, 30, .7);
  transition: translate .45s var(--ease);
}
.toast.is-visible { translate: -50% 0; }
.toast svg { width: 18px; height: 18px; }

/* ---------- 13. Print ---------- */
@media print {
  .site-header, .toast, .mobile-drawer, .drawer-scrim, .floating-contact { display: none !important; }
}
