@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/cormorant-garamond-500-italic-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: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/cormorant-garamond-500-italic-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: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/cormorant-garamond-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: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/cormorant-garamond-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: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/cormorant-garamond-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: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/cormorant-garamond-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: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/be-vietnam-pro-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/be-vietnam-pro-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/be-vietnam-pro-600.woff2') format('woff2');
}

:root {
  --linen: #f3ede4;
  --paper: #fbf8f3;
  --oat: #e8ddcb;
  --ink: #2e2420;
  --ink-2: #6b5b51;
  --line: #ddd2c3;
  --line-2: #c2b19b;
  --clay: #a4553a;
  --clay-d: #8a4530;
  --clay-a10: rgb(164 85 58 / 10%);
  --clay-a16: rgb(164 85 58 / 16%);
  --clay-a30: rgb(164 85 58 / 30%);
  --brass: #b58a4c;
  --brass-a14: rgb(181 138 76 / 14%);
  --err: #a33a2b;
  --err-soft: #fbefec;
  --white: #fff;
  --dark: #2e2420;
  --dark-2: #4a3a31;
  --dark-text: #d9cbbd;
  --dark-mute: #c9b8a7;
  --dark-price: #f0c9a8;
  --scrim: rgb(243 237 228 / 92%);
  --card-glass: rgb(251 248 243 / 94%);
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 72px;
  --r: 14px;
  --r-pill: 999px;
  --rail: 76px;
  --gutter: 44px;
  --sh: 0 14px 34px -18px rgb(70 42 28 / 38%);
  --sh-h: 0 22px 44px -20px rgb(70 42 28 / 46%);
  --ease: cubic-bezier(0.22, 0.8, 0.3, 1);
  --dur-1: 0.18s;
  --dur-2: 0.3s;
  --dur-3: 0.7s;
  --stagger: 70ms;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  max-width: 100%;
  padding-left: var(--rail);
  overflow-x: hidden;
  background: var(--linen);
  color: var(--ink);
  font: 400 15px / 1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
  transition: outline-offset var(--dur-1) var(--ease);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.eyebrow {
  color: var(--clay);
  font: 600 12px / 1.4 var(--font);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap > * {
  min-width: 0;
}

/* ---------- Thanh dọc (máy tính) / thanh đáy (điện thoại) ---------- */

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: var(--rail);
  padding: 26px 0;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.brand {
  font: 600 22px / 1 var(--serif);
  letter-spacing: 0.14em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  transition: color var(--dur-2) var(--ease);
}

.brand i {
  color: var(--clay);
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.rail-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rail-nav a {
  position: relative;
  display: block;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--ink-2);
  border-radius: 50%;
  transition:
    border-color var(--dur-2) var(--ease),
    background var(--dur-2) var(--ease),
    transform var(--dur-2) var(--ease);
}

.rail-nav a:active {
  transform: scale(0.85);
}

.rail-nav a[aria-current] {
  border-color: var(--clay);
  background: var(--clay);
}

.rail-tip {
  position: absolute;
  top: 50%;
  left: 26px;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-6px, -50%);
  transition:
    opacity var(--dur-1) var(--ease),
    transform var(--dur-1) var(--ease);
}

.rail-nav a:focus-visible .rail-tip {
  opacity: 1;
  transform: translate(0, -50%);
}

.rail-ring {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--clay);
  border-radius: 50%;
  opacity: 0.55;
  pointer-events: none;
  transform: translateY(calc(var(--i, 0) * 32px));
  transition: transform var(--dur-3) var(--ease);
}

.rail-prog {
  position: relative;
  width: 2px;
  height: 70px;
  border-radius: 2px;
  background: var(--line);
}

.rail-prog b {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: var(--clay);
  transform: scaleY(var(--p, 0));
  transform-origin: top;
}

/* ---------- Nút ---------- */

.btn {
  position: relative;
  display: inline-block;
  padding: 13px 26px;
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  transition:
    background var(--dur-2) var(--ease),
    color var(--dur-2) var(--ease),
    border-color var(--dur-2) var(--ease),
    transform var(--dur-1) var(--ease),
    box-shadow var(--dur-2) var(--ease);
}

.btn.primary {
  background: var(--clay);
  color: var(--white);
  box-shadow: 0 10px 22px -12px var(--clay);
}

.btn.ghost {
  border-color: var(--ink);
}

.btn.small {
  padding: 8px 16px;
  font-size: 13px;
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow: none;
}

