/* Giao diện public — mobile first, dựng theo giao diện daphattam.com.
   Không phụ thuộc thư viện ngoài. */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --color-primary: #1e40af;    /* xanh thanh mạng xã hội, link */
  --color-secondary: #c9a227;  /* vàng gold của logo */
  --color-accent: #a11d17;     /* đỏ nút gọi điện */
  --color-purple: #6d28d9;     /* tên sản phẩm */
  --color-star: #e8a825;
  --header-bg: #14161a;
  --text: #333a45;
  --text-muted: #6b7280;
  --border: #e4e7ec;
  --bg-alt: #f7f8fa;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .1), 0 1px 2px rgba(16, 24, 40, .06);
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  line-height: 1.65;
  background: #fff;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1200px, 100% - 2rem); margin-inline: auto; }

/* ---- Nút ---------------------------------------------------------------- */
.btn {
  display: inline-block; padding: .65rem 1.4rem; border-radius: var(--radius);
  font-weight: 600; border: 1px solid transparent; cursor: pointer;
  text-align: center; transition: opacity .15s, background .15s;
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-outline { border-color: var(--color-primary); color: var(--color-primary); background: transparent; }
.btn-sm { padding: .4rem .9rem; font-size: .875rem; }
.btn-block { width: 100%; }

/* ==========================================================================
   Thanh mạng xã hội trên cùng
   ========================================================================== */
.topbar { background: var(--color-primary); }
.topbar-inner {
  display: flex; align-items: center; justify-content: center; gap: 1.15rem;
  padding: .5rem 1rem; flex-wrap: wrap;
}
.topbar-icon { color: #fff; display: flex; }
.topbar-icon:hover { opacity: .8; text-decoration: none; }
.topbar-icon svg { width: 17px; height: 17px; }

/* ==========================================================================
   Header — nền đá tối, logo giữa, nút gọi điện đỏ
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: linear-gradient(180deg, #1b1e24 0%, #0d0e11 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.header-inner {
  display: flex; align-items: center; gap: .75rem;
  min-height: 72px; width: min(1200px, 100% - 1.5rem); margin-inline: auto;
}

.nav-toggle {
  display: flex; flex-direction: column; gap: 5px; flex-shrink: 0;
  background: none; border: 0; cursor: pointer; padding: .5rem;
}
.nav-toggle span { width: 26px; height: 2px; background: #fff; border-radius: 2px; }

.brand { display: flex; align-items: center; margin-inline: auto; }
.brand-logo { max-height: 56px; width: auto; }
.brand-name {
  color: var(--color-secondary); font-weight: 700;
  font-size: clamp(.78rem, 3.1vw, 1.05rem); line-height: 1.25;
  letter-spacing: .04em; text-transform: uppercase; text-align: center;
}
.brand:hover { text-decoration: none; }

.header-right { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.btn-call-header {
  background: linear-gradient(180deg, #b5241d, #8b1a14);
  color: #fff; font-weight: 700; text-transform: uppercase;
  padding: .7rem 1.15rem; border-radius: var(--radius); font-size: .82rem;
  letter-spacing: .04em; white-space: nowrap;
}
.btn-call-header:hover { text-decoration: none; filter: brightness(1.08); }

.header-cart { position: relative; display: flex; color: #fff; }
.header-cart svg { width: 23px; height: 23px; }
.cart-badge {
  position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px;
  padding: 0 4px; border-radius: 9px; background: var(--color-secondary);
  color: #1a1a1a; font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Menu ngang chỉ hiện trên màn hình rộng */
.desktop-nav { display: none; }
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .brand { margin-inline: 0; }
  .desktop-nav { display: block; margin-inline: auto; }
  .nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.6rem; }
  .nav-list > li { position: relative; }
  .nav-list > li > a {
    display: block; padding: 1.4rem 0; color: #e8e9ec; font-weight: 600;
    font-size: .88rem; text-transform: uppercase; letter-spacing: .04em;
  }
  .nav-list > li > a:hover, .nav-list a.active { color: var(--color-secondary); text-decoration: none; }
  .submenu {
    position: absolute; top: 100%; left: 0; min-width: 240px; list-style: none;
    margin: 0; padding: .4rem 0; background: #fff; border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18); display: none;
  }
  .has-children:hover .submenu { display: block; }
  .submenu a { display: block; padding: .55rem 1rem; color: var(--text); font-size: .9rem; }
  .submenu a:hover { background: var(--bg-alt); text-decoration: none; }
}

/* ==========================================================================
   Menu trượt (mobile)
   ========================================================================== */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, .45);
}
.drawer-close {
  position: absolute; top: .75rem; right: 1rem;
  background: none; border: 0; color: #fff; font-size: 2.2rem;
  line-height: 1; cursor: pointer; padding: .25rem .5rem;
}
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 95;
  width: min(78vw, 340px); background: #f4f5f7;
  overflow-y: auto; box-shadow: 4px 0 20px rgba(0, 0, 0, .2);
  transform: translateX(-100%); transition: transform .25s ease;
}
.drawer.open { transform: translateX(0); }

.drawer-search {
  display: flex; align-items: center; gap: .5rem; padding: 1.1rem 1.1rem .9rem;
}
.drawer-search input {
  flex: 1; padding: .6rem 1rem; font: inherit; color: var(--text);
  border: 1px solid #d9dce2; border-radius: 999px; background: #fbfbfc;
}
.drawer-search button {
  background: none; border: 0; cursor: pointer; color: var(--text-muted);
  display: flex; padding: .35rem;
}
.drawer-search svg { width: 22px; height: 22px; }

