/* ==========================================================================
   Caesar Việt — giao diện 2026
   Ý tưởng: "tường gạch men" — sản phẩm xếp thành lưới ô gạch trắng, ngăn bởi
   đường ron mảnh; nền xanh xám như gạch ốp; màu cam thương hiệu chỉ dùng cho
   giá bán và nút hành động.
   ========================================================================== */

:root {
    --brand: #f96d10;            /* ghi đè từ tbl_config.color */
    --brand-ink: #fff;
    --ink: #17324d;              /* chữ chính, header */
    --ink-2: #5b6b7b;            /* chữ phụ */
    --tile: #eef2f5;             /* nền gạch ốp */
    --line: #d9e1e8;             /* đường ron */
    --white: #fff;
    --ok: #1d7a46;
    --danger: #b42318;

    --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --fs-xs: .8125rem;   /* 13 */
    --fs-sm: .875rem;    /* 14 */
    --fs-md: 1rem;       /* 16 */
    --fs-lg: 1.25rem;    /* 20 */
    --fs-xl: 1.625rem;   /* 26 */
    --fs-2xl: 2.0625rem; /* 33 */

    --wrap: 1240px;
    --gap: 24px;
    --r-sm: 6px;
    --r-md: 10px;
    --header-h: 96px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
body {
    margin: 0; font: 400 var(--fs-md)/1.6 var(--font); color: var(--ink);
    background: var(--white); -webkit-font-smoothing: antialiased;
}
img, svg, video, iframe { max-width: 100%; }
img { height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 700; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
svg[viewBox="0 0 24 24"] { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-xs); }

/* ---------- Nút ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 0 18px; border-radius: var(--r-sm);
    border: 1.5px solid transparent; background: none; cursor: pointer;
    font-weight: 500; white-space: nowrap; transition: background .15s, color .15s, border-color .15s;
}
.btn--brand { background: var(--brand); color: var(--brand-ink); }
.btn--brand:hover { background: color-mix(in srgb, var(--brand) 88%, #000); color: var(--brand-ink); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: var(--white); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: var(--fs-sm); }
.btn--lg { min-height: 50px; padding: 0 26px; font-size: var(--fs-md); }
.icon-btn {
    display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0;
    background: none; border-radius: var(--r-sm); cursor: pointer; position: relative; color: inherit;
}
.icon-btn:hover { background: var(--tile); color: var(--ink); }
.badge {
    position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 10px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700;
    display: grid; place-items: center; line-height: 1;
}
.badge[hidden] { display: none; }

/* ---------- Topbar & header ---------- */
/* Theo giao diện website cũ: thanh trên xám đậm + nút giỏ hàng cam; hàng chính nền xám nhạt,
   logo — menu chữ in hoa có vạch ngăn — ô tìm kiếm nút cam */
.topbar { background: #333; color: #ddd; font-size: 15px; }
.topbar__in { display: flex; gap: 36px; align-items: center; min-height: 34px; }
.topbar__phone { display: inline-flex; align-items: center; gap: 6px; }
.topbar__phone svg { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: #5cb85c; fill: #fff; }
.topbar__phone b { color: #fff; font-weight: 700; }
.topbar a { color: #ddd; }
.topbar a:hover { color: #fff; }
.topbar__cart {
    margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 3px;
    background: var(--brand); color: #fff !important; font-size: 14px; line-height: 18px;
}
.topbar__cart svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.topbar__cart:hover { filter: brightness(1.08); }

.header { position: sticky; top: 0; z-index: 40; background: #f5f5f5; border-bottom: 1px solid #e6e6e6; }
.header__in { position: relative; display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
.header__menu { display: none; }
.header__cart { display: none; }
.logo { flex: none; }
.logo img { max-height: 64px; width: auto; }

.search { position: relative; flex: 0 1 300px; margin-left: auto; display: flex; }
.search input {
    flex: 1; min-width: 0; height: 34px; padding: 0 24px; border: 1px solid #ddd; border-right: 0;
    border-radius: 0; background: var(--white); font-size: 15px;
}
.search input:focus { outline: none; border-color: var(--brand); }
.search button { width: 39px; height: 34px; border: 0; border-radius: 0; background: var(--brand); color: #fff; cursor: pointer; display: grid; place-items: center; }
.search button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.6; }
.search__list {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50; background: var(--white);
    border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 12px 32px rgb(23 50 77 / .14); overflow: hidden;
}
.search__list a { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 8px 12px; font-size: var(--fs-sm); }
.search__list a:hover, .search__list a.is-active { background: var(--tile); color: var(--ink); }
.search__list img { width: 48px; height: 48px; object-fit: contain; background: #fff; }
.search__list small { color: var(--ink-2); display: block; }
.search__list b { color: var(--brand); font-weight: 700; white-space: nowrap; }
.search__list .search__all { display: block; text-align: center; padding: 10px; font-weight: 500; border-top: 1px solid var(--line); }
.search--inline { max-width: 420px; margin: 20px 0; }

/* Menu chính: chữ in hoa đậm, vạch chấm ngăn giữa các mục */
.nav { display: flex; align-items: stretch; align-self: stretch; }
.nav > * { position: relative; display: flex; }
/* Vạch ngăn gắn vào chữ menu (mục SẢN PHẨM là position: static nên không gắn vào khung bọc được) */
.nav > * + .nav__link::before,
.nav > * + .nav__drop > .nav__link::before { content: ""; position: absolute; left: 0; top: 50%; height: 16px; margin-top: -8px; border-left: 1px dotted #999; }
.nav__link { position: relative; display: flex; align-items: center; gap: 5px; padding: 0 12px; font-size: 14px; font-weight: 700; text-transform: uppercase; color: #222; white-space: nowrap; }
.nav__link:hover, .nav__link.is-active { color: var(--brand); }
.nav__link--caret::after { content: ""; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; margin-top: 2px; }
.mega, .nav__sub {
    position: absolute; top: 100%; left: 0; z-index: 45; background: var(--white);
    border: 1px solid var(--line); box-shadow: 0 18px 40px rgb(23 50 77 / .14);
    visibility: hidden; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s;
}
.mega { width: min(980px, calc(100vw - 32px)); display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 24px; padding: 20px 24px; }
.mega a { display: block; padding: 4px 0; font-size: var(--fs-sm); color: var(--ink-2); }
.mega a:hover { color: var(--brand); }
.mega .mega__root { color: var(--ink); font-weight: 700; font-size: var(--fs-md); padding-bottom: 6px; }
.mega__col { break-inside: avoid; padding-bottom: 12px; }
.nav__drop:hover .mega, .nav__drop:focus-within .mega,
.nav__drop:hover .nav__sub, .nav__drop:focus-within .nav__sub { visibility: visible; opacity: 1; transform: none; }
.nav__drop { position: relative; display: flex; }
/* Danh mục dưới SẢN PHẨM: căn theo cả hàng header (rộng hết khung), không theo mục menu */
.nav__drop--mega { position: static; }
.nav__drop--mega .mega {
    left: 0; right: 0; width: auto; border-top: 2px solid var(--brand);
    display: block; columns: 4 220px; column-gap: 32px; /* không đặt max-height: cột sẽ tràn ngang và mất mục */
}
.nav__drop--mega .mega__col { break-inside: avoid; padding-bottom: 14px; }
.nav__sub { min-width: 320px; padding: 8px 0; }
.nav__sub a { display: block; padding: 8px 18px; font-size: var(--fs-sm); }

/* Drawer mobile */
.drawer { margin: 0; padding: 0; border: 0; width: min(360px, 88vw); height: 100dvh; max-height: none; background: var(--white); }
.drawer::backdrop { background: rgb(23 50 77 / .45); }
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.drawer__body { padding: 8px 0 32px; overflow-y: auto; height: calc(100% - 65px); }
.drawer__link, .drawer__group summary { display: block; padding: 12px 20px; font-weight: 500; border-bottom: 1px solid var(--tile); cursor: pointer; }
.drawer__group summary { list-style: none; display: flex; justify-content: space-between; }
.drawer__group summary::after { content: "+"; color: var(--ink-2); }
.drawer__group[open] summary::after { content: "−"; }
.drawer__group a { display: block; padding: 9px 20px 9px 36px; font-size: var(--fs-sm); color: var(--ink-2); }
.drawer__label { margin: 16px 20px 4px; font-size: var(--fs-xs); color: var(--ink-2); }

/* ---------- Thông báo ---------- */
.notice { margin: 16px 0 0; padding: 12px 16px; border-radius: var(--r-sm); background: #e8f5ee; color: var(--ok); border-left: 4px solid var(--ok); }
.notice--error { background: #fdecea; color: var(--danger); border-color: var(--danger); }
.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90;
    background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-sm);
    display: flex; gap: 16px; align-items: center; box-shadow: 0 10px 30px rgb(0 0 0 / .25); max-width: calc(100vw - 32px);
}
.toast[hidden] { display: none; }
.toast a { color: #fff; font-weight: 700; text-decoration: underline; }

/* ---------- Trang chủ ---------- */
.hero { display: grid; grid-template-columns: 260px 1fr; gap: var(--gap); margin-top: var(--gap); align-items: stretch; }
.hero .slider { min-height: 100%; }
.hero .slider__track, .hero .slider__item, .hero .slider__item img { height: 100%; }
.slider { position: relative; overflow: hidden; border-radius: var(--r-md); background: var(--tile); }
.slider__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slider__track::-webkit-scrollbar { display: none; }
.slider__item { flex: 0 0 100%; scroll-snap-align: start; }
.slider__item img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.slider__dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 8px; }
.slider__dots button { width: 28px; height: 4px; border: 0; border-radius: 2px; background: rgb(255 255 255 / .6); cursor: pointer; padding: 0; }
.slider__dots button[aria-selected="true"] { background: var(--brand); }

.banners { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.banners img { width: 100%; border-radius: var(--r-md); }
.banners--promo { margin-bottom: 32px; }

.promises { margin-top: 32px; }
.promises__h1 { font-size: var(--fs-lg); font-weight: 500; color: var(--ink-2); margin-bottom: 12px; }
.promises ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; } /* viền đủ 4 cạnh */
.promises li { padding: 16px 20px; color: var(--ink-2); font-size: var(--fs-sm); }
.promises li + li { border-left: 1px solid var(--line); }
.promises strong { display: block; color: var(--ink); font-size: var(--fs-md); }
.promises a { color: var(--brand); font-weight: 700; font-size: var(--fs-md); }

.block { margin-top: 48px; }
.block__head { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.block__title { font-size: var(--fs-xl); }
.block__more { margin-left: auto; font-weight: 500; color: var(--ink-2); font-size: var(--fs-sm); border-bottom: 1px solid currentColor; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.block__head .chips { margin: 0; flex: 1; min-width: 0; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 14px; border-radius: 999px; background: var(--tile); font-size: var(--fs-sm); }
.chip:hover { background: var(--ink); color: #fff; }

/* ---------- Lưới gạch sản phẩm (yếu tố nhận diện) ---------- */
.tiles {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.tiles--row {
    --per-row: 5;
    grid-template-columns: none; grid-auto-flow: column;
    grid-auto-columns: calc(100% / var(--per-row));
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none;
}
.tiles--row::-webkit-scrollbar { display: none; }
.tiles--row .tile { scroll-snap-align: start; }
.tile { position: relative; background: var(--white); display: flex; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tile__img { position: relative; display: block; padding: 18px; background: var(--white); }
.tile__img img { width: 100%; aspect-ratio: 1; object-fit: contain; transition: transform .25s ease; }
.tile:hover .tile__img img { transform: scale(1.04); }
.tile__off {
    position: absolute; top: 12px; left: 12px; background: var(--brand); color: #fff;
    font-size: var(--fs-xs); font-weight: 700; padding: 2px 8px; border-radius: 3px;
}
/* Hết hàng — MỌI giao diện: ảnh mờ + nhãn "Hết hàng" góc trên bên phải (thẻ sản phẩm, trang chi tiết, xem nhanh).
   Kiểu nhãn trên thẻ sản phẩm: theme có thể ghi đè .tile__stock (Showroom, Vivid có kiểu riêng). */
.tile.is-out .tile__img img, .soldout img { opacity: .35; filter: grayscale(.5); }
.tile__stock, .soldout__label {
    position: absolute; top: 12px; right: 12px; z-index: 2; padding: 2px 8px; border-radius: 3px;
    background: rgb(31 41 55 / .85); color: #fff; font-size: var(--fs-xs); font-weight: 600; pointer-events: none;
}
.soldout { position: relative; }
.soldout__label { top: 16px; right: 16px; padding: 4px 12px; font-size: var(--fs-sm); }
.tile__body { padding: 0 16px 14px; flex: 1; }
.tile__model { font-size: var(--fs-xs); color: var(--ink-2); }
.tile__name { font-size: var(--fs-sm); font-weight: 500; line-height: 1.45; margin: 2px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
/* Nút mua đè mép dưới ảnh — không tốn chiều cao, không che tên / giá */
.tile__media { position: relative; }
.tile__actions { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 2; display: flex; gap: 6px; }
.tile__actions form { flex: 1; min-width: 0; }
.tile__add { width: 100%; gap: 6px; padding: 0 10px; white-space: nowrap; box-shadow: 0 4px 12px rgb(0 0 0 / .15); }
.tile__add svg, .tile__quick svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.tile__add span { overflow: hidden; text-overflow: ellipsis; }
.tile__quick {
    flex: none; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; cursor: pointer;
    border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); color: var(--ink); box-shadow: 0 4px 12px rgb(0 0 0 / .1);
}
.tile__quick:hover { border-color: var(--ink); }
@media (hover: hover) {
    /* Máy tính: rê chuột mới hiện */
    .tile__actions { opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s; }
    .tile:hover .tile__actions, .tile:focus-within .tile__actions { opacity: 1; transform: none; }
}
@media (hover: none) {
    /* Điện thoại / máy tính bảng: chỉ nút giỏ tròn ở góc ảnh, luôn hiện; bấm sản phẩm để xem chi tiết */
    .tile__actions { left: auto; right: 8px; bottom: 8px; }
    .tile__quick, .tile__add span { display: none; }
    .tile__add { width: 38px; height: 38px; min-height: 0; padding: 0; border-radius: 50%; }
    .tile__add svg { width: 18px; height: 18px; }
}

.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.price strong { color: var(--brand); font-weight: 700; }
.price s { color: var(--ink-2); font-size: var(--fs-xs); }
/* Thẻ sản phẩm: giá bán + giá gạch nằm 1 dòng (chỉ xuống dòng khi ô quá hẹp, vd điện thoại) */
.tile .price { gap: 2px 6px; }
.tile .price strong { font-size: 15px; white-space: nowrap; }
.tile .price s { font-size: 12px; white-space: nowrap; margin-left: auto; } /* giá gốc (không kèm "đ") dồn sang phải */
.tile:not([class*="tile--"]) .tile__body { padding-inline: 14px; } /* giao diện gốc: thêm chỗ cho 2 giá 1 dòng */
.price--lg strong { font-size: var(--fs-2xl); line-height: 1.1; }
.price--lg s { font-size: var(--fs-md); }
.price__off { font-size: var(--fs-sm); color: var(--ok); font-weight: 500; }

/* Slider trang chủ: ảnh giữa nổi bật, hai bên lấp ló mờ (như site cũ) */
.stage { position: relative; background: var(--tile); }
.stage .slider__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-inline: max(16px, calc((100vw - var(--wrap)) / 2)); gap: 12px; }
.stage .slider__track::-webkit-scrollbar { display: none; }
.stage .slider__item { flex: 0 0 min(100%, calc(var(--wrap) - 32px)); scroll-snap-align: center; transition: opacity .3s; opacity: .45; }
.stage .slider__item.is-active { opacity: 1; }
.stage .slider__item img { width: 100%; aspect-ratio: 1000 / 300; object-fit: cover; background: #dfe5ea; }
.stage__arrow {
    position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0;
    background: rgb(255 255 255 / .85); color: var(--ink); cursor: pointer; display: grid; place-items: center;
}
.stage__arrow:hover { background: #fff; }
.stage__arrow--prev { left: max(16px, calc((100vw - var(--wrap)) / 2 + 16px)); }
.stage__arrow--next { right: max(16px, calc((100vw - var(--wrap)) / 2 + 16px)); }

.promises__icon { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; }
.promises li { display: flex; align-items: center; gap: 14px; }
.promises li span strong { display: inline; }
.promises li > span:last-child { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.35; }
.promises li > span:last-child strong { color: var(--ink); font-size: var(--fs-md); display: block; }

.banners--home { grid-template-columns: 3fr 2fr; }
.banners--home a:only-child { grid-column: 1 / -1; }
.banners--home img { height: 100%; object-fit: cover; }

/* Nền gạch cho vùng sản phẩm */
.band { background: var(--tile); padding: 8px 0 48px; margin-top: 40px; }
.band .rail { margin-top: 40px; }
.sale-block { display: grid; grid-template-columns: 260px 1fr; gap: var(--gap); align-items: stretch; }
/* Khung danh mục cạnh "Sản phẩm khuyến mãi": đều mép trên + mép dưới với lưới sản phẩm,
   các dòng giãn đều chiều cao. 96px = .band .rail margin-top 40 + dòng tiêu đề 40 + khoảng cách 16. */
.sale-block .block__head { min-height: 40px; margin-bottom: 16px; flex-wrap: nowrap; }
.sale-block .catnav { margin-top: 96px; display: flex; flex-direction: column; }
.sale-block .catnav__title { font-size: 17px; padding: 14px 18px; }
.sale-block .catnav > ul { flex: 1; display: flex; flex-direction: column; }
.sale-block .catnav > ul > li { flex: 1 1 0; display: flex; min-height: 40px; }
.sale-block .catnav > ul > li > a { flex: 1; display: flex; align-items: center; font-size: 15px; padding-inline: 18px 30px; }
.sale-block .catnav li ul { display: none; }
.sale-block__main { min-width: 0; }
.sale-block .tiles--row { --per-row: 4; grid-template-rows: repeat(2, auto); } /* 2 hàng, cuộn ngang theo cột (sản phẩm xếp trên → dưới rồi sang cột kế) */
.rail__nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.rail__nav .block__more { margin-right: 10px; }
.rail__btn { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--white); border-radius: var(--r-sm); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.rail__btn svg { width: 18px; height: 18px; }
.rail__btn:hover:not(:disabled) { border-color: var(--ink); }
.rail__btn:disabled { opacity: .35; cursor: default; }
.block__head .block__more { margin-left: 0; }
.block__head > .block__more:last-child { margin-left: auto; }

.to-top {
    position: fixed; right: 20px; bottom: 24px; z-index: 55; width: 46px; height: 46px; border-radius: 50%;
    border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer;
    box-shadow: 0 6px 18px rgb(23 50 77 / .3);
}
.to-top[hidden] { display: none; }

/* Newsletter */
.newsletter {
    margin-top: 56px; color: #fff;
    background: linear-gradient(rgb(23 50 77 / .88), rgb(23 50 77 / .88)), var(--bg, none) center / cover, var(--ink);
}
.newsletter__in { display: grid; grid-template-columns: 1fr minmax(320px, 460px); gap: 32px; align-items: center; padding-block: 40px; }
.newsletter h2 { font-size: var(--fs-xl); margin-bottom: 6px; }
.newsletter p { margin: 0; color: #c9d6e2; max-width: 56ch; }
.newsletter__form { display: flex; gap: 8px; }
.newsletter__form input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 0; border-radius: var(--r-sm); color: var(--ink); }
.newsletter__form .btn { min-height: 48px; }

/* Tin tức */
.posts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.post__img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-md); background: var(--tile); }
.post__title { font-size: var(--fs-md); margin: 12px 0 6px; }
.post__excerpt { margin: 0; color: var(--ink-2); font-size: var(--fs-sm); }

/* ---------- Bố cục 2 cột ---------- */
.layout { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; margin-bottom: 32px; }
.content { min-width: 0; }
.sidebar { display: grid; gap: 20px; position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; scrollbar-width: thin; }

.catnav { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--white); }
.catnav__title { font-size: var(--fs-md); padding: 12px 16px; background: var(--tile); }
.catnav ul { list-style: none; margin: 0; padding: 0; }
.catnav > ul > li { border-top: 1px solid var(--line); }
.catnav a { display: block; padding: 9px 16px; font-size: var(--fs-sm); }
.catnav > ul > li > a { font-weight: 500; }
.catnav li ul { display: none; padding-bottom: 6px; }
.catnav li.is-open ul { display: block; }
.catnav li ul a { padding: 5px 16px 5px 28px; color: var(--ink-2); }
.catnav a.is-current { color: var(--brand); font-weight: 700; }
.hero .catnav li ul { display: none !important; }
@media (hover: hover) { .catnav > ul > li:hover ul { display: block; } .hero .catnav > ul > li:hover ul { display: none; } }

/* Cột bên trên máy tính: tên danh mục 1 dòng, danh mục con bung sang phải (không đẩy các dòng dưới) */
@media (hover: hover) and (min-width: 901px) {
    /* .sidebar là position: sticky → tạo lớp xếp chồng riêng; phải nâng cả cột lên trên cột sản phẩm
       thì khung danh mục con mới không bị ô sản phẩm đè (vẫn dưới header z-index 40) */
    .layout > .sidebar { z-index: 30; }
    :is(.sidebar .catnav, .sale-block .catnav, .catnav--fly) > ul > li > a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 28px; position: relative; }
    :is(.sidebar .catnav, .sale-block .catnav, .catnav--fly) > ul > li.has-sub > a::after {
        content: ""; position: absolute; right: 14px; top: 50%; width: 6px; height: 6px; margin-top: -3px;
        border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); opacity: .45;
    }
    :is(.sidebar .catnav, .sale-block .catnav, .catnav--fly) > ul > li:hover > a { background: var(--tile); color: var(--brand); }
    :is(.sidebar .catnav, .sale-block .catnav, .catnav--fly) li ul,
    :is(.sidebar .catnav, .sale-block .catnav, .catnav--fly) li.is-open ul { display: none; }
    :is(.sidebar .catnav, .sale-block .catnav, .catnav--fly) > ul > li:hover > ul {
        display: block; position: fixed; z-index: 70; min-width: 240px; max-width: 340px; max-height: 70vh; overflow-y: auto;
        padding: 6px 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
        box-shadow: 0 12px 32px rgb(23 50 77 / .16);
    }
    :is(.sidebar .catnav, .sale-block .catnav, .catnav--fly) li ul a { padding: 8px 18px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    :is(.sidebar .catnav, .sale-block .catnav, .catnav--fly) li ul a:hover { background: var(--tile); color: var(--brand); }
}

/* Nút sắp xếp nhanh */
.quick-sort { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-sort a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: var(--fs-sm); color: var(--ink); background: var(--white); white-space: nowrap; }
.quick-sort a:hover { border-color: var(--brand); color: var(--brand); }
.quick-sort a.is-active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }

.filters { display: grid; gap: 4px; }
.filters__group { border: 0; padding: 0 0 12px; margin: 0; border-bottom: 1px solid var(--line); }
.filters__group legend { font-weight: 700; padding: 8px 0; font-size: var(--fs-sm); }
.opt { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: var(--fs-sm); cursor: pointer; }
.opt input { accent-color: var(--ink); width: 16px; height: 16px; margin: 0; }
.opt--switch { padding: 12px 0; font-weight: 500; }
.filters__reset { font-size: var(--fs-sm); color: var(--danger); text-decoration: underline; padding: 4px 0; }

.side-banners { display: grid; gap: 12px; }
.side-banners img { width: 100%; border-radius: var(--r-md); }
.side-box__title { font-size: var(--fs-md); margin-bottom: 8px; }
.side-box .chips { margin: 0; }

/* Danh sách sản phẩm */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 16px 0; margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a:hover { color: var(--brand); }
.cat-banner { width: 100%; border-radius: var(--r-md); margin-bottom: 20px; }
.listing-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.listing-head h1, .page-title { font-size: var(--fs-2xl); }
.page-title { margin-bottom: 20px; }
.page-title span { color: var(--brand); }
.listing-head__count { margin: 0; color: var(--ink-2); }
.lead { margin-top: 8px; color: var(--ink-2); }
.content > .prose { margin-top: 24px; }
.toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 0; margin-top: 8px; }
.toolbar__filter { display: none; }
.toolbar__sort { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
.toolbar__sort select { height: 38px; padding: 0 32px 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); color: var(--ink); }
.empty { padding: 40px 24px; text-align: center; background: var(--tile); border-radius: var(--r-md); }
.empty p { margin: 0 0 12px; }

.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 32px 0; }
.pager__btn { min-width: 40px; height: 40px; padding: 0 12px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.pager__btn.is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager__btn.is-disabled { color: var(--line); }
.pager__gap { padding: 0 6px; align-self: center; }

/* ---------- Chi tiết sản phẩm ---------- */
.pd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.gallery { position: sticky; top: calc(var(--header-h) + 16px); }
.gallery__main { border: 1px solid var(--line); background: var(--white); }
.gallery__main img { width: 100%; aspect-ratio: 1; object-fit: contain; padding: 24px; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); border-left: 1px solid var(--line); }
.gallery__thumbs button { background: var(--white); border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; cursor: pointer; }
.gallery__thumbs button.is-active { box-shadow: inset 0 -3px 0 var(--brand); }
.gallery__thumbs img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.pd__name { font-size: var(--fs-2xl); }
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 20px 0; border-top: 1px solid var(--line); }
.specs div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.specs dt { font-size: var(--fs-xs); color: var(--ink-2); }
.specs dd { margin: 0; font-weight: 500; }
.specs .in-stock { color: var(--ok); }
.specs .out-stock { color: var(--danger); font-weight: 700; }
.stock-note { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--r-sm); background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; font-size: var(--fs-sm); }
.stock-note a { color: var(--danger); font-weight: 700; white-space: nowrap; }
.pd__price { padding: 4px 0 16px; }
.pd__excerpt { font-size: var(--fs-sm); color: var(--ink-2); border-left: 3px solid var(--tile); padding-left: 16px; }
.gift { display: grid; gap: 2px; margin-top: 16px; padding: 12px 16px; border: 1.5px dashed var(--brand); border-radius: var(--r-md); font-size: var(--fs-sm); }
.gift strong { color: var(--brand); }
.buy { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.qty { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--r-sm); height: 50px; }
.cart .qty { height: 40px; }
.qty button { width: 40px; border: 0; background: none; font-size: var(--fs-lg); cursor: pointer; color: var(--ink); }
.qty input { width: 52px; border: 0; text-align: center; -moz-appearance: textfield; font-weight: 500; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.callbox { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--tile); border-radius: var(--r-md); }
.callbox span { font-size: var(--fs-sm); color: var(--ink-2); }
.callbox strong { font-size: var(--fs-xl); color: var(--ink); }
.callbox:hover strong { color: var(--brand); }
.callbox strong { white-space: nowrap; }
@media (max-width: 640px) {
    /* Điện thoại: số điện thoại vừa 1 dòng, không bị xuống dòng */
    .callbox { padding: 12px 14px; gap: 10px; }
    .callbox span { font-size: var(--fs-xs); line-height: 1.4; }
    .callbox strong { font-size: var(--fs-lg); }
}
.pd__promise { margin-top: 20px; font-size: var(--fs-sm); }

.tabs { margin-top: 48px; }
/* Tab trang chi tiết: khung viền mảnh, đáy vạch đậm màu chính; chữ in hoa đậm màu chính, tab đang mở màu xanh đậm (--tab-active) */
.tabs__list {
    --tab-active: #0d6b2f;
    display: flex; gap: 0; overflow-x: auto; scrollbar-width: none;
    background: var(--white); border: 1px solid #c9ced3; border-bottom: 4px solid var(--brand);
}
.tabs__list::-webkit-scrollbar { display: none; }
.tabs__list button {
    flex: none; padding: 14px 24px; background: none; border: 0; border-right: 1px solid var(--line);
    font: 700 17px/1.2 var(--font); text-transform: uppercase; letter-spacing: .01em; color: var(--brand); cursor: pointer; white-space: nowrap;
}
.tabs__list button:hover { color: var(--tab-active); }
.tabs__list button[aria-selected="true"] { color: var(--tab-active); }
@media (max-width: 640px) { .tabs__list button { padding: 12px 14px; font-size: 14px; } }
.tabs__panel { padding: 24px 0; max-width: 900px; }

/* Nội dung HTML từ trình soạn thảo */
.prose { line-height: 1.7; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose img { height: auto !important; margin: 12px auto; border-radius: var(--r-sm); }
.prose figure { margin: 20px auto; text-align: center; max-width: 560px; }
.prose figure img { display: block; max-width: 100%; margin: 0 auto 6px; }
.prose figcaption { font-size: var(--fs-xs); color: var(--ink-2); font-style: italic; }
.prose table { width: 100% !important; border-collapse: collapse; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--line); padding: 8px 10px; }
.prose h2 { font-size: var(--fs-xl); margin: 1.4em 0 .5em; }
.prose h3 { font-size: var(--fs-lg); margin: 1.2em 0 .4em; }
.prose a { color: var(--brand); text-decoration: underline; }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.prose--invert { color: #c9d6e2; }
.prose--invert a { color: #fff; }
.prose--readmore.is-collapsed { max-height: var(--readmore-h, 320px); overflow: hidden; position: relative; }

/* Trang chủ: giới thiệu (H1 + đoạn trả lời thẳng) và câu hỏi thường gặp */
.home-intro { margin-top: 28px; text-align: center; }
.home-intro__title { font-size: var(--fs-xl); margin: 0 0 6px; }
.home-intro__tagline { max-width: 820px; margin: 0 auto; color: var(--ink-2); font-size: var(--fs-md); line-height: 1.6; }
.home-about { margin: 56px 0 -64px; padding: 40px 0 48px; background: var(--tile); } /* -64px: nối liền footer (footer có margin-top 64px) */
.home-about__in { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: start; }
.home-about__in--single { grid-template-columns: 1fr; }
/* Điện thoại / máy tính bảng: nội dung trước, câu hỏi thường gặp xuống dưới (đặt SAU quy tắc 2 cột để thắng) */
@media (max-width: 900px) {
    .home-about__in { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .home-intro__tagline { font-size: var(--fs-sm); }
    /* Chữ phần "Về …" + FAQ bằng cỡ chữ các phần khác trên điện thoại */
    .home-about h2 { font-size: var(--fs-lg); }
    .home-about__intro, .home-about__intro p, .home-about__intro li { font-size: var(--fs-sm); line-height: 1.65; }
    .home-about__intro h3 { font-size: var(--fs-md); }
    .home-about__intro table { font-size: var(--fs-xs); }
    .home-faq__list details { padding: 0 14px; }
    .home-faq__list summary { padding: 11px 24px 11px 0; font-size: var(--fs-sm); font-weight: 600; line-height: 1.45; }
    .home-faq__list summary::after { font-size: 18px; }
    .home-faq__list p { font-size: var(--fs-sm); margin-bottom: 12px; }
}
.home-about__intro { --readmore-h: 190px; margin-top: 14px; color: var(--ink-2); }
.home-about .home-about__intro.is-collapsed::after,
.home-about .home-faq__list.is-collapsed::after { background: linear-gradient(transparent, var(--tile)); } /* mờ dần về màu nền xám, không phải trắng */
.home-faq__list.prose--readmore { --readmore-h: 270px; } /* thu gọn: hiện khoảng 4 câu đầu */
.home-about__intro table { display: table; width: 100% !important; background: var(--white); font-size: var(--fs-sm); } /* bảng 4 cột: giãn hết cột, không cần cuộn ngang */
.home-about__intro td:nth-child(n+2), .home-about__intro th:nth-child(n+2) { white-space: nowrap; }
.home-about__intro th { background: var(--ink); color: #fff; text-align: left; }
.home-about__intro h3 { color: var(--ink); }
.listing-tagline { max-width: 900px; font-size: var(--fs-md); line-height: 1.6; }
.home-faq__list { display: grid; gap: 10px; margin-top: 16px; }
.home-faq__list details { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); padding: 0 18px; }
.home-faq__list summary { cursor: pointer; list-style: none; padding: 14px 28px 14px 0; font-weight: 700; position: relative; }
.home-faq__list summary::-webkit-details-marker { display: none; }
.home-faq__list summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--brand); font-weight: 400; }
.home-faq__list details[open] summary::after { content: "−"; }
.home-faq__list p { margin: 0 0 14px; color: var(--ink-2); line-height: 1.6; }
.prose--readmore.is-collapsed::after { content: ""; position: absolute; inset: auto 0 0; height: 120px; background: linear-gradient(transparent, var(--white)); }
.readmore-btn { display: block; margin: 12px auto 0; }

/* Bài viết */
.article { max-width: 820px; }
.article__lead { font-weight: 500; font-size: var(--fs-lg); line-height: 1.55; margin: 12px 0 20px; }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 32px 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.share a, .share button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: none; cursor: pointer; }
.related h2 { font-size: var(--fs-lg); margin-bottom: 8px; }
.related ul { padding-left: 20px; }
.related li { padding: 4px 0; }
.row-post { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.row-post__img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r-md); background: var(--tile); }
.row-post__title { font-size: var(--fs-lg); margin-bottom: 4px; }
.row-post p { color: var(--ink-2); margin: 8px 0 0; }
.promo { padding: 24px 0; border-bottom: 1px solid var(--line); }
.promo__head h2 { font-size: var(--fs-xl); }
.promo__head p { margin: 4px 0 16px; }

/* ---------- Form, giỏ hàng, liên hệ ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; }
.form { display: grid; gap: 14px; align-content: start; }
.form h2 { font-size: var(--fs-lg); }
.form label { display: grid; gap: 6px; font-size: var(--fs-sm); font-weight: 500; }
.form label small { font-weight: 400; color: var(--ink-2); }
.form input, .form textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
    background: var(--white); font-weight: 400;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--ink); }
.form__error { color: var(--danger); margin: 0; font-size: var(--fs-sm); }
/* Trường bắt buộc: dấu * đỏ cạnh tên ô; chữ gợi ý (placeholder) màu nhạt */
.req { color: var(--danger); font-weight: 700; margin-left: 2px; }
.form__label small { margin-left: 4px; }
.form__hint { margin: 0; font-size: var(--fs-xs); color: var(--ink-2); }
.form input::placeholder, .form textarea::placeholder { color: #9aa3ad; opacity: 1; }

.cart { display: grid; grid-template-columns: 1fr 400px; gap: 32px; align-items: start; margin-bottom: 48px; }
.cart__items { border-top: 1px solid var(--line); }
.cart__row { display: grid; grid-template-columns: 88px 1fr auto 120px auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart__img img { width: 88px; height: 88px; object-fit: contain; border: 1px solid var(--line); }
.cart__info { display: grid; gap: 2px; }
.cart__name { font-weight: 500; }
.cart__info .muted { font-size: var(--fs-xs); }
.cart__sub { text-align: right; }
.cart__remove { font-size: var(--fs-sm); color: var(--ink-2); text-decoration: underline; }
.cart__checkout { position: sticky; top: calc(var(--header-h) + 16px); }
.cart__total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-block: 1px solid var(--line); }
.cart__total strong { font-size: var(--fs-xl); color: var(--brand); }

.contact { display: grid; grid-template-columns: 1fr 460px; gap: 48px; margin-bottom: 40px; }
.contact__phones { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.contact__phones a { display: grid; padding: 12px 20px; background: var(--tile); border-radius: var(--r-md); font-size: var(--fs-xl); font-weight: 700; }
.contact__phones small { font-size: var(--fs-xs); font-weight: 400; color: var(--ink-2); }
.map iframe { display: block; width: 100%; height: 420px; border: 0; }
.done { padding: 48px 16px 64px; max-width: 720px; }

/* Thanh toán (giỏ hàng / đặt hàng thành công) */
.pay { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.pay legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.form .pay__opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-weight: 400; }
.form .pay__opt input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.pay__opt span { display: grid; gap: 2px; }
.pay__opt small { color: var(--ink-2); }
.pay__opt:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--white)); }
.pay__transfer { display: grid; gap: 12px; padding: 14px; border: 1px dashed var(--line); border-radius: var(--r-sm); }
.pay__transfer[hidden] { display: none; }
.pay__qr { width: 220px; max-width: 100%; height: auto; margin-inline: auto; border-radius: var(--r-sm); background: #fff; }
.pay__info { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: var(--fs-sm); }
.pay__info dt { color: var(--ink-2); }
.pay__info dd { margin: 0; overflow-wrap: anywhere; }
.pay__copy { margin-left: 6px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); cursor: pointer; font-size: var(--fs-xs); }
.pay__preview { max-width: 160px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.pay__done { margin-top: 24px; }
.pay__done h2 { font-size: var(--fs-lg); margin-bottom: 8px; }
@media (min-width: 560px) { .pay__done .pay__transfer { grid-template-columns: 220px 1fr; align-items: center; } }

/* Modal xem nhanh */
.modal { border: 0; border-radius: var(--r-md); padding: 0; width: min(860px, calc(100vw - 32px)); }
.modal::backdrop { background: rgb(23 50 77 / .5); }
.modal__close { position: absolute; top: 8px; right: 8px; z-index: 1; }
.modal__body { padding: 28px; min-height: 200px; }
.modal__body.is-loading { display: grid; place-items: center; color: var(--ink-2); }
.qv { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.qv__img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.qv__name { font-size: var(--fs-xl); margin-bottom: 4px; }
.qv__excerpt { font-size: var(--fs-sm); color: var(--ink-2); }

/* ---------- Footer ---------- */
.footer { margin-top: 64px; background: var(--ink); color: #c9d6e2; font-size: var(--fs-sm); }
/* flex thay cho grid: số cột menu thay đổi theo dữ liệu (repeat(auto-fit) không dùng chung được với cột fr) */
.footer__grid { display: flex; flex-wrap: wrap; gap: 32px; padding-block: 48px; }
.footer__grid > * { flex: 1 1 170px; min-width: 0; }
.footer__grid > .footer__about { flex: 1.6 1 280px; }
.footer__about p { margin: 0 0 4px; margin-left: 0 !important; } /* nội dung soạn từ admin cũ có style="margin-left:40px" */
.footer__title { color: #fff; font-size: var(--fs-lg); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 14px; }
.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a:hover { color: #fff; }
.social-block { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.social-block a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgb(255 255 255 / .1); color: #fff; transition: background .2s, transform .2s; }
.social-block svg { width: 18px; height: 18px; fill: currentColor; }
.social-block a:hover { color: #fff; transform: translateY(-2px); }
.social-block .facebook a:hover { background: #1877f2; }
.social-block .twitter a:hover { background: #000; }
.social-block .youtube a:hover { background: #ff0000; }
.social-block .pinterest a:hover { background: #e60023; }
.footer__bottom { border-top: 1px solid rgb(255 255 255 / .12); padding: 16px 0; font-size: var(--fs-xs); }

/* ---------- Liên hệ nhanh (partials/contact-dock): máy tính = cột nút tròn góc phải dưới (Chat AI trên cùng) ---------- */
.cdock { position: fixed; right: 18px; bottom: 24px; z-index: 55; display: flex; flex-direction: column; gap: 10px; }
.cdock--ai ~ .aic-btn { display: none !important; } /* nút Chat trong cột thay cho nút tròn riêng của AI chat */
/* Nút lên đầu trang: DƯỚI CÙNG cột (site.js chèn vào), cách 3 nút chat 1 khoảng, nhỏ hơn.
   Khi chưa cuộn: ẩn nhưng vẫn giữ chỗ → 3 nút chat không bị nhảy lên xuống. */
.cdock .to-top { order: 10; position: static; align-self: center; width: 50px; height: 50px; margin: 34px 0 0; background: rgb(31 41 55 / .75); box-shadow: 0 6px 16px rgb(0 0 0 / .22); transition: opacity .2s; }
.cdock .to-top[hidden] { display: grid; visibility: hidden; opacity: 0; }
.cdock .to-top svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.4; }
.cdock .to-top:hover { background: var(--ink); }
.cdock__item { position: relative; display: flex; align-items: center; padding: 0; border: 0; background: none; font: inherit; color: #fff; cursor: pointer; text-decoration: none; }
.cdock__icon {
    display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; flex: none;
    box-shadow: 0 6px 16px rgb(0 0 0 / .22); transition: transform .15s;
}
.cdock__icon svg { width: 24px; height: 24px; fill: currentColor; }
.cdock__icon--zalo { font: 700 13px/1 Arial, sans-serif; letter-spacing: -.02em; }
.cdock__item--call .cdock__icon { background: var(--brand); color: var(--brand-ink, #fff); animation: cdock-ring 2.4s infinite; }
.cdock__item--zalo .cdock__icon { background: #0068ff; }
.cdock__item--chat .cdock__icon { position: relative; background: var(--brand-dark, #1f2937); color: var(--brand-dark-ink, #fff); }
/* Icon robot (assets/img/ai-bot.svg) tự là bong bóng chat → bỏ nền tròn, to hơn chút */
.cdock__item--chat .cdock__icon--bot { width: 58px; height: 58px; margin: -4px; /* bong bóng chỉ chiếm ~80% khung ảnh → to hơn nút tròn 50px chút; margin âm giữ nguyên khoảng cách cột */ background: none; box-shadow: none; filter: drop-shadow(0 5px 10px rgb(22 99 214 / .35)); }
.cdock__icon--bot img { width: 100%; height: 100%; display: block; }
.cdock__dot { position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
html.aic-open .cdock { display: none; } /* đang mở khung chat AI */
@media (hover: hover) { .cdock__item:hover .cdock__icon { transform: scale(1.08); } } /* không để "dính" hiệu ứng sau khi chạm trên điện thoại */
/* Máy tính: chữ hiện khi rê chuột (riêng Hotline luôn hiện số) */
.cdock__label {
    position: absolute; right: 58px; top: 50%; transform: translateY(-50%); white-space: nowrap; text-align: right;
    padding: 5px 12px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.25;
    box-shadow: 0 4px 14px rgb(0 0 0 / .14); opacity: 0; pointer-events: none; transition: opacity .15s;
}
.cdock__label small { display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-2); }
.cdock__mb { display: none; }
.cdock__item--fb .cdock__icon { background: linear-gradient(45deg, #0a7cff, #a334fa 70%, #ff5c87); }
.cdock__item--fb .cdock__icon svg { width: 30px; height: 30px; } /* logo Messenger to, rõ */
.cdock__item--call { display: none; } /* Máy tính: cột phải chỉ 3 nút chat (AI · Zalo · Messenger); nút gọi chỉ có ở thanh dưới trên điện thoại */
.cdock__item:hover .cdock__label, .cdock__item--call .cdock__label { opacity: 1; }
.cdock__item--call .cdock__label { color: var(--brand); }
@keyframes cdock-ring {
    0%, 60%, 100% { box-shadow: 0 6px 16px rgb(0 0 0 / .22), 0 0 0 0 color-mix(in srgb, var(--brand) 45%, transparent); }
    30% { box-shadow: 0 6px 16px rgb(0 0 0 / .22), 0 0 0 12px transparent; }
}
@media (prefers-reduced-motion: reduce) { .cdock__item--call .cdock__icon { animation: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .tiles--row { --per-row: 4; }
    .mega { grid-template-columns: repeat(3, 1fr); }
    .posts { grid-template-columns: repeat(2, 1fr); }
    .cart { grid-template-columns: 1fr; }
    .cart__checkout { position: static; }
}
@media (max-width: 900px) {
    :root { --header-h: 60px; }
    .topbar, .nav { display: none; }
    .header__menu { display: inline-grid; }
    .header__in { gap: 8px; }
    .logo img { max-height: 40px; }
    .header__cart { display: inline-grid; margin-left: auto; }
    .header { background: var(--white); }
    .search { margin-left: 0; }
    .search { order: 10; flex-basis: 100%; max-width: none; margin-bottom: 10px; }
    .search input { height: 42px; }
    .header__in { flex-wrap: wrap; }

    .hero, .layout, .pd, .contact, .newsletter__in, .qv, .sale-block, .banners--home { grid-template-columns: 1fr; }
    .sale-block .catnav { display: none; }
    .sale-block .tiles--row { --per-row: 2.2; }
    .stage .slider__track { padding-inline: 0; gap: 0; }
    .stage .slider__item { flex-basis: 100%; opacity: 1; }
    .stage__arrow { display: none; }
    .promises li { gap: 10px; }
    .promises__icon { display: none !important; }
    .promises li { padding: 12px 14px; }
    .rail__btn { display: none; }
    .to-top { bottom: 76px; left: auto; right: 12px; width: 40px; height: 40px; }
    .hero .catnav { display: none; }
    .slider { margin-inline: -16px; border-radius: 0; }
    .promises ul { grid-template-columns: repeat(2, 1fr); }
    .promises li:nth-child(3) { border-left: 0; }
    .promises li:nth-child(n+3) { border-top: 1px solid var(--line); }

    .tiles { grid-template-columns: repeat(2, 1fr); margin-inline: -16px; border-left: 0; }
    .tiles--row { --per-row: 2.2; grid-template-columns: none; }
    .tile__img { padding: 10px; }
    .tile__body { padding: 0 10px 10px; }
    .block__title { font-size: var(--fs-lg); }
    .block__head .chips { order: 3; flex-basis: 100%; }

    .sidebar { position: static; max-height: none; overflow: visible; }
    .layout > .sidebar { display: none; }
    .layout > .sidebar.is-open {
        display: grid; position: fixed; inset: 0; z-index: 70; background: var(--white);
        padding: 16px 16px 96px; overflow-y: auto; align-content: start;
    }
    .layout > .sidebar.is-open .catnav, .layout > .sidebar.is-open .side-banners { display: none; }
    .filters__close { display: flex !important; }
    .toolbar__filter { display: inline-flex; }
    .toolbar { flex-wrap: wrap; }
    .quick-sort { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
    .quick-sort::-webkit-scrollbar { display: none; }

    .gallery { position: static; }
    .specs { grid-template-columns: 1fr 1fr; }
    .buy .btn { flex: 1; }
    .row-post { grid-template-columns: 120px 1fr; gap: 14px; }
    .row-post__title { font-size: var(--fs-md); }
    .cart__row { grid-template-columns: 72px 1fr; }
    .cart__img img { width: 72px; height: 72px; }
    .cart__row .qty, .cart__sub, .cart__remove { grid-column: 2; justify-self: start; }
    .listing-head h1, .page-title, .pd__name { font-size: var(--fs-xl); }
    .price--lg strong { font-size: var(--fs-xl); }

    /* Điện thoại: thanh 4 cột CHỈ ICON dưới đáy màn hình (Gọi · Zalo · Messenger · Chat AI), không hiện số / chữ */
    /* Cùng 1 màu nền (màu chính), thấp 46px, các ô ngăn bằng vạch trắng */
    body { padding-bottom: calc(46px + env(safe-area-inset-bottom)); }
    .cdock {
        inset: auto 0 0; flex-direction: row; gap: 0; padding-bottom: env(safe-area-inset-bottom);
        background: var(--brand); box-shadow: 0 -2px 10px rgb(0 0 0 / .12);
    }
    .cdock__item { flex: 1 1 0; justify-content: center; height: 46px; min-width: 0; padding: 0; color: var(--brand-ink, #fff); }
    .cdock__item { border-left: 1px solid rgb(255 255 255 / .85); }
    .cdock__item--call { border-left: 0; } /* cột đầu tiên (theo thứ tự hiển thị) */
    /* Nút lên đầu trang: nhỏ, nổi ngay trên thanh, góc phải */
    .cdock .to-top { position: absolute; right: 10px; bottom: calc(100% + 10px); width: 34px; height: 34px; margin: 0; }
    .cdock .to-top svg { width: 18px; height: 18px; }
    /* Phản hồi khi chạm (điện thoại không có hover): sẫm màu + lún nhẹ */
    .cdock__item { -webkit-tap-highlight-color: transparent; transition: background-color .12s, color .12s; }
    /* Khi chạm: đảo màu (nền trắng, icon màu chính) — sẫm màu thì trùng nền nên khó thấy */
    .cdock__item:active { background: #fff; color: var(--brand); }
    .cdock__item:active .cdock__icon { transform: scale(.9); }
    .cdock__item:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
    .cdock .to-top:active { transform: scale(.9); }
    @media (hover: hover) { .cdock__item:hover { background: #fff; color: var(--brand); } } /* cửa sổ máy tính thu nhỏ */
    .cdock__item--call { order: 1; display: flex; }
    .cdock__item--zalo { order: 2; }
    .cdock__item--fb { order: 3; display: flex; }
    .cdock__item--chat { order: 4; color: var(--brand-ink, #fff); }
    .cdock__icon, .cdock__item--call .cdock__icon { width: 30px; height: 30px; background: none !important; box-shadow: none; animation: none; color: inherit; }
    .cdock__icon svg { width: 22px; height: 22px; }
    .cdock__item--fb .cdock__icon svg { width: 27px; height: 27px; }
    .cdock__icon--zalo { width: auto; padding: 3px 6px; border: 2px solid currentColor; border-radius: 8px; font-size: 11.5px; }
    .cdock__item--chat .cdock__icon--bot { width: 34px; height: 34px; margin: 0; filter: none; }
    .cdock__dot { top: 0; right: 0; width: 9px; height: 9px; }
    .cdock__label { display: none !important; } /* chỉ icon */
    .toast { bottom: 66px; }
}
/* Điện thoại / máy tính bảng nhỏ: chỉ giữ slider, ẩn banner (trang chủ, cột trái, ảnh đầu trang danh mục) — mọi giao diện */
@media (max-width: 900px) {
    .banners--home, .side-banners, .cat-banner { display: none !important; }
}

/* ---------- Header thu gọn khi cuộn xuống (site.js thêm html.is-scrolled) — mọi giao diện ---------- */
.header__in, .logo img, .vv-nav__in, .st-mtop__bar, .st-mtop__logo img { transition: min-height .2s ease, max-height .2s ease, padding .2s ease; }
html.is-scrolled .header__in { min-height: 62px; }
html.is-scrolled .logo img { max-height: 42px; }
html.is-scrolled .vv-nav__in { min-height: 42px; }
html.is-scrolled :is(.header, .st-mtop) { box-shadow: 0 2px 14px rgb(0 0 0 / .08); }
@media (max-width: 900px) {
    html.is-scrolled .header__in { min-height: 0; padding-top: 4px; }
    html.is-scrolled .logo img { max-height: 30px; }
    html.is-scrolled .header .search { margin-bottom: 6px; }
    html.is-scrolled .header .search input { height: 36px; }
}
@media (max-width: 1100px) {
    html.is-scrolled .st-mtop__bar { padding-block: 3px; }
    html.is-scrolled .st-mtop__logo img { max-height: 30px; }
    html.is-scrolled .st-mtop .st-search { margin-bottom: 6px; }
    html.is-scrolled .st-mtop .st-search input { height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .header__in, .logo img, .vv-nav__in, .st-mtop__bar, .st-mtop__logo img { transition: none; } }

/* ---------- Đánh giá sản phẩm (partials/reviews) ---------- */
.stars { --rate: 0%; position: relative; display: inline-block; font-size: 20px; line-height: 1; letter-spacing: 2px; color: #d1d5db; }
.stars::before { content: "★★★★★"; }
.stars::after { content: "★★★★★"; position: absolute; left: 0; top: 0; width: var(--rate); overflow: hidden; color: #f59e0b; white-space: nowrap; }
.stars--sm { font-size: 14px; letter-spacing: 1px; vertical-align: -1px; }
.pd__rating { display: inline-flex; align-items: center; gap: 6px; margin: -4px 0 10px; font-size: var(--fs-sm); color: var(--ink-2); }
.reviews { margin-top: 36px; }
.reviews__grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 14px; }
.reviews__summary { padding: 18px; border: 1px solid var(--line); border-radius: var(--r-md); text-align: center; }
.reviews__avg b { font-size: 40px; line-height: 1; }
.reviews__bars { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-xs); }
.reviews__bars li { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; gap: 6px; }
.reviews__bars i { position: relative; height: 6px; border-radius: 3px; background: var(--tile); overflow: hidden; }
.reviews__bars i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: #f59e0b; }
.reviews__form { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-md); }
.reviews__form-title { margin: 0; }
.rate-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; margin-top: 4px; }
.reviews__form .form__label { display: block; font-size: var(--fs-sm); font-weight: 500; }
.rate-input input { position: absolute; opacity: 0; pointer-events: none; }
.rate-input label { font-size: 30px; line-height: 1; color: #d1d5db; cursor: pointer; transition: color .1s; }
.rate-input input:checked ~ label, .rate-input label:hover, .rate-input label:hover ~ label { color: #f59e0b; }
.rate-input input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.reviews__list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.reviews__list li { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); }
.reviews__list p { margin: 6px 0 0; }
.reviews__reply { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--brand); background: var(--tile); font-size: var(--fs-sm); }
@media (max-width: 900px) { .reviews__grid { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

/* Ô bẫy chống spam (partials/antispam): khách không thấy, không tab tới; bot tự điền thì bị chặn */
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.filters__close { display: none; justify-content: space-between; align-items: center; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Thông tin công ty (Admin → Thông tin công ty) */
.footer__legal { display: inline-block; margin-left: 12px; }
.footer__legal::before { content: "·"; margin-right: 12px; opacity: .5; }
.contact__company { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 4px; }