.btn:disabled {
  background: var(--line);
  border-color: var(--line);
  color: var(--ink-2);
  box-shadow: none;
  cursor: not-allowed;
}

@media (hover: hover) {
  .btn.primary:hover {
    background: var(--clay-d);
    transform: translateY(-2px);
  }

  .btn.ghost:hover {
    background: var(--ink);
    color: var(--paper);
  }
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  min-height: 660px;
  padding: 64px 0 72px;
}

.hero > * {
  min-width: 0;
}

.hero h1 {
  margin: 18px 0 22px;
  font-size: clamp(46px, 6vw, 84px);
}

.ln {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
}

.ln > span {
  display: block;
  animation: line-up 0.9s var(--ease) backwards;
}

.ln:nth-child(2) > span {
  animation-delay: 0.1s;
}

.ln:nth-child(3) > span {
  animation-delay: 0.2s;
}

@keyframes line-up {
  from {
    transform: translateY(110%);
  }
}

.hero h1 em {
  color: var(--clay);
}

.lead {
  max-width: 460px;
  color: var(--ink-2);
  font-size: 16px;
  animation: rise 0.9s var(--ease) 0.3s backwards;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
  animation: rise 0.9s var(--ease) 0.42s backwards;
}

.facts {
  display: flex;
  gap: 34px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  animation: rise 0.9s var(--ease) 0.54s backwards;
}

.facts div {
  display: flex;
  flex-direction: column-reverse;
}

.facts dd {
  font: 500 40px / 1 var(--serif);
  font-variant-numeric: tabular-nums;
}

.facts dt {
  color: var(--ink-2);
  font-size: 12.5px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

.arch {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 470px;
  margin: 0;
}

.arch::before {
  content: '';
  position: absolute;
  inset: -16px -16px 24px;
  z-index: -1;
  border: 1.5px solid var(--brass);
  border-radius: 999px 999px 24px 24px;
  opacity: 0.55;
  animation: fade-in 1.2s var(--ease) 0.5s backwards;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.arch-img {
  aspect-ratio: 4 / 5.3;
  overflow: hidden;
  border-radius: 999px 999px 18px 18px;
  background: var(--oat);
  box-shadow: var(--sh);
  animation: arch-open 1.3s var(--ease) 0.15s backwards;
}

.arch-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: settle 1.8s var(--ease) 0.15s backwards;
}

@keyframes arch-open {
  from {
    clip-path: inset(100% 0 0 0);
  }

  to {
    clip-path: inset(0);
  }
}

@keyframes settle {
  from {
    transform: scale(1.18);
  }
}

.arch-tag {
  position: absolute;
  bottom: 48px;
  left: -34px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--sh);
  font-size: 13px;
  animation: rise 0.9s var(--ease) 0.9s backwards;
}

.dot {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--tone, var(--oat));
  box-shadow: inset 0 0 0 1.5px rgb(46 36 32 / 25%);
}

/* ---------- Khung chung của section ---------- */

.sec {
  padding: 76px 0;
}

.sec.tight {
  padding-top: 20px;
}

.sec-h {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 34px;
}

.sec-h h2 {
  margin-top: 8px;
  font-size: clamp(34px, 4vw, 54px);
}

.count {
  color: var(--ink-2);
  font-size: 13px;
}

[data-reveal] {
  transition:
    opacity var(--dur-3) var(--ease) calc(var(--i, 0) * var(--stagger)),
    transform var(--dur-3) var(--ease) calc(var(--i, 0) * var(--stagger));
}

.js[data-ready] [data-reveal]:not(.in) {
  opacity: 0;
  transform: translateY(22px);
}

/* ---------- Chọn phòng ---------- */

.rooms {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 26px;
  align-items: start;
}

.room {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--r);
  background: var(--oat);
  box-shadow: var(--sh);
  text-align: left;
  outline: 3px solid transparent;
  outline-offset: 4px;
  transition:
    outline-color var(--dur-2) var(--ease),
    transform var(--dur-1) var(--ease),
    opacity var(--dur-3) var(--ease) calc(var(--i, 0) * var(--stagger));
}

.room:nth-child(1) {
  aspect-ratio: 4 / 3;
}

.room:nth-child(2) {
  aspect-ratio: 1;
  margin-top: 64px;
}

.room img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-3) var(--ease);
}

.room[aria-pressed='true'] {
  outline-color: var(--clay);
}

