/* =========================================================
   MINH HIỀN - Ống thủy lực & Rắc co
   Thiết kế tối giản, rõ ràng, dễ dùng cho mọi lứa tuổi.
   Bảng màu lấy đúng từ logo (images/logo-full.jpg): navy #13345a,
   cam #dc7824, nền kem #f4ecd9.
   ========================================================= */

:root{
  --navy: #13345a;
  --navy-dark: #0b2240;
  --navy-light: #1f4a7a;
  --accent: #dc7824;
  --accent-dark: #b45c12;   /* nền nút cam - đủ tương phản với chữ trắng */
  --cream: #f4ecd9;
  --bg: #f8f5ee;
  --white: #ffffff;
  --text: #1f2a33;
  --text-muted: #5a6670;
  --border: #e6e0d3;
  --zalo: #0068ff;
  --zalo-dark: #0052cc;
  --error: #b3392f;
  --error-bg: #fdeeec;
  --success: #2e7d52;
  --success-bg: #eaf6ef;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 2px 10px rgba(19, 52, 90, 0.07);
  --shadow-lg: 0 8px 28px rgba(19, 52, 90, 0.13);
  --container: 1180px;
  --header-h: 76px;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: 'Be Vietnam Pro', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
ul{ list-style: none; margin: 0; padding: 0; }
h1,h2,h3,h4{ margin: 0 0 .5em; line-height: 1.25; font-weight: 700; color: var(--navy-dark); }
h1.h2, .h2{ font-size: 1.9rem; }
.h3{ font-size: 1.2rem; }
.page-title{ font-size: 1.9rem; margin-bottom: 6px; }
.page-lead{ max-width: 70ch; margin-bottom: 26px; }
a:focus-visible, button:focus-visible{ outline: 3px solid var(--accent); outline-offset: 2px; }
p{ margin: 0 0 1em; }
button{ font-family: inherit; cursor: pointer; }
input, select, textarea{ font-family: inherit; font-size: 1rem; }

.container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  min-height: 48px;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{ background: var(--accent-dark); color: var(--white); }
.btn-primary:hover{ background: #9a4d0c; }
.btn-zalo{ background: var(--zalo); color: var(--white); }
.btn-zalo:hover{ background: var(--zalo-dark); }
.btn-secondary{ background: var(--navy); color: var(--white); }
.btn-secondary:hover{ background: var(--navy-light); }
.btn-outline{ background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-outline:hover{ background: var(--navy); color: var(--white); }
.btn-outline.on-dark{ border-color: rgba(255,255,255,.6); color: var(--white); }
.btn-outline.on-dark:hover{ background: var(--white); color: var(--navy); }
.btn-block{ width: 100%; }
.btn-lg{ padding: 16px 30px; font-size: 1.1rem; }
.btn-sm{ padding: 8px 16px; min-height: 38px; font-size: .9rem; }
.btn:disabled{ opacity: .5; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header{
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.topbar{
  background: var(--navy-dark);
  color: #cfe0ee;
  font-size: .85rem;
}
.topbar .container{
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px; padding-bottom: 8px; gap: 12px; flex-wrap: wrap;
}
.topbar a{ color: #cfe0ee; }
.topbar a:hover{ color: var(--white); }
.topbar-links{ display: flex; gap: 18px; flex-wrap: wrap; }
.topbar a, .topbar span{ display: inline-flex; align-items: center; gap: 6px; }
.topbar svg{ width: 14px; height: 14px; flex-shrink: 0; }
.topbar b{ color: var(--white); }
.header-main{
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
  gap: 20px;
}
.logo{
  display: flex; align-items: center; gap: 10px;
  color: var(--navy); flex-shrink: 0;
}
.logo img{ width: 52px; height: auto; }
.logo-text, .footer-brand span{
  font-family: 'Roboto Slab', Georgia, serif; font-weight: 800; font-size: 1.45rem;
  letter-spacing: .02em; line-height: 1.05;
}
.logo small, .footer-brand small{
  display: block; font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: .7rem; font-weight: 800; color: var(--accent-dark);
  letter-spacing: .08em; text-transform: uppercase; margin-top: 3px;
}

.main-nav{ display: flex; align-items: center; gap: 2px; }
.main-nav a{
  padding: 10px 10px; border-radius: 8px; font-weight: 600; color: var(--navy-dark);
  font-size: .92rem; white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active{ background: var(--bg); color: var(--accent-dark); }

.header-actions{ display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.quote-btn{
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 16px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
  font-weight: 700; color: var(--navy);
}
.quote-btn:hover{ border-color: var(--navy); }
.quote-badge{
  position: absolute; top: -6px; right: -6px;
  background: var(--accent); color: var(--white);
  font-size: .7rem; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px; border: 2px solid var(--white);
}
.nav-toggle{ display: none; }
.main-nav-close{ display: none; }

/* Ngưỡng riêng cho main-nav (1020px) - khác các breakpoint 900px còn lại trong
   file (đừng gộp chung): logo + 5 mục menu + nút "Báo giá" cần đủ chỗ mới nằm
   trên 1 hàng, hẹp hơn thì chuyển hẳn sang menu toàn màn hình. */
@media (max-width: 1020px){
  /* Menu phủ toàn màn hình (top: 0) - không phụ thuộc chiều cao header/topbar */
  .main-nav{
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--white);
    flex-direction: column; align-items: stretch;
    padding: 16px 20px; gap: 4px;
    transform: translateY(-110%);
    transition: transform .25s ease;
    overflow-y: auto;
    z-index: 99;
  }
  .main-nav.open{ transform: translateY(0); }
  .main-nav a{ padding: 14px 16px; font-size: 1.05rem; border-bottom: 1px solid var(--border); white-space: normal; }
  .nav-toggle{
    display: flex; width: 46px; height: 46px; border-radius: 10px;
    align-items: center; justify-content: center;
    background: var(--bg); border: 1px solid var(--border);
    flex-direction: column; gap: 4px;
  }
  .nav-toggle{ width: 48px; height: 48px; }
  .nav-toggle span{ width: 20px; height: 2px; background: var(--navy-dark); display: block; }
  .main-nav{ padding-top: 72px; }

  /* Nút X đóng menu - nằm cố định góc trên phải trong menu mobile toàn màn hình,
     để bấm đóng theo bản năng thay vì phải nhớ bấm lại icon 3 sọc trên header. */
  .main-nav-close{
    display: flex; position: absolute; top: 16px; right: 16px;
    width: 40px; height: 40px; border-radius: 10px;
    align-items: center; justify-content: center;
    background: var(--bg); border: 1px solid var(--border);
    font-size: 1.1rem; color: var(--navy-dark); cursor: pointer; z-index: 1;
  }
  .main-nav-close:hover{ background: #eef1f4; }
}
@media (max-width: 900px){
  .topbar-links{ font-size: .8rem; gap: 12px; }
}
@media (max-width: 720px){
  .topbar-hide-sm{ display: none !important; }
  .topbar .container{ justify-content: center; }
}
/* Điện thoại: thu nhỏ logo để nút "Báo giá" vẫn giữ được CHỮ (không icon-only) */
@media (max-width: 480px){
  .container{ padding: 0 16px; }
  .logo{ gap: 7px; }
  .logo img{ width: 40px; }
  .logo-text{ font-size: 1.12rem; }
  .logo small{ font-size: .56rem; letter-spacing: .04em; }
  .quote-btn{ padding: 0 10px; gap: 5px; font-size: .92rem; }
  .header-main{ gap: 8px; }
  .header-actions{ gap: 8px; }
}
/* Máy hẹp (Galaxy Z Fold 344px, máy 320-400px): logo nhỏ thêm, nút "Báo giá"
   bỏ icon nhưng GIỮ CHỮ, để đầu trang không tràn ngang (dải xanh trên cùng hụt) */
@media (max-width: 400px){
  .logo{ gap: 6px; }
  .logo img{ width: 34px; }
  .logo-text{ font-size: 1rem; }
  .logo small{ font-size: .5rem; letter-spacing: .02em; }
  .quote-btn{ padding: 0 12px; }
  .quote-btn svg{ display: none; }
  .nav-toggle{ width: 44px; height: 44px; }
  .header-main{ gap: 6px; }
  .header-actions{ gap: 6px; }
}
@media (max-width: 340px){
  .container{ padding: 0 12px; }
  /* Chữ trong nút được xuống dòng, cột lưới được co lại: nút dài không đẩy trang tràn ngang */
  .btn{ white-space: normal; text-align: center; }
  .hero .container{ grid-template-columns: minmax(0, 1fr); }
}
/* Màn hình rất hẹp (Galaxy Fold đời đầu 280px): bỏ hình logo, giữ chữ MINH HIỀN */
@media (max-width: 300px){
  .logo img{ display: none; }
}

/* ---------- Hero ---------- */
.hero{
  background: linear-gradient(120deg, var(--navy-dark), var(--navy));
  color: var(--white);
  padding: 64px 0;
}
.hero .container{
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
}
.hero-eyebrow{
  display: inline-block; background: rgba(220,120,36,.2); color: #ffbd85;
  padding: 6px 14px; border-radius: 999px; font-size: .85rem; font-weight: 700;
  margin-bottom: 16px;
}
.hero h1{ color: var(--white); font-size: 2.5rem; margin-bottom: 16px; }
.hero p.lead{ color: #cfe0ee; font-size: 1.1rem; max-width: 46ch; }
.hero-actions{ display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-points{ display: grid; gap: 8px; margin-top: 28px; }
.hero-points li{ position: relative; padding-left: 28px; color: #e3edf6; }
.hero-points li::before{
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent);
  color: var(--white); font-size: .75rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
/* ---------- Thẻ cửa hàng (cột phải hero trang chủ) ----------
   ≥1021px (máy tính, iPad ngang): 2 cột, thẻ bên phải, nội dung xếp dọc.
   601-1020px (iPad dọc, điện thoại ngang): 1 cột, thẻ nằm dưới, QR | thông tin.
   ≤600px (điện thoại): ẩn thẻ, thay bằng .shop-strip gọn dưới 2 nút. */
.shop-card{
  background: var(--white); color: var(--text);
  border-radius: var(--radius-lg); padding: 22px;
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
  width: 100%; max-width: 400px; justify-self: end;
}
.shop-card-body{ display: grid; gap: 18px; margin-top: 16px; }
.shop-status{
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .95rem; color: var(--navy-dark);
  background: var(--bg); border-radius: 999px; padding: 7px 14px;
}
.shop-status-dot{ width: 10px; height: 10px; border-radius: 50%; background: #9aa5ae; flex-shrink: 0; }
.shop-status.is-open .shop-status-dot{ background: #2e9e5b; box-shadow: 0 0 0 4px rgba(46,158,91,.18); }
.shop-status.is-soon .shop-status-dot{ background: var(--accent); box-shadow: 0 0 0 4px rgba(220,120,36,.2); }
.shop-status.is-closed .shop-status-dot{ background: #c0463b; }
.shop-qr{
  display: flex; align-items: center; gap: 16px;
  padding: 14px; border: 1px solid var(--border); border-radius: var(--radius);
}
.shop-qr:hover{ border-color: var(--zalo); }
.shop-qr img{ width: 132px; height: 132px; flex-shrink: 0; border-radius: 6px; }
.shop-qr-text{ font-size: .88rem; color: var(--text-muted); line-height: 1.5; }
.shop-qr-text b{ display: block; color: var(--zalo); font-size: 1.02rem; margin-bottom: 4px; }
.shop-info{ display: grid; gap: 12px; align-content: start; }
.shop-info-row{ display: flex; gap: 10px; margin: 0; font-size: .95rem; line-height: 1.5; }
.shop-info-row svg{ flex-shrink: 0; margin-top: 2px; color: var(--accent-dark); }
.shop-info-row small{ color: var(--text-muted); font-size: .85rem; }
.shop-info .btn{ margin-top: 4px; }
.shop-strip{ display: none; }

@media (max-width: 1020px){
  .hero{ padding: 44px 0; }
  .hero .container{ grid-template-columns: 1fr; gap: 30px; }
  .hero h1{ font-size: 2.1rem; }
  .shop-card{ max-width: none; justify-self: stretch; }
  .shop-card-body{ grid-template-columns: auto 1fr; align-items: center; gap: 22px; }
  .shop-qr{ flex-direction: column; text-align: center; max-width: 220px; }
}
@media (max-width: 600px){
  .hero{ padding: 32px 0 36px; }
  .hero h1{ font-size: 1.75rem; }
  .hero-actions .btn{ width: 100%; }
  .shop-card{ display: none; }
  .shop-strip{
    display: grid; gap: 10px; margin-top: 18px;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
    border-radius: var(--radius); padding: 12px 14px;
  }
  .shop-strip .shop-status{ background: var(--white); justify-self: start; font-size: .9rem; }
  .shop-strip-link{ display: flex; gap: 8px; align-items: flex-start; color: #e3edf6; font-size: .95rem; }
  .shop-strip-link svg{ flex-shrink: 0; margin-top: 2px; color: #ffbd85; }
  .shop-strip-link b{ color: var(--white); text-decoration: underline; }
}
}

/* ---------- Thanh tìm kiếm trang chủ ---------- */
.home-search-section{ padding: 44px 0 8px; }
.home-search-box{
  position: relative;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 760px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow);
}
.home-search-input-wrap{
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-muted);
}
.home-search-input-wrap input{
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  color: var(--text);
  padding: 13px 0;
  min-height: 44px;
}
.home-search-btn{ min-height: 48px; flex-shrink: 0; }
@media (max-width: 560px){
  .home-search-box{ flex-direction: column; }
  .home-search-btn{ width: 100%; }
}

/* ---------- Sections ---------- */
.section{ padding: 60px 0; }
.section-tight{ padding: 40px 0; }
.section-head{ text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head .eyebrow{
  color: var(--accent-dark); font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; font-size: .82rem; margin-bottom: 8px; display: block;
}
.section-head h2{ font-size: 1.9rem; }
.section-head p{ color: var(--text-muted); }
.bg-white{ background: var(--white); }
.bg-navy{ background: var(--navy-dark); color: var(--white); }
.bg-navy h2, .bg-navy h3{ color: var(--white); }
.bg-navy p{ color: #d5e2ee; }
.cta-band{ display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.cta-band > div:first-child{ max-width: 620px; }
.cta-band .hero-actions{ margin-top: 0; }

/* ---------- Category / feature cards ---------- */
.grid-2{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; max-width: 760px; margin: 0 auto; }
@media (max-width: 560px){ .grid-2{ grid-template-columns: 1fr; } }
.grid-3{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 900px){ .grid-3, .grid-4{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px){ .grid-3, .grid-4{ grid-template-columns: 1fr; } }

.cat-card{
  display: block;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; text-align: center; transition: box-shadow .15s ease, transform .15s ease;
}
.way-card{
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 24px 24px;
}
.way-card p{ color: var(--text-muted); font-size: .95rem; margin: 0 0 6px; flex: 1; }
.way-card h3{ margin: 0; font-size: 1.2rem; }
.way-card-accent{ border: 2px solid var(--accent); background: #fffaf3; }
.way-num{
  width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem;
}
.way-card-accent .way-num{ background: var(--accent-dark); }
.cat-card:hover{ box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.cat-card .cat-icon{
  width: 64px; height: 64px; border-radius: 16px; background: var(--bg);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
  color: var(--navy);
}
.cat-card h3{ font-size: 1.1rem; margin-bottom: 6px; }
.cat-card p{ color: var(--text-muted); font-size: .92rem; margin-bottom: 14px; }

.feature-card{
  background: var(--white); border-radius: var(--radius-lg); padding: 24px;
  border: 1px solid var(--border);
}
.feature-card .icon{
  width: 52px; height: 52px; border-radius: 12px; background: rgba(220,120,36,.12);
  color: var(--accent-dark); display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.feature-card h3{ font-size: 1.05rem; }
.feature-card p{ color: var(--text-muted); font-size: .92rem; margin: 0; }
.feature-card .step-icon{ background: rgba(220,120,36,.25); color: #ffbd85; font-weight: 800; font-size: 1.2rem; }

/* ---------- Product cards / grid ---------- */
.product-toolbar{
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 24px;
  position: sticky;
  top: 76px; /* dự phòng - JS đo đúng chiều cao header thật rồi ghi đè inline */
  z-index: 90; /* dưới header (100) và dưới thanh liên hệ/chat widget (150+) */
  background: var(--bg);
  padding: 14px 0;
  transition: box-shadow .15s ease;
}
.product-toolbar.is-stuck{
  box-shadow: 0 8px 16px rgba(18, 48, 73, 0.12);
}
.search-box{
  position: relative;
  display: flex; align-items: center; gap: 10px; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 16px; flex: 1; min-width: 220px; max-width: 420px;
}
.search-box input{ border: none; outline: none; flex: 1; font-size: 1rem; background: transparent; }

/* ---------- Dropdown gợi ý tìm kiếm sản phẩm ---------- */
.search-dropdown{
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 160;
  max-height: 420px;
  overflow-y: auto;
  padding: 6px;
}
.search-result-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
}
.search-result-item:hover{ background: var(--bg); }
.search-result-thumb{
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 8px;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  color: var(--navy);
}
.search-result-info{ display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.search-result-name{
  font-weight: 700; font-size: 0.92rem; color: var(--navy-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result-cat{ font-size: 0.8rem; color: var(--text-muted); }
.search-empty{
  padding: 18px 14px; text-align: center; color: var(--text-muted); font-size: 0.9rem; line-height: 1.5;
}
.search-empty a{ color: var(--accent-dark); font-weight: 700; }
.search-view-all{
  display: block; width: 100%; text-align: center; padding: 11px;
  background: none; border: none; border-top: 1px solid var(--border); margin-top: 4px;
  color: var(--navy); font-weight: 700; font-size: 0.88rem; cursor: pointer; font-family: inherit;
}
.search-view-all:hover{ background: var(--bg); }

@media (max-width: 560px){
  .search-dropdown{ max-height: 320px; }
}
.filter-chips{ display: flex; gap: 8px; flex-wrap: wrap; }
.chip{
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--white); font-weight: 600; font-size: .88rem; color: var(--text);
}
.chip.active{ background: var(--navy); color: var(--white); border-color: var(--navy); }
.chip:hover{ border-color: var(--navy); }

.product-grid{
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
@media (max-width: 900px){ .product-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px){ .product-grid{ grid-template-columns: 1fr; } }

.product-card{
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .15s ease, transform .15s ease;
}
.product-card:hover{ box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.product-thumb{
  aspect-ratio: 4/3; background: var(--bg); display: flex; align-items: center; justify-content: center;
  padding: 18px; position: relative; overflow: hidden; color: var(--navy);
}
/* Ảnh thật phủ lên icon minh hoạ (xem productThumbHTML trong main.js) */
.thumb-img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--white); }
.search-result-thumb, .admin-product-thumb{ position: relative; overflow: hidden; }
.product-thumb .badge, .pd-gallery .badge{
  position: absolute; top: 12px; left: 12px; background: var(--accent-dark); color: var(--white);
  font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; z-index: 1;
}
.product-body{ padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-meta-row{ display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sale-type{
  display: inline-block; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: #e8eef6; color: var(--navy);
}
.sale-type-meter{ background: #eaf3ec; color: #24613a; }
.sale-type-custom{ background: #fdeedd; color: #8a4508; }
.product-size{ color: var(--text-muted); font-size: .82rem; font-weight: 600; }
.product-title{ font-size: 1.05rem; font-weight: 700; color: var(--navy-dark); margin: 0; }
.product-desc{
  color: var(--text-muted); font-size: .88rem; flex: 1; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-price{ font-size: 1.15rem; font-weight: 800; color: var(--navy); }
.product-price small{ color: var(--text-muted); font-weight: 500; font-size: .78rem; }
.price-from{ font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.price-contact{ color: var(--accent-dark); font-size: 1rem; }
.product-more{ color: var(--navy); font-weight: 700; font-size: .88rem; margin-top: 2px; }
.product-card:hover .product-more{ color: var(--accent-dark); }

.catalog-empty{
  grid-column: 1 / -1; text-align: center; background: var(--white);
  border: 1px dashed var(--border); border-radius: var(--radius-lg); padding: 40px 24px;
}
.catalog-empty p{ color: var(--text-muted); max-width: 52ch; margin: 0 auto 6px; }
.empty-state{
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}

/* ---------- Product detail ---------- */
.pd-wrap{ display: grid; grid-template-columns: 1fr 1fr; gap: 46px; }
@media (max-width: 900px){ .pd-wrap{ grid-template-columns: 1fr; } }
.pd-gallery-wrap{ display: flex; flex-direction: column; gap: 12px; }
.pd-gallery{
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4/3; overflow: hidden; position: relative;
}
.pd-gallery #pd-main-img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--white); padding: 12px; }
.pd-gallery{ color: var(--navy); }
.pd-gallery-thumbs{ display: flex; gap: 10px; flex-wrap: wrap; }
.pd-gallery-thumb{
  width: 64px; height: 64px; border-radius: var(--radius); overflow: hidden;
  border: 2px solid var(--border); cursor: pointer; background: var(--bg); padding: 0;
}
.pd-gallery-thumb img{ width: 100%; height: 100%; object-fit: cover; }
.pd-gallery-thumb.active{ border-color: var(--accent); }

.detail-info-content{ color: var(--text); font-size: 1rem; line-height: 1.7; }
.detail-info-content p{ margin-bottom: 16px; }
.detail-info-content p:last-child{ margin-bottom: 0; }
.pd-info .product-cat{ margin-bottom: 6px; }
.pd-info h1{ font-size: 1.8rem; margin-top: 10px; }
.pd-size{ font-size: 1.02rem; margin-bottom: 8px; }
.pd-price{ font-size: 1.8rem; font-weight: 800; color: var(--navy); margin: 12px 0 4px; }
.pd-price.price-contact{ font-size: 1.4rem; color: var(--accent-dark); }
.pd-price small{ font-size: 1rem; font-weight: 500; color: var(--text-muted); }
.pd-price-note{ color: var(--text-muted); font-size: .88rem; margin-bottom: 16px; }
.pd-quote-box{
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; margin-bottom: 20px;
}
.pd-quote-hint{ font-weight: 600; color: var(--navy-dark); margin-bottom: 12px; }
.pd-or{ text-align: center; font-size: .88rem; margin: 12px 0 8px; }
.pd-specs-title{ font-size: 1.15rem; margin-top: 8px; }
.qty-field label, .quote-note-field label{ display: block; font-weight: 600; font-size: .85rem; margin-bottom: 4px; }
.pd-meta{ display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.pd-meta div{ display: flex; gap: 8px; font-size: .95rem; }
.pd-meta b{ min-width: 130px; color: var(--navy-dark); }
.qty-picker{ display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; width: fit-content; flex-shrink: 0; background: var(--white); }
.qty-picker button{ width: 48px; height: 48px; background: var(--bg); border: none; font-size: 1.3rem; }
.qty-picker input{ width: 64px; text-align: center; border: none; height: 48px; font-size: 1.05rem; -moz-appearance: textfield; }
.qty-picker input::-webkit-outer-spin-button, .qty-picker input::-webkit-inner-spin-button{ -webkit-appearance: none; margin: 0; }
.pd-buy-row{ display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.pd-add-btn{ flex: 1; min-width: 220px; white-space: normal; }
.pd-actions{ display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.trust-row{ display: flex; gap: 22px; margin-top: 26px; flex-wrap: wrap; }
.trust-row div{ display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text-muted); }

/* ---------- Cart ---------- */
.cart-wrap{ display: grid; grid-template-columns: 1fr 380px; gap: 30px; align-items: start; }
@media (max-width: 900px){ .cart-wrap{ grid-template-columns: 1fr; } }
.quote-list{ background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.quote-row{ display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 18px; border-bottom: 1px solid var(--border); }
.quote-row:last-child{ border-bottom: none; }
.quote-thumb{
  position: relative; width: 72px; height: 72px; border-radius: 10px; background: var(--bg); color: var(--navy);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.quote-name{ font-weight: 700; color: var(--navy-dark); }
.quote-name:hover{ color: var(--accent-dark); }
.quote-sub{ color: var(--text-muted); font-size: .85rem; margin-bottom: 10px; }
.quote-row-controls{ display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.quote-note-field{ flex: 1; min-width: 200px; }
.quote-note-field input{
  width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg);
}
.remove-btn{
  color: var(--error); font-size: .88rem; font-weight: 600;
  background: none; border: none; padding: 8px 0 0; min-height: 36px;
}
.remove-btn:hover{ text-decoration: underline; }
@media (max-width: 560px){
  .quote-row{ grid-template-columns: 56px 1fr; gap: 12px; padding: 14px; }
  .quote-thumb{ width: 56px; height: 56px; }
}
.quote-form{ position: sticky; top: calc(var(--header-h) + 50px); }
@media (max-width: 900px){ .quote-form{ position: static; } }

/* ---------- Forms ---------- */
.form-card{
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px;
}
.form-group{ margin-bottom: 18px; }
.form-group label{ display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.form-group .hint{ font-weight: 400; color: var(--text-muted); font-size: .82rem; }
.form-group input, .form-group textarea, .form-group select{
  width: 100%; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus{
  outline: 2px solid var(--navy); outline-offset: 1px; background: var(--white);
}
.form-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px){ .form-row{ grid-template-columns: 1fr; } }
.form-error{
  background: var(--error-bg); color: var(--error); border-radius: var(--radius);
  padding: 12px 14px; font-size: .92rem; margin-bottom: 14px;
}
.payment-note{
  margin: 10px 0 0; padding: 12px 14px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border); font-size: .92rem; color: var(--text);
}
/* Giao tận nơi = phải chuyển khoản trước → tô cam cho khách chú ý */
.payment-note-ship{ background: #fff6ec; border-color: #f2d5ad; color: #7a4310; font-weight: 600; }
.form-privacy{ font-size: .82rem; color: var(--text-muted); margin: 10px 0 0; text-align: center; }
.form-privacy a{ text-decoration: underline; }
.form-divider{ display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--text-muted); font-size: .85rem; }
.form-divider::before, .form-divider::after{ content: ""; flex: 1; height: 1px; background: var(--border); }
/* Ô bẫy bot - người thật không thấy, bot tự điền thì server bỏ qua */
.hp-field{ position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.radio-card-group{ display: flex; flex-direction: column; gap: 10px; }
.radio-card{
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 48px;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.radio-card:has(input:checked){ border-color: var(--navy); background: var(--bg); }
.radio-card input[type="radio"]{ width: 20px; height: 20px; accent-color: var(--navy); flex-shrink: 0; }
.radio-card span{ font-weight: 600; }
.form-note{
  background: #fff6ec; border: 1px solid #f2d5ad; color: #7a5117;
  border-radius: var(--radius); padding: 14px 16px; font-size: .9rem; margin-bottom: 20px;
}

.success-box{
  text-align: center; background: var(--success-bg); border: 1px solid #bfe4cd; color: var(--success);
  border-radius: var(--radius-lg); padding: 40px 24px;
}
/* ---------- Contact ---------- */
.contact-quick{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 30px; }
@media (max-width: 620px){ .contact-quick{ grid-template-columns: 1fr; } }
.contact-quick-btn{
  display: flex; flex-direction: column; gap: 4px; padding: 20px 22px; border-radius: var(--radius-lg);
  color: var(--white); box-shadow: var(--shadow);
}
.contact-quick-btn strong{ font-size: 1.25rem; }
.contact-quick-btn > span{ opacity: .9; font-size: .92rem; }
.contact-quick-zalo{ background: var(--zalo); }
.contact-quick-zalo:hover{ background: var(--zalo-dark); }
.contact-quick-call{ background: var(--navy); }
.contact-quick-call:hover{ background: var(--navy-light); }
.contact-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
@media (max-width: 900px){ .contact-grid{ grid-template-columns: 1fr; } }
.contact-info-item{ display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.contact-info-item .icon{
  width: 46px; height: 46px; border-radius: 10px; background: var(--bg); color: var(--navy);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.map-box{
  aspect-ratio: 4/3; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center; color: var(--text-muted); text-align: center;
  overflow: hidden;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb{ font-size: .88rem; color: var(--text-muted); margin-bottom: 18px; }
.breadcrumb a:hover{ color: var(--navy); }
.pd-back-btn{ margin-bottom: 14px; }

/* ---------- Footer ---------- */
.site-footer{ background: var(--navy-dark); color: #c3d3e2; padding: 50px 0 20px; margin-top: 60px; }
.footer-brand{ display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--white); }
.footer-brand img{ width: 52px; height: auto; background: var(--cream); border-radius: 10px; padding: 4px; }
.footer-brand small{ color: #ffbd85; }
.footer-contact a, .footer-contact > li > span{ display: flex; gap: 8px; align-items: flex-start; }
.footer-contact svg{ flex-shrink: 0; margin-top: 3px; width: 16px; height: 16px; }
.footer-grid{ display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px; margin-bottom: 30px; }
@media (max-width: 900px){ .footer-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .footer-grid{ grid-template-columns: 1fr; } }
.site-footer h4{ color: var(--white); font-size: 1rem; margin-bottom: 14px; }
.site-footer p{ font-size: .9rem; }
.site-footer ul li{ margin-bottom: 10px; font-size: .9rem; }
.site-footer a{ font-size: .9rem; }
.site-footer a:hover{ color: var(--white); }
.footer-bottom{
  border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; text-align: center; font-size: .85rem;
}

/* ---------- Thanh liên hệ nhanh (mobile only) ---------- */
.mobile-contact-bar{ display: none; }

@media (max-width: 768px){
  body{ padding-bottom: 92px; }

  .mobile-contact-bar{
    display: flex;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 150;
    gap: 10px;
  }
  body.nav-open .mobile-contact-bar{ display: none; }

  .contact-bar-btn{
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 8px 22px rgba(18, 48, 73, 0.25);
    text-decoration: none;
  }
  .contact-bar-call{
    background: var(--navy);
    color: var(--white);
  }
  .contact-bar-zalo{
    background: var(--zalo);
    color: var(--white);
  }
  /* Nút "Hỏi AI": gọn hơn 2 nút kia, chữ ngắn */
  .contact-bar-ai{
    flex: 0 0 auto; padding: 0 14px; border: none; font-family: inherit;
    background: var(--accent-dark); color: var(--white);
  }
  .contact-bar-ai svg{ width: 20px; height: 20px; }
  .contact-bar-btn{ gap: 6px; font-size: .95rem; white-space: nowrap; }
}

/* ---------- Nút liên hệ nổi (desktop) ---------- */
.desktop-fab{ display: none; }

@media (min-width: 769px){
  .desktop-fab{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 150;
  }
  .fab-btn{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 52px;
    border-radius: 999px;
    padding: 0 15px;
    box-shadow: 0 8px 22px rgba(18, 48, 73, 0.28);
    text-decoration: none;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    font-family: inherit;
  }
  .fab-btn .fab-label{
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    font-weight: 700;
    font-size: 0.95rem;
    margin-right: 0;
    transition: max-width 0.28s ease, opacity 0.2s ease, margin-right 0.28s ease;
  }
  .fab-btn:hover .fab-label{
    max-width: 140px;
    opacity: 1;
    margin-right: 10px;
  }
  .fab-btn .fab-icon{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }
  .fab-call{ background: var(--navy); color: var(--white); }
  .fab-call:hover{ background: var(--navy-light); }
  .fab-zalo{ background: var(--zalo); color: var(--white); }
  .fab-zalo:hover{ background: var(--zalo-dark); }
  .fab-ai{ background: var(--accent-dark); color: var(--white); }
  .fab-ai:hover{ background: #9a4d0c; }
  .fab-ai-badge{
    position: absolute;
    top: -6px;
    right: 6px;
    background: var(--navy);
    color: var(--white);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 1px 5px;
    border-radius: 999px;
    border: 2px solid var(--white);
    pointer-events: none;
  }
}

/* Màn hình vừa (iPad ngang, laptop nhỏ 769-1299px): nội dung chạm gần mép phải nên
   cột nút giữa màn hình sẽ đè lên chữ, nên dời xuống góc dưới bên phải. */
@media (min-width: 769px) and (max-width: 1299px){
  .desktop-fab{ top: auto; bottom: 20px; transform: none; }
}

/* ---------- Khung chat trợ lý AI ---------- */
.ai-chat-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(10, 30, 48, 0.35);
  z-index: 198;
  display: none;
}
body.ai-chat-open .ai-chat-backdrop{ display: block; }
body.ai-chat-open .mobile-contact-bar,
body.ai-chat-open .desktop-fab{ display: none; }

.ai-chat-panel{
  position: fixed;
  z-index: 199;
  display: none;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
body.ai-chat-open .ai-chat-panel{ display: flex; }

.ai-chat-header{
  background: var(--navy);
  color: var(--white);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.ai-chat-header strong{ display: block; font-size: 0.98rem; }
.ai-chat-subtitle{ display: block; font-size: 0.76rem; color: #cfe0ee; margin-top: 2px; }
.ai-chat-close{
  background: rgba(255,255,255,.12);
  border: none;
  color: var(--white);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  font-size: 1rem;
  cursor: pointer;
}
.ai-chat-close:hover{ background: rgba(255,255,255,.22); }

.ai-chat-messages{
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}
.ai-chat-msg{
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.ai-chat-msg-bot{
  align-self: flex-start;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.ai-chat-msg-user{
  align-self: flex-end;
  background: var(--navy);
  color: var(--white);
  border-bottom-right-radius: 4px;
}
.ai-chat-msg-typing{ color: var(--text-muted); font-style: italic; }

.ai-chat-escalate-wrap{
  flex-shrink: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--white);
}
.ai-chat-escalate-btn{
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 2px solid var(--accent);
  background: #fff6ec;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.ai-chat-escalate-btn:hover{ background: var(--accent); color: var(--white); }

.ai-chat-input-row{
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--white);
}
.ai-chat-input-row input{
  flex: 1;
  padding: 10px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.92rem;
}
.ai-chat-input-row input:focus{ outline: 2px solid var(--navy); outline-offset: 1px; background: var(--white); }
.ai-chat-input-row button{
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ai-chat-input-row button:hover{ background: var(--accent-dark); }
.ai-chat-input-row button:disabled{ opacity: .5; cursor: not-allowed; }

/* Mobile: nút nổi trên thanh liên hệ nhanh; panel gần toàn màn hình */
@media (max-width: 768px){
  .ai-chat-panel{ top: 14px; left: 14px; right: 14px; bottom: 14px; }
}

/* Desktop: nút Chat AI nằm chung cột với Gọi điện/Zalo (xem .fab-ai);
   panel dạng popup nhỏ phía trên góc dưới phải */
@media (min-width: 769px){
  .ai-chat-panel{
    right: 20px;
    bottom: 88px;
    width: 370px;
    height: min(560px, 75vh);
  }
}

/* ---------- Bài viết / Kiến thức thủy lực ---------- */
.article-card{
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: box-shadow .15s ease, transform .15s ease;
}
.article-card:hover{ box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.article-card-thumb{
  aspect-ratio: 16/9; background: var(--bg); color: var(--navy);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.article-card-thumb img{ width: 100%; height: 100%; object-fit: cover; }
.article-card-body{ padding: 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.article-card-date{ color: var(--text-muted); font-size: .8rem; }
.article-card-title{ font-size: 1.05rem; color: var(--navy-dark); }
.article-card-excerpt{
  color: var(--text-muted); font-size: .9rem; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card-more{ margin-top: auto; padding-top: 8px; color: var(--accent-dark); font-weight: 700; font-size: .88rem; }

.article-empty{ text-align: center; padding: 40px 20px; color: var(--text-muted); }

/* Phân trang danh sách bài viết */
.pagination{ display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 36px; flex-wrap: wrap; }
.pagination button{
  min-width: 44px; height: 44px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--white); font-weight: 700; color: var(--navy-dark);
}
.pagination button:hover:not(:disabled){ border-color: var(--navy); }
.pagination button.active{ background: var(--navy); color: var(--white); border-color: var(--navy); }
.pagination button:disabled{ opacity: .4; cursor: not-allowed; }

/* Trang chi tiết 1 bài viết */
.article-wrap{ max-width: 760px; margin: 0 auto; }
.article-wrap .eyebrow{ color: var(--accent-dark); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: .82rem; }
.article-wrap h1{ font-size: 1.9rem; margin-top: 8px; }
.article-meta{ color: var(--text-muted); font-size: .9rem; margin-bottom: 22px; }
.article-cover{
  border-radius: var(--radius-lg); overflow: hidden; background: var(--bg); margin-bottom: 30px;
}
.article-cover-img{ width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.article-cover-placeholder{
  width: 100%; aspect-ratio: 16/9; color: var(--navy);
  display: flex; align-items: center; justify-content: center;
}
.article-content{ font-size: 1.08rem; line-height: 1.85; color: var(--text); }
.article-content h2{ font-size: 1.4rem; margin-top: 1.6em; }
.article-content h3{ font-size: 1.15rem; margin-top: 1.4em; }
.article-content p{ margin-bottom: 1.1em; }
.article-content ul, .article-content ol{ margin: 0 0 1.1em; padding-left: 1.4em; }
.article-content ul{ list-style: disc; }
.article-content ol{ list-style: decimal; }
.article-content li{ margin-bottom: .5em; }
.article-content a{ color: var(--navy); font-weight: 600; text-decoration: underline; }
.article-content img{ border-radius: var(--radius); margin: 1.2em 0; }
.article-content blockquote{
  margin: 1.4em 0; padding: 14px 18px; border-left: 4px solid var(--accent);
  background: var(--bg); border-radius: 0 var(--radius) var(--radius) 0; color: var(--text-muted);
}
.article-meta span, .article-meta time{ white-space: nowrap; }
/* "Trả lời nhanh" - câu trả lời ngắn ngay đầu bài, đoạn Google/AI hay trích */
.article-answer{
  background: #fffaf3; border: 1px solid #f0d9bd; border-left: 5px solid var(--accent);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 26px;
}
.article-answer strong{
  display: block; color: var(--accent-dark); font-size: .82rem; letter-spacing: .05em;
  text-transform: uppercase; margin-bottom: 6px;
}
.article-answer p{ margin: 0; font-size: 1.08rem; line-height: 1.7; color: var(--navy-dark); font-weight: 500; }
.article-toc{
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 30px;
}
.article-toc strong{ color: var(--navy-dark); }
.article-toc ol{ margin: 8px 0 0; padding-left: 1.3em; list-style: decimal; }
.article-toc li{ padding: 4px 0; }
.article-toc a{ color: var(--navy); font-weight: 600; }
.article-toc a:hover{ color: var(--accent-dark); text-decoration: underline; }
.article-content h2, .article-content h3{ scroll-margin-top: 130px; }
.article-products, .article-related{ max-width: 760px; margin: 44px auto 0; }
.article-related{ max-width: none; }
.article-products h2, .article-related h2{ font-size: 1.35rem; }
.article-product-list{ display: grid; gap: 10px; }
.article-product{
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px;
}
.article-product:hover{ border-color: var(--navy); }
.article-product strong{ color: var(--navy-dark); }
.article-product span{ color: var(--text-muted); font-size: .9rem; }
.article-product-cta{ margin-left: auto; color: var(--accent-dark) !important; font-weight: 700; }
.article-cta{
  max-width: 760px; margin: 50px auto 0; text-align: center; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 34px 24px;
}

/* ---------- Khung đăng nhập bằng email/mật khẩu ---------- */
.email-auth-backdrop{
  position: fixed; inset: 0; background: rgba(10, 30, 48, .35); z-index: 210; display: none;
}
body.email-auth-open .email-auth-backdrop{ display: block; }
.email-auth-modal{
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 211; display: none; width: min(400px, calc(100vw - 32px));
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 28px; max-height: 90vh; overflow-y: auto;
}
body.email-auth-open .email-auth-modal{ display: block; }
.email-auth-modal h3{ margin: 0 0 18px; padding-right: 30px; }
.email-auth-close{
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg); border: none; font-size: 1rem; cursor: pointer;
}
.email-auth-error{
  background: #fdeeec; color: #b3392f; border-radius: var(--radius); padding: 10px 12px;
  font-size: .85rem; margin-bottom: 14px;
}
.email-auth-link{
  display: block; width: 100%; text-align: center; background: none; border: none;
  color: var(--navy); font-weight: 600; font-size: .88rem; padding: 10px 0; cursor: pointer; font-family: inherit;
}
.email-auth-link:hover{ text-decoration: underline; }

/* ---------- Spinner nút submit ---------- */
.btn-spinner{
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; animation: btn-spin .7s linear infinite; display: inline-block;
}
@keyframes btn-spin{ to{ transform: rotate(360deg); } }

/* ---------- Trang quản lý sản phẩm (quan-ly-san-pham.html) ---------- */
.admin-bar{ display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: -4px 0 24px; }
.admin-user{ display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--text-muted); }
/* Trang nội bộ: ẩn thanh liên hệ/chat của khách cho đỡ vướng */
body.admin-page .mobile-contact-bar, body.admin-page .desktop-fab,
body.admin-page #ai-chat-widget{ display: none !important; }
body.admin-page{ padding-bottom: 0; }
.account-email-link-btn{
  background: none; border: none; font-family: inherit; font-size: .85rem; font-weight: 600;
  color: var(--text-muted); text-decoration: underline; cursor: pointer; padding: 6px 0;
}
.account-email-link-btn:hover{ color: var(--navy); }
.admin-product-row{
  display: flex; align-items: center; gap: 14px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 12px 16px; margin-bottom: 10px;
}
.admin-product-thumb{
  width: 56px; height: 56px; border-radius: var(--radius); background: var(--bg);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; color: var(--navy);
}
.admin-product-info{ flex: 1; min-width: 0; }
.admin-product-name{ font-weight: 700; color: var(--navy-dark); }
.admin-product-actions{ display: flex; gap: 8px; flex-shrink: 0; }

.spec-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.spec-row input{
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
}

.admin-thumb-list{ display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.admin-thumb{
  position: relative; width: 80px; height: 80px; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border); background: var(--bg);
}
.admin-thumb img{ width: 100%; height: 100%; object-fit: cover; }
.admin-thumb-remove{
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(10,30,48,.75); color: var(--white); border: none; font-size: .75rem;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.admin-thumb-remove:hover{ background: var(--navy-dark); }

/* ---------- Trang tra giá + lên đơn nội bộ (tra-gia.html) ----------
   Kiểu bán tại quầy: ô tìm có danh sách sổ xuống, đơn nằm ngay bên dưới.
   Điện thoại: 1 cột + thanh tổng tiền dưới đáy. Máy tính (>=960px): phần
   tổng tiền nằm cột phải, dính theo khi cuộn. */
.pos-top{ margin: 0 0 14px; }
.pos-top .admin-user{ flex-wrap: wrap; }
.price-admin-links{ display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pos{ display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.pos-main{ min-width: 0; }
.pos-groups{ display: flex; gap: 8px; overflow-x: auto; padding: 0 0 10px; scrollbar-width: none; }
.pos-groups::-webkit-scrollbar{ display: none; }
.pos-group{
  flex-shrink: 0; min-height: 40px; padding: 6px 14px; border-radius: 999px; font-size: .9rem; font-weight: 600;
  background: var(--white); border: 1px solid var(--border); color: var(--navy);
}
.pos-group.is-active{ background: var(--navy); border-color: var(--navy); color: var(--white); }

.pos-searchwrap{ position: relative; z-index: 90; }
.price-search{ max-width: none; width: 100%; height: 54px; border-width: 2px; border-color: var(--navy); }
.price-search:focus-within{ border-color: var(--accent); }
.price-search input{ font-size: 1.05rem; }
.pos-dropdown{
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); max-height: min(60vh, 480px); overflow-y: auto; overscroll-behavior: contain;
}
.pos-dropdown[hidden]{ display: none; }
.pos-dd-head{
  position: sticky; top: 0; z-index: 1; padding: 8px 14px; font-size: .85rem; color: var(--text-muted);
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.pos-dd-item{
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 10px 10px 14px; border: none; border-bottom: 1px solid var(--border);
  background: var(--white); font: inherit; color: inherit; cursor: pointer;
}
.pos-dd-item:last-child{ border-bottom: none; }
.pos-dd-item:hover, .pos-dd-item.is-active{ background: #fff6ec; }
.pos-dd-main{ flex: 1; min-width: 0; display: grid; gap: 1px; }
.pos-dd-main strong{ color: var(--navy-dark); line-height: 1.3; }
.pos-dd-main mark{ background: #ffe2bf; color: inherit; border-radius: 3px; padding: 0 1px; }
.pos-dd-sub{ font-size: .82rem; color: var(--text-muted); }
.pos-dd-tiers{ display: flex; flex-wrap: wrap; gap: 0 10px; font-size: .86rem; }
.pos-dd-tiers b{ color: var(--accent-dark); }
.pos-dd-unit{ color: var(--text-muted); }
.pos-dd-cost{ font-size: .82rem; color: var(--success); font-weight: 600; }
.pos-dd-add{
  flex-shrink: 0; min-width: 72px; min-height: 44px; padding: 4px 8px; border-radius: var(--radius);
  background: var(--accent-dark); color: var(--white); font-weight: 700; font-size: .88rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.2;
}
.pos-dd-add small{ font-size: .72rem; font-weight: 600; opacity: .9; }
.pos-dd-empty{ padding: 16px 14px; }
.pos-dd-empty p{ margin: 0 0 10px; color: var(--text-muted); }
.pos-dd-empty .btn{ white-space: normal; text-align: left; }
.price-tier-hint{ font-size: .85rem; margin: 8px 0 0; }
.price-sync{ font-size: .82rem; margin: 2px 0 0; color: var(--success); }
.price-sync:empty{ display: none; }
.price-sync.is-warn{ color: #9a4d0c; font-weight: 600; }

.pos-order-head{ margin: 18px 0 8px; }
.pos-order-head h2{ font-size: 1.2rem; margin: 0; }
.pos-order-head h2 span{ color: var(--text-muted); font-weight: 600; font-size: 1rem; }
.pos-lines{ background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.pos-empty{ padding: 32px 16px; text-align: center; color: var(--text-muted); }
.pos-line{ padding: 14px 16px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.pos-line:last-child{ border-bottom: none; }
.pos-line.is-new{ animation: pos-flash 1.4s ease; }
@keyframes pos-flash{ from{ background: #ffe9cf; } to{ background: transparent; } }
.pos-line-top{ display: flex; gap: 10px; align-items: flex-start; }
.pos-line-no{
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--cream); color: var(--navy);
  font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.pos-line-name{ flex: 1; min-width: 0; display: grid; }
.pos-line-name strong{ color: var(--navy-dark); line-height: 1.35; }
.pos-line-name .muted{ font-size: .85rem; }
.pos-line-del{
  flex-shrink: 0; min-height: 40px; padding: 4px 12px; border-radius: var(--radius);
  background: var(--error-bg); color: var(--error); border: none; font-weight: 600; font-size: .88rem;
}
.pos-line-edit{ display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: end; }
.pos-field{ display: grid; gap: 4px; min-width: 0; }
.pos-field label{ font-size: .82rem; color: var(--text-muted); font-weight: 600; }
.pos-line .qty-picker input{ width: 68px; font-size: 1.05rem; font-weight: 600; }
.pos-input{
  width: 100%; height: 48px; padding: 0 12px; font: inherit; font-size: 1.05rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); color: var(--text);
}
.pos-input:focus, .pos-line .qty-picker input:focus{ outline: 2px solid var(--accent); outline-offset: -2px; }
.pos-price{ text-align: right; font-weight: 600; max-width: 220px; justify-self: end; }
.pos-line-bottom{ display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pos-line-tier{ font-size: .85rem; color: var(--text-muted); }
.pos-line-total{ font-weight: 700; font-size: 1.1rem; color: var(--navy-dark); margin-left: auto; }
.pos-link{ background: none; border: none; padding: 4px 0; color: var(--accent-dark); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.pos-add-free{ margin-top: 12px; white-space: normal; }

.pos-summary{
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px 16px; display: grid; gap: 8px;
}
.pos-row[hidden]{ display: none; }
.pos-row{ display: flex; justify-content: space-between; align-items: center; gap: 4px 12px; flex-wrap: wrap; }
.pos-row label{ font-weight: 500; }
.pos-discount{ width: 150px; height: 44px; text-align: right; }
.pos-grand{ padding-top: 8px; border-top: 1px solid var(--border); }
.pos-grand span{ font-weight: 700; font-size: 1.05rem; }
.pos-grand b{ font-size: 1.5rem; color: var(--accent-dark); }
.pos-profit{ font-size: .88rem; color: var(--success); }
.pos-profit:empty{ display: none; }
.pos-actions{ display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 4px; }
.pos-actions .btn{ white-space: normal; padding-left: 16px; padding-right: 16px; }
.pos-bar{ display: none; }

@media (min-width: 960px){
  .pos{ grid-template-columns: minmax(0, 1fr) 360px; }
  .pos-summary{ position: sticky; top: 150px; margin-top: 50px; }
}
@media (max-width: 959px){
  body.pos-page main{ padding-bottom: 100px; }
  .pos-bar{
    display: flex; align-items: center; gap: 10px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
    padding: 8px 12px max(8px, env(safe-area-inset-bottom)) 16px;
    background: var(--navy-dark); color: var(--white); box-shadow: 0 -4px 16px rgba(11, 34, 64, .18);
  }
  body.pos-typing .pos-bar{ display: none; }
  .pos-bar-total{
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25;
    background: none; border: none; color: var(--white); font: inherit; text-align: left; padding: 4px 0;
  }
  .pos-bar-total span{ font-size: .82rem; opacity: .85; }
  .pos-bar-total b{ font-size: 1.25rem; }
  .pos-bar-copy{
    min-height: 48px; padding: 8px 18px; border-radius: var(--radius); border: none;
    background: var(--accent-dark); color: var(--white); font: inherit; font-weight: 700;
  }
  body.pos-page .toast{ bottom: 88px; max-width: calc(100% - 32px); }
  body.pos-typing .toast{ bottom: auto; top: 16px; }
}
/* Máy rất hẹp: ô số lượng và ô giá xếp chồng, ô giá đủ rộng cho số tiền dài */
@media (max-width: 360px){
  .pos-line-edit{ grid-template-columns: minmax(0, 1fr); }
  .pos-price{ max-width: none; justify-self: stretch; }
  .pos-line, .pos-summary{ padding-left: 12px; padding-right: 12px; }
  .pos-grand b{ font-size: 1.3rem; }
  .pos-bar-copy{ padding: 8px 12px; }
}
@media (max-width: 600px){
  .pos-top h1{ font-size: 1.45rem; }
  .pos-top .admin-email{ display: none; }
  .pos-dropdown{ max-height: 52vh; }
}
/* Điện thoại hẹp: tiêu đề + Đăng xuất chung 1 hàng, 2 nút quản trị chung 1 hàng */
@media (max-width: 400px){
  .pos-top{ flex-wrap: nowrap; gap: 8px; }
  .pos-top h1{ font-size: 1.25rem; }
  .pos-top .btn-sm, .price-admin-links .btn-sm{ padding: 6px 10px; min-height: 40px; font-size: .84rem; }
  .price-admin-links{ gap: 6px; flex-wrap: nowrap; }
}

/* ---------- Toast ---------- */
.toast{
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy-dark); color: var(--white); padding: 14px 22px; border-radius: var(--radius);
  font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 200;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-lg);
}
.toast.show{ opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Utility ---------- */
.text-center{ text-align: center; }
.mt-0{ margin-top: 0; }
.muted{ color: var(--text-muted); }
