:root{
  --bg:#ffffff;
  --text:#111;
  --muted:rgba(0,0,0,.65);
  --border:#eaeaea;
  --card:#fff;
  --shadow:0 6px 20px rgba(0,0,0,.06);
  --radius:14px;

  --accent-border:rgba(140,170,230,.38);
  --accent-bg:#f3f4f6;
}

/* RESET */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
h1{
  font-size:24px;
  margin:12px 0 6px;
  line-height:1.3;
}
/* LAYOUT */
.container{max-width:1100px;margin:0 auto;padding:20px}
.row{display:flex;justify-content:center}
.muted{opacity:.7;font-size:13px}

/* HEADER */
.topbar{display:flex;align-items:center;justify-content:center;margin:10px 0 12px}
.brand{font-size:38px;font-weight:900;letter-spacing:.2px}

/* BUTTONS */
.btn,.btn-link{
  font-weight:650;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.btn:hover,.btn-link:hover{background:#fafafa}

/* BUY BUTTON */
.btn-buy{
  display:flex;
  align-items:center;
  justify-content:center;
  width:min(520px,100%);
  margin:16px auto 10px;
  padding:15px 22px;
  border-radius:8px;
  background:#ff0000;
  color:#fff;
  font-weight:900;
  font-size:22px;
  border:0;
  cursor:pointer;
  box-shadow:0 12px 30px rgba(198,58,51,.25);
}
.btn-buy:active{transform:translateY(1px)}

/* ================= PRODUCT GRID ================= */
.grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:14px;
  padding-bottom:10px;
}

.card{
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  box-shadow:0 4px 14px rgba(0,0,0,.05);
  transition:.15s;
}

.card:hover{
  transform:translateY(-3px);
  box-shadow:0 10px 26px rgba(0,0,0,.08);
}

.img{
  width:100%;
  aspect-ratio:1/1;
  object-fit:cover;
  background:#f6f6f6;
}

.name{
  padding:10px 12px 0;
  font-weight:400;
  font-size:14px;
  line-height:1.35;
  min-height:40px;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;

  text-transform:none; /* 🔥 QUAN TRỌNG: bỏ ép chữ thường */
}

.price{
  margin-top:8px;
  margin-left:12px; /* khớp với padding của .name */
  font-weight:800;
  color:#e60023; /* đỏ sàn TMĐT */
  font-size:16px;
}

.card .muted{
  padding:2px 12px 8px;
}

.card .btn-buy-small{
  margin-top:10px;
  display:block;
  text-align:center;
  padding:10px 0;
  border-top:1px solid #eee;
  font-weight:700;
  font-size:16px;
  color:#111;
}

/* Desktop grid */
@media (min-width:768px){
  .grid{grid-template-columns:repeat(4,1fr);}
}

/* SEARCH */
.search-form{width:100%}
.search-box{
  display:flex;
  align-items:center;
  gap:12px;
  padding:2px 12px;
  border-radius:22px;
  background:#fff;
  border:1px solid var(--accent-border);
  box-shadow:0 6px 20px rgba(0,0,0,.05);
  margin:8px 0 18px;
}
.search-input{
  flex:1;
  border:0;
  outline:0;
  background:transparent;
  font-size:18px;
  padding:4px 10px;
}
.search-input::placeholder{color:rgba(0,0,0,.38)}
.search-btn{
  width:44px;height:44px;border:0;background:transparent;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}
.search-icon{width:26px;height:26px;color:rgba(0,0,0,.42)}

    .kpi{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
    .sort-wrap{display:flex;align-items:center;gap:8px}
    .sort{padding:8px 10px;border-radius:10px;border:1px solid #ddd;background:#fff}
 
/* ===== PAGINATION ===== */
.pagination{
  margin:12px 0 20px;
  font-size:18px;
}

.pagination-row{
  display:flex;
  align-items:center;
  gap:18px;
  flex-wrap:wrap;
}

.page-next{
  color:#1a73e8;
  font-weight:600;
  white-space:nowrap;
}

.page-numbers{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  color:#444;
}

.page-numbers span{
  color:#555;
}

.page-numbers a{
  color:#1a73e8;
  font-weight:600;
  text-decoration:none;
}

.page-numbers a:hover{
  text-decoration:underline;
}

.dot{
  color:#888;
}
@media (max-width:600px){
  .pagination{
    font-size:16px;
  }
  .pagination-row{
    gap:12px;
  }
}
/* ================= RELATED ================= */
.related-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:14px;
  margin-top:18px;
}

.related-card{
  background:#fff;
  border-radius:14px;
  overflow:hidden;
  color:#111;
  box-shadow:0 4px 14px rgba(0,0,0,.06);
  display:flex;
  flex-direction:column;
}

.related-card img{
  width:100%;
  aspect-ratio:1/1;
  object-fit:cover;
}

.related-name{
  font-size:13px;
  padding:10px 10px 0;
  min-height:38px;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.related-price{
  color:#e60023;
  font-weight:800;
  font-size:15px;
  padding:6px 10px 12px;
  margin-top:auto;
}

/* DESCRIPTION */
.desc{white-space:pre-line;line-height:1.6}

/* SHARE BUTTONS */
.share-wrap{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:6px;
  margin-top:24px;
}
.share-btn{
  background:none;border:none;cursor:pointer;padding:0;
  width:62px;
  display:flex;flex-direction:column;align-items:center;
}
.share-icon{
  width:35px;height:35px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 4px 10px rgba(0,0,0,.08);
}
.share-btn span{margin-top:6px;font-size:12px;color:#222}
.share-icon svg{width:32px;height:32px;fill:#fff}

/* FOOTER */
.site-footer{margin-top:26px;padding:18px 0 26px;text-align:center;position:relative}
.site-footer::before{
  content:"";position:absolute;top:0;left:50%;transform:translateX(-50%);
  width:100vw;height:1px;background:#e5e7eb;
}
.footer-copy{font-size:13px;opacity:.8;margin-bottom:10px}
.footer-desc{font-size:13px;opacity:.75;line-height:1.55;max-width:720px;margin:0 auto}

/* ================= STICKY BUY BAR ================= */
.sticky-buy-bar{
  position:fixed;
  bottom:-60px;
  left:0;
  width:100%;
  height:48px;
  display:flex;
  background:#fff;
  box-shadow:0 -2px 12px rgba(0,0,0,.08);
  z-index:9999;
  transition:bottom .35s ease;
}
.sticky-buy-bar.show{bottom:0}

.sticky-buy-bar a{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  font-size:12px;
  font-weight:600;
  line-height:1;
}

.sticky-chat,.sticky-cart{
  width:25%;
  background:#fff;
  color:#333;
  border-right:1px solid #eee;
}

.sticky-buy{
  width:50%;
  background:#c62828;
  color:#fff;
  font-size:16px;
  font-weight:700;
}

.sticky-buy-bar svg{width:20px;height:20px;margin-bottom:2px}
.sticky-chat svg,.sticky-cart svg{fill:#d32f2f}
.sticky-buy svg{fill:#fff}

@media (min-width:768px){
  .sticky-buy-bar{display:none;}
}

body.has-sticky-bar{
  padding-bottom:52px;
}