.room[aria-pressed='true'] img {
  transform: scale(1.06);
}

.room:active {
  transform: scale(0.99);
}

.cap {
  position: absolute;
  inset: auto 14px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--card-glass);
}

.cap strong {
  display: block;
  font: 500 30px / 1.05 var(--serif);
}

.cap small {
  display: block;
  color: var(--ink-2);
  font-size: 12.5px;
}

.chk {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--ink-2);
  border-radius: 50%;
  color: transparent;
  transition:
    background var(--dur-2) var(--ease),
    border-color var(--dur-2) var(--ease),
    color var(--dur-2) var(--ease),
    transform var(--dur-2) var(--ease);
}

.chk svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.room[aria-pressed='true'] .chk {
  border-color: var(--clay);
  background: var(--clay);
  color: var(--white);
  transform: scale(1.1);
}

@media (hover: hover) {
  .room:hover img {
    transform: scale(1.05);
  }

  .room:hover .chk {
    border-color: var(--clay);
  }
}

/* ---------- Thanh lọc ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 calc(var(--gutter) * -1);
  padding: 14px var(--gutter);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--scrim);
  backdrop-filter: blur(8px);
  transition: box-shadow var(--dur-2) var(--ease);
}

.bar.stuck {
  box-shadow: 0 10px 24px -18px rgb(70 42 28 / 50%);
}

.bar-in {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.chips {
  position: relative;
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--paper);
}

.chip-ind {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 1px;
  border-radius: var(--r-pill);
  background: var(--ink);
  transition:
    transform var(--dur-2) var(--ease),
    width var(--dur-2) var(--ease);
}

.chip {
  position: relative;
  z-index: 1;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition:
    color var(--dur-2) var(--ease),
    background var(--dur-2) var(--ease),
    opacity var(--dur-2) var(--ease),
    transform var(--dur-1) var(--ease);
}

.chip[aria-pressed='true'] {
  color: var(--paper);
}

.chip:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.chip:active:not(:disabled) {
  transform: scale(0.95);
}

@media (hover: hover) {
  .chip:hover:not(:disabled, [aria-pressed='true']) {
    background: var(--clay-a10);
  }
}

.bar-right {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

.selects {
  display: contents;
}

/* Dropdown tự vẽ */

.dd {
  position: relative;
}

.dd-btn {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-width: 168px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  font-size: 13.5px;
  text-align: left;
  transition:
    border-color var(--dur-2) var(--ease),
    box-shadow var(--dur-2) var(--ease),
    transform var(--dur-1) var(--ease);
}

.dd-btn:active {
  transform: scale(0.98);
}

.dd-btn small {
  display: block;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.2;
}

.dd-btn svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--dur-2) var(--ease);
}

.dd.open .dd-btn {
  border-color: var(--clay);
  box-shadow: 0 0 0 3px var(--clay-a16);
}

.dd.open .dd-btn svg {
  transform: rotate(180deg);
}

.dd.has-value .dd-btn {
  border-color: var(--clay-a30);
}

.dd-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 5;
  min-width: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--sh);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity var(--dur-1) var(--ease),
    transform var(--dur-1) var(--ease),
    visibility 0s var(--dur-1);
}

.dd.open .dd-list {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.dd-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}

.dd-list li.is-active {
  background: var(--linen);
}

.dd-list li svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--clay);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity var(--dur-1) var(--ease),
    transform var(--dur-2) var(--ease);
}

.dd-list li[aria-selected='true'] {
  color: var(--clay);
  font-weight: 600;
}

.dd-list li[aria-selected='true'] svg {
  opacity: 1;
  transform: none;
}

@media (hover: hover) {
  .dd-btn:hover {
    border-color: var(--clay);
  }

  .dd-list li:hover {
    background: var(--linen);
  }
}

/* Nhãn bộ lọc đang dùng */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--clay-a30);
  border-radius: var(--r-pill);
  background: var(--clay-a10);
  color: var(--clay-d);
  font-size: 12.5px;
  font-weight: 500;
  animation: tag-in var(--dur-2) var(--ease) backwards;
  transition:
    background var(--dur-2) var(--ease),
    color var(--dur-2) var(--ease),
    transform var(--dur-1) var(--ease);
}

.tag svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.tag:active {
  transform: scale(0.94);
}

@media (hover: hover) {
  .tag:hover {
    background: var(--clay);
    color: var(--white);
  }
}

