/* ============ TS SUPERLIGHT — Storefront ============ */
:root {
  --brand: #ffb800;
  --brand-2: #ff8a00;
  --brand-ink: #1a1300;
  --dark: #0d1015;
  --dark-2: #161b23;
  --dark-3: #232a35;
  --sale: #e5192c;
  --ok: #16a34a;
  --bg: #f3f4f6;
  --on-bg: var(--ink);
  --on-bg-muted: var(--muted);
  --card: #ffffff;
  --ink: #16181d;
  --muted: #6b7280;
  --line: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
  --wrap: 1240px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(12px, 3vw, 16px); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 600;
  transition: transform .15s, box-shadow .15s, background .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-brand { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); box-shadow: 0 6px 18px -6px rgba(255,160,0,.7); }
.btn-brand:hover { box-shadow: 0 8px 24px -6px rgba(255,160,0,.9); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: var(--dark-3); }
.btn-outline { background: #fff; border: 1.5px solid var(--line); }
.btn-outline:hover { border-color: var(--ink); }
.btn-zalo { background: #0068ff; color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 15px; }

/* ---------- Top bar & header ---------- */
.topbar { background: linear-gradient(90deg, var(--brand-2), var(--brand)); color: var(--brand-ink); font-size: 13px; font-weight: 600; text-align: center; padding: 5px 16px; }
.header { background: var(--dark); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 20px rgba(0,0,0,.3); }
.header-main { display: flex; align-items: center; gap: 28px; padding: 10px 16px; min-height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-img { display: block; height: 60px; width: auto; }
.logo-text b { display: block; font-size: 19px; letter-spacing: .5px; line-height: 1.1; }
.logo-text b span { color: var(--brand); }
.logo-text small { color: #9aa3b2; font-size: 11px; }
.header svg { width: 24px; height: 24px; display: block; }
.menu-btn, .icon-btn, .nav-close { border: 0; background: none; padding: 0; color: #b5b5b5; line-height: 0; }
.menu-btn { display: none; color: #fff; }
.icon-btn:hover { color: var(--brand); }
.header-actions { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.hotline { display: flex; align-items: center; gap: 10px; }
.hotline .ico { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--brand); display: grid; place-items: center; color: var(--brand); font-size: 16px; }
.hotline small { display: block; color: #b5b5b5; font-size: 11px; }
.hotline b { color: var(--brand); font-size: 15px; letter-spacing: .3px; }

/* Menu chính (kiểu cuongden: chữ xám, hover vàng, menu con thả xuống) */
.nav { flex: 1; display: flex; justify-content: flex-start; }
.nav-head { display: none; }
.nav ul { list-style: none; margin: 0; padding: 0; }
#navMenu { display: flex; gap: 28px; align-items: center; }
.nav-item { position: relative; display: flex; align-items: center; gap: 4px; }
.nav-item > a { display: block; padding: 12px 0; color: #b5b5b5; font-size: 16px; font-weight: 400; white-space: nowrap; transition: color .2s; }
.nav-item > a:hover, .nav-item > a.on, .nav-item.on > a { color: var(--brand); }
.nav-item .arrow { border: 0; background: none; padding: 2px 0 0; color: #b5b5b5; line-height: 0; }
.nav-item .arrow svg { width: 16px; height: 16px; transition: transform .25s; }
.nav-item:hover > .arrow, .nav-item.on > .arrow { color: var(--brand); }
.nav-sub {
  position: absolute; left: -16px; top: 100%; z-index: 5; min-width: 220px; width: max-content;
  background: #fff; border-radius: 10px; padding: 10px 0; box-shadow: 0 0 50px rgba(0,0,0,.07), 0 10px 30px rgba(0,0,0,.25);
  visibility: hidden; opacity: 0; transform: translateY(30px); transition: all .3s ease-in-out;
}
.nav-item:hover > .nav-sub, .nav-item:focus-within > .nav-sub { visibility: visible; opacity: 1; transform: translateY(0); }
.nav-sub li a { display: block; padding: 6px 20px; color: #333; font-size: 15px; white-space: nowrap; transition: color .15s, padding .15s; }
.nav-sub li a:hover, .nav-sub li a.on { color: var(--brand-2); padding-left: 24px; }
.nav-sub.cols { display: grid; grid-template-columns: repeat(3, auto); column-gap: 6px; }
.nav-sub .sub-all a { font-weight: 700; color: var(--ink); }
/* Menu cấp 3: danh mục → danh sách sản phẩm bay ra bên phải */
.nav-sub > li.has-child { position: relative; }
.has-child:has(.nav-sub-child) > a { display: flex; justify-content: space-between; gap: 18px; }
.has-child:has(.nav-sub-child) > a::after { content: '›'; font-size: 18px; line-height: 1; color: #999; }
.nav-sub-child {
  position: absolute; left: 100%; top: -10px; min-width: 260px; width: max-content; max-width: 360px;
  background: #fff; border-radius: 10px; padding: 10px 0; list-style: none; box-shadow: 0 10px 30px rgba(0,0,0,.2);
  visibility: hidden; opacity: 0; transform: translateX(12px); transition: all .2s ease-in-out;
}
.has-child:hover > .nav-sub-child { visibility: visible; opacity: 1; transform: none; }
.nav-sub-child li a { white-space: normal; }
.nav-backdrop { display: none; }

/* Tìm kiếm toàn màn hình */
.search-overlay { position: fixed; inset: 0; z-index: 1001; background: rgba(0,0,0,.85); display: none; align-items: flex-start; justify-content: center; padding: 18vh 16px 0; animation: fade .2s; }
.search-overlay.show { display: flex; }
.search-box { width: 100%; max-width: 850px; }
.search-box p { color: #fff; font-size: 22px; font-weight: 700; text-transform: uppercase; text-align: center; margin: 0 0 16px; letter-spacing: .5px; }
.search-close { position: absolute; top: 20px; right: 20px; border: 0; background: none; color: #fff; font-size: 30px; line-height: 1; padding: 4px; }
.search { position: relative; display: flex; background: #fff; }
.search input { flex: 1; border: 0; height: 50px; padding: 10px 65px 10px 15px; outline: none; color: var(--ink); min-width: 0; font-size: 15px; }
.search button { position: absolute; right: 0; top: 0; width: 50px; height: 50px; border: 0; background: transparent; color: var(--ink); display: grid; place-items: center; }
.search button svg { width: 25px; height: 25px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 2.2fr 1fr; gap: 14px; margin-top: 16px; }
.slider { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--dark); min-height: 360px; }
.slide { position: absolute; inset: 0; display: grid; grid-template-columns: 1.2fr 1fr; opacity: 0; transition: opacity .6s; pointer-events: none; }
.slide.on { opacity: 1; pointer-events: auto; }
.slide-text { padding: 44px 40px 44px 64px; color: #fff; display: flex; flex-direction: column; justify-content: center; gap: 14px; position: relative; z-index: 2; }
.slide-text .tag { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 5px 10px; border-radius: 6px; background: rgba(255,184,0,.15); color: var(--brand); border: 1px solid rgba(255,184,0,.35); }
.slide-text h2 { font-size: clamp(24px, 2.4vw + 12px, 38px); line-height: 1.1; margin: 0; font-weight: 800; letter-spacing: -.5px; }
.slide-text p { color: #b9c1cd; margin: 0; font-size: 15px; max-width: 380px; }
.slide-media { position: relative; overflow: hidden; }
.slide-media img, .slide-media video { width: 100%; height: 100%; object-fit: cover; }
.slide-media::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--dark) 0%, transparent 45%); z-index: 1; }
.slide.cyan .tag { color: #3ee0ff; background: rgba(62,224,255,.12); border-color: rgba(62,224,255,.35); }
.slide.red .tag { color: #ff5a6a; background: rgba(255,90,106,.12); border-color: rgba(255,90,106,.35); }
.slide-glow { position: absolute; width: 380px; height: 380px; border-radius: 50%; left: -120px; bottom: -160px; background: radial-gradient(circle, rgba(255,184,0,.28), transparent 70%); z-index: 1; }
.slide.cyan .slide-glow { background: radial-gradient(circle, rgba(62,224,255,.25), transparent 70%); }
.slide.red .slide-glow { background: radial-gradient(circle, rgba(255,60,80,.25), transparent 70%); }
.dots { position: absolute; left: 64px; bottom: 22px; display: flex; gap: 8px; z-index: 3; }
.dots button { width: 10px; height: 10px; border-radius: 5px; border: 0; background: rgba(255,255,255,.3); padding: 0; transition: width .3s; }
.dots button.on { width: 28px; background: var(--brand); }
.slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 18px; backdrop-filter: blur(4px); }
.slider-arrow:hover { background: var(--brand); color: var(--brand-ink); }
.slider-arrow.prev { left: 10px; } .slider-arrow.next { right: 10px; }
.side-ads { display: grid; grid-template-rows: 1fr 1fr; gap: 14px; }
.side-ad { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--dark); min-height: 170px; }
.side-ad img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.side-ad:hover img { transform: scale(1.06); }
.side-ad::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.8), transparent 60%); }
.side-ad div { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); z-index: 2; color: #fff; background: rgba(0,0,0,.68); padding: 7px 12px; border-radius: 8px; backdrop-filter: blur(3px); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.side-ad b { display: block; font-size: 18px; }
.side-ad span { color: var(--brand); font-weight: 700; font-size: 13px; }

/* ---------- Policies ---------- */
.policies { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.policy { background: var(--card); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); }
.policy i { font-style: normal; width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: #fff6de; color: var(--brand-2); font-size: 18px; }
.policy b { display: block; font-size: 13.5px; }
.policy small { color: var(--muted); font-size: 12px; }

/* ---------- Sections ---------- */
.section { margin-top: 28px; }
/* Tiêu đề mục gọn 1 hàng: tên mục (vạch màu bên trái) — link "Xem tất cả" bên phải */
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 14px; color: var(--on-bg); }
.section-head h3 { margin: 0; font-size: clamp(17px, .8vw + 12px, 22px); font-weight: 800; text-transform: uppercase; letter-spacing: .3px; padding-left: 12px; border-left: 4px solid var(--brand); line-height: 1.15; }
.section-head a { color: var(--brand-2); font-weight: 600; font-size: 14px; white-space: nowrap; }
.section-head a:hover { text-decoration: underline; }
.panel { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }

/* Flash sale */
.flash { background: linear-gradient(120deg, #1a0d02, #3a1600 50%, #1a0d02); border-radius: var(--radius); padding: 18px; color: #fff; position: relative; overflow: hidden; }
.flash::before { content: ''; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; background: radial-gradient(circle, rgba(255,140,0,.35), transparent 70%); }
.flash-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; position: relative; }
.flash-head h3 { margin: 0; font-size: 22px; font-weight: 800; font-style: italic; color: var(--brand); text-transform: uppercase; }
.flash-head h3::before { content: '⚡ '; }
.countdown { display: flex; gap: 6px; align-items: center; }
.countdown span { background: #fff; color: var(--dark); font-weight: 800; border-radius: 6px; padding: 4px 8px; min-width: 36px; text-align: center; font-variant-numeric: tabular-nums; }
.countdown em { font-style: normal; color: var(--brand); font-weight: 800; }
.flash .grid .card { border: 0; color: var(--ink); }

/* Category tiles: dàn đều hết chiều ngang, ảnh bên trái — chữ bên phải */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.cat { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; border: 1.5px solid transparent; min-width: 0; }
.cat:hover { transform: translateY(-3px); border-color: var(--brand); }
.cat .ic { flex: 0 0 76px; height: 76px; border-radius: 12px; overflow: hidden; background: #f4f4f4; }
.cat .ic img { width: 100%; height: 100%; object-fit: cover; }
.cat > div:last-child { min-width: 0; }
.cat b { display: block; font-size: 14.5px; line-height: 1.3; }
.cat small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat em { display: block; font-style: normal; color: var(--brand-2); font-weight: 700; font-size: 12.5px; margin-top: 4px; }
/* Máy tính bảng: ô hẹp → ảnh trên, chữ dưới cho khỏi bị ép nhiều dòng */
@media (min-width: 641px) and (max-width: 1100px) {
  .cat { flex-direction: column; text-align: center; gap: 8px; padding: 12px 8px; }
  .cat .ic { flex: 0 0 auto; width: 64px; height: 64px; }
  .cat small { display: none; }
}

/* Vehicle chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); font-weight: 600; font-size: 13px; transition: all .15s; }
.chip:hover, .chip.on { background: var(--dark); color: var(--brand); border-color: var(--dark); }
.chip small { margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--muted); }
.chip:hover small, .chip.on small { color: inherit; opacity: .75; }
.section-head > .muted { font-size: 13.5px; }

/* ---------- Product grid & card ---------- */
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
/* .grid.fill (Sản phẩm nổi bật): luôn đủ hàng — 10 = 5×2, 8 = 4×2, 9 = 3×3, 6 = 2×3 */
@media (min-width: 901px) and (max-width: 1100px) { .grid.fill > :nth-child(n+9) { display: none; } }
@media (min-width: 641px) and (max-width: 900px) { .grid.fill > :nth-child(n+10) { display: none; } }
@media (max-width: 640px) { .grid.fill > :nth-child(n+7) { display: none; } }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; position: relative; }
.card:hover { box-shadow: 0 10px 30px -10px rgba(0,0,0,.25); transform: translateY(-2px); }
.card-img { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--dark); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-img img { transform: scale(1.07); }
.badges { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 2; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 5px; color: #fff; background: var(--sale); line-height: 1.3; }
.badge.new { background: var(--ok); }
.badge.flash { background: linear-gradient(90deg, var(--brand-2), var(--brand)); color: var(--brand-ink); }
.badge.video { background: rgba(0,0,0,.65); }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { font-weight: 500; font-size: 14px; text-align: center; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.card-name:hover { color: var(--brand-2); }
.price { display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.price b { color: var(--sale); font-size: 16px; font-weight: 800; }
.price s { color: var(--muted); font-size: 12.5px; }
.card-add { display: block; text-align: center; margin-top: auto; border: 1.5px solid var(--dark); background: #fff; border-radius: 8px; padding: 7px; font-weight: 700; font-size: 12.5px; transition: all .15s; }
.card-add:hover { background: var(--dark); color: var(--brand); }

/* ---------- TikTok videos ---------- */
.tiktok-head { display: flex; align-items: center; gap: 14px; background: var(--dark); color: #fff; padding: 16px 18px; border-radius: var(--radius) var(--radius) 0 0; flex-wrap: wrap; }
.tiktok-head .avatar { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px #fe2c55, 0 0 0 4px #25f4ee; }
.tiktok-head .avatar img { width: 100%; height: 100%; object-fit: cover; }
.tiktok-head b { font-size: 17px; display: block; }
.tiktok-head small { color: #9aa3b2; }
.tiktok-head .btn { margin-left: auto; background: #fe2c55; color: #fff; }
.videos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; background: var(--dark-2); padding: 12px; border-radius: 0 0 var(--radius) var(--radius); }
.tiktok-head .avatars { display: flex; }
/* Nút "Xem thêm" trang Video theo xe (mỗi lần 20 video = 5 cột × 4 hàng) */
.load-more { text-align: center; margin-top: 16px; }
.load-more .btn small { font-weight: 500; opacity: .7; margin-left: 4px; }
.tiktok-head .avatars .avatar + .avatar { margin-left: -14px; }
.tiktok-head .tt-follow { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tiktok-head .tt-follow .btn { margin-left: 0; }
/* Dải video kéo ngang (trang chủ) */
.rail-wrap { position: relative; background: var(--dark-2); padding: 12px; border-radius: 0 0 var(--radius) var(--radius); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 50px) / 6); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.rail::-webkit-scrollbar { display: none; }
.rail .vid { scroll-snap-align: start; }
.vid.more { display: grid; place-items: center; text-align: center; color: #fff; font-size: 13px; line-height: 1.6; background: linear-gradient(160deg, #25f4ee33, #fe2c5533), var(--dark); border: 1.5px dashed rgba(255,255,255,.25); }
.vid.more::after { display: none; }
.vid.more b { color: var(--brand); }
.rail-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: #111; font-size: 24px; line-height: 1; box-shadow: 0 4px 14px rgba(0,0,0,.4); cursor: pointer; }
.rail-nav:hover { background: #fff; }
.rail-nav.prev { left: 2px; }
.rail-nav.next { right: 2px; }
.vid { position: relative; aspect-ratio: 9 / 14; border-radius: 10px; overflow: hidden; background: #000; cursor: pointer; }
.vid img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s, opacity .3s; }
.vid:hover img { transform: scale(1.05); opacity: .85; }
.vid::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.85), transparent 50%); }
.vid .play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.2); backdrop-filter: blur(6px); display: grid; place-items: center; color: #fff; font-size: 16px; z-index: 2; border: 1.5px solid rgba(255,255,255,.5); }
.vid .cap { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 2; color: #fff; font-size: 12px; line-height: 1.35; }
.vid .cap b { display: block; font-size: 11px; color: var(--brand); margin-bottom: 2px; }
.vid .cap span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Breadcrumb / listing ---------- */
.crumbs { display: flex; gap: 8px; color: var(--on-bg-muted); font-size: 13px; margin: 16px 0 12px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--brand-2); }
.crumbs span::before { content: '›'; margin-right: 8px; }
.listing { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.filters { position: sticky; top: 130px; }
.filters h4 { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; }
.filters .grp + .grp { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.filters label { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; font-size: 13.5px; }
.filters input[type=radio], .filters input[type=checkbox] { accent-color: var(--brand-2); width: 16px; height: 16px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar h2 { margin: 0; font-size: 20px; color: var(--on-bg); text-transform: uppercase; }
.toolbar h2 .muted { color: var(--on-bg-muted); text-transform: none; }
select.sort { border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 48px; }
.listing .grid { grid-template-columns: repeat(4, 1fr); }

/* ---------- Product detail ---------- */
.pd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 28px); }
/* Không để phần tử con (nút, chữ dài) kéo giãn lưới làm tràn ngang trên điện thoại */
.pd > *, .hero > *, .listing > *, .footer-grid > * { min-width: 0; }
.pd-gallery .main { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: var(--dark); }
.pd-gallery .main img, .pd-gallery .main video { width: 100%; height: 100%; object-fit: cover; }
.pd-gallery .main video { object-fit: contain; }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--dark); position: relative; }
.thumbs button.on { border-color: var(--brand-2); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .is-video::after { content: '▶'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.4); font-size: 18px; }
.pd-info h1 { font-size: clamp(19px, 1vw + 14px, 24px); line-height: 1.3; margin: 0 0 8px; }
.pd-meta { display: flex; gap: 16px; color: var(--muted); font-size: 13px; flex-wrap: wrap; align-items: center; }
.pd-price { background: #fafafa; border-radius: 10px; padding: 14px 16px; margin: 16px 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px dashed var(--line); }
.pd-price b { color: var(--sale); font-size: clamp(24px, 1.5vw + 18px, 30px); font-weight: 800; }
.pd-price s { color: var(--muted); font-size: 16px; }
.pd-price .off { background: var(--sale); color: #fff; font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 5px; }
.pd-flash { display: flex; align-items: center; gap: 12px; background: linear-gradient(90deg, var(--brand-2), var(--sale)); color: #fff; padding: 10px 16px; border-radius: 10px 10px 0 0; margin-bottom: -16px; margin-top: 16px; font-weight: 700; flex-wrap: wrap; }
.pd-flash + .pd-price { border-radius: 0 0 10px 10px; }
.pd-flash .countdown span { padding: 2px 6px; min-width: 28px; font-size: 13px; }
.pd-flash .countdown em { color: #fff; }
.pd-row { display: flex; gap: 14px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.pd-row > label { width: 90px; color: var(--muted); font-size: 13px; flex-shrink: 0; }
.opt { display: flex; gap: 8px; flex-wrap: wrap; }
.opt button { border: 1.5px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 600; }
.opt button.on { border-color: var(--brand-2); background: #fff6de; color: #8a4a00; }
.opt button:has(img) { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; }
.opt button img { width: 28px; height: 28px; border-radius: 5px; object-fit: cover; }
.pd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.pd-perks { margin-top: 18px; display: grid; gap: 8px; background: #fafafa; padding: 14px; border-radius: 10px; }
.pd-perks div { display: flex; gap: 10px; font-size: 13.5px; }
.pd-perks div::before { content: '✓'; color: var(--ok); font-weight: 800; }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 10px 16px; font-weight: 700; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand-2); }
.desc { white-space: pre-line; font-size: 14.5px; line-height: 1.7; }
table.specs { width: 100%; border-collapse: collapse; }
table.specs td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.specs td:first-child { color: var(--muted); width: 38%; background: #fafafa; }

/* ---------- Tóm tắt (dùng trong Admin) & form ---------- */
.summary { position: sticky; top: 130px; }
.summary .row { display: flex; justify-content: space-between; padding: 7px 0; }
.summary .total { border-top: 1.5px dashed var(--line); margin-top: 8px; padding-top: 12px; font-size: 16px; font-weight: 800; }
.summary .total span:last-child { color: var(--sale); font-size: 22px; }
.msg { font-size: 12.5px; margin-top: -4px; }
.msg.ok { color: var(--ok); } .msg.err { color: var(--sale); }


.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; outline: none; transition: border-color .15s; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-2); }
.field.invalid input { border-color: var(--sale); }
.mini-items .it { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-size: 13px; }
.mini-items img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.mini-items .it div { flex: 1; }


/* ---------- Modal / popup ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(5,7,10,.72); backdrop-filter: blur(4px); animation: fade .2s; }
.modal-box { background: #fff; border-radius: 16px; max-width: 460px; width: 100%; overflow: hidden; position: relative; animation: pop .25s; max-height: 92vh; overflow-y: auto; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 16px; z-index: 3; }
.popup-ad img { width: 100%; height: 260px; object-fit: cover; }
.popup-ad .body { padding: 20px; text-align: center; }
.popup-ad h3 { margin: 0 0 6px; font-size: 22px; }
.video-modal .modal-box { background: #000; max-width: 400px; }
.video-modal video { width: 100%; max-height: 82vh; }
.video-modal iframe { display: block; width: 100%; height: min(76vh, 700px); border: 0; }
.video-modal .tt-link { display: block; padding: 10px; text-align: center; color: #fff; font-size: 13px; font-weight: 600; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--brand-2); border-radius: 50%; animation: spin .8s linear infinite; margin: 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.95); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--dark); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 200; opacity: 0; transition: all .25s; display: flex; gap: 10px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast b { color: var(--brand); }

.float-contact { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.float-contact a { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.float-contact .p { background: linear-gradient(180deg, #5df27a, #28c840); animation: ring-green 2s infinite; }
.float-contact .p svg { width: 50%; height: 50%; display: block; }
.float-contact .z { background: #0068ff; animation: ring 2s infinite; }
.float-contact .t { background: #000; border: 2px solid #fe2c55; }
.float-contact .t svg { width: 46%; height: 46%; display: block; overflow: visible; }
.mobile-bar { display: none; }
@media (max-width: 1023px) {
  /* Có thanh liên hệ dưới đáy → ẩn nút nổi để không che nội dung */
  .float-contact { display: none; }
  .mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(3, 1fr);
    background: var(--dark); box-shadow: 0 -4px 18px rgba(0,0,0,.25); padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-bar a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 54px; font-weight: 700; font-size: 14.5px; color: #fff; }
  .mobile-bar i { font-style: normal; font-size: 17px; }
  .mobile-bar .call { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); }
  .mobile-bar .zalo { background: #0068ff; }
  body { padding-bottom: calc(54px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(70px + env(safe-area-inset-bottom)); }
}
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(0,104,255,.5); } 50% { box-shadow: 0 0 0 12px rgba(0,104,255,0); } }
@keyframes ring-green { 0%, 100% { box-shadow: 0 0 0 0 rgba(40,200,64,.5); } 50% { box-shadow: 0 0 0 12px rgba(40,200,64,0); } }

/* ---------- Footer ---------- */
.footer { background: var(--dark); color: #aab2bf; margin-top: 40px; padding: 36px 0 0; font-size: 13.5px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 28px; }
.footer h5 { color: #fff; font-size: 14px; text-transform: uppercase; margin: 0 0 12px; letter-spacing: .4px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.footer a:hover { color: var(--brand); }
.footer .contact b { color: var(--brand); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 28px; padding: 14px 0; text-align: center; font-size: 12.5px; }
.social { display: flex; gap: 8px; margin-top: 12px; }
.social a { padding: 7px 12px; border-radius: 8px; background: var(--dark-3); color: #fff; font-weight: 600; font-size: 12.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .hotline { display: none; }
  #navMenu { gap: 22px; }
  .nav-item > a { font-size: 15px; }
}
/* Mobile: menu trượt từ trái, nền trắng như cuongden */
@media (max-width: 1023px) {
  .header-main { gap: 14px; }
  .menu-btn { display: block; }
  .logo { margin-right: auto; }
  .nav {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 1002; width: 300px; max-width: 85vw;
    background: #fff; color: var(--ink); display: block; overflow-y: auto;
    transform: translateX(-100%); transition: transform .3s ease;
  }
  .nav.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .nav-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #eee; }
  .nav-head .logo-text b { color: var(--ink); }
  .nav-head .logo-text b span { color: var(--brand-2); }
  .nav-close { color: var(--ink); font-size: 20px; line-height: 1; padding: 4px; }
  #navMenu { display: block; padding: 6px 0; }
  .nav-item { flex-wrap: wrap; justify-content: space-between; border-bottom: 1px solid #f1f1f1; }
  .nav-item > a { color: #333; font-size: 15px; padding: 11px 16px; flex: 1; }
  .nav-item > a.on, .nav-item.on > a { color: var(--brand-2); }
  .nav-item .arrow { color: #333; padding: 10px 16px; }
  .nav-item.open > .arrow svg { transform: rotate(180deg); }
  .nav-sub, .nav-sub.cols {
    position: static; display: none; width: 100%; min-width: 0; box-shadow: none; border-radius: 0;
    background: #fafafa; padding: 4px 0 8px; visibility: visible; opacity: 1; transform: none; transition: none;
  }
  .nav-sub.cols { grid-template-columns: 1fr 1fr; }
  .nav-item.open > .nav-sub { display: block; }
  .nav-item.open > .nav-sub.cols { display: grid; }
  .nav-sub li a { padding: 7px 28px; font-size: 14px; white-space: normal; }
  .nav-sub-child { display: none; }
  .has-child:has(.nav-sub-child) > a::after { content: none; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 1001; background: rgba(0,0,0,.55); }
  /* Menu đang mở: đưa header (chứa menu + lớp phủ) lên trên nút nổi Zalo/TikTok, khoá cuộn trang phía sau */
  body.nav-open { overflow: hidden; }
  body.nav-open .header { z-index: 1001; }
  .nav-backdrop.show { display: block; }
}
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .listing .grid { grid-template-columns: repeat(3, 1fr); }
  .videos { grid-template-columns: repeat(4, 1fr); }
  .rail { grid-auto-columns: calc((100% - 30px) / 4); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .side-ads { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .policies { grid-template-columns: repeat(2, 1fr); }
  .grid, .grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
  .listing { grid-template-columns: 1fr; }
  .filters { position: static; }
  .pd { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .header-main { min-height: 58px; }
  .logo-text small { display: none; }
  .logo-text b { font-size: 17px; }
  .logo-img { height: 42px; }
  .slider { min-height: clamp(340px, 105vw, 440px); }
  .slide { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .slide-media { position: absolute; inset: 0; }
  .slide-media::before { background: linear-gradient(0deg, var(--dark) 20%, rgba(13,16,21,.3) 70%); }
  .slide-text { grid-row: 2; padding: 24px 20px 50px; }
  .dots { left: 20px; bottom: 18px; }
  .slider-arrow { display: none; }
  .side-ad { min-height: 130px; }
  .grid, .grid.cols-4, .listing .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .videos { grid-template-columns: repeat(2, 1fr); }
  .rail { grid-auto-columns: 42%; }
  .rail-nav { display: none; }
  .cats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cat { padding: 10px; gap: 10px; }
  .cat .ic { flex-basis: 48px; height: 48px; border-radius: 10px; }
  .cat b { font-size: 13px; }
  .cat small { display: none; }
  .cat em { font-size: 11.5px; }
  .cat:last-child:nth-child(odd) { grid-column: 1 / -1; } /* số danh mục lẻ → ô cuối trải hết hàng */
  .policies { gap: 8px; }
  .policy { padding: 10px; gap: 8px; align-items: flex-start; }
  .policy i { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
  .policy b { font-size: 12.5px; line-height: 1.3; }
  .policy small { font-size: 11px; line-height: 1.35; display: block; margin-top: 2px; }
  .topbar { font-size: 12px; padding: 4px 12px; line-height: 1.35; }
  .side-ad b { font-size: 15px; }
  .side-ad span { font-size: 12px; }
  .chip { padding: 7px 11px; font-size: 12.5px; }
  .pd-actions { grid-template-columns: 1fr; }
  .pd-actions .btn, .btn-lg { white-space: normal; text-align: center; }
  .pd-row > label { width: 72px; }
  .pd-price { padding: 12px; gap: 6px 10px; }
  .float-contact { right: 10px; bottom: 12px; gap: 8px; }
  .float-contact a { width: 42px; height: 42px; font-size: 10.5px; }
  .toolbar h2 { font-size: 17px; }
  .tiktok-head { padding: 12px; gap: 10px; }
  .tiktok-head .avatar { width: 42px; height: 42px; }
  .tiktok-head .btn { margin-left: 0; width: 100%; }
  .tiktok-head .tt-follow { width: 100%; margin-left: 0; }
  .tiktok-head .tt-follow .btn { flex: 1; width: auto; }
  .rail-wrap { padding: 8px; }
  .rail { gap: 8px; }
  .videos { padding: 8px; gap: 8px; }
  .panel { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
/* Màn hình rất nhỏ (iPhone SE, Android 360px…) */
@media (max-width: 380px) {
  .header-main { gap: 10px; padding-left: 12px; padding-right: 12px; }
  .header-actions { gap: 12px; }
  .logo { gap: 7px; }
  .logo-text b { font-size: 15px; }
  .logo-img { height: 36px; }
  .grid, .grid.cols-4, .listing .grid { gap: 8px; }
  .card-body { padding: 8px 8px 10px; gap: 4px; }
  .card-name { font-size: 13px; min-height: 34px; }
  .card-add { font-size: 12px; padding: 6px; }
  .policies { grid-template-columns: 1fr; }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .side-ads { grid-template-columns: 1fr; }
}