.drawer-menu { list-style: none; margin: 0; padding: 0; }
.drawer-menu > li { border-top: 1px solid #e3e5ea; }
.drawer-menu > li > a {
  display: block; padding: 1rem 1.1rem; color: #4a5260;
  font-weight: 600; font-size: .95rem; text-transform: uppercase; letter-spacing: .03em;
}
.drawer-menu > li > a:hover, .drawer-menu a.active { color: var(--color-primary); text-decoration: none; }
.drawer-submenu { list-style: none; margin: 0; padding: 0 0 .5rem 1.1rem; }
.drawer-submenu a {
  display: block; padding: .5rem 1.1rem; color: var(--text-muted); font-size: .9rem;
}

.drawer-socials {
  display: flex; gap: 1rem; flex-wrap: wrap;
  padding: 1.4rem 1.1rem; border-top: 1px solid #e3e5ea;
}
.drawer-socials a { color: #9aa1ad; display: flex; }
.drawer-socials svg { width: 21px; height: 21px; }

/* ==========================================================================
   Trang chủ
   ========================================================================== */
.home-video { padding: 1.25rem 0 0; }
.video-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: var(--radius); overflow: hidden;
  margin-bottom: 1.5rem;
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.home-intro { padding: 1.5rem 0 2rem; }
.intro-title {
  font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 500;
  letter-spacing: .05em; text-transform: uppercase; color: #4a5260;
  margin: 0 0 1rem;
}
.intro-text { color: #6b7280; font-size: 1.02rem; }
.intro-text p { margin: 0 0 1rem; }
.link-more {
  display: inline-block; margin-top: .5rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; font-size: .88rem;
  color: var(--color-primary);
}

/* ---- Tiêu đề khối ------------------------------------------------------- */
.section { padding: 2.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section-heading { text-align: center; margin-bottom: 2rem; }
.section-heading h2 {
  margin: 0; font-weight: 500; color: #4a5260;
  font-size: clamp(1.15rem, 4vw, 1.5rem);
  letter-spacing: .05em; text-transform: uppercase;
}
.heading-rule {
  display: block; width: 200px; max-width: 60%; height: 2px;
  background: #d4d7dd; margin: .9rem auto 0;
}
/* Kiểu tiêu đề trong khung, có kẻ chạy sang hai bên */
.section-heading.boxed {
  display: flex; align-items: center; gap: 0; margin-bottom: 2rem;
}
.section-heading.boxed::before, .section-heading.boxed::after {
  content: ''; flex: 1; height: 1px; background: #e0e2e7;
}
.section-heading.boxed h2 {
  border: 1px solid #dcdfe4; padding: .7rem 1.1rem; background: #fff;
  font-size: clamp(1rem, 3.6vw, 1.35rem); flex-shrink: 1;
}

.section-more { text-align: center; margin-top: 2rem; }
.page-title {
  margin: 1.75rem 0 1.5rem; font-size: clamp(1.4rem, 4.5vw, 1.9rem);
  font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: #4a5260;
}

/* ---- Tại sao nên chọn --------------------------------------------------- */
.feature-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }
.feature-item { text-align: center; }
.feature-photo {
  width: 210px; max-width: 62vw; aspect-ratio: 1; margin: 0 auto 1.1rem;
  border-radius: 50%; overflow: hidden; background: var(--bg-alt);
}
.feature-photo img { width: 100%; height: 100%; object-fit: cover; }
.feature-item h3 {
  margin: 0 0 .35rem; font-size: 1.05rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: #4a5260;
}
.feature-icon { display: block; color: #9aa1ad; margin-bottom: .5rem; }
.feature-icon svg { width: 20px; height: 20px; margin: 0 auto; }
.feature-item p { margin: 0; color: #6b7280; }

/* ---- Nút kêu gọi hành động --------------------------------------------- */
.cta-section { padding: 1rem 0 2.5rem; }
.cta-stack {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.cta-btn {
  display: block; width: min(560px, 100%); text-align: center;
  padding: 1rem 1.5rem; border-radius: 10px; color: #fff;
  font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  font-size: clamp(.95rem, 3.5vw, 1.15rem);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}
.cta-btn:hover { text-decoration: none; filter: brightness(1.07); }
.cta-call { background: linear-gradient(180deg, #d0342b, #8e1b14); }
.cta-zalo { background: linear-gradient(180deg, #3a75ad, #2b5484); }

/* ---- Đánh giá khách hàng ----------------------------------------------- */
.testimonial-list { display: grid; gap: 2.25rem; }
.testimonial { display: flex; gap: 1.1rem; align-items: flex-start; }
.testimonial-avatar {
  width: 96px; height: 96px; flex-shrink: 0; border-radius: 50%;
  overflow: hidden; background: var(--bg-alt);
}
.testimonial-avatar img { width: 100%; height: 100%; object-fit: cover; }
.stars { color: var(--color-star); font-size: 1.15rem; letter-spacing: .1em; line-height: 1; }
.testimonial blockquote {
  margin: .6rem 0 .75rem; font-style: italic; color: #5b6472; font-size: 1rem;
}
.testimonial-author { margin: 0; color: var(--text-muted); font-size: .95rem; }
.testimonial-author strong { color: #4a5260; }
@media (max-width: 560px) {
  .testimonial-avatar { width: 72px; height: 72px; }
}

/* ==========================================================================
   Sản phẩm
   ========================================================================== */
.product-grid {
  display: grid; gap: 1.5rem 1rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) { .product-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem 1.5rem; } }
@media (min-width: 1100px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card { position: relative; display: flex; flex-direction: column; }
.product-thumb {
  position: relative; display: block; aspect-ratio: 4 / 3;
  background: var(--bg-alt); overflow: hidden; border-radius: 2px;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder {
  display: flex; align-items: center; justify-content: center; height: 100%;
  color: var(--text-muted); font-size: .875rem;
}
.badge-sale {
  position: absolute; top: .5rem; left: .5rem; background: var(--color-accent);
  color: #fff; font-size: .72rem; padding: .2rem .5rem; border-radius: 3px; font-weight: 600;
}
/* Nút lưu sản phẩm ở góc trên phải ảnh; kiểu icon và màu chọn ở Giao diện › Nút lưu sản phẩm */
.wishlist-btn {
  position: absolute; top: .6rem; right: .6rem; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .8);
  color: #9aa1ad; display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
.wishlist-btn svg { width: 20px; height: 20px; }
.wishlist-btn:hover { background: #fff; color: var(--wishlist-on, var(--color-accent)); }
.wishlist-btn.saved { color: var(--wishlist-on, var(--color-accent)); background: #fff; }
.wishlist-btn.saved svg { fill: currentColor; }

.product-info { padding: .8rem .25rem 0; text-align: center; }
.product-name { margin: 0; font-size: .98rem; line-height: 1.45; font-weight: 400; }
.product-name a { color: var(--color-purple); }
.product-price { margin-top: .45rem; }
.price-old { text-decoration: line-through; color: var(--text-muted); font-size: .85rem; margin-right: .4rem; }
.price-now { color: #1c2230; font-weight: 700; font-size: .96rem; }
.price-contact { color: var(--text-muted); font-style: italic; }

/* ---- Danh mục ----------------------------------------------------------- */
.category-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.category-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem;
  text-align: center; color: var(--text); background: #fff;
}
.category-card:hover { text-decoration: none; box-shadow: var(--shadow); }
.category-card img { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; margin: 0 auto .6rem; }
.category-name { display: block; font-weight: 600; font-size: .92rem; }
.category-count { display: block; font-size: .8rem; color: var(--text-muted); }

/* ---- Bố cục có sidebar -------------------------------------------------- */
.page-layout { display: grid; gap: 2rem; grid-template-columns: 1fr; padding-bottom: 3rem; }
/* Trên mobile: danh sách sản phẩm lên trước, bộ lọc danh mục xuống dưới */
.page-layout .sidebar { order: 2; }
.page-layout .content-area { order: 1; }
@media (min-width: 992px) {
  .page-layout { grid-template-columns: 260px 1fr; }
  .page-layout .sidebar { order: 0; }
  .page-layout .content-area { order: 0; }
}
.sidebar-title {
  font-size: 1rem; margin: 0 0 .75rem; text-transform: uppercase; letter-spacing: .04em;
}
.category-list, .category-sub { list-style: none; margin: 0; padding: 0; }
.category-list > li { border-bottom: 1px solid var(--border); }
.category-list a { display: block; padding: .6rem 0; color: var(--text); font-size: .94rem; }
.category-list a.active { color: var(--color-primary); font-weight: 600; }
.category-sub { padding-left: 1rem; padding-bottom: .4rem; }
.category-sub a { font-size: .9rem; color: var(--text-muted); padding: .3rem 0; }
.count { color: var(--text-muted); font-size: .8rem; }

.search-form { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search-form input {
  flex: 1; padding: .6rem .9rem; border: 1px solid var(--border);
  border-radius: 999px; font: inherit;
}
.search-form button {
  padding: .6rem 1.3rem; border: 0; border-radius: 999px;
  background: var(--color-primary); color: #fff; cursor: pointer; font-weight: 600;
}
.result-count { color: var(--text-muted); font-size: .9rem; }

/* ==========================================================================
   Chi tiết sản phẩm
   ========================================================================== */
.breadcrumb { font-size: .85rem; color: var(--text-muted); padding: 1rem 0; }
.product-detail { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .product-detail { grid-template-columns: 1fr 1fr; } }
.gallery-main {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; aspect-ratio: 4 / 3; background: var(--bg-alt);
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.gallery-thumbs .thumb {
  width: 70px; height: 70px; padding: 0; border: 2px solid var(--border);
  border-radius: 6px; overflow: hidden; cursor: pointer; background: none;
}
.gallery-thumbs .thumb.active { border-color: var(--color-primary); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.product-summary h1 {
  margin: 0 0 .5rem; font-size: clamp(1.3rem, 4vw, 1.7rem);
  font-weight: 500; color: #3a4150;
}
.product-sku { color: var(--text-muted); font-size: .9rem; margin: 0 0 1rem; }
.product-price-lg { font-size: 1.5rem; margin-bottom: 1rem; }
.stock { font-weight: 600; }
.stock.in { color: #16a34a; }
.stock.out { color: #dc2626; }
.product-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.5rem 0; }
.attr-table, .variation-table {
  width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .9rem;
}
.attr-table th, .attr-table td, .variation-table th, .variation-table td {
  border: 1px solid var(--border); padding: .5rem .75rem; text-align: left;
}
.attr-table th { background: var(--bg-alt); width: 35%; }
.product-description { margin: 3rem 0; }
.product-description h2 {
  font-size: 1.2rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .04em; color: #4a5260;
}

/* Khối liên hệ báo giá khi tắt bán hàng online */
.quote-box {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin: 1.5rem 0;
}
.quote-box p { margin: 0 0 1rem; color: var(--text-muted); }
.quote-actions { display: flex; flex-direction: column; gap: .75rem; }
@media (min-width: 520px) { .quote-actions { flex-direction: row; } }
.quote-actions .btn { flex: 1; }
.btn-call { background: linear-gradient(180deg, #d0342b, #8e1b14); color: #fff; }
.btn-zalo { background: linear-gradient(180deg, #3a75ad, #2b5484); color: #fff; }

/* ---- Nội dung giàu định dạng (import từ WordPress) ---------------------- */
.rich-text { line-height: 1.8; overflow-wrap: break-word; }
.rich-text img { border-radius: var(--radius); margin: 1rem 0; }
.rich-text h2, .rich-text h3 { margin-top: 2rem; color: #3a4150; }
.rich-text ul, .rich-text ol { padding-left: 1.5rem; }
.rich-text table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.rich-text td, .rich-text th { border: 1px solid var(--border); padding: .5rem; }
.rich-text iframe { max-width: 100%; aspect-ratio: 16/9; height: auto; }

/* ==========================================================================
   Tin tức
   ========================================================================== */
.post-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.post-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.post-thumb { display: block; aspect-ratio: 16/9; background: var(--bg-alt); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-body { padding: 1rem; }
.post-body h2, .post-body h3 { margin: 0 0 .35rem; font-size: 1.02rem; font-weight: 500; }
.post-body h2 a, .post-body h3 a { color: var(--color-purple); }
.post-body time { font-size: .8rem; color: var(--text-muted); }
.post-body p { font-size: .9rem; color: var(--text-muted); }

.article-layout { display: grid; gap: 2rem; grid-template-columns: 1fr; padding-bottom: 3rem; }
@media (min-width: 992px) { .article-layout { grid-template-columns: 1fr 300px; } }
.article-wide { max-width: 900px; margin-inline: auto; }
.article-title { font-size: clamp(1.45rem, 4vw, 2rem); margin: .5rem 0; font-weight: 500; color: #3a4150; }
.article-meta { color: var(--text-muted); font-size: .875rem; }
.article-cover { width: 100%; border-radius: var(--radius); margin: 1rem 0 2rem; }
.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li { border-bottom: 1px solid var(--border); }
.related-list a { display: flex; gap: .75rem; align-items: center; padding: .75rem 0; color: var(--text); font-size: .9rem; }
.related-list img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }

/* ---- Phân trang --------------------------------------------------------- */
.pagination { display: flex; gap: .35rem; justify-content: center; margin: 2.5rem 0; flex-wrap: wrap; }
.pagination a { padding: .45rem .8rem; border: 1px solid var(--border); border-radius: 6px; color: var(--text); }
.pagination a.current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.pagination .dots { padding: .45rem .3rem; color: var(--text-muted); }

/* ---- Liên hệ ------------------------------------------------------------ */
.contact-layout { display: grid; gap: 2rem; grid-template-columns: 1fr; padding-bottom: 3rem; }
@media (min-width: 768px) { .contact-layout { grid-template-columns: 2fr 1fr; } }
.contact-form label { display: block; margin-bottom: 1rem; font-weight: 500; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: .65rem .8rem; margin-top: .3rem;
  border: 1px solid var(--border); border-radius: var(--radius); font: inherit;
}
.required { color: #dc2626; }
.alert { padding: .85rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.contact-info { background: var(--bg-alt); padding: 1.5rem; border-radius: var(--radius); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: #16181c; color: #b9c0cb; margin-top: 3rem; }
.footer-grid {
  display: grid; gap: 2rem; padding: 3rem 0;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.footer-col h3 {
  color: var(--color-secondary); font-size: 1rem; margin: 0 0 .8rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.footer-col p { font-size: .9rem; margin: .35rem 0; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links a { display: block; padding: .3rem 0; color: #b9c0cb; font-size: .9rem; }
.site-footer a { color: #b9c0cb; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .09); padding: 1rem 0;
  font-size: .85rem; text-align: center;
}

/* ==========================================================================
   Nút nổi — gọi điện (trái, có vòng sóng) và Zalo (phải)
   ========================================================================== */
.floating-buttons {
  position: fixed; bottom: 1.15rem; z-index: 80;
  display: flex; flex-direction: column; gap: .75rem;
}
.floating-right { right: 1.15rem; align-items: flex-end; }
.floating-left { left: 1.15rem; align-items: flex-start; }

.float-btn {
  position: relative; width: 54px; height: 54px; padding: 0; border: 0;
  border-radius: 50%; cursor: pointer;
  background: var(--btn-color, var(--color-primary)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .28);
}
.float-btn:hover { text-decoration: none; filter: brightness(1.08); }
.float-icon { display: flex; align-items: center; justify-content: center; }
.float-icon svg { width: 25px; height: 25px; }

/* Vòng sóng lan toả quanh nút gọi điện */
.float-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--btn-color, var(--color-accent));
  animation: float-pulse 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes float-pulse {
  0%   { transform: scale(1);   opacity: .65; }
  100% { transform: scale(1.9); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .float-ring { animation: none; opacity: .35; }
}

/* Nút Zalo: logo dạng chữ trên nền xanh, giống site cũ */
.float-zalo { background: #0068ff; }
.float-zalo-text {
  color: #fff; font-weight: 700; font-size: .95rem;
  letter-spacing: -.01em; font-family: Arial, Helvetica, sans-serif;
}

/* ==========================================================================
   Khung chat
   ========================================================================== */
.chat-widget {
  position: fixed; bottom: 5.5rem; right: 1.15rem; z-index: 90;
  width: min(360px, calc(100vw - 2rem)); background: #fff;
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
  border: 1px solid var(--border); overflow: hidden;
  display: flex; flex-direction: column; max-height: calc(100dvh - 7rem);
}
.chat-widget[hidden] { display: none; }
.chat-header {
  display: flex; align-items: center; gap: .65rem;
  background: var(--color-primary); color: #fff; padding: .7rem .9rem;
}
.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.18);
  display: grid; place-items: center; flex: none;
}
.chat-avatar svg { width: 20px; height: 20px; fill: currentColor; }
.chat-head-text { display: flex; flex-direction: column; line-height: 1.25; margin-right: auto; }
.chat-head-text small { opacity: .8; font-size: .75rem; }
.chat-close { background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; line-height: 1; padding: .2rem .4rem; }
.chat-intro { padding: 1rem; overflow-y: auto; }
.chat-welcome { margin: 0 0 .9rem; font-size: .92rem; background: var(--bg-alt); padding: .65rem .8rem; border-radius: 12px 12px 12px 4px; }
.chat-label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .3rem; }
.chat-label small { font-weight: 400; color: var(--text-muted); }
.chat-intro input, .chat-intro textarea {
  width: 100%; padding: .6rem .75rem; margin-bottom: .7rem;
  border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 16px; resize: vertical;
}
.chat-intro input:focus, .chat-intro textarea:focus, .chat-form input:focus { outline: 2px solid var(--color-primary); outline-offset: -1px; }
.chat-error { color: #b91c1c; font-size: .85rem; margin: -.3rem 0 .6rem; }
.chat-start, .chat-form button {
  padding: .65rem 1rem; border: 0; border-radius: 8px;
  background: var(--color-primary); color: #fff; cursor: pointer; font-weight: 700;
}
.chat-start { width: 100%; font-size: 1rem; }
.chat-start:disabled { opacity: .7; cursor: wait; }
.chat-privacy { font-size: .74rem; color: var(--text-muted); margin: .6rem 0 0; text-align: center; }
.chat-body { display: flex; flex-direction: column; min-height: 0; }
.chat-messages { height: 320px; max-height: calc(100dvh - 15rem); overflow-y: auto; padding: 1rem; background: var(--bg-alt); }
.chat-line { margin-bottom: .6rem; display: flex; flex-direction: column; align-items: flex-start; }
.chat-line.visitor { align-items: flex-end; }
.chat-bubble {
  max-width: 82%; padding: .5rem .75rem; border-radius: 14px 14px 14px 4px; font-size: .92rem;
  background: #fff; border: 1px solid var(--border); white-space: pre-wrap; overflow-wrap: anywhere;
}
.chat-line.visitor .chat-bubble { background: var(--color-primary); color: #fff; border-color: transparent; border-radius: 14px 14px 4px 14px; }
.chat-line.failed .chat-bubble { opacity: .6; }
.chat-line.failed .chat-time { color: #b91c1c; }
.chat-time { font-size: .7rem; color: var(--text-muted); margin-top: .15rem; padding: 0 .3rem; }
.chat-form { display: flex; gap: .5rem; padding: .6rem; border-top: 1px solid var(--border); }
.chat-form input { flex: 1; min-width: 0; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 16px; }
.chat-foot { margin: 0; padding: 0 .75rem .55rem; font-size: .74rem; color: var(--text-muted); }
.chat-foot .link-btn { font-size: inherit; padding: 0; background: none; border: 0; color: var(--color-primary); cursor: pointer; text-decoration: underline; }
/* Chấm đỏ báo có tin nhắn mới trên nút chat nổi */
.float-chat { position: relative; }
.float-chat.has-unread::after {
  content: ''; position: absolute; top: 2px; right: 2px; width: 13px; height: 13px;
  border-radius: 50%; background: #ef4444; border: 2px solid #fff;
}
@media (max-width: 480px) {
  /* Trên điện thoại khung chat chiếm gần trọn màn hình để gõ cho thoải mái */
  .chat-widget { left: .5rem; right: .5rem; width: auto; bottom: .5rem; max-height: calc(100dvh - 1rem); }
  .chat-messages { height: auto; flex: 1; max-height: none; min-height: 200px; }
  .chat-body { flex: 1; }
  body.chat-open .floating-buttons, body.chat-open .buy-bar { display: none; }
}

/* ==========================================================================
   Khác
   ========================================================================== */
.empty { color: var(--text-muted); padding: 2rem 0; text-align: center; }
.error-page { text-align: center; padding: 5rem 0; }
.error-page h1 { font-size: 5rem; margin: 0; color: var(--color-primary); }
.read-more { font-size: .875rem; font-weight: 600; }
.hint { color: var(--text-muted); font-size: .88rem; }

/* ==========================================================================
   Thương mại điện tử: giỏ hàng, thanh toán, đơn hàng, tài khoản
   ========================================================================== */
.add-to-cart-form { margin: 1.5rem 0; }
.variation-select select {
  width: 100%; padding: .6rem .8rem; margin-top: .3rem; font: inherit;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.qty-row { display: flex; gap: .75rem; align-items: flex-end; margin-top: 1rem; flex-wrap: wrap; }
.qty-field { display: block; font-size: .9rem; }
.qty-field input {
  width: 90px; padding: .6rem .5rem; margin-top: .3rem; font: inherit;
  border: 1px solid var(--border); border-radius: var(--radius); text-align: center;
}
.btn-add-cart { flex: 1; min-width: 180px; }
.out-of-stock-note {
  background: var(--bg-alt); padding: .85rem 1rem; border-radius: var(--radius);
  color: var(--text-muted); font-size: .9rem;
}

.table-scroll { overflow-x: auto; }
.cart-table, .order-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: .92rem; }
.cart-table th, .cart-table td, .order-table th, .order-table td {
  padding: .75rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle;
}
.cart-table th, .order-table th { font-size: .82rem; color: var(--text-muted); font-weight: 600; }
.cell-thumb { width: 72px; }
.cell-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.variation-note { font-size: .82rem; color: var(--text-muted); }
.qty-input { width: 72px; padding: .4rem; text-align: center; font: inherit; border: 1px solid var(--border); border-radius: 6px; }
.line-total { font-weight: 600; }
.link-btn {
  background: none; border: 0; color: var(--color-primary); cursor: pointer;
  font: inherit; padding: 0; text-decoration: underline;
}
.link-btn.danger { color: #dc2626; }
.cart-actions { margin-bottom: 2rem; }

.cart-footer { display: grid; gap: 2rem; grid-template-columns: 1fr; margin-bottom: 3rem; }
@media (min-width: 768px) { .cart-footer { grid-template-columns: 1fr 340px; } }
.coupon-form { align-self: start; }
.coupon-form label { display: block; font-size: .9rem; margin-bottom: .5rem; }
.coupon-form input {
  width: 100%; max-width: 260px; padding: .55rem .7rem; margin-top: .3rem; font: inherit;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.field-error { color: #dc2626; font-size: .85rem; margin-top: .4rem; }

.cart-summary, .checkout-summary {
  background: var(--bg-alt); padding: 1.25rem; border-radius: var(--radius); align-self: start;
}
.summary-row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; font-size: .95rem; }
.summary-row.discount strong { color: #16a34a; }
.summary-row.total {
  border-top: 1px solid var(--border); margin-top: .5rem; padding-top: .75rem; font-size: 1.15rem;
}
.summary-row.total strong { color: var(--color-accent); }
.summary-note { font-size: .8rem; color: var(--text-muted); margin: .5rem 0 1rem; }
.continue-link { display: block; text-align: center; margin-top: .75rem; font-size: .9rem; }

.checkout-layout { display: grid; gap: 2rem; grid-template-columns: 1fr; margin-bottom: 3rem; }
@media (min-width: 900px) { .checkout-layout { grid-template-columns: 1fr 360px; } }
.checkout-form h2 { font-size: 1.1rem; margin: 1.5rem 0 1rem; text-transform: uppercase; letter-spacing: .03em; }
.checkout-form h2:first-child { margin-top: 0; }
.checkout-form label { display: block; margin-bottom: 1rem; font-weight: 500; font-size: .92rem; }
.checkout-form input, .checkout-form textarea, .checkout-form select {
  width: 100%; padding: .6rem .8rem; margin-top: .3rem; font: inherit;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.checkout-form .field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.checkout-form .field-row label { flex: 1; min-width: 150px; }

.payment-methods { display: flex; flex-direction: column; gap: .6rem; }
.payment-option {
  display: flex; gap: .75rem; align-items: flex-start; margin: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .85rem 1rem; cursor: pointer; font-weight: 400;
}
.payment-option:has(input:checked) { border-color: var(--color-primary); background: var(--bg-alt); }
.payment-option input { width: auto; margin: .25rem 0 0; }
.payment-option small { color: var(--text-muted); }

.summary-items { list-style: none; margin: 0 0 1rem; padding: 0; }
.summary-items li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .88rem;
}
.item-qty { color: var(--text-muted); }
.item-total { white-space: nowrap; font-weight: 600; }

.order-page { padding-bottom: 3rem; }
.order-header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 2rem 0 .5rem; }
.order-header h1 { margin: 0; font-size: 1.5rem; font-weight: 500; }
.order-meta { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem; }
.order-status { display: inline-block; padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.status-pending   { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-shipping  { background: #e0e7ff; color: #3730a3; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.pay-paid { color: #16a34a; font-weight: 600; }
.pay-unpaid { color: #d97706; }
.pay-failed, .pay-refunded { color: #dc2626; }

.order-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .order-grid { grid-template-columns: 1fr 320px; } }
.order-grid h2 { font-size: 1.05rem; margin: 0 0 1rem; text-transform: uppercase; letter-spacing: .03em; }
.order-totals { max-width: 340px; margin-left: auto; }

.order-history { list-style: none; margin: 0; padding: 0; }
.order-history li {
  padding: .6rem 0 .6rem 1rem; border-left: 2px solid var(--border);
  position: relative; font-size: .9rem;
}
.order-history li::before {
  content: ''; position: absolute; left: -5px; top: .95rem;
  width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary);
}
.history-status { font-weight: 600; }
.history-time { display: block; font-size: .8rem; color: var(--text-muted); }
.history-note { font-size: .85rem; color: var(--text-muted); margin-top: .2rem; }

.narrow-page { max-width: 520px; margin-inline: auto; padding-bottom: 3rem; }
.payment-result { text-align: center; padding-top: 3rem; }
.result-icon {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 1.5rem;
  display: flex; align-items: center; justify-content: center; font-size: 2.2rem; color: #fff;
}
.result-icon.ok { background: #16a34a; }
.result-icon.fail { background: #dc2626; }
.result-message { color: var(--text-muted); margin-bottom: 1.5rem; }

.account-form label, .lookup-form label {
  display: block; margin-bottom: 1rem; font-weight: 500; font-size: .92rem;
}
.account-form input, .lookup-form input {
  width: 100%; padding: .6rem .8rem; margin-top: .3rem; font: inherit;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.form-alt { text-align: center; margin-top: 1.25rem; font-size: .9rem; color: var(--text-muted); }
.account-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.admin-panel-like { background: var(--bg-alt); padding: 1.25rem; border-radius: var(--radius); margin-bottom: 2rem; }
.admin-panel-like h2 { margin: 0 0 .75rem; font-size: 1.05rem; }


/* ==========================================================================
   Trang shop: breadcrumb, nút lọc, sắp xếp
   ========================================================================== */
.product-page { padding-bottom: 3rem; }
.product-page .breadcrumb {
  text-align: center; padding: 1.25rem 0 .5rem;
  font-size: .95rem; letter-spacing: .02em; color: var(--text-muted);
}
.product-page .breadcrumb a { color: var(--text-muted); }
.product-page .breadcrumb strong { color: #2b3240; font-weight: 700; }
.product-page .breadcrumb .sep { margin: 0 .35rem; color: #c6cad1; }

/* Nút chuyển sản phẩm trước/sau */
.product-nav { display: flex; justify-content: center; gap: .6rem; margin-bottom: .5rem; }
.product-nav a, .product-nav span {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid #d9dce2;
  display: flex; align-items: center; justify-content: center;
  color: #6b7280; font-size: 1.15rem; line-height: 1;
}
.product-nav a:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }
.product-nav .disabled { opacity: .35; }

.filter-toggle {
  display: flex; align-items: center; gap: .45rem; margin: 0 auto .9rem;
  background: none; border: 0; cursor: pointer; padding: .4rem .6rem;
  color: #4a5260; font-weight: 600; font-size: .95rem;
  text-transform: uppercase; letter-spacing: .04em;
}
.filter-toggle svg { width: 20px; height: 20px; }

.sort-form { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.sort-form select {
  width: min(320px, 100%); padding: .7rem 1rem; font: inherit; color: var(--text);
  border: 1px solid #d9dce2; border-radius: 4px; background: #fff;
}

.shop-layout { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.shop-filter { order: 2; }
.shop-content { order: 1; }
@media (min-width: 992px) {
  .shop-layout { grid-template-columns: 260px 1fr; }
  .shop-filter { order: 0; }
  .shop-content { order: 0; }
  /* Trên màn hình rộng bộ lọc luôn hiện, không cần bấm nút */
  .filter-toggle { display: none; }
  .shop-filter[hidden] { display: block; }
}

/* ==========================================================================
   Chi tiết sản phẩm — theo giao diện site hiện tại
   ========================================================================== */
.product-title {
  margin: 0 0 .6rem; font-size: clamp(1.25rem, 4.4vw, 1.6rem);
  font-weight: 600; color: #2b3240; line-height: 1.35;
}
.title-rule { display: block; width: 42px; height: 3px; background: #d4d7dd; margin-bottom: 1rem; }

.product-price-lg { margin-bottom: 1rem; font-weight: 700; color: #1c2230; }
.price-amount { font-size: clamp(1.35rem, 5vw, 1.7rem); }
.price-unit { font-size: .68em; font-weight: 700; margin-left: 1px; }
.product-price-lg .price-old {
  display: block; font-size: .95rem; font-weight: 400; margin-bottom: .1rem;
}

/* Nút "Save" của Pinterest ở góc trên trái ảnh */
.gallery-main { position: relative; }
.pin-save {
  position: absolute; top: .6rem; left: .6rem; z-index: 2;
  display: flex; align-items: center; gap: .35rem;
  background: #e60023; color: #fff; font-weight: 700; font-size: .8rem;
  padding: .3rem .7rem; border-radius: 4px;
}
.pin-save:hover { text-decoration: none; filter: brightness(1.08); }
.pin-dot {
  width: 12px; height: 12px; border-radius: 50%; background: #fff;
  display: inline-block; flex-shrink: 0;
}
.wishlist-lg { width: 42px; height: 42px; background: rgba(255,255,255,.7); }

/* Ghi chú "giá phụ thuộc vào..." */
.price-note { margin: 1rem 0; }
.price-note p { margin: 0 0 .5rem; color: #4a5260; }
.price-note ul { margin: 0; padding-left: 1.25rem; color: #5b6472; }
.price-note li { margin-bottom: .35rem; }

/* Dãy icon mạng xã hội vuông trong mô tả sản phẩm */
.share-block { margin: 1.5rem 0; }
.share-title { margin: 0 0 .75rem; font-weight: 700; color: #3a4150; }
.share-icons { display: flex; gap: .75rem; flex-wrap: wrap; }
.share-sq {
  width: 54px; height: 54px; border-radius: 12px; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.share-sq:hover { text-decoration: none; filter: brightness(1.1); }
.share-sq svg { width: 30px; height: 30px; }
.sq-tiktok { background: #010101; }
.sq-youtube { background: #ff0000; }
.sq-facebook { background: #1877f2; }
.sq-pinterest { background: #e60023; }

/* Khối "Khuyến mại trong tháng" */
.promo-box {
  border: 1px solid #f0a8a4; border-radius: 12px; background: #fffdf9;
  padding: 1rem 1.1rem; margin: 1.5rem 0;
}
.promo-head { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; }
.promo-badge {
  background: #e02b20; color: #fff; font-weight: 700; font-size: .74rem;
  padding: .2rem .55rem; border-radius: 999px; letter-spacing: .04em;
}
.promo-head strong { color: #3a4150; }
.promo-item { margin-bottom: 1rem; }
.promo-item:last-child { margin-bottom: 0; }
.promo-icon { font-size: 1.15rem; margin-right: .4rem; }
.promo-text { color: #4a5260; }
.promo-text a { color: #d0342b; font-weight: 700; text-decoration: underline; }
.promo-btn {
  display: inline-block; margin-top: .5rem; margin-left: 1.8rem;
  border: 1px solid #f0a8a4; border-radius: 999px; color: #d0342b;
  padding: .35rem 1rem; font-size: .85rem; background: #fff;
}
.promo-btn:hover { text-decoration: none; background: #fff5f4; }

/* Bộ chọn số lượng + nút thêm vào giỏ */
.buy-row { display: flex; gap: .75rem; align-items: stretch; margin-top: 1rem; flex-wrap: wrap; }
.qty-stepper {
  display: flex; align-items: stretch; border: 1px solid #d9dce2;
  border-radius: 4px; overflow: hidden; background: #fff; flex-shrink: 0;
}
.qty-btn {
  width: 34px; border: 0; background: #f4f5f7; color: #4a5260;
  font-size: 1.15rem; cursor: pointer; line-height: 1;
}
.qty-btn:hover { background: #e9ebef; }
.qty-stepper input {
  width: 48px; border: 0; text-align: center; font: inherit;
  -moz-appearance: textfield; appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn-add-cart {
  flex: 1; min-width: 200px; border: 0; cursor: pointer;
  background: #1f6b2e; color: #fff; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; font-size: .92rem;
  padding: .85rem 1.5rem; border-radius: 4px; font-family: inherit;
}
.btn-add-cart:hover { background: #1a5b27; }

.product-cats { margin: 1.25rem 0 0; font-size: .9rem; color: var(--text-muted); }
.product-cats a { color: var(--color-purple); }

/* Tab "MÔ TẢ" */
.product-description { margin: 3rem 0; }
.desc-tab {
  border-top: 3px solid var(--color-primary); padding: .9rem 0 .6rem;
  font-weight: 700; letter-spacing: .06em; color: #3a4150; font-size: .92rem;
}

/* ---- Vùng chạm trên điện thoại ------------------------------------------
   "Xóa" là thao tác phá hủy nằm sát ô số lượng — nới vùng bấm để không
   bấm nhầm. Các link điều hướng trong giỏ cũng cho cao hơn.              */
.cart-table .link-btn.danger {
  display: inline-block; padding: .5rem .6rem; margin: -.5rem -.6rem;
}
.continue-link { padding: .5rem 0; }
@media (max-width: 767px) {
  .cart-table .link-btn.danger { padding: .6rem .75rem; margin: -.6rem -.75rem; }
}

/* ==========================================================================
   Bảng sản phẩm (giỏ hàng / đơn hàng) trên điện thoại
   Bảng 6 cột ép vào màn hình hẹp làm tên sản phẩm vỡ thành mỗi dòng một từ
   và cắt mất cột thành tiền. Dưới 640px đổi sang xếp dọc dạng thẻ.
   ========================================================================== */
@media (max-width: 640px) {
  .product-lines,
  .product-lines thead,
  .product-lines tbody,
  .product-lines tr,
  .product-lines td { display: block; width: 100%; }

  .product-lines thead { display: none; }

  .product-lines tr {
    display: grid;
    /* auto: sản phẩm chưa có ảnh thì cột trái co về 0, không để khoảng trống */
    grid-template-columns: auto 1fr;
    column-gap: .85rem;
    align-items: start;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
  }
  .product-lines tr:last-child { border-bottom: 0; }

  /* Ảnh chiếm cột trái, trải suốt chiều cao thẻ */
  .product-lines .cell-thumb {
    grid-column: 1; grid-row: 1 / span 10;
    width: auto; padding: 0;
  }
  .product-lines .cell-thumb img { width: 72px; height: 72px; }

  .product-lines td { grid-column: 2; padding: 0; border: 0; }

  /* Tên sản phẩm: cả dòng, chữ đủ rộng để không vỡ từng từ */
  .product-lines td:not([data-label]):not(.cell-thumb):not(.cell-remove) {
    font-size: .95rem; line-height: 1.45; margin-bottom: .5rem;
  }

  /* Các ô còn lại hiện kèm nhãn ở bên trái */
  .product-lines td[data-label] {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; padding: .2rem 0; font-size: .9rem;
  }
  .product-lines td[data-label]::before {
    content: attr(data-label);
    color: var(--text-muted); font-size: .82rem; flex-shrink: 0;
  }
  .product-lines .qty-input { width: 84px; }
  .product-lines .cell-remove { margin-top: .5rem; }
}

/* Chừa chỗ cuối trang để nút nổi không che mất nội dung cuối cùng */
body { padding-bottom: 4.5rem; }
@media (min-width: 992px) { body { padding-bottom: 0; } }

/* ==========================================================================
   Cải tiến trải nghiệm (rà soát UI/UX)
   ========================================================================== */

/* ---- Nhãn trên card sản phẩm ------------------------------------------- */
.badge-oos {
  position: absolute; top: .5rem; left: .5rem; z-index: 1;
  background: rgba(20, 22, 26, .82); color: #fff;
  font-size: .72rem; font-weight: 600; padding: .2rem .55rem; border-radius: 3px;
}
/* Sản phẩm hết hàng mờ đi một chút để khách nhận ra ngay khi lướt */
.product-card.is-oos .product-thumb img { filter: grayscale(.6); opacity: .75; }
.product-card.is-oos .price-contact,
.product-card.is-oos .price-now { color: var(--text-muted); }

/* % giảm cạnh giá ở trang chi tiết */
.price-pct {
  display: inline-block; vertical-align: middle; margin-left: .5rem;
  background: var(--color-accent); color: #fff; font-size: .8rem; font-weight: 700;
  padding: .15rem .45rem; border-radius: 3px;
}

/* ---- Ảnh chính bấm để phóng to ----------------------------------------- */
.zoom-trigger {
  display: block; width: 100%; height: 100%; padding: 0; border: 0;
  background: none; cursor: zoom-in; position: relative;
}
.zoom-trigger img { width: 100%; height: 100%; object-fit: contain; }
.zoom-hint {
  position: absolute; right: .6rem; bottom: .6rem;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, .85); color: #2b3240;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}
.zoom-hint svg { width: 18px; height: 18px; }

.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(8, 9, 11, .94);
  display: flex; align-items: center; justify-content: center; padding: 3.5rem 1rem;
}
.lightbox[hidden] { display: none; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.lb-close {
  position: absolute; top: .6rem; right: .8rem; background: none; border: 0;
  color: #fff; font-size: 2.4rem; line-height: 1; cursor: pointer; padding: .3rem .6rem;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 2rem; line-height: 1;
}
.lb-nav:hover { background: rgba(255, 255, 255, .26); }
.lb-prev { left: .6rem; }
.lb-next { right: .6rem; }
.lb-count {
  position: absolute; bottom: 1rem; left: 0; right: 0; margin: 0;
  text-align: center; color: rgba(255, 255, 255, .75); font-size: .9rem;
}

/* ---- Thanh mua dính đáy (điện thoại) ------------------------------------ */
.buy-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 85;
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
}
.buy-bar[hidden] { display: none; }
.buy-bar-price { font-weight: 700; color: #1c2230; font-size: 1.05rem; white-space: nowrap; }
.buy-bar .btn-add-cart { flex: 1; min-width: 0; padding: .8rem 1rem; }
@media (min-width: 768px) { .buy-bar { display: none !important; } }

/* Khi có thanh mua: đẩy nút nổi lên trên để không đè nhau */
body.has-buybar .floating-buttons { bottom: 5rem; }
body.has-buybar .chat-widget { bottom: 9.5rem; }

/* ---- Ẩn nút nổi khi đang gõ (bàn phím điện thoại đang mở) -------------- */
body.is-typing .floating-buttons { opacity: 0; pointer-events: none; transform: translateY(12px); }
.floating-buttons { transition: opacity .15s, transform .15s; }

/* ---- Nút lớn cho thao tác chính ----------------------------------------- */
.btn-lg { padding: .95rem 1.4rem; font-size: 1.05rem; }
.btn-place-order { text-transform: uppercase; letter-spacing: .04em; }

/* Nút đang xử lý: mờ và không bấm được nữa */
.is-busy { opacity: .7; cursor: progress; }

/* ---- Viền khi điều hướng bằng bàn phím ---------------------------------- */
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.btn-call-header:focus-visible,
.cta-btn:focus-visible,
.btn-add-cart:focus-visible { outline-color: var(--color-secondary); }

/* ---- Máy tính ------------------------------------------------------------ */
@media (min-width: 1024px) {
  /* Nút GỌI ĐIỆN nằm cuối hàng (sau menu) thay vì chen giữa logo và menu */
  .header-right { order: 3; }
  .desktop-nav { order: 2; }
  /* Cột phải dài (ghi chú giá, khuyến mại...) — giữ ảnh luôn trong tầm mắt */
  .product-gallery { position: sticky; top: 90px; align-self: start; }
}

@media (max-width: 480px) {
  body.has-buybar .chat-widget { bottom: .5rem; }
}

/* ==========================================================================
   Báo giá, Zalo, gợi ý tìm kiếm, toast
   ========================================================================== */
.quote-box {
  margin: 1.1rem 0; border: 1px solid var(--border); border-radius: 10px;
  background: #fffbea; overflow: hidden;
}
.quote-box summary {
  cursor: pointer; padding: .8rem 1rem; font-weight: 700; color: #7a5b00; list-style: none;
}
.quote-box summary::-webkit-details-marker { display: none; }
.quote-box summary::after { content: '+'; float: right; font-size: 1.2rem; line-height: 1; }
.quote-box[open] summary::after { content: '−'; }
.quote-form { padding: 0 1rem 1rem; }
.quote-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.quote-form input, .quote-form textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 8px;
  font: inherit; font-size: 16px; background: #fff;
}
.quote-form textarea { margin: .5rem 0; resize: vertical; }
.btn-quote { width: 100%; background: #a3800f; color: #fff; font-weight: 700; border: 0; padding: .7rem; border-radius: 8px; cursor: pointer; }
.quote-ok { margin: 0; padding: 0 1rem 1rem; color: #166534; font-weight: 600; }
@media (max-width: 400px) { .quote-fields { grid-template-columns: 1fr; } }

.btn-zalo-consult {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin: .6rem 0 1rem; padding: .65rem; border: 1.5px solid #0068ff; border-radius: 8px;
  color: #0068ff; font-weight: 700; background: #fff;
}
.btn-zalo-consult:hover { background: #eef5ff; text-decoration: none; }
.btn-zalo-consult .float-zalo-text { background: #0068ff; color: #fff; border-radius: 6px; padding: .1rem .4rem; font-size: .8rem; }

.drawer-search { position: relative; }
.search-suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: .25rem;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); max-height: 60vh; overflow-y: auto; text-align: left;
}
.suggest-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; color: var(--text); border-bottom: 1px solid var(--border); }
.suggest-item:hover, .suggest-item:focus { background: var(--bg-alt); text-decoration: none; }
.suggest-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; }
.suggest-name { flex: 1; font-size: .9rem; line-height: 1.3; text-transform: none; letter-spacing: 0; }
.suggest-price { font-size: .82rem; color: var(--color-accent); font-weight: 700; white-space: nowrap; }
.suggest-all { display: block; padding: .6rem .7rem; font-size: .85rem; color: var(--color-primary); font-weight: 600; }
.suggest-empty { margin: 0; padding: .7rem; font-size: .85rem; color: var(--text-muted); }

.toast {
  position: fixed; left: 50%; bottom: 6rem; transform: translate(-50%, 20px); z-index: 200;
  background: #1f2937; color: #fff; padding: .7rem 1rem; border-radius: 8px; font-size: .9rem;
  max-width: calc(100vw - 2rem); opacity: 0; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Chat: gửi ảnh */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chat-attach { display: grid; place-items: center; width: 42px; flex: none; border-radius: 8px; color: var(--color-primary); cursor: pointer; }
.chat-attach:hover, .chat-attach:focus-within { background: var(--bg-alt); }
.chat-attach svg { width: 24px; height: 24px; }
.chat-bubble.has-image { padding: 4px; }
.chat-bubble img { display: block; max-width: 220px; max-height: 260px; border-radius: 10px; object-fit: cover; }
.chat-bubble.has-image div { padding: .3rem .5rem .2rem; }

/* Chat: thẻ sản phẩm */
.chat-bubble.has-card { padding: 0; background: #fff; border: 1px solid var(--border); overflow: hidden; max-width: 260px; }
.chat-card { display: block; color: var(--text); text-decoration: none; }
.chat-card:hover { text-decoration: none; }
.chat-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; max-height: none; border-radius: 0; }
.chat-card-info { display: flex; flex-direction: column; gap: .15rem; padding: .55rem .7rem .65rem; }
.chat-card-info strong { font-size: .9rem; line-height: 1.3; color: var(--color-purple, #333); }
.chat-card-price { color: var(--color-accent); font-weight: 700; font-size: .88rem; }
.chat-card-price s { color: var(--text-muted); font-weight: 400; font-size: .78rem; }
.chat-card-cta { font-size: .8rem; color: var(--color-primary); font-weight: 600; margin-top: .15rem; }
.chat-card-noimg { display: block; aspect-ratio: 4 / 3; background: #eef1f5 url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%2394a3b8%27 stroke-width=%271.5%27%3E%3Crect x=%273%27 y=%275%27 width=%2718%27 height=%2714%27 rx=%272%27/%3E%3Ccircle cx=%278.5%27 cy=%2710%27 r=%271.5%27/%3E%3Cpath d=%27M21 16l-5-5-8 8%27/%3E%3C/svg%3E") center / 42px no-repeat; }

/* Nút "Sửa trang này" cho nhân viên đang đăng nhập admin (khách không thấy) */
.admin-editbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 1200; display: flex; gap: 2px;
  background: #1e293b; border-radius: 999px; padding: 4px; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); max-width: calc(100vw - 32px); }
.admin-editbar a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.admin-editbar-btn { background: #2563eb; }
.admin-editbar a:hover { filter: brightness(1.12); text-decoration: none; }
.admin-editbar-link { color: #cbd5e1 !important; font-weight: 500 !important; }
.price-from { font-size: .9rem; color: #6b7280; margin-right: .3rem; font-weight: 500; }
.variation-table .var-old { color: #9ca3af; font-size: .85em; }

/* ---- Thanh toán: chọn địa chỉ mới / cũ, vận chuyển ---- */
.seg-scheme { display: flex; gap: 0; margin: .25rem 0 .35rem; border: 1px solid #d1d5db; border-radius: 10px; overflow: hidden; }
.seg-scheme label { flex: 1; margin: 0; cursor: pointer; position: relative; }
.seg-scheme input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.seg-scheme span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 .5rem; font-weight: 600; text-align: center; }
.seg-scheme input:checked + span { background: var(--primary, #b8860b); color: #fff; }
.seg-scheme input:focus-visible + span { outline: 2px solid #2563eb; outline-offset: -2px; }
.checkout-form select { width: 100%; min-height: 44px; font-size: 16px; }
.ship-fee { color: #b91c1c; font-weight: 600; }
.payment-option.is-disabled { opacity: .5; }
[hidden] { display: none !important; }

/* ---- Trang đơn hàng: QR chuyển khoản ---- */
.bank-pay { border: 1px solid #bfdbfe; background: #f0f7ff; border-radius: 12px; padding: 1rem; margin: 1rem 0 1.5rem; }
.bank-pay h2 { margin-top: 0; font-size: 1.15rem; }
.bank-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1rem; margin: .75rem 0; }
.bank-card { background: #fff; border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; align-items: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.bank-qr { width: 100%; max-width: 260px; }
.bank-qr svg { width: 100%; height: auto; display: block; }
.bank-info { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem .75rem; margin: 0; width: 100%; font-size: .95rem; }
.bank-info dt { color: #6b7280; }
.bank-info dd { margin: 0; overflow-wrap: anywhere; }
.bank-info .price-big { color: #b91c1c; font-size: 1.1rem; }
.copy-btn { border: 1px solid #d1d5db; background: #fff; border-radius: 6px; padding: 0 .75rem; min-height: 40px; font-size: .85rem; cursor: pointer; margin-left: .25rem; }
.bank-dl { min-height: 40px; display: inline-flex; align-items: center; }
/* Danh mục chưa có ảnh dùng logo: thu vừa khung, không cắt */
.category-card img.is-logo { object-fit: contain; background: #fff; padding: 8px; border: 1px solid #eee; }

/* Chuẩn kích thước bấm (rà soát giao diện) */
.nav-toggle { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.filter-toggle { min-height: 44px; }
.account-form input, .lookup-form input { min-height: 44px; font-size: 16px; }

/* ---- Chủ đề bài viết ---- */
.topic-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1.5rem; }
.topic-chip { display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: 0 1rem; border: 1px solid var(--border, #e5e7eb);
  border-radius: 999px; color: var(--text, #333); text-decoration: none; font-size: .92rem; background: #fff; transition: border-color .15s, background .15s; }
.topic-chip span { color: var(--text-muted, #777); font-size: .8rem; }
.topic-chip:hover { border-color: var(--primary, #b8860b); text-decoration: none; }
.topic-chip.active { background: var(--primary, #b8860b); border-color: var(--primary, #b8860b); color: #fff; }
.topic-chip.active span { color: rgba(255, 255, 255, .85); }
.post-topics { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .4rem; }
.post-topics a { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--primary, #b8860b); text-decoration: none; }
.post-topics a + a::before { content: '·'; margin-right: .35rem; color: var(--text-muted, #999); }
.article-topics { margin: .25rem 0 1rem; }
.article-topics a { font-size: .8rem; padding: .3rem .7rem; border: 1px solid currentColor; border-radius: 999px; min-height: 32px; display: inline-flex; align-items: center; }
.article-topics a + a::before { content: none; }

/* ---- Thư viện video ---- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.25rem; margin-top: 1rem; }
.video-card { margin: 0; background: #fff; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; overflow: hidden; }
.video-card iframe, .video-play { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.video-play { position: relative; padding: 0; background: #000; cursor: pointer; }
.video-play img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; transition: opacity .15s; }
.video-play:hover img { opacity: 1; }
.video-play-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.video-play-icon svg { width: 68px; height: 48px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); }
.video-card figcaption { padding: .75rem .9rem .9rem; font-weight: 600; line-height: 1.4; }
.video-card figcaption a { color: inherit; text-decoration: none; }
.video-card figcaption a:hover { color: var(--primary, #b8860b); }
.video-card iframe { background: #000; }
@media (max-width: 760px) {
  .topic-bar { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 0 16px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .topic-bar::-webkit-scrollbar { display: none; }
  .topic-chip { flex: 0 0 auto; white-space: nowrap; }
}

/* ---- Video nhúng trong bài viết / trang ---- */
.rich-text .video-embed, .video-embed { position: relative; width: 100%; max-width: 900px; margin: 1.25rem auto; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Iframe YouTube trơn (có sẵn width/height cố định) co giãn theo khung, giữ tỉ lệ 16:9 */
.rich-text iframe[src*="youtube"], .rich-text iframe[src*="youtu.be"] { display: block; width: 100%; max-width: 900px; height: auto; aspect-ratio: 16 / 9; margin: 1.25rem auto; border: 0; border-radius: 10px; }
.rich-text .video-embed iframe { margin: 0; max-width: none; height: 100%; aspect-ratio: auto; border-radius: 0; }
/* Khung video của theme Flatsome / WordPress (padding-top 56.25%) — trước cần CSS của theme mới đặt iframe vào đúng chỗ */
.rich-text .video-fit, .rich-text .responsive-embed, .rich-text .wp-block-embed__wrapper:has(iframe), .rich-text .embed-youtube { position: relative; }
.rich-text .video-fit { padding-top: 56.25%; height: 0; overflow: hidden; margin: 1.25rem 0; }
.rich-text .video-fit > p { margin: 0; }
.rich-text .video-fit iframe { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; margin: 0; aspect-ratio: auto; }
.rich-text [hidden] { display: none !important; }

/* ==========================================================================
   Khung ảnh sản phẩm (thay lưới ảnh nhỏ nhiều hàng): ảnh lớn vuốt ngang, mũi tên to,
   bộ đếm "3 / 48", một hàng ảnh nhỏ vuốt ngang, nút "Xem tất cả ảnh".
   ========================================================================== */
.pg { min-width: 0; }
.pg-stage { position: relative; }
.pg-track { display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; outline: none; }
.pg-track::-webkit-scrollbar { display: none; }
.pg-track:focus-visible { box-shadow: inset 0 0 0 3px var(--color-primary, #1e40af); }
.pg-slide { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.pg-slide .zoom-trigger { width: 100%; height: 100%; }
.pg-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .92); color: #1f2937; box-shadow: 0 2px 10px rgba(0, 0, 0, .22); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: opacity .15s, transform .15s; }
.pg-arrow svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pg-arrow:hover { transform: translateY(-50%) scale(1.06); }
.pg-arrow:disabled { opacity: 0; pointer-events: none; }
.pg-prev { left: .6rem; }
.pg-next { right: .6rem; }
.pg-count { position: absolute; left: .6rem; bottom: .6rem; z-index: 3; background: rgba(17, 24, 39, .72); color: #fff;
  font-size: .95rem; font-weight: 600; padding: .3rem .75rem; border-radius: 999px; pointer-events: none; letter-spacing: .02em; }
.pg-thumbs { display: flex; gap: .5rem; margin-top: .75rem; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 2px 6px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.pg-thumb { flex: 0 0 72px; width: 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  cursor: pointer; background: var(--bg-alt, #f3f4f6); opacity: .7; scroll-snap-align: start; transition: opacity .15s, border-color .15s; }
.pg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-thumb:hover { opacity: 1; }
.pg-thumb.active { border-color: var(--color-primary, #1e40af); opacity: 1; }
.pg-all { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 48px; margin-top: .5rem;
  border: 1px solid var(--border, #e5e7eb); border-radius: var(--radius, 8px); background: #fff; color: var(--text, #1f2937);
  font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer; }
.pg-all svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.pg-all:hover { border-color: var(--color-primary, #1e40af); color: var(--color-primary, #1e40af); }
@media (max-width: 767px) {
  .pg-thumb { flex-basis: 60px; width: 60px; height: 60px; }
  .pg-arrow { width: 44px; height: 44px; }
  .zoom-hint { width: 44px; height: 44px; }
}
@media (hover: none) { .pg-arrow:hover { transform: translateY(-50%); } }

/* Hộp xem ảnh phóng to: thanh trên cùng có bộ đếm, "Tất cả ảnh", "Đóng" (chữ to, dễ bấm) */
.lb-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem;
  background: linear-gradient(rgba(0, 0, 0, .55), transparent); }
.lb-bar .lb-count { position: static; margin: 0 auto 0 0; color: #fff; font-size: 1rem; font-weight: 600; }
.lb-btn { min-height: 44px; padding: 0 1rem; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; background: rgba(255, 255, 255, .12);
  color: #fff; font: inherit; font-size: .98rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lb-btn:hover { background: rgba(255, 255, 255, .24); }
.lightbox .lb-close { position: static; font-size: .98rem; line-height: normal; padding: 0 1rem; }
.lightbox .lb-nav { width: 52px; height: 52px; font-size: 2.2rem; background: rgba(255, 255, 255, .18); }
.lb-grid { position: absolute; inset: 64px 0 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px; padding: 6px 12px 24px; align-content: start; }
.lb-cell { padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; aspect-ratio: 1; cursor: pointer; background: #222; }
.lb-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-cell:hover, .lb-cell:focus-visible { border-color: #fff; }
.lightbox.is-grid .lb-img, .lightbox.is-grid .lb-nav { display: none; }
@media (max-width: 767px) { .lb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px 4px 24px; } }

/* ==========================================================================
   Đánh giá sản phẩm — chữ to, nút lớn, dễ bấm cho người lớn tuổi
   ========================================================================== */
.stars { display: inline-flex; gap: 1px; color: #d4d7dd; letter-spacing: 0; line-height: 1; }
.stars .on { color: #f5a623; }
.stars-lg { font-size: 1.5rem; }
.rating-line { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; color: var(--text, #333); font-size: .95rem; margin-bottom: .25rem; }
.rating-line:hover { text-decoration: none; }
.rating-line .stars { font-size: 1.1rem; }
.product-reviews { margin: 3rem 0; scroll-margin-top: 80px; }
.product-reviews h2.desc-tab { margin: 0 0 1rem; font-size: .92rem; text-transform: none; }
.rv-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 2rem; align-items: start; }
.rv-summary { background: #fafaf8; border: 1px solid #ebe8e1; border-radius: var(--radius, 8px); padding: 1.25rem; text-align: center; position: sticky; top: 90px; }
.rv-score b { font-size: 2.8rem; font-weight: 700; color: #222; line-height: 1; }
.rv-score span { color: #888; font-size: 1.1rem; }
.rv-count { margin: .3rem 0 .9rem; color: #666; }
.rv-empty { color: #555; margin: 0 0 1rem; line-height: 1.6; }
.rv-bars { display: grid; gap: .25rem; margin-bottom: 1rem; }
.rv-bar { display: grid; grid-template-columns: 2.4rem 1fr 2rem; align-items: center; gap: .5rem; min-height: 32px; padding: 0 .3rem; border: 0;
  background: transparent; font: inherit; font-size: .9rem; color: #444; cursor: pointer; border-radius: 6px; }
.rv-bar:hover:not(:disabled), .rv-bar.active { background: #f1ede4; }
.rv-bar:disabled { cursor: default; opacity: .55; }
.rv-bar i { height: 8px; background: #e6e3dc; border-radius: 4px; overflow: hidden; }
.rv-bar em { display: block; height: 100%; background: #f5a623; }
.rv-bar small { text-align: right; color: #777; font-size: .85rem; }
.btn-review { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.5rem; border: 0; border-radius: var(--radius, 8px);
  background: var(--color-primary); color: #fff; font-weight: 700; letter-spacing: .04em; font-size: .95rem; cursor: pointer; width: 100%; }
.btn-review:hover { text-decoration: none; filter: brightness(1.08); }
.btn-review:disabled { opacity: .7; }
.rv-filter { margin: 0 0 .75rem; color: #555; }
.link-like { background: none; border: 0; color: var(--color-primary); font: inherit; cursor: pointer; padding: .4rem 0; min-height: 40px; }
.review-list { display: grid; gap: .25rem; }
.review-item { padding: 1rem 0; border-bottom: 1px solid #eee; }
.review-head { display: flex; gap: .75rem; align-items: flex-start; }
.review-avatar { flex: 0 0 42px; height: 42px; border-radius: 50%; background: #efe9dd; color: #7a5b24; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; }
.review-who { min-width: 0; }
.review-who strong { font-size: 1rem; margin-right: .35rem; }
.review-badge { display: inline-block; font-size: .8rem; color: #1f6b2e; background: #e8f5ec; border-radius: 999px; padding: .1rem .55rem; margin-right: .3rem; }
.review-src { display: inline-block; font-size: .8rem; color: #666; background: #f1f1f1; border-radius: 999px; padding: .1rem .55rem; }
.review-meta { display: flex; align-items: center; gap: .6rem; margin-top: .25rem; color: #888; font-size: .85rem; }
.review-meta .stars { font-size: 1rem; }
.review-text { margin: .6rem 0 0; line-height: 1.7; font-size: 1rem; white-space: pre-line; overflow-wrap: anywhere; }
.review-reply { margin: .75rem 0 0 1rem; padding: .7rem .9rem; background: #f6f4ef; border-left: 3px solid var(--color-secondary, #c9a227); border-radius: 0 6px 6px 0; }
.review-reply strong { font-size: .85rem; color: #6b5420; }
.review-reply p { margin: .3rem 0 0; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.btn-more-reviews { margin: 1rem 0; min-height: 44px; padding: 0 1.25rem; border: 1px solid #d9d4c8; background: #fff; border-radius: var(--radius, 8px); cursor: pointer; font: inherit; }
.rv-form { margin-top: 1.5rem; padding: 1.25rem; border: 1px solid #ebe8e1; border-radius: var(--radius, 8px); background: #fff; scroll-margin-top: 80px; }
.rv-form h3 { margin: 0 0 .75rem; font-size: 1.1rem; }
.rv-form label { display: block; margin-bottom: .85rem; font-weight: 500; }
.rv-form label small { font-weight: 400; color: #777; }
.rv-form input[type=text], .rv-form input[type=tel], .rv-form textarea { display: block; width: 100%; margin-top: .35rem; padding: .7rem .8rem; font: inherit; font-size: 16px;
  border: 1px solid #cfd4dc; border-radius: 8px; background: #fff; box-sizing: border-box; }
.rv-form textarea { resize: vertical; min-height: 110px; }
.rv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.rv-hint { margin: -.3rem 0 1rem; color: #666; font-size: .88rem; }
.rv-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rv-error { color: #b42318; background: #fef3f2; border-radius: 6px; padding: .6rem .8rem; margin: 0 0 .8rem; }
.rv-thanks { margin-top: 1.5rem; padding: 1rem 1.2rem; background: #ecfdf3; color: #065f46; border-radius: var(--radius, 8px); font-size: 1.05rem; }
/* Chọn sao: các nút xếp ngược để "rê / chọn sao 4 thì sáng cả sao 1–4" chỉ bằng CSS */
.rv-stars-input { border: 0; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.rv-stars-input legend { width: 100%; font-weight: 500; margin-bottom: .3rem; padding: 0; }
.rv-stars-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rv-stars-input label { margin: 0; width: 46px; height: 46px; display: grid; place-items: center; font-size: 2.1rem; color: #d4d7dd; cursor: pointer; line-height: 1; }
.rv-stars-input input:checked ~ label, .rv-stars-input label:hover, .rv-stars-input label:hover ~ label { color: #f5a623; }
.rv-stars-input input:focus-visible + label { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 6px; }
.rv-stars-text { order: -1; margin-left: .6rem; color: #6b5420; font-weight: 600; min-width: 7em; }
@media (max-width: 760px) {
  .rv-layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .rv-summary { position: static; }
  .rv-row { grid-template-columns: minmax(0, 1fr); }
  .rv-form { padding: 1rem; }
  /* Điện thoại: 5 sao luôn trên một hàng, chữ "Rất hài lòng" xuống dòng dưới */
  .rv-stars-text { order: 10; flex-basis: 100%; min-width: 0; margin: .15rem 0 0; min-height: 1.4em; }
  .review-reply { margin-left: 0; }
}
/* Ảnh trong bài AI viết */
.rich-text .ai-figure { margin: 1.25rem 0; }
.rich-text .ai-figure img { display: block; max-width: 100%; height: auto; border-radius: var(--radius, 8px); margin: 0 auto; }
.rich-text .ai-figure figcaption { text-align: center; color: #666; font-size: .9rem; margin-top: .4rem; font-style: italic; }
.rv-captcha { margin: 0 0 1rem; padding: .8rem; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; }
.rv-captcha label { margin-bottom: .4rem; }
.rv-captcha-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.rv-captcha-row img { width: 210px; max-width: calc(100% - 56px); height: auto; aspect-ratio: 3 / 1; border-radius: 6px; border: 1px solid #e5e7eb; background: #fff; }
.rv-captcha-refresh { flex: 0 0 46px; width: 46px; height: 46px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; font-size: 1.4rem; cursor: pointer; }
.rv-captcha input { display: block; width: 100%; max-width: 260px; padding: .7rem .8rem; font: inherit; font-size: 16px; border: 1px solid #cfd4dc; border-radius: 8px; text-transform: uppercase; letter-spacing: .15em; box-sizing: border-box; }

/* ---- Banner trượt đầu trang chủ ---- */
.hero { position: relative; background: #111; }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-track:focus-visible { outline: 3px solid var(--color-secondary, #c9a227); outline-offset: -3px; }
.hero-slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; overflow: hidden;
  height: max(180px, calc(var(--hero-hm, 28) * 1vh)); }
/* svh: không tính thanh địa chỉ của trình duyệt điện thoại → banner không nhảy khi cuộn */
@supports (height: 1svh) { .hero-slide { height: max(180px, calc(var(--hero-hm, 28) * 1svh)); } }
@media (min-width: 761px) {
  .hero-slide { height: clamp(260px, calc(var(--hero-hd, 60) * 1vh), 1000px); }
}
/* "Hiện trọn ảnh": không cắt, phần thừa là nền tối */
.hero.fit-contain .hero-slide img { object-fit: contain; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.15), rgba(0,0,0,.35)); pointer-events: none; }
.hero-text { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; padding: 0 1rem; text-shadow: 0 2px 8px rgba(0,0,0,.55); }
.hero-title { margin: 0; font-size: clamp(1.7rem, 5vw, 3.2rem); font-weight: 600; line-height: 1.2; font-family: inherit; }
.hero-sub { margin: .5rem 0 0; font-size: clamp(1rem, 2.4vw, 1.5rem); font-weight: 500; }
.hero-btn { margin-top: 1.1rem; display: inline-flex; align-items: center; min-height: 46px; padding: 0 1.5rem; border-radius: var(--radius, 8px); background: var(--color-secondary, #c9a227); color: #1c1c1c; font-weight: 700; text-shadow: none; }
.hero-btn:hover { text-decoration: none; filter: brightness(1.08); }
.hero-link { position: absolute; inset: 0; z-index: 1; }
.hero-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(0,0,0,.35); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hero-nav:hover { background: rgba(0,0,0,.55); }
.hero-prev { left: 12px; }
.hero-next { right: 12px; }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 2px; z-index: 2; display: flex; justify-content: center; gap: 0; }
/* Vùng bấm 40px (dễ chạm trên điện thoại), chấm nhìn thấy chỉ 10px */
.hero-dots button { width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.hero-dots button::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.55); box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.hero-dots button[aria-selected="true"]::before { background: #fff; }
@media (max-width: 760px) { .hero-nav { display: none; } }

/* ---- Giới thiệu: video bên trái, chữ bên phải (máy tính) ---- */
.home-intro.has-video .intro-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.home-intro.has-video .video-frame { margin-bottom: 0; }
@media (max-width: 860px) { .home-intro.has-video .intro-grid { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; } }

/* ---- Ô tìm kiếm trên đầu trang ---- */
.header-search { position: relative; display: flex; align-items: center; color: #e8e9ec; }
.header-search input { width: 190px; height: 38px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: inherit; padding: 0 2.4rem 0 .9rem; font: inherit; font-size: 15px; }
/* Theo màu chữ đầu trang (mẫu giao diện nền sáng / tối đều đọc được) */
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .header-search input { border-color: color-mix(in srgb, currentColor 30%, transparent); background: color-mix(in srgb, currentColor 8%, transparent); }
}
.header-search input::placeholder { color: currentColor; opacity: .65; }
.header-search button[type=submit] { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: transparent; color: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.header-search svg { width: 18px; height: 18px; }
.header-search .search-suggest { right: 0; left: auto; width: 320px; color: #222; }
@media (max-width: 1023px) { .header-search { display: none; } }
@media (min-width: 1024px) and (max-width: 1279px) { .header-search input { width: 150px; } }

/* Điện thoại / máy tính bảng: logo luôn ở chính giữa màn hình (nút ☰ bên trái và nút Gọi điện bên phải
   rộng khác nhau nên căn bằng flex sẽ lệch) */
@media (max-width: 1023px) {
  .header-inner { position: relative; justify-content: space-between; }
  .brand { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; max-width: 34vw; }
  .brand-logo { max-width: 100%; height: auto; max-height: 56px; }
}
@media (max-width: 359px) { .btn-call-header { padding: .6rem .7rem; font-size: .74rem; } }