@keyframes tag-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
}

/* ---------- Lưới sản phẩm ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 26px;
  align-items: start;
  margin-top: 34px;
}

.grid.fresh {
  animation: swap var(--dur-2) var(--ease) backwards;
}

@keyframes swap {
  from {
    opacity: 0.2;
    transform: translateY(10px);
  }
}

.card {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  transition:
    transform var(--dur-2) var(--ease),
    box-shadow var(--dur-2) var(--ease),
    opacity var(--dur-3) var(--ease) calc(var(--i, 0) * var(--stagger));
}

.card:nth-child(3n + 2) {
  margin-top: 44px;
}

.ph {
  position: relative;
  display: block;
  aspect-ratio: 4 / 4.3;
  overflow: hidden;
  background: var(--oat);
}

.card:nth-child(3n + 2) .ph {
  aspect-ratio: 4 / 5.2;
}

.ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform var(--dur-3) var(--ease),
    opacity var(--dur-3) var(--ease);
}

.js[data-ready] img:not(.loaded, .failed) {
  opacity: 0;
}

img.failed {
  visibility: hidden;
}

.has-fail {
  position: relative;
  background: var(--tone, var(--oat));
}

.has-fail::after {
  content: 'Ảnh chưa tải được';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 12.5px;
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: var(--paper);
  font-size: 11.5px;
  font-weight: 600;
}

.badge.made {
  background: var(--clay);
  color: var(--white);
}

.tx {
  display: block;
  min-width: 0;
  padding: 16px 18px 18px;
}

.name {
  display: block;
  font: 500 25px / 1.1 var(--serif);
  overflow-wrap: anywhere;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.price {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.price b {
  color: var(--clay-d);
  font: 600 30px / 1 var(--serif);
}

.price b small {
  color: var(--ink-2);
  font: 500 13px var(--font);
}

.price > span {
  color: var(--ink-2);
  font-size: 12px;
}

@media (hover: hover) {
  .card:hover {
    box-shadow: var(--sh-h);
    transform: translateY(-6px);
  }

  .card:hover .ph img {
    transform: scale(1.07);
  }
}

.card:active {
  transform: translateY(-1px);
}

.card:focus-visible .ph img {
  transform: scale(1.04);
}

.more {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

/* Khung xương khi lọc */

.skel-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
}

.skel-card:nth-child(3n + 2) {
  margin-top: 44px;
}

.skel-card i {
  display: block;
  background: var(--oat);
  animation: pulse 1.1s ease-in-out infinite alternate;
}

.skel-card .s-img {
  aspect-ratio: 4 / 4.3;
}

.skel-card .s-line {
  height: 14px;
  margin: 16px 18px 0;
  border-radius: 7px;
}

.skel-card .s-line.short {
  width: 45%;
  margin-bottom: 18px;
}

@keyframes pulse {
  from {
    opacity: 0.45;
  }
}

/* Trạng thái rỗng và lỗi */

.empty {
  grid-column: 1 / -1;
  padding: 34px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r);
  background: rgb(251 248 243 / 60%);
  text-align: center;
  animation: rise 0.6s var(--ease) backwards;
}

.empty svg {
  width: 96px;
  height: 64px;
  margin: 0 auto 12px;
  fill: none;
  stroke: var(--line-2);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty h2,
.empty h3 {
  font-size: 30px;
}

.empty p {
  margin: 6px 0 16px;
  color: var(--ink-2);
}

.empty.error {
  border-color: var(--err);
}

/* ---------- Combo ---------- */

.arrows {
  display: flex;
  gap: 10px;
}

.arrow {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  transition:
    background var(--dur-2) var(--ease),
    color var(--dur-2) var(--ease),
    opacity var(--dur-2) var(--ease),
    transform var(--dur-1) var(--ease);
}

.arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arrow:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

.arrow:active:not(:disabled) {
  transform: scale(0.92);
}

@media (hover: hover) {
  .arrow:hover:not(:disabled) {
    background: var(--ink);
    color: var(--paper);
  }
}

.belt-wrap {
  margin-right: calc(var(--gutter) * -1);
}

.belt {
  display: flex;
  gap: 24px;
  padding-right: var(--gutter);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
  mask-image: linear-gradient(90deg, #000 88%, transparent);
  transition: mask-position var(--dur-2) var(--ease);
}

.belt.at-end {
  -webkit-mask-image: none;
  mask-image: none;
}

.belt::-webkit-scrollbar {
  display: none;
}

.combo-card {
  display: grid;
  flex: 0 0 min(520px, 82%);
  grid-template-columns: 44% 1fr;
  gap: 18px;
  min-width: 0;
  padding: 12px;
  border-radius: var(--r);
  background: var(--dark);
  color: var(--paper);
  scroll-snap-align: start;
}

.combo-card:nth-child(even) {
  background: var(--dark-2);
}

.combo-img {
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 10px;
  background: var(--dark-2);
}

.combo-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform var(--dur-3) var(--ease),
    opacity var(--dur-3) var(--ease);
}

.combo-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px 8px 8px 0;
}

