/* ==========================================================================
   BÓNG BÀN VIỆT — Design system 2026
   Table blue + white court line + rubber red. Archivo (expanded) + Be Vietnam Pro.
   ========================================================================== */

:root {
  --table: #1D5FA8;      /* mặt bàn */
  --table-2: #2A72C2;
  --deep: #0E2A4F;       /* navy sâu, section tối */
  --ink: #142033;        /* chữ chính */
  --mute: #5B6779;       /* chữ phụ */
  --paper: #EEF2F7;      /* nền sáng lạnh */
  --white: #FFFFFF;
  --rubber: #D62B2B;     /* đỏ mặt vợt — CTA, giá */
  --rubber-d: #B21F1F;
  --rule: #D5DCE6;
  --imgbg: #F1F4F8;      /* nền chung của mọi ảnh sản phẩm: ảnh nền trắng hoà vào bằng multiply */
  --rule-dark: rgba(255,255,255,.18);

  --f-display: 'Archivo', 'Be Vietnam Pro', system-ui, sans-serif;
  --f-body: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --step--1: clamp(.82rem, .8rem + .1vw, .88rem);
  --step-0: clamp(1rem, .96rem + .2vw, 1.0625rem);
  --step-1: clamp(1.2rem, 1.1rem + .45vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3.1rem);
  --step-4: clamp(2.6rem, 1.8rem + 4vw, 5.2rem);
  --step-5: clamp(3.2rem, 1.6rem + 7.5vw, 9rem);

  --gutter: clamp(1.1rem, 4vw, 3.5rem);
  --maxw: 1360px;
  --header-h: 72px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--rubber); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--table); color: #fff; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 999; background: var(--ink); color: #fff; padding: 10px 16px; transition: top .2s; }
.skip-link:focus { top: 12px; }

