/*
 * Giao diện khách — CSS thuần, KHÔNG qua Tailwind/Vite.
 *
 * Vì sao: màu do admin đổi trong /admin, phải là biến CSS đọc lúc chạy. Tailwind
 * build sẵn lúc deploy thì không đổi màu theo cài đặt được, mà lại bắt server phải
 * có node. Cách này sửa màu xong tải lại trang là thấy.
 *
 * Viết theo lối điện thoại trước (mobile-first), màn to thì nới ra ở @media.
 */

:root {
  --vien: 1px solid rgba(0, 0, 0, 0.08);
  --bong: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
  --rong: 1200px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--mau-nen);
  color: var(--mau-chu);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.boc { width: 100%; max-width: var(--rong); margin: 0 auto; padding: 0 16px; }

/* ---------- Đầu trang ---------- */
.dau-trang {
  background: var(--mau-dau-trang);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}
.dau-trang .boc { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.hieu { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.hieu img { height: 36px; width: auto; border-radius: 8px; }
.dau-trang nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.dau-trang nav a { padding: 8px 10px; border-radius: 8px; font-size: 15px; opacity: .9; }
.dau-trang nav a:hover { background: rgba(255, 255, 255, .12); opacity: 1; }

/* Điện thoại: giấu bớt mục, chừa chỗ cho nút quan trọng */
.chi-may-tinh { display: none; }
@media (min-width: 860px) { .chi-may-tinh { display: inline-flex; } }

/* ---------- Nút ---------- */
.nut {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border: 0; border-radius: calc(var(--bo-goc) * 1px);
  font-size: 16px; font-weight: 600; cursor: pointer; text-align: center;
  background: var(--mau-chinh); color: var(--mau-chu-tren-chinh);
}
.nut:hover { filter: brightness(1.08); }
.nut.phu { background: transparent; color: inherit; border: 2px solid currentColor; }
.nut.zalo { background: #0068ff; color: #fff; }
.nut.goi { background: #16a34a; color: #fff; }
.nut.nho { padding: 8px 12px; font-size: 14px; }
.nut.rong { width: 100%; }

/* ---------- Ảnh bìa ---------- */
.bia {
  background: var(--mau-chinh) center/cover no-repeat;
  color: #fff; padding: 40px 0; margin-bottom: 20px;
}
.bia h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.25; }
.bia p { margin: 0; opacity: .92; }
.bia .phu-mo { background: rgba(0, 0, 0, .38); display: inline-block; padding: 16px 20px; border-radius: 14px; }
@media (min-width: 860px) { .bia { padding: 72px 0; } .bia h1 { font-size: 40px; } }

/* ---------- Banner admin treo ---------- */
.banner { margin: 0 0 20px; }
.banner img { width: 100%; border-radius: calc(var(--bo-goc) * 1px); }

/* ---------- Bộ lọc ---------- */
.loc {
  background: var(--mau-the); border: var(--vien); box-shadow: var(--bong);
  border-radius: calc(var(--bo-goc) * 1px); padding: 14px; margin-bottom: 20px;
}
.loc form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.loc label { display: block; font-size: 13px; color: var(--mau-chu-nhat); margin-bottom: 4px; }
.loc input, .loc select {
  width: 100%;
  min-width: 0;   /* không có dòng này thì ô nhập giữ bề ngang mặc định, làm tràn trang */ padding: 10px; border-radius: 10px; border: 1px solid rgba(0,0,0,.15);
  background: #fff; font-size: 16px;   /* 16px để iPhone không tự phóng to khi bấm vào ô */
  color: var(--mau-chu);
}
.loc .ca-hang { grid-column: 1 / -1; }
@media (min-width: 860px) { .loc form { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; } .loc .ca-hang { grid-column: auto; } }

/* ---------- Lưới gà ---------- */
.luoi {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
/* Phòng xa: ô lưới mặc định không co nhỏ hơn chuỗi chữ dài nhất bên trong.
   Hiện tại chưa tràn (đo bằng CDP: innerWidth 390 = scrollWidth 390), nhưng
   thêm một giống gà tên dài là tràn ngay — chặn trước cho yên. */
.luoi > * { min-width: 0; }
.the h3, .the .thong-so, .the .gia { overflow-wrap: anywhere; }
@media (min-width: 860px) { .luoi { gap: 20px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); } }

.the {
  background: var(--mau-the); border: var(--vien); box-shadow: var(--bong);
  border-radius: calc(var(--bo-goc) * 1px); overflow: hidden;
  display: flex; flex-direction: column;
}
.the .khung-anh { position: relative; aspect-ratio: 4 / 3; background: #e9e5e1; }
.the .khung-anh img, .the .khung-anh video { width: 100%; height: 100%; object-fit: cover; }
.the .than { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.the h3 { margin: 0; font-size: 15px; line-height: 1.35; }
.the .thong-so { font-size: 13px; color: var(--mau-chu-nhat); }
.the .gia { font-weight: 700; color: var(--mau-nhan); font-size: 17px; margin-top: auto; }

.nhan {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(0, 0, 0, .65); color: #fff;
}
.nhan.con-hang { background: #16a34a; }
.nhan.da-ban { background: #6b7280; }
.nhan.giu-cho { background: #d97706; }
.nhan.co-clip { left: auto; right: 8px; background: rgba(0,0,0,.55); font-weight: 600; }

/* ---------- Trang chi tiết ---------- */
.chi-tiet { display: grid; gap: 20px; }
@media (min-width: 960px) { .chi-tiet { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: start; } }

.khoi {
  background: var(--mau-the); border: var(--vien); box-shadow: var(--bong);
  border-radius: calc(var(--bo-goc) * 1px); padding: 16px; margin-bottom: 16px;
}
.khoi h2 { margin: 0 0 12px; font-size: 18px; }

.bang-thong-so { width: 100%; border-collapse: collapse; font-size: 15px; }
.bang-thong-so th, .bang-thong-so td { text-align: left; padding: 9px 0; border-bottom: 1px solid rgba(0,0,0,.06); }
.bang-thong-so th { color: var(--mau-chu-nhat); font-weight: 500; width: 42%; }

.thu-vien { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.thu-vien img, .thu-vien video { width: 100%; border-radius: 10px; aspect-ratio: 4/3; object-fit: cover; }

.gia-lon { font-size: 28px; font-weight: 800; color: var(--mau-nhan); }
.hang-nut { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hang-nut .ca-hang { grid-column: 1 / -1; }

/* ---------- Chân trang ---------- */
.chan-trang { background: var(--mau-chan-trang); color: rgba(255,255,255,.82); margin-top: 32px; padding: 28px 0 20px; }
.chan-trang a { color: #fff; opacity: .85; }
.chan-trang a:hover { opacity: 1; }
.chan-cot { display: grid; gap: 20px; }
@media (min-width: 860px) { .chan-cot { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); } }
.chan-trang h4 { margin: 0 0 8px; color: #fff; font-size: 15px; }
.chan-trang ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.chan-cuoi { margin-top: 20px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.15); font-size: 13px; opacity: .7; }

/* ---------- Thanh liên hệ dính đáy màn hình điện thoại ---------- */
.thanh-day {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--mau-the); border-top: var(--vien);
}
.thanh-day + .dem-day { height: 76px; }
@media (min-width: 860px) { .thanh-day, .thanh-day + .dem-day { display: none; height: 0; } }

/* ---------- Lặt vặt ---------- */
.trong { text-align: center; padding: 48px 16px; color: var(--mau-chu-nhat); }
.loi-nhan { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; background: #dcfce7; color: #14532d; }
.loi-nhan.xau { background: #fee2e2; color: #7f1d1d; }
.bai-viet { line-height: 1.75; }
.bai-viet h2 { font-size: 19px; margin: 22px 0 8px; }
.bai-viet ul { padding-left: 20px; }
.nut-mang-xa-hoi { display: grid; gap: 10px; }
.nut-mang-xa-hoi .nut { background: #fff; color: #1f1c1a; border: 1px solid rgba(0,0,0,.18); }

/* ---------- Biểu mẫu (đặt mua, đăng nhập) ---------- */
.bieu-mau { display: grid; gap: 12px; }
.bieu-mau label { display: block; font-size: 14px; color: var(--mau-chu-nhat); margin-bottom: 4px; }
.bieu-mau input, .bieu-mau textarea {
  width: 100%; min-width: 0; padding: 11px; border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, .18); background: #fff; color: var(--mau-chu);
  font: inherit; font-size: 16px;   /* nhỏ hơn 16px là iPhone tự phóng to trang */
}
.bieu-mau textarea { resize: vertical; }

.gach-ngang { display: flex; align-items: center; gap: 10px; color: var(--mau-chu-nhat); margin: 14px 0; }
.gach-ngang::before, .gach-ngang::after { content: ""; flex: 1; height: 1px; background: rgba(0, 0, 0, .12); }

/* ---------- Trang tài khoản ---------- */
.o-vi { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ma-lon {
  font-size: 24px; font-weight: 800; letter-spacing: 3px; text-align: center;
  padding: 14px; border-radius: calc(var(--bo-goc) * 1px);
  background: rgba(0, 0, 0, .04); border: 1px dashed rgba(0, 0, 0, .2);
}

/* ── Gà bố mẹ (thêm 10/09/2026) ────────────────────────────────────────────
   Bán gà đá là bán niềm tin vào dòng máu, nên khối này phải bấm được và
   nhìn ra ngay là bấm được — không phải dòng chữ chìm trong bảng thông số. */
.the-bo-me {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mot-bo-me {
  border: 1px solid #e6e1db;
  border-radius: 10px;
  padding: 10px;
  background: var(--mau-nen);
}
.nhan-bo-me {
  font-size: 12px;
  color: var(--mau-chu-nhat);
  margin-bottom: 6px;
}
.lien-ket-bo-me {
  display: block;
  text-decoration: none;
  color: inherit;
}
.lien-ket-bo-me img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 6px;
}
.ten-bo-me {
  display: block;
  font-weight: 600;
}
.ten-bo-me.khong-lien-ket {
  color: var(--mau-chu-nhat);
  font-weight: 500;
}
.xem-bo-me {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--mau-chinh);
}
.lien-ket-bo-me:hover .xem-bo-me { text-decoration: underline; }

/* Nhãn "gà giống — không bán", để khách khỏi nhầm là hàng đang bán. */
.the-giong {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--mau-nhan);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 480px) {
  .the-bo-me { grid-template-columns: 1fr; }
}