.combo-room {
  color: var(--dark-price);
  font: 600 12px / 1.4 var(--font);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.combo-body h3 {
  margin-top: 6px;
  color: var(--white);
  font-size: 30px;
}

.combo-note {
  margin-top: 8px;
  color: var(--dark-mute);
  font-size: 13px;
}

.parts {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  padding: 0;
  color: var(--dark-text);
  font-size: 13px;
  list-style: none;
}

.parts li {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
}

.parts a {
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--dur-2) var(--ease);
}

.parts a:hover,
.parts a:focus-visible {
  text-decoration-color: currentcolor;
}

.combo-foot {
  display: flex;
  gap: 10px;
  align-items: end;
  justify-content: space-between;
  margin-top: auto;
}

.combo-card .price {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--dark-mute);
}

.combo-card .price b {
  color: var(--dark-price);
  font-size: 38px;
}

.combo-card .btn.ghost {
  border-color: var(--dark-mute);
  color: var(--paper);
}

@media (hover: hover) {
  .combo-card:hover .combo-img img {
    transform: scale(1.06);
  }

  .combo-card .btn.ghost:hover {
    background: var(--paper);
    color: var(--ink);
  }
}

/* ---------- Form ---------- */

.contact {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: start;
}

.contact > * {
  min-width: 0;
}

.contact h2 {
  margin: 14px 0 16px;
  font-size: clamp(36px, 4.4vw, 60px);
}

.contact p {
  max-width: 420px;
  color: var(--ink-2);
}

.demo-note {
  margin-top: 12px;
  font-size: 12.5px;
}

.form {
  display: grid;
  gap: 18px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--sh);
}

.field label,
.legend {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--linen);
  color: inherit;
  font: inherit;
  transition:
    border-color var(--dur-2) var(--ease),
    box-shadow var(--dur-2) var(--ease),
    background var(--dur-2) var(--ease);
}

.field textarea {
  resize: vertical;
}

.field input:hover,
.field textarea:hover {
  border-color: var(--line-2);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--clay);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--clay-a16);
  outline: 0;
}

.field.bad input {
  border-color: var(--err);
  background: var(--err-soft);
}

.field.bad.fresh {
  animation: shake 0.4s var(--ease);
}

@keyframes shake {
  25% {
    transform: translateX(-5px);
  }

  50% {
    transform: translateX(5px);
  }

  75% {
    transform: translateX(-3px);
  }
}

.err {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 5px;
  color: var(--err);
  font-size: 12.5px;
}

.err:empty {
  display: none;
}

.err::before {
  content: '!';
  display: grid;
  flex: none;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--err);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
}

.err:not(:empty) {
  animation: rise var(--dur-2) var(--ease) backwards;
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0;
  border: 0;
}

.seg-opt {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--linen);
  font-size: 13.5px;
  font-weight: 500;
  transition:
    background var(--dur-2) var(--ease),
    color var(--dur-2) var(--ease),
    border-color var(--dur-2) var(--ease),
    transform var(--dur-1) var(--ease);
}

.seg-opt[aria-checked='true'] {
  border-color: var(--clay);
  background: var(--clay);
  color: var(--white);
}

.seg.bad .seg-opt {
  border-color: var(--err);
}

.seg-opt:active {
  transform: scale(0.97);
}

@media (hover: hover) {
  .seg-opt:hover:not([aria-checked='true']) {
    border-color: var(--clay);
  }
}

.submit {
  justify-self: start;
}

.submit .spin {
  display: none;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid currentcolor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}

.submit.is-busy .spin {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ok {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--brass);
  border-radius: 12px;
  background: var(--brass-a14);
  font-size: 13.5px;
}

.ok.fresh {
  animation: rise 0.6s var(--ease) backwards;
}