/* ---------- Typography ---------- */
.display, h1, h2, h3 {
  font-family: var(--f-display);
  font-stretch: 125%;
  font-variation-settings: 'wdth' 125;
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.02em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.15; letter-spacing: -.005em; }
p { margin: 0 0 1em; max-width: 68ch; }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--mute); max-width: 52ch; }
.kicker { font-size: var(--step--1); font-weight: 600; color: var(--table); margin-bottom: .9rem; display: block; }
.on-dark .kicker { color: #9CC4F2; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--ink); --fg: #fff;
  display: inline-flex; align-items: center; gap: .6em;
  padding: .95em 1.5em;
  background: var(--bg); color: var(--fg);
  border: 0; border-radius: 999px;
  font-weight: 700; font-size: .98rem; line-height: 1;
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform .5s var(--ease-out), background-color .3s;
  will-change: transform;
}
.btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: rgba(255,255,255,.16);
  transform: translateY(101%); transition: transform .45s var(--ease-out);
}
.btn:hover::after { transform: translateY(0); }
.btn:active { transform: scale(.97); }
.btn--red { --bg: var(--rubber); }
.btn--red:hover { --bg: var(--rubber-d); }
.btn--white { --bg: #fff; --fg: var(--ink); }
.btn--white::after { background: rgba(14,42,79,.08); }
.btn--ghost { --bg: transparent; --fg: currentColor; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

.link-line { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .45s var(--ease-out); padding-bottom: 2px; }
.link-line:hover { background-size: 100% 1.5px; }

/* ---------- Header ---------- */
.bbv-header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: var(--header-h);
  color: var(--ink);
  transition: transform .5s var(--ease-out), background-color .35s, color .35s, box-shadow .35s;
}
.bbv-header.is-overlay:not(.is-scrolled) { color: #fff; }
.bbv-header.is-scrolled { background: rgba(238,242,247,.86); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 1px 0 var(--rule); }
.bbv-header.is-hidden { transform: translateY(-100%); }
.bbv-header__in { height: 100%; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .7rem; flex: none; }
.brand img { width: 42px; height: 42px; border-radius: 50%; background: #fff; }
.brand b { font-family: var(--f-display); font-variation-settings: 'wdth' 125; font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; line-height: 1; }
.brand small { display: block; font-size: .7rem; font-weight: 500; opacity: .7; margin-top: 3px; }
.nav { display: flex; gap: .2rem; margin-left: auto; }
.nav a { padding: .5rem .75rem; font-size: .93rem; font-weight: 600; border-radius: 999px; position: relative; transition: background-color .25s; }
.nav a:hover { background: rgba(127,140,160,.14); }
.nav a[aria-current="page"]::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--rubber); transform: translateX(-50%); }
.header-actions { display: flex; align-items: center; gap: .4rem; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: transparent; border: 0; transition: background-color .25s; }
.icon-btn:hover { background: rgba(127,140,160,.16); }
.icon-btn svg { width: 21px; height: 21px; }
.header-zalo { padding: .7em 1.2em; font-size: .9rem; }
.menu-btn { display: none; }

@media (max-width: 1080px) {
  .nav, .header-zalo { display: none; }
  .menu-btn { display: grid; }
  .header-actions { margin-left: auto; }
}

/* Mobile menu */
.mnav { position: fixed; inset: 0; z-index: 150; background: var(--deep); color: #fff; display: flex; flex-direction: column; padding: calc(var(--header-h) + 1rem) var(--gutter) 2rem; clip-path: circle(0 at calc(100% - 44px) 36px); visibility: hidden; transition: clip-path .7s var(--ease-io), visibility 0s .7s; }
.mnav.is-open { clip-path: circle(150% at calc(100% - 44px) 36px); visibility: visible; transition: clip-path .8s var(--ease-io); }
.mnav a.mnav__link { font-family: var(--f-display); font-variation-settings: 'wdth' 125; font-weight: 800; font-size: clamp(1.9rem, 8vw, 3rem); line-height: 1.15; display: block; padding: .15em 0; border-bottom: 1px solid var(--rule-dark); opacity: 0; transform: translateY(24px); transition: opacity .4s, transform .6s var(--ease-out); }
.mnav.is-open a.mnav__link { opacity: 1; transform: none; }
.mnav__foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: .8rem; padding-top: 1.5rem; }
.mnav__close { position: absolute; top: 15px; right: var(--gutter); color: #fff; }

/* Search overlay */
.search { position: fixed; inset: 0; z-index: 160; background: rgba(14,42,79,.55); backdrop-filter: blur(6px); display: none; }
.search.is-open { display: block; }
.search__panel { background: var(--paper); padding: 1.2rem var(--gutter) 2rem; max-height: 86vh; overflow: auto; transform-origin: top; }
.search__row { display: flex; gap: .8rem; align-items: center; max-width: var(--maxw); margin: 0 auto; }
.search input { flex: 1; font: inherit; font-size: var(--step-2); font-family: var(--f-display); font-variation-settings: 'wdth' 110; font-weight: 700; border: 0; border-bottom: 2px solid var(--ink); background: transparent; padding: .4em 0; outline: none; color: var(--ink); }
.search input::placeholder { color: #9AA6B6; }
.search__results { max-width: var(--maxw); margin: 1.2rem auto 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .6rem; }
.search__hit { display: flex; gap: .8rem; align-items: center; padding: .6rem; border-radius: 10px; background: #fff; transition: transform .3s var(--ease-out); }
.search__hit:hover { transform: translateX(4px); }
.search__hit img { width: 56px; height: 56px; object-fit: contain; background: var(--paper); border-radius: 8px; }
.search__hit b { font-size: .92rem; line-height: 1.3; display: block; }
.search__hit span { font-size: .82rem; color: var(--rubber); font-weight: 700; }
.search__empty { color: var(--mute); padding: 1rem 0; }

/* ---------- Product card ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 238px), 1fr)); gap: clamp(.8rem, 1.6vw, 1.4rem); }
.pcard { position: relative; display: flex; flex-direction: column; background: #fff; border-radius: 14px; overflow: hidden; transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out); }
.pcard:hover { transform: translateY(-6px); box-shadow: 0 22px 40px -24px rgba(14,42,79,.45); }
.pcard__media { position: relative; aspect-ratio: 1; background: var(--imgbg); overflow: hidden; isolation: isolate; }
.pcard__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 5%; mix-blend-mode: multiply; transition: transform .9s var(--ease-out), opacity .5s; }
.pcard__media img.alt { opacity: 0; }
.pcard:hover .pcard__media img { transform: scale(1.07) rotate(-1.5deg); }
.pcard:hover .pcard__media img.alt { opacity: 1; }
.pcard:hover .pcard__media img.alt ~ img.main, .pcard:hover .pcard__media.has-alt img.main { opacity: 0; }
.pcard__badge { position: absolute; left: 12px; top: 12px; z-index: 2; background: var(--rubber); color: #fff; font-size: .72rem; font-weight: 700; padding: .3em .7em; border-radius: 999px; }
.pcard__brand { position: absolute; right: 12px; top: 12px; z-index: 2; font-family: var(--f-display); font-variation-settings: 'wdth' 125; font-size: .7rem; font-weight: 800; color: var(--table); background: rgba(255,255,255,.85); padding: .32em .7em; border-radius: 999px; }
.pcard__body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.pcard__name { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.pcard__meta { font-size: .82rem; color: var(--mute); }
.pcard__price { margin-top: auto; padding-top: .45rem; font-family: var(--f-display); font-variation-settings: 'wdth' 112; font-weight: 800; font-size: 1.12rem; color: var(--rubber); }
.pcard__price.is-contact { color: var(--table); font-size: .95rem; }
.pcard__meters { display: grid; gap: 4px; margin-top: .3rem; }
.meter { display: grid; grid-template-columns: 5.6em 1fr 2em; align-items: center; gap: .5em; font-size: .72rem; white-space: nowrap; color: var(--mute); }
.meter i { display: block; height: 4px; border-radius: 4px; background: #E3E8EF; overflow: hidden; position: relative; }
.meter i::before { content: ''; position: absolute; inset: 0; width: var(--v, 0%); background: var(--table); border-radius: inherit; transform-origin: left; transform: scaleX(0); transition: transform 1.1s var(--ease-out) .1s; }
.is-in .meter i::before, .meter.is-in i::before { transform: scaleX(1); }
.meter b { font-weight: 700; color: var(--ink); text-align: right; }

.skeleton { background: linear-gradient(90deg, #E3E8EF 0, #F2F5F9 40%, #E3E8EF 80%) 0 0 / 300% 100%; animation: sk 1.4s linear infinite; border-radius: 14px; aspect-ratio: .78; }
@keyframes sk { to { background-position: -300% 0; } }

/* ---------- Footer ---------- */
.bbv-footer { background: var(--deep); color: #DCE6F3; padding: clamp(3.5rem, 8vw, 6rem) 0 2rem; position: relative; overflow: hidden; }
.bbv-footer::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.07); }
.foot-cta { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: end; padding-bottom: 3rem; border-bottom: 1px solid var(--rule-dark); position: relative; }
.foot-cta h2 { color: #fff; font-size: var(--step-4); }
.foot-cta__act { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: flex-end; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; padding-top: 2.6rem; position: relative; }
.foot-grid h3 { font-size: .95rem; color: #fff; margin-bottom: .9rem; font-variation-settings: 'wdth' 110; }
.foot-grid a { display: block; padding: .22rem 0; color: #B9C8DB; font-size: .93rem; transition: color .2s, transform .3s var(--ease-out); }
.foot-grid a:hover { color: #fff; transform: translateX(3px); }
.foot-grid p { color: #B9C8DB; font-size: .93rem; }
.foot-bottom { margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid var(--rule-dark); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: .82rem; color: #8FA3BD; position: relative; }
.foot-word { font-family: var(--f-display); font-variation-settings: 'wdth' 125; font-weight: 900; font-size: clamp(2.4rem, 8.6vw, 9.6rem); line-height: .8; letter-spacing: -.04em; color: rgba(255,255,255,.05); white-space: nowrap; margin-top: 2.5rem; user-select: none; position: relative; overflow: hidden; }
@media (max-width: 860px) {
  .foot-cta { grid-template-columns: 1fr; }
  .foot-cta__act { justify-content: flex-start; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

/* Floating Zalo */
.fab-zalo { position: fixed; right: 18px; bottom: 18px; z-index: 90; width: 58px; height: 58px; border-radius: 50%; background: #0068FF; color: #fff; display: grid; place-items: center; box-shadow: 0 10px 28px -8px rgba(0,104,255,.7); font-weight: 800; font-size: .8rem; transition: transform .4s var(--ease-out); }
.fab-zalo:hover { transform: scale(1.08); }
.fab-zalo::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #0068FF; animation: ping 2.4s var(--ease-out) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .8; } 80%, 100% { transform: scale(1.7); opacity: 0; } }

/* Scroll progress */
.progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 120; background: var(--rubber); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }

/* ---------- Page hero (inner pages) ---------- */
.phero { position: relative; color: #fff; background: var(--deep); padding: calc(var(--header-h) + clamp(3rem, 8vw, 6rem)) 0 clamp(2.5rem, 6vw, 4.5rem); overflow: hidden; isolation: isolate; }
.phero__bg { position: absolute; inset: -10% 0 0; z-index: -2; background-size: cover; background-position: center; }
.phero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(14,42,79,.45), rgba(14,42,79,.85)); }
.phero h1 { font-size: var(--step-5); }
.phero .lede { color: #CFDDF0; margin-top: 1.2rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .85rem; color: #B9CDE6; margin-bottom: 1.4rem; }
.crumbs a:hover { color: #fff; }
.crumbs span[aria-hidden] { opacity: .5; }

/* ---------- Reveal primitives (JS adds .is-in) ---------- */
html.js [data-reveal] { opacity: 0; transform: translateY(28px); }
html.js [data-reveal="clip"] { opacity: 1; transform: none; clip-path: inset(100% 0 0 0); }
html.js [data-reveal].is-in { opacity: 1; transform: none; clip-path: inset(0 0 0 0); transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out), clip-path 1.2s var(--ease-io); transition-delay: var(--d, 0s); }
.split-line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }

/* ---------- View transitions (cross-document) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .45s var(--ease-io) both; }
::view-transition-new(root) { animation: vt-in .6s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-2%) scale(.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(3%); } }
::view-transition-group(prod-img) { animation-duration: .7s; animation-timing-function: var(--ease-out); }
::view-transition-group(bbv-header) { animation: none; }
.bbv-header { view-transition-name: bbv-header; }

/* ---------- Commerce hidden (checkout tắt) ---------- */
html.no-checkout .bbv-cart-trigger,
html.no-checkout .bbv-commerce-overlay,
html.no-checkout [data-commerce] { display: none !important; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  html.js [data-reveal] { opacity: 1; transform: none; clip-path: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Logo Đã thông báo Bộ Công Thương (footer) */
.bct { display: inline-block; margin-top: 1.1rem; background: #fff; border-radius: 12px; padding: 6px 10px; line-height: 0; transition: transform .3s var(--ease-out); }
.bct:hover { transform: translateY(-2px); }
.bct img { width: 150px; height: auto; }
