/* =========================================================
   GIAO DIỆN CHUNG — bmcarpet.com.vn
   Sửa giao diện cho TOÀN BỘ website: chỉ sửa file này.
   CẤM đổi tên hoặc chuyển file này sang chỗ khác.
   ========================================================= */

:root {
  /* Màu lấy theo logo tientruong.vn */
  --mau-chinh: #22984f;      /* xanh lá logo: đầu trang, dấu chính hãng */
  --mau-dam: #17703a;        /* xanh lá đậm: tiêu đề, liên kết */
  --mau-vang: #fff212;       /* vàng logo: đường nhấn */
  --mau-nhan: #22984f;
  --mau-nen: #f4f7f5;
  --mau-the: #ffffff;
  --mau-chu: #222222;
  --mau-chu-phu: #5f6670;
  --mau-vien: #e1e4e8;
  --bo-goc: 10px;
  --rong-toi-da: 960px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--mau-chu);
  background: var(--mau-nen);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--mau-dam); }

.khung { max-width: var(--rong-toi-da); margin: 0 auto; padding: 0 16px; }

/* ---------- Đầu trang ---------- */
.dau-trang { background: var(--mau-chinh); color: #fff; position: sticky; top: 0; z-index: 10; border-bottom: 4px solid var(--mau-vang); }
.dau-trang .khung { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.ten-web { color: #fff; text-decoration: none; font-weight: bold; font-size: 20px; letter-spacing: 1px; }
.nut-menu {
  background: none; border: 1px solid rgba(255,255,255,.5); color: #fff;
  font-size: 22px; line-height: 1; padding: 8px 12px; border-radius: 6px; cursor: pointer;
}
.menu { display: none; border-top: 1px solid rgba(255,255,255,.15); }
.menu.mo { display: block; max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.menu ul { list-style: none; margin: 0; padding: 4px 16px 12px; }
.menu li a { display: block; color: #fff; text-decoration: none; padding: 12px 4px; border-bottom: 1px solid rgba(255,255,255,.1); }
.menu li a.dang-xem { font-weight: bold; text-decoration: underline; }

@media (min-width: 800px) {
  .dau-trang { position: static; }
  .nut-menu { display: none; }
  .menu { display: block; border-top: none; }
  .menu ul { max-width: var(--rong-toi-da); margin: 0 auto; padding: 0 16px 10px; display: flex; flex-wrap: wrap; gap: 4px 20px; }
  .menu li a { border-bottom: none; padding: 6px 0; }
}

/* ---------- Nội dung ---------- */
main { padding: 16px 0 32px; }

.the { background: var(--mau-the); border: 1px solid var(--mau-vien); border-radius: var(--bo-goc); padding: 16px; margin-bottom: 16px; }

.chinh-hang {
  display: flex; align-items: center; gap: 12px;
  background: #eaf6ee; border: 2px solid var(--mau-nhan); border-radius: var(--bo-goc);
  padding: 14px 16px; margin-bottom: 16px;
}
.chinh-hang .dau-tich {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  background: var(--mau-nhan); color: #fff; font-size: 24px; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
}
.chinh-hang strong { display: block; color: var(--mau-nhan); font-size: 18px; }
.chinh-hang span { color: var(--mau-chu-phu); font-size: 14px; }

h1 { color: var(--mau-dam); font-size: 26px; margin: 0 0 4px; }
h2 { color: var(--mau-dam); font-size: 20px; margin: 0 0 12px; }
.ma-sp { color: var(--mau-chu-phu); margin: 0 0 12px; }
.tieu-de-nhom { margin: 0 0 16px; }

.bo-cuc-sp { display: grid; gap: 16px; }
@media (min-width: 800px) { .bo-cuc-sp { grid-template-columns: 1fr 1fr; align-items: start; } }

.anh-chinh { border-radius: var(--bo-goc); width: 100%; }

.thong-so { width: 100%; border-collapse: collapse; }
.thong-so th, .thong-so td { text-align: left; vertical-align: top; padding: 9px 6px; border-bottom: 1px solid var(--mau-vien); font-size: 15px; }
.thong-so th { width: 42%; color: var(--mau-chu-phu); font-weight: normal; }
.thong-so tr:last-child th, .thong-so tr:last-child td { border-bottom: none; }

.luoi-mau { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 600px) { .luoi-mau { grid-template-columns: repeat(5, 1fr); } }
.luoi-mau figure { margin: 0; }
.luoi-mau img { border-radius: 6px; aspect-ratio: 1 / 1; object-fit: cover; width: 100%; background: var(--mau-vien); }
.luoi-mau figcaption { text-align: center; font-size: 14px; margin-top: 4px; }

.nguon { font-size: 14px; color: var(--mau-chu-phu); }

/* Lưới sản phẩm (trang chủ) */
.luoi-sp { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 600px) { .luoi-sp { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .luoi-sp { grid-template-columns: repeat(4, 1fr); } }
.luoi-sp a {
  display: block; background: var(--mau-the); border: 1px solid var(--mau-vien);
  border-radius: var(--bo-goc); overflow: hidden; text-decoration: none; color: var(--mau-chu);
}
.luoi-sp img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; background: var(--mau-vien); }
.luoi-sp span { display: block; padding: 10px; font-weight: bold; text-align: center; }

/* ---------- Chân trang ---------- */
.chan-trang { background: #173d27; color: #d4e4da; font-size: 14px; padding: 20px 0 28px; }
.chan-trang p { margin: 4px 0; }
.chan-trang a { color: #fff; }
.chan-trang .ten-cty { color: #fff; font-weight: bold; }

/* ---------- Phóng to ảnh (khu vực Màu sắc / Hình ảnh) ---------- */
.luoi-mau img { cursor: zoom-in; }
.luoi-mau img:focus-visible { outline: 3px solid var(--mau-chinh); outline-offset: 2px; }

.phong-to {
  position: fixed; inset: 0; z-index: 100; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0,0,0,.92); padding: 56px 12px 16px;
}
.phong-to.mo { display: flex; }
.phong-to img {
  max-width: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px;
  max-height: calc(100vh - 130px); max-height: calc(100dvh - 130px);
}
.phong-to .pt-chu { color: #fff; text-align: center; margin-top: 12px; font-size: 16px; }
.phong-to .pt-dem { display: block; color: rgba(255,255,255,.7); font-size: 13px; margin-top: 2px; }
.phong-to button {
  position: absolute; background: rgba(255,255,255,.16); color: #fff; border: none;
  width: 44px; height: 44px; border-radius: 50%; font-size: 30px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.phong-to button:hover, .phong-to button:focus-visible { background: rgba(255,255,255,.3); }
.phong-to .pt-dong { top: 8px; right: 8px; }
.phong-to .pt-truoc { left: 8px; top: 50%; transform: translateY(-50%); }
.phong-to .pt-sau { right: 8px; top: 50%; transform: translateY(-50%); }
@media (min-width: 800px) {
  .phong-to { padding: 64px 80px 24px; }
  .phong-to button { width: 52px; height: 52px; }
  .phong-to .pt-truoc { left: 20px; }
  .phong-to .pt-sau { right: 20px; }
  .phong-to .pt-dong { top: 16px; right: 20px; }
}