.foot {
  margin-top: 40px;
  padding: 30px 0 50px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
}

/* ---------- Chi tiết ---------- */

.detail {
  padding: 48px 0 24px;
}

.detail.fresh,
#home.fresh {
  animation: rise 0.6s var(--ease) backwards;
}

.back {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 600;
  transition: transform var(--dur-2) var(--ease);
}

.back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--dur-2) var(--ease);
}

.back:hover svg {
  transform: translateX(-4px);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: start;
}

.detail-grid > * {
  min-width: 0;
}

.zoom {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--oat);
  box-shadow: var(--sh);
  cursor: zoom-in;
}

.zoom img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform var(--dur-3) var(--ease),
    opacity var(--dur-3) var(--ease);
}

@media (hover: hover) {
  .zoom:hover img {
    transform: scale(1.8);
  }
}

.detail-info h1 {
  margin: 8px 0 12px;
  font-size: clamp(36px, 4vw, 56px);
}

.detail-info h1:focus {
  outline: 0;
}

.price.big {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
}

.price.big b {
  font-size: 44px;
}

.price-note {
  margin-left: 10px;
  color: var(--ink-2);
  font-size: 13px;
}

.detail-note {
  margin: 14px 0 20px;
  color: var(--ink-2);
}

.specs {
  display: grid;
  gap: 0;
  margin: 0 0 24px;
}

.specs div {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.specs dt {
  color: var(--ink-2);
}

.specs dd {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  font-weight: 500;
  text-align: right;
}

.detail .parts {
  color: var(--ink);
}

.detail .parts li {
  border-color: var(--line);
}

.parts-title {
  margin-top: 8px;
  font-size: 26px;
}

.related {
  margin-top: 64px;
}

.related h2 {
  font-size: 34px;
}

/* ---------- Điện thoại: thanh đáy ---------- */

@media (width <= 860px) {
  :root {
    --gutter: 20px;
  }

  body {
    padding: 0 0 74px;
  }

  .rail {
    inset: auto 0 0;
    flex-direction: row;
    width: auto;
    height: 64px;
    padding: 0 22px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .brand {
    font-size: 19px;
    writing-mode: horizontal-tb;
    transform: none;
  }

  .rail-nav {
    flex-direction: row;
    gap: 22px;
  }

  .rail-nav a {
    width: 14px;
    height: 14px;
  }

  .rail-tip,
  .rail-prog {
    display: none;
  }

  .rail-ring {
    top: -5px;
    left: -5px;
    width: 24px;
    height: 24px;
    transform: translateX(calc(var(--i, 0) * 36px));
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    min-height: 0;
    padding: 34px 0 40px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .arch {
    justify-self: center;
    max-width: 340px;
  }

  .arch-tag {
    bottom: 28px;
    left: -6px;
  }

  .facts {
    gap: 22px;
  }

  .facts dd {
    font-size: 32px;
  }

  .sec {
    padding: 48px 0;
  }

  .sec-h h2 {
    font-size: 32px;
  }

  .rooms {
    grid-template-columns: 1fr;
  }

  .room:nth-child(2) {
    aspect-ratio: 4 / 3;
    margin-top: 0;
  }

  .bar {
    position: static;
  }

  .chips {
    max-width: 100%;
    overflow-x: auto;
  }

  .bar-right {
    width: 100%;
    margin-left: 0;
  }

  .dd-btn {
    min-width: 150px;
  }

  .dd-list {
    min-width: 190px;
  }

  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 18px 14px;
  }

  .card:nth-child(3n + 2),
  .skel-card:nth-child(3n + 2) {
    margin-top: 0;
  }

  .card:nth-child(2n),
  .skel-card:nth-child(2n) {
    margin-top: 28px;
  }

  .ph,
  .card:nth-child(3n + 2) .ph {
    aspect-ratio: 4 / 5;
  }

  .name {
    font-size: 20px;
  }

  .price b {
    font-size: 24px;
  }

  .tx {
    padding: 12px;
  }

  .combo-card {
    grid-template-columns: 1fr;
    flex-basis: 84%;
  }

  .combo-img {
    aspect-ratio: 16 / 10;
  }

  .contact {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .form {
    padding: 20px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ---------- Giảm chuyển động ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js[data-ready] [data-reveal]:not(.in) {
    transform: none;
  }

  .zoom:hover img,
  .room[aria-pressed='true'] img {
    transform: none;
  }
}
