@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/bvp-400-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(fonts/bvp-400-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(fonts/bvp-600-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(fonts/bvp-600-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: 800; font-display: swap; src: url(fonts/bvp-800-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: 800; font-display: swap; src: url(fonts/bvp-800-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: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --line: #e6e9f1;
  --text: #141929;
  --muted: #667089;
  --accent: #f0325a;
  --accent-soft: #fde8ed;
  --grad: linear-gradient(115deg, #f0325a 0%, #ff5a4d 60%, #ff8040 100%);
  --danger: #d92d3e;
  --ok: #12925a;
  --new: #16a866;
  --zalo: #0a6cff;
  --fb: #3b5bdb;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 25, 41, .04), 0 8px 24px rgba(20, 25, 41, .06);
  --shadow-lg: 0 18px 40px rgba(20, 25, 41, .14);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Chỉ dùng transform và opacity cho hiệu ứng: card đồ họa xử lý riêng nên không làm giật trang */
@keyframes rise { from { opacity: .01; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes ring { 0% { opacity: .55; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.35, 1.7); } }
@keyframes reveal { from { opacity: .01; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* Chuyển trang mượt không cần JavaScript, trình duyệt cũ chỉ đơn giản là bỏ qua */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-group(root) { animation-duration: .16s; }
  .topbar { view-transition-name: topbar; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
a, button, label, select, input { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: radial-gradient(1100px 420px at 50% -140px, #ffe4ec 0%, rgba(255, 228, 236, 0) 72%) no-repeat, var(--bg);
  color: var(--text);
  font: 16px/1.6 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
.wrap { width: 100%; max-width: 1172px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 56px; min-height: 70vh; }
.muted { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.anchor { scroll-margin-top: 84px; }

.topbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 11px; padding-bottom: 11px; }
.admin .topbar-inner { flex-wrap: wrap; }
.topbar-left { display: flex; flex: 1 1 auto; align-items: center; gap: 30px; min-width: 0; }
.topbar .btn-primary { flex: 0 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.brand span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.brand img { height: 38px; width: auto; border-radius: 8px; }
.site-nav { display: flex; flex: 0 0 auto; gap: 24px; font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.site-nav a, .admin-nav a { position: relative; transition: color .15s; }
.site-nav a::after, .admin-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; border-radius: 2px; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform .22s var(--ease); }
.contact { display: flex; gap: 8px; flex-wrap: wrap; }

.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 20px 0; background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.footer strong { color: var(--text); }

.float-zalo { position: fixed; right: 16px; bottom: 20px; z-index: 30; background: var(--zalo); color: #fff; font-size: 14px; font-weight: 700; padding: 11px 18px; border-radius: 999px; box-shadow: 0 8px 22px rgba(10, 108, 255, .35); transition: transform .18s var(--ease); }
.float-zalo::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--zalo); animation: ring 2.6s ease-out infinite; pointer-events: none; }
.float-zalo:active { transform: scale(.96); }

.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 18px; border: 1px solid transparent; border-radius: 11px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: transform .14s var(--ease), color .15s, background-color .15s, border-color .15s; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 14px; border-radius: 8px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(240, 50, 90, .28); overflow: hidden; }
.btn-primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .35), rgba(255, 255, 255, 0)); transform: translateX(-160%) skewX(-18deg); pointer-events: none; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.btn-zalo { background: var(--zalo); color: #fff; }
.btn-fb { background: var(--fb); color: #fff; }
.contact .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (hover: hover) {
  .site-nav a:hover, .admin-nav a:hover, .link:hover, .crumb a:hover { color: var(--accent); }
  .site-nav a:hover::after, .admin-nav a:hover::after { transform: scaleX(1); }
  .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
  .btn-primary:hover::after { transform: translateX(320%) skewX(-18deg); transition: transform .6s var(--ease); }
  .btn-zalo:hover, .btn-fb:hover { transform: translateY(-1px); }
  .float-zalo:hover { transform: translateY(-3px); }
  .pill:hover:not(.active) { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
  .card:hover { transform: translateY(-5px); border-color: rgba(240, 50, 90, .45); }
  .card:hover::after { opacity: 1; }
  .card:hover .card-img img { transform: scale(1.06); }
  .card:hover .card-more { color: var(--accent); }
  .gallery-thumbs button:hover img { transform: scale(1.07); }
  .gallery-nav:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-50%) scale(1.08); }
  .lightbox-close:hover { background: rgba(255, 255, 255, .28); }
  .step:hover { border-color: rgba(240, 50, 90, .4); }
  .table tbody tr:hover { background: #fbfbfe; }
}

.banner { width: 100%; aspect-ratio: 5 / 2; object-fit: cover; border-radius: 20px; box-shadow: 0 16px 44px rgba(240, 50, 90, .18); margin-bottom: 32px; background: var(--surface-2); }

section + section { margin-top: 52px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 800; letter-spacing: -.015em; }
.section-title::before { content: ""; flex: 0 0 auto; width: 5px; height: .9em; border-radius: 3px; background: var(--grad); }
.crumb { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.crumb a { transition: color .15s; }
.empty { color: var(--muted); padding: 44px 16px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); margin-top: 18px; animation: fade .25s both; }

.list-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.list-search { display: flex; gap: 8px; flex: 0 1 460px; }
.list-search input { flex: 1 1 auto; min-width: 0; background: var(--surface); }
.list-search select { flex: 0 0 160px; width: 160px; background: var(--surface); }

.price-slider { max-width: 520px; margin: 2px 0 6px; }
.price-slider-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); }
.price-slider-head strong { color: var(--text); white-space: nowrap; }
.price-slider-track { position: relative; height: 34px; }
.price-slider-track::before { content: ""; position: absolute; left: 11px; right: 11px; top: 15px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--line) var(--a), var(--accent) var(--a), var(--accent) var(--b), var(--line) var(--b)); }
/* Hai thanh range chồng lên nhau, chỉ phần nút kéo nhận thao tác */
.price-slider-track input[type=range]:not([type=checkbox]):not([type=file]) { position: absolute; inset: 0; width: 100%; height: 34px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.price-slider-track input[type=range]::-webkit-slider-runnable-track { background: none; }
.price-slider-track input[type=range]::-moz-range-track { background: none; }
.price-slider-track input[type=range]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 2px 6px rgba(20, 25, 41, .2); cursor: grab; }
.price-slider-track input[type=range]::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 2px 6px rgba(20, 25, 41, .2); cursor: grab; }
.price-slider-track input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }

#acc .card-grid { transition: opacity .12s; }
#acc.is-loading .card-grid { opacity: .55; }

.pills { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 15px; font-size: 14px; font-weight: 600; transition: transform .14s var(--ease), color .15s, border-color .15s, background-color .15s; }
.pill:active { transform: scale(.96); }
.pill img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.pill small { color: var(--muted); font-size: 13px; font-weight: 500; }
.pill.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 5px 14px rgba(240, 50, 90, .26); }
.pill.active small { color: rgba(255, 255, 255, .85); }

.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .24s var(--ease), border-color .2s; animation: rise .38s var(--ease) backwards; }
/* Bóng lớn nằm sẵn ở lớp riêng, chỉ đổi độ mờ nên hover không phải vẽ lại */
.card::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .24s var(--ease); pointer-events: none; }
.card:nth-child(2) { animation-delay: .03s; }
.card:nth-child(3) { animation-delay: .06s; }
.card:nth-child(4) { animation-delay: .09s; }
.card:nth-child(5) { animation-delay: .12s; }
.card:nth-child(6) { animation-delay: .15s; }
.card:nth-child(7) { animation-delay: .18s; }
.card:nth-child(n+8) { animation-delay: .21s; }
.card-img { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; border-radius: 15px 15px 0 0; }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.card.is-sold .card-img img { filter: grayscale(1) opacity(.65); }
.tag { position: absolute; top: 9px; left: 9px; background: rgba(15, 18, 30, .78); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 7px; max-width: calc(100% - 76px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge-new, .badge-sold { position: absolute; top: 9px; right: 9px; color: #fff; font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 999px; text-transform: uppercase; }
.badge-new { background: var(--new); }
.badge-sold { background: var(--danger); }
.card-body { padding: 13px 15px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 8px; margin-top: auto; padding-top: 4px; }
.card-meta { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.4; }
.card-foot span { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; transition: color .15s; }
.card-game { color: var(--muted); font-size: 13px; }
.price { color: var(--accent); font-size: 18px; font-weight: 800; overflow-wrap: anywhere; }
.check input[type=checkbox] { flex: 0 0 auto; accent-color: var(--accent); }
.price-lg { display: block; font-size: 32px; letter-spacing: -.01em; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); transition: border-color .2s; }
.step span { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; background: var(--grad); color: #fff; border-radius: 10px; font-weight: 800; font-size: 15px; box-shadow: 0 5px 12px rgba(240, 50, 90, .25); }
.step h3 { font-size: 17px; margin-top: 12px; }
.step p { color: var(--muted); font-size: 15px; margin: 6px 0 0; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 18px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.filters input, .filters select { width: 160px; background: var(--surface); }

input:not([type=checkbox]):not([type=file]), select, textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; color: var(--text); font: inherit; font-size: 16px; padding: 8px 12px; min-height: 42px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:not([type=checkbox]):not([type=file]):focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }

.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 26px; color: var(--muted); }

.detail { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; align-items: start; }
.gallery-main { width: 100%; max-height: 620px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 84px; }
.gallery-main, .photo-list img { cursor: zoom-in; }
.no-scroll { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 48px 16px; background: rgba(10, 12, 20, .93); animation: fade .16s ease-out both; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 10px; animation: zoom-in .2s var(--ease) both; }
.lightbox-close { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; background: rgba(255, 255, 255, .14); border: 0; border-radius: 50%; color: #fff; font-size: 18px; cursor: pointer; transition: background-color .15s; }
.lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lightbox-count { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; font-weight: 600; }
.gallery-stage { position: relative; }
/* Vuốt ngang để chuyển ảnh, không để trình duyệt hiểu là quay lại trang trước */
.gallery-stage, .gallery-stage img, .lightbox, .lightbox img { touch-action: pan-y pinch-zoom; }
/* Khung cố định để nút chuyển ảnh không nhảy chỗ giữa ảnh ngang và ảnh dọc */
.gallery-stage.has-nav .gallery-main { aspect-ratio: 2 / 1; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 0 4px; background: #fff; border: 1px solid var(--line); border-radius: 50%; color: var(--text); font: inherit; font-size: 28px; line-height: 1; cursor: pointer; box-shadow: var(--shadow); transition: transform .16s var(--ease), color .15s, border-color .15s; }
.gallery-nav:active { transform: translateY(-50%) scale(.92); }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-title { font-size: 17px; margin-top: 18px; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.gallery-thumbs button { padding: 0; background: none; border: 2px solid transparent; border-radius: 11px; overflow: hidden; cursor: pointer; transition: border-color .15s; }
.gallery-thumbs button.active { border-color: var(--accent); }
.gallery-thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); transition: transform .3s var(--ease); }
.photo-list { display: flex; flex-direction: column; gap: 14px; max-width: 900px; margin: 40px auto 0; }
.photo-list img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }
.detail-info { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); animation: rise .34s var(--ease) backwards; }
.detail-info h1 { font-size: 24px; font-weight: 800; margin: 4px 0 8px; overflow-wrap: anywhere; letter-spacing: -.01em; }
.detail-info h2 { font-size: 17px; margin-top: 22px; }
.detail-info .contact { margin-top: 8px; }
.sold-note { color: var(--danger); font-weight: 700; }
.desc { color: #3c4459; margin-top: 6px; overflow-wrap: anywhere; }

.error-page { text-align: center; padding: 70px 0; animation: rise .34s var(--ease) backwards; }
.error-page h1 { font-size: 72px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.admin-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 15px; font-weight: 600; }
.link { background: none; border: 0; padding: 0; color: var(--text); font: inherit; cursor: pointer; transition: color .15s; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.page-head small { color: var(--muted); font-weight: 400; font-size: 16px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; max-width: 900px; margin: 0 auto; box-shadow: var(--shadow); animation: rise .3s var(--ease) backwards; }
.panel.narrow { max-width: 540px; }
.panel h1 { font-size: 22px; font-weight: 800; margin-bottom: 14px; letter-spacing: -.01em; }
.panel h2 { font-size: 17px; margin-top: 10px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label, .label { display: block; font-size: 14px; color: var(--muted); }
.form label input:not([type=checkbox]), .form label select, .form label textarea { margin-top: 4px; color: var(--text); }
.form input[type=file] { display: block; margin-top: 6px; color: var(--text); max-width: 100%; }
.form .check, .check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form-actions { display: flex; gap: 10px; }
.form-img { max-width: 240px; border-radius: 8px; }
.form-banner { width: 100%; border-radius: 10px; margin-bottom: 6px; }
.logo-current { display: flex; align-items: center; gap: 14px; }
.logo-current img { max-height: 60px; }

.img-manage { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 10px; margin-top: 6px; }
.img-manage:empty { display: none; }
.img-item.is-uploading img { opacity: .45; }
.img-state { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.img-item.is-error { outline: 1px solid var(--danger); }
.img-item.is-error .img-state { color: var(--danger); }
.img-item { min-width: 0; background: var(--surface-2); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.img-item img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; }
.img-tools { display: flex; justify-content: space-between; gap: 4px; }
.img-tools .btn { flex: 1 1 0; min-width: 0; padding-left: 0; padding-right: 0; }

.import-summary { font-weight: 700; margin: 0 0 8px; }
.import-actions { margin-top: 12px; }
progress { display: block; width: 100%; height: 8px; margin: 8px 0; accent-color: var(--accent); }
progress[hidden], .btn[hidden] { display: none; }
.import-list { position: relative; max-height: 440px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.import-drop { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 2px dashed var(--line); border-radius: 12px; transition: border-color .15s, background-color .15s; }
.import-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.import-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-bottom: 8px; }
.import-tools .btn { margin-left: auto; }
.import-remove.btn { width: 30px; min-height: 30px; padding: 0; }
.import-row input.import-final:not([type=file]):not([type=checkbox]) { padding: 4px 8px; color: var(--accent); font-weight: 700; border-color: transparent; background: var(--accent-soft); }
.import-row input.import-final.is-manual:not([type=file]):not([type=checkbox]) { border-color: var(--accent); background: var(--surface); }
.import-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 118px 122px 52px minmax(0, 1fr) 30px; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.import-row:last-child { border-bottom: 0; }
.import-row strong { overflow-wrap: anywhere; }
.import-row input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.import-row input:not([type=file]):not([type=checkbox]) { min-height: 36px; padding: 4px 10px; }
.import-state { color: var(--muted); overflow-wrap: anywhere; }
.import-row.is-wait .import-state, .import-row.is-busy .import-state { color: var(--accent); }
.import-row.is-done .import-state { color: var(--ok); font-weight: 700; }
.import-row.is-error .import-state { color: var(--danger); }
.import-row.is-skip > :not(.import-note, .import-remove, input[type=checkbox]) { opacity: .6; }
.import-note { grid-column: 2 / -1; color: var(--danger); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.import-note:empty { display: none; }
.import-desc { grid-column: 2 / -1; color: var(--muted); font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.import-desc:empty { display: none; }
.import-note a { text-decoration: underline; }

.alert { padding: 10px 14px; border-radius: 11px; margin-bottom: 14px; font-size: 15px; animation: rise .24s var(--ease) backwards; }
.alert-ok { background: #e3f6ed; color: #0c6b42; }
.alert-note { background: #fff4dc; color: #80570a; }
.alert-note a { font-weight: 700; text-decoration: underline; }
.nav-badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; }
.approval-tabs { margin-top: 12px; }
.sheet-section { margin-top: 26px; }
.sheet-section .section-title { font-size: 19px; margin-bottom: 10px; }
.sheet-section .section-title small { font-size: 15px; }
.sheet-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet-chips a { padding: 3px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.alert-error { background: #fde8ea; color: #b1202f; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { background: #fafbfd; color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap; }
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .12s; }
.thumb img { width: 64px; height: 46px; object-fit: cover; border-radius: 8px; }
.guide-steps { counter-reset: guide; display: flex; flex-direction: column; gap: 12px; }
.guide-steps:empty { display: none; }
.guide-step { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; background: var(--surface-2); border-radius: 12px; }
.guide-step::before { counter-increment: guide; content: "Bước " counter(guide); color: var(--muted); font-size: 13px; font-weight: 700; }
.bulk-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.bulk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bulk-tools input:not([type=checkbox]):not([type=file]) { width: 130px; min-height: 32px; padding: 4px 10px; font-size: 14px; }
.td-check { width: 34px; padding-right: 0; }
.td-check input { display: block; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.table tbody tr.is-picked { background: var(--accent-soft); }
.actions { display: flex; gap: 6px; }
.status { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-available { background: #e3f6ed; color: var(--ok); }
.status-sold { background: #fde8ea; color: var(--danger); }
.status-hidden { background: var(--surface-2); color: var(--muted); }

/* Hiện dần khi cuộn tới, chạy trên luồng đồ họa nên không ảnh hưởng độ mượt khi cuộn */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .step, .photo-list img { animation: reveal linear backwards; animation-timeline: view(); animation-range: entry 0% entry 35%; }
  }
}

/* Màn hình cảm ứng: nút đủ lớn để bấm bằng tay */
@media (pointer: coarse) {
  .btn-sm { min-height: 40px; padding: 6px 12px; }
  .pill { min-height: 40px; }
  .site-nav a, .admin-nav a, .admin-nav .link { display: inline-flex; align-items: center; min-height: 40px; }
  .check input[type=checkbox] { width: 20px; height: 20px; }
}

/* Tablet */
@media (max-width: 960px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .detail { gap: 20px; }
  .gallery-thumbs { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }

  /* Bảng quản trị chuyển thành các thẻ */
  .table-wrap { overflow: visible; background: none; border: 0; border-radius: 0; box-shadow: none; }
  .table, .table tbody { display: block; }
  .table thead { display: none; }
  .table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .table tr { display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 12px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }
  .table td { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; font-size: 14px; }
  .table td[data-label] { text-align: right; }
  .table td[data-label]::before { content: attr(data-label); flex: 0 0 auto; color: var(--muted); }
  .table tr { position: relative; }
  .table td.td-check { position: absolute; top: 16px; left: 16px; z-index: 1; display: block; width: auto; padding: 0; }
  .td-check input { width: 22px; height: 22px; }
  .table td.thumb { grid-column: 1; padding: 0; }
  .table td.thumb:empty { min-height: 52px; background: var(--surface-2); border-radius: 6px; }
  .thumb img { width: 72px; height: 52px; }
  .table td.td-main { grid-column: 2; display: block; padding: 0 0 6px; overflow-wrap: anywhere; }
  .table td.td-main:first-child { grid-column: 1 / -1; }
  .table td.actions { flex-wrap: wrap; justify-content: flex-start; gap: 8px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
  .table td.actions > .btn, .table td.actions > form { flex: 1 1 auto; }
  .table td.actions form .btn { width: 100%; }
}

/* Điện thoại lớn và tablet dọc nhỏ */
@media (max-width: 760px) {
  .admin .topbar { position: static; }
  .admin .topbar-inner { gap: 4px 12px; }
  .admin-nav { width: 100%; gap: 2px 16px; }

  .banner { border-radius: 14px; margin-bottom: 22px; }
  .list-search { flex: 1 1 100%; }

  /* Trang chi tiết: ảnh lớn, rồi giá và liên hệ, sau đó mới tới lưới ảnh */
  /* stretch: Safari tính độ rộng theo dòng chữ dài nhất nếu để start, làm khung tràn màn hình */
  .detail { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .gallery { display: contents; }
  .gallery-stage { order: 1; }
  .detail-info { order: 2; position: static; padding: 18px; }
  .gallery-title { order: 3; margin-top: 4px; }
  .gallery-thumbs { order: 4; margin-top: -6px; }
  .detail-info .contact .btn { flex: 1 1 130px; min-height: 46px; }
  .photo-list { margin-top: 28px; gap: 10px; }

  .gallery-nav { width: 40px; height: 40px; font-size: 26px; }
  .gallery-nav.prev { left: 6px; }
  .gallery-nav.next { right: 6px; }

  .filters label { flex: 1 1 42%; }
  .filters input, .filters select { width: 100%; }
  .filters .btn { flex: 1 1 100%; }
  /* Form dài nhiều ảnh: nút lưu luôn trong tầm tay */
  .form-actions { position: sticky; bottom: 0; z-index: 5; padding: 10px 0; background: var(--surface); border-top: 1px solid var(--line); }
  .footer { padding-bottom: 76px; }
}

/* Điện thoại */
@media (max-width: 600px) {
  main.wrap { padding-top: 16px; padding-bottom: 36px; }
  .site-nav { display: none; }
  .brand { font-size: 17px; }
  .brand img { height: 32px; }
  .topbar .btn-primary { padding: 8px 14px; font-size: 14px; }

  section + section { margin-top: 36px; }
  .section-title { font-size: 22px; }
  .list-head { margin-bottom: 12px; }
  .list-search select { flex: 0 0 132px; width: 132px; }

  /* Hàng lọc vuốt ngang để không chiếm nhiều dòng khi có nhiều game */
  .pills { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 8px; padding: 2px 16px 6px; scrollbar-width: none; }
  .pills::-webkit-scrollbar { display: none; }
  .pill { flex: 0 0 auto; }

  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
  .card-body { padding: 10px 11px 12px; gap: 4px; }
  .card-body h3 { font-size: 14px; }
  .card-desc { font-size: 12px; -webkit-line-clamp: 1; }
  .card-foot { flex-direction: column; align-items: flex-start; gap: 0; }
  .card-meta { align-items: flex-start; }
  .tag { font-size: 11px; padding: 2px 7px; top: 7px; left: 7px; max-width: calc(100% - 60px); }
  .badge-new, .badge-sold { font-size: 11px; padding: 2px 8px; top: 7px; right: 7px; }
  .price { font-size: 16px; }
  .price-lg { font-size: 28px; }

  .steps { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .step { padding: 16px; }
  .detail-info h1 { font-size: 21px; }
  .gallery-thumbs { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; }

  .float-zalo { right: 12px; bottom: 14px; padding: 10px 15px; font-size: 13px; }

  .panel { padding: 16px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .import-row { grid-template-columns: 20px minmax(0, 1fr) 120px; }
  .import-row > span { grid-column: 2 / -1; }
  .import-row > .import-remove { grid-column: 2 / -1; justify-self: end; }
  .import-row > input.import-final { grid-column: 3; }
  .form-actions .btn { flex: 1 1 auto; }
  .page-head h1 { font-size: 21px; }
  .table tbody { grid-template-columns: minmax(0, 1fr); }
  .img-manage { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .lightbox { padding: 56px 8px 44px; }
}

/* Người dùng bật giảm chuyển động trong máy thì tắt hết hiệu ứng */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
