/* Phòng thử đồ · Mặc Thử. Light, tĩnh, không phụ thuộc framework. */
/* Tự sinh bởi scripts/get-fonts.mjs: font tự host, subset vietnamese + latin */
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:400;font-display:swap;src:url(/assets/fonts/bevietnampro-400-normal-vietnamese.woff2) format('woff2');unicode-range:U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:400;font-display:swap;src:url(/assets/fonts/bevietnampro-400-normal-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:500;font-display:swap;src:url(/assets/fonts/bevietnampro-500-normal-vietnamese.woff2) format('woff2');unicode-range:U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:500;font-display:swap;src:url(/assets/fonts/bevietnampro-500-normal-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:600;font-display:swap;src:url(/assets/fonts/bevietnampro-600-normal-vietnamese.woff2) format('woff2');unicode-range:U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB}
@font-face{font-family:'Be Vietnam Pro';font-style:normal;font-weight:600;font-display:swap;src:url(/assets/fonts/bevietnampro-600-normal-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Bricolage Grotesque';font-style:normal;font-weight:500 700;font-stretch:100%;font-display:swap;src:url(/assets/fonts/bricolagegrotesque-500-700-normal-vietnamese.woff2) format('woff2');unicode-range:U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB}
@font-face{font-family:'Bricolage Grotesque';font-style:normal;font-weight:500 700;font-stretch:100%;font-display:swap;src:url(/assets/fonts/bricolagegrotesque-500-700-normal-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}

:root {
  --bg: #eceeed;
  --paper: #f7f8f7;
  --ink: #15181b;
  --muted: #5f656a;
  --line: #d3d8d7;
  --accent: #2a45e0;
  --tint: #7ba6d4;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --display: 'Bricolage Grotesque', 'Be Vietnam Pro', system-ui, sans-serif;
  --text: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pad: clamp(18px, 3vw, 40px);
  --topbar: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
::selection { background: color-mix(in srgb, var(--accent) 24%, #fff); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
:focus:not(:focus-visible) { outline: none; }

/* ---------- Thanh trên ---------- */
.top {
  height: var(--topbar); padding: 0 var(--pad);
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; min-height: 44px; font: 600 22px/1 var(--display); letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .5);
  font-size: 13.5px; font-weight: 500; transition: background .2s, border-color .2s;
}
.cart-btn:hover { background: #fff; border-color: #b9c0bf; }
.cart-btn b {
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: #fff;
  display: inline-grid; place-items: center; font: 600 12px/1 var(--text); font-variant-numeric: tabular-nums;
}
.cart-btn.is-bump b { animation: bump .5s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------- Sân khấu ---------- */
.room { padding: 0 var(--pad) 14px; }
.stage {
  --fig-h: clamp(380px, calc(100svh - 238px), 860px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 520px) minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: clamp(12px, 2.4vw, 40px);
  max-width: 1600px; margin: 0 auto;
}
.col { display: flex; flex-direction: column; min-height: 0; grid-row: 1; }
.col--jacket { grid-column: 1; }
.col--pants { grid-column: 3; }
.figure-col { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: center; }

.col-head { min-height: 150px; padding-top: 14px; }
.title { font: 600 clamp(26px, 2.5vw, 38px)/1.05 var(--display); letter-spacing: -.025em; text-wrap: balance; }
.lede { margin-top: 10px; max-width: 30ch; font-size: 14px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }

.reel-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.reel-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; font-weight: 500; color: var(--muted); padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.reel-count { font-variant-numeric: tabular-nums; }

/* ---------- Cuộn ảnh (reel) ---------- */
.reel {
  --cw: clamp(104px, 11.5vw, 170px);
  --ratio: 1;
  --h: calc(var(--cw) * var(--ratio));
  --step: calc(var(--h) * .94 + 40px);
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
}
.reel[data-kind="pants"] { --ratio: 1.22; }
.reel.is-dragging { cursor: grabbing; }
.item {
  position: absolute; left: 50%; top: 50%; width: var(--cw);
  transform: translate(-50%, calc(-50% + var(--d, 0) * var(--step) + var(--sd, 0) * 30px)) scale(calc(1 - var(--ad, 0) * .16));
  opacity: calc(1 - var(--ad, 0) * .42);
  transition: transform .62s var(--ease), opacity .4s var(--ease);
  text-align: center; border-radius: 26px;
}
.item.jump { transition: none; }
.item[data-ad="2"] { pointer-events: none; opacity: 0; }
.item-art {
  position: relative; display: block; height: var(--h); padding: 12px;
  border-radius: 26px; background: var(--paper);
  box-shadow: 0 0 0 1px rgba(21, 24, 27, .05), 0 22px 36px -24px rgba(21, 24, 27, .4);
  transition: box-shadow .3s, background .3s;
}
.item-art svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 10px 10px rgba(10, 14, 18, .16)); }
.item:hover .item-art { background: #fff; }
.item.is-active .item-art { background: #fff; box-shadow: 0 0 0 1.5px var(--accent), 0 26px 40px -24px rgba(21, 24, 27, .45); }
.item-tag {
  position: absolute; z-index: 2; left: 50%; top: -11px; padding: 3px 10px; white-space: nowrap; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; line-height: 1.5;
  opacity: 0; transform: translate(-50%, 4px); transition: opacity .3s, transform .4s var(--ease);
}
.item.is-active .item-tag { opacity: 1; transform: translate(-50%, 0); }
.item-meta {
  position: absolute; left: -24px; right: -24px; top: calc(100% + 10px);
  opacity: 0; transition: opacity .3s;
}
.item.is-active .item-meta { opacity: 1; }
.item-name { display: block; font-size: 13.5px; font-weight: 500; line-height: 1.3; text-wrap: balance; }
.item-price { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Người mẫu ---------- */
.figure {
  position: relative; height: var(--fig-h); aspect-ratio: 400 / 880; max-width: 100%;
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none;
}
.figure.is-dragging { cursor: grabbing; }
.halo {
  position: absolute; left: 50%; top: 44%; width: 150%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--tint) 26%, #f9faf9) 0, color-mix(in oklab, var(--tint) 12%, #f4f5f4) 62%, transparent 100%);
  transition: background .8s var(--ease);
}
.figure-art { position: relative; width: 100%; height: 100%; }
.model { position: relative; display: block; width: 100%; height: 100%; overflow: visible; }
.gar {
  opacity: 0; visibility: hidden; transform: translateY(var(--from, -26px));
  transition: opacity .34s ease, transform .6s var(--ease), visibility 0s .6s;
}
.gar.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.zone { position: absolute; left: 0; right: 0; }
.zone--top { top: 0; height: 47%; }
.zone--bottom { top: 47%; bottom: 0; }
.zone-tag {
  position: absolute; left: -6px; top: 18%; padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 500; line-height: 1.3;
  opacity: 0; transform: translateX(-6px); transition: opacity .25s, transform .4s var(--ease); pointer-events: none;
}
.zone--bottom .zone-tag { top: 30%; }
.figure[data-zone="jacket"] .zone--top .zone-tag,
.figure[data-zone="pants"] .zone--bottom .zone-tag,
.figure.is-hint .zone .zone-tag { opacity: 1; transform: none; }
.zone::after {
  content: ''; position: absolute; left: 6%; right: 6%; bottom: 0; border-bottom: 1px dashed rgba(21, 24, 27, .22);
  opacity: 0; transition: opacity .25s;
}
.zone--bottom::after { display: none; }
.figure[data-zone="jacket"] .zone--top::after, .figure[data-zone="pants"] .zone--top::after { opacity: 1; }

.swipe-hint { display: none; max-width: 32ch; margin-top: 10px; text-align: center; font-size: 12.5px; color: var(--muted); }

.look-names { width: 100%; margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.look-piece { padding: 6px 8px; border-radius: 12px; text-align: center; transition: background .2s; }
.look-piece:hover { background: rgba(255, 255, 255, .6); }
.look-k { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.look-n { display: block; font-size: 13.5px; font-weight: 500; line-height: 1.3; text-wrap: balance; transition: opacity .25s; }

.look-buy {
  grid-column: 2; grid-row: 2; width: 100%; margin-top: 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.look-price { display: flex; flex-direction: column; line-height: 1.2; }
.look-price small { font-size: 11.5px; color: var(--muted); }
.look-total { font: 600 19px/1.2 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.look-actions { display: flex; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px;
  border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background .2s, transform .25s var(--ease), box-shadow .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn--solid { background: var(--ink); color: #fff; }
.btn--solid:hover { background: #000; }
.btn--ghost { border: 1px solid #b9c0bf; background: rgba(255, 255, 255, .5); }
.btn--ghost:hover { background: #fff; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn--icon { width: 46px; padding: 0; }
.shuffle-label { display: none; }

.foot-note { text-align: center; margin: 14px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- Ngăn chi tiết / giỏ ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(21, 24, 27, .36); opacity: 0; transition: opacity .3s; }
.scrim.is-open { opacity: 1; }
.sheet {
  position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  background: #fff; color: var(--ink); box-shadow: -30px 0 60px -30px rgba(21, 24, 27, .35);
  transform: translateX(100%); transition: transform .5s var(--ease); display: flex; flex-direction: column;
  overscroll-behavior: contain;
}
.sheet.is-open { transform: none; }
.sheet-inner { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 14px; font-size: 13px; color: var(--muted); border-bottom: 1px solid #eceeed; }
.sheet-x { width: 40px; height: 40px; margin: -8px -10px -8px 0; border-radius: 50%; display: grid; place-items: center; }
.sheet-x:hover { background: #eceeed; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 8px; scrollbar-width: thin; scrollbar-color: #c9cfce transparent; }
.sheet-art { display: grid; place-items: center; height: min(36svh, 300px); border-radius: 22px; background: radial-gradient(closest-side, #fbfbfa, #f0f2f1); }
.sheet-art svg { height: 86%; width: auto; max-width: 86%; filter: drop-shadow(0 14px 14px rgba(10, 14, 18, .18)); }
.sheet-name { margin-top: 20px; font: 600 28px/1.1 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.sheet-price { margin-top: 6px; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sheet-short { margin-top: 10px; color: var(--muted); font-size: 14.5px; text-wrap: pretty; }
.sizes-label { margin-top: 20px; font-size: 13px; color: var(--muted); }
.sizes-label b { color: var(--ink); font-weight: 600; }
.sizes { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.size {
  min-width: 52px; height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid #c9cfce;
  font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; transition: background .2s, color .2s, border-color .2s;
}
.size:hover { border-color: var(--ink); }
.size[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs { margin-top: 24px; display: flex; gap: 20px; border-bottom: 1px solid #e3e6e5; }
.tab { position: relative; padding: 8px 0 10px; font-size: 14px; font-weight: 500; color: var(--muted); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); }
.tabpanel { padding: 14px 0 18px; font-size: 14px; }
.spec { margin: 0; display: grid; grid-template-columns: 92px 1fr; row-gap: 10px; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; }
.sheet-foot { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; padding: 14px 22px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid #eceeed; background: #fff; }

/* giỏ hàng */
.cart-list { list-style: none; margin: 0; padding: 0; }
.cart-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid #eceeed; }
.cart-thumb { height: 84px; border-radius: 14px; background: #f2f3f2; display: grid; place-items: center; padding: 6px; }
.cart-thumb svg { width: 100%; height: 100%; }
.cart-name { font-weight: 500; font-size: 14px; line-height: 1.3; }
.cart-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.cart-rm { font-size: 12.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }
.cart-rm:hover { color: var(--ink); }
.cart-price { font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
.cart-empty { padding: 36px 0; color: var(--muted); text-align: center; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 6px; font-weight: 600; }
.cart-total span:last-child { font: 600 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.cart-note { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 500;
  transition: opacity .3s, transform .5s var(--ease); max-width: calc(100vw - 32px); text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Màn hình nhỏ: người mẫu trên cùng, hai băng chuyền ngang bên dưới ---------- */
@media (max-width: 900px) {
  :root { --topbar: 56px; }
  .stage { display: flex; flex-direction: column; --fig-h: min(56svh, 540px); }
  .col { display: contents; }
  .col-head { order: 0; min-height: 0; padding: 4px 0 6px; }
  .col--pants .col-head { display: none; }
  .title { font-size: 28px; }
  .lede { max-width: 42ch; margin-top: 6px; }
  .figure-col { order: 1; }
  .col--jacket .reel-wrap { order: 2; }
  .col--pants .reel-wrap { order: 3; }
  .look-buy { order: 4; }
  .figure { cursor: default; }
  .zone-tag { display: none; }
  .swipe-hint { display: block; }
  .reel-wrap { flex: none; margin-top: 18px; }
  .reel-head { border: 0; padding-bottom: 8px; font-size: 14px; color: var(--ink); font-weight: 600; }
  .reel {
    flex: none; display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity;
    margin: 0 calc(var(--pad) * -1); padding: 16px var(--pad) 14px; scrollbar-width: none;
    touch-action: pan-x pan-y; cursor: default; -webkit-mask-image: none; mask-image: none;
  }
  .reel::-webkit-scrollbar { display: none; }
  .item {
    position: relative; left: auto; top: auto; flex: 0 0 140px; width: 140px; transform: none; opacity: 1; scroll-snap-align: center;
    text-align: left; transition: none;
  }
  .item[data-ad="2"] { pointer-events: auto; opacity: 1; }
  .item-art { height: 156px; }
  .item-meta { position: static; opacity: 1; margin-top: 10px; }
  .item-tag { opacity: 0; }
  .look-names { margin-top: 8px; }
  .look-buy {
    position: sticky; bottom: 0; z-index: 20; margin: 12px calc(var(--pad) * -1) 0; width: auto;
    padding: 10px var(--pad) calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 96%, #fff);
    border-top: 1px solid var(--line);
  }
  .foot-note { margin-top: 18px; }
  .sheet { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92svh; border-radius: 22px 22px 0 0; transform: translateY(100%); box-shadow: 0 -20px 50px -20px rgba(21, 24, 27, .4); }
  .sheet.is-open { transform: none; }
  .sheet-art { height: min(30svh, 240px); }
  .toast { bottom: 84px; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .stage { grid-template-columns: minmax(0, 1fr) minmax(280px, 400px) minmax(0, 1fr); }
  .lede { max-width: 24ch; font-size: 13.5px; }
  .title { font-size: 26px; }
  .look-total { font-size: 17px; }
  .btn { padding: 0 16px; }
}
@media (min-width: 901px) and (max-height: 700px) {
  .stage { --fig-h: clamp(330px, calc(100svh - 228px), 840px); }
  .col-head { min-height: 128px; }
}
@media (max-width: 380px) {
  .look-total { font-size: 17px; }
  .btn { padding: 0 16px; }
}
@media (hover: none) {
  .zone-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation-duration: .01ms !important; }
}
