/* ============================================================================
   styles.css — GIAO DIỆN "TỐI SANG TRỌNG" (Dark Luxury)
   ----------------------------------------------------------------------------
   Ý tưởng: nền tối than chì + chữ serif trắng cỡ lớn + ảnh macro làm chủ đạo +
   điểm nhấn vàng đồng. Giống cách các thương hiệu cao cấp dùng nền tối để sản
   phẩm trông "đắt giá" hơn.

   Bố cục file:
     1) Biến màu + font dùng chung
     2) Thiết lập chung (reset, nền, container, tiêu đề chung)
     3) Header (thanh trên cùng, trong suốt rồi đặc dần khi cuộn)
     4) Hero (ảnh lớn + chữ)
     5) Bộ lọc + lưới sản phẩm
     6) Giới thiệu / liên hệ / chân trang
     7) Giỏ hàng (drawer) + form đặt hàng
     8) Responsive (màn hình điện thoại)
   ========================================================================== */


/* ---------- 1) BIẾN MÀU + FONT DÙNG CHUNG ----------
   Đổi tông cả web chỉ bằng cách sửa các giá trị ở đây. */
:root {
  --bg:        #0f0f0e;   /* nền chính: đen than chì */
  --bg-soft:   #15150f;   /* nền phụ, hơi ấm hơn một chút */
  --surface:   #1a1a17;   /* bề mặt nổi (thẻ sản phẩm, ô nhập) */
  --surface-2: #222019;   /* bề mặt khi rê chuột */
  --line:      #2c2b26;   /* màu đường kẻ/viền mảnh */
  --text:      #f2efe6;   /* chữ chính: trắng ngà */
  --muted:     #a7a297;   /* chữ phụ: xám ấm */
  --gold:      #c6a256;   /* điểm nhấn: vàng đồng */
  --gold-soft: #d9bd7e;   /* vàng nhạt hơn (khi rê chuột) */
  --green:     #5a6b58;   /* xanh rêu phụ */
  --radius:    14px;      /* độ bo góc */

  /* Hai bộ chữ. Nếu Google Fonts không tải được, tự lùi về font hệ thống. */
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}


/* ---------- 2) THIẾT LẬP CHUNG ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;   /* chữ mịn hơn trên Mac */
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

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

/* Tiêu đề các mục dùng font serif, có đường kẻ vàng nhỏ phía dưới. */
.info-section h2,
.section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 2rem;
  letter-spacing: 0.5px;
}


/* ---------- 3) HEADER ----------
   Header "dán" cố định ở trên cùng. Mặc định trong suốt để nổi trên ảnh hero;
   khi cuộn xuống (JS thêm class .scrolled) thì chuyển nền tối đặc + viền mảnh. */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(15, 15, 14, 0.85);
  backdrop-filter: blur(10px);            /* làm mờ nền phía sau cho sang */
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text);
}
.main-nav a {
  margin: 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.2s ease;
}
.main-nav a:hover { color: var(--gold); }
/* Mục ĐANG XEM ("bạn đang ở đây"): chữ vàng + gạch chân vàng nhỏ. */
.main-nav a.active { color: var(--gold); position: relative; }
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 16px; }

/* Nút đổi ngôn ngữ: viền vàng mảnh, hover thì đổ màu vàng. */
.lang-btn {
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  border-radius: 999px;
  padding: 6px 16px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lang-btn:hover { background: var(--gold); color: var(--bg); }

/* Nút giỏ hàng */
.cart-btn {
  position: relative;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text);
  line-height: 1;
}
.cart-count {
  position: absolute;
  top: -8px; right: -10px;
  background: var(--gold);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}


/* ---------- 4) HERO ----------
   3 lớp chồng nhau: ảnh nền + lớp phủ tối + chữ. */
.hero {
  position: relative;
  min-height: 90vh;          /* cao gần kín màn hình lần đầu mở */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;          /* ảnh phủ kín, không méo */
}
/* Lớp phủ tối: tối ở dưới để chữ luôn đọc được dù ảnh sáng. */
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
              rgba(15,15,14,0.45) 0%,
              rgba(15,15,14,0.55) 50%,
              rgba(15,15,14,0.92) 100%);
}
.hero-content { position: relative; z-index: 2; padding: 100px 24px 60px; }

.hero-eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 18px;
}
#heroTitle {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 5rem);   /* tự co theo bề rộng màn hình */
  line-height: 1.05;
  letter-spacing: 0.5px;
  margin-bottom: 18px;
}
#heroSlogan {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 34px;
}
/* Nút "Khám phá" ở hero */
.btn-hero {
  display: inline-block;
  background: var(--gold);
  color: var(--bg);
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 14px 34px;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn-hero:hover { background: var(--gold-soft); transform: translateY(-2px); }


/* ---------- 5) BỘ LỌC + LƯỚI SẢN PHẨM ---------- */
.products-section { padding: 80px 0; }

/* Mỗi NHÓM sản phẩm (Bọ ngựa / Phụ kiện / Thức ăn) + tiêu đề nhóm. */
.product-group { margin-bottom: 64px; }
.product-group:last-child { margin-bottom: 0; }
.group-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.7rem;
  letter-spacing: 0.5px;
  margin-bottom: 26px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);   /* gạch chân mảnh ngăn cách */
}
.group-title::before {
  content: "";
  display: inline-block;
  width: 22px; height: 2px;
  background: var(--gold);                  /* gạch vàng nhỏ trước tiêu đề */
  vertical-align: middle;
  margin-right: 12px;
}

.category-filters {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center;
  margin-bottom: 48px;
}
.filter-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 8px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}
.filter-btn:hover { color: var(--text); border-color: var(--muted); }
.filter-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
  font-weight: 600;
}

/* Lưới sản phẩm: tự chia cột theo bề rộng. */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

/* Thẻ 1 sản phẩm */
.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.product-card:hover {
  border-color: var(--gold);
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

/* Khung ảnh: cắt vuông, ảnh phóng nhẹ khi rê chuột. */
.product-card img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  transition: transform 0.4s ease;
}
.product-card:hover img { transform: scale(1.05); }

.product-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.product-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.product-desc { font-size: 0.9rem; color: var(--muted); flex: 1; margin-bottom: 16px; }
.product-price {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

/* Chọn phụ kiện ở TRANG CHI TIẾT: nhãn gợi ý + danh sách món có ô tích chọn. */
.bundle-pick-label { font-weight: 600; margin: 18px 0 10px; }
.bundle-subtotal { margin: 16px 0; font-size: 1.05rem; }
.bundle-subtotal strong { color: var(--gold); font-size: 1.2rem; }

/* Danh sách các món có ô tích chọn (dùng ở trang chi tiết sản phẩm "gói"). */
.bundle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.bundle-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.bundle-item:hover { border-color: var(--gold); }
.bundle-item input { width: 18px; height: 18px; flex: none; cursor: pointer; accent-color: var(--gold); }
.bundle-item img {
  width: 48px;
  height: 48px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  flex: none;
}
.bundle-item-name { flex: 1; font-weight: 500; }
.bundle-item-price { color: var(--gold); font-weight: 600; white-space: nowrap; }

/* Nút chung — kiểu "viền rồi đổ màu khi rê chuột". */
.btn {
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.3px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
}
.btn:hover { background: var(--gold); color: var(--bg); }
.btn-primary { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.btn-primary:hover { background: var(--gold-soft); border-color: var(--gold-soft); }
.btn-zalo { background: #0068ff; color: #fff; border-color: #0068ff; margin-top: 10px; }
.btn-zalo:hover { background: #2a82ff; border-color: #2a82ff; color: #fff; }
.btn-mess { background: #0084ff; color: #fff; border-color: #0084ff; margin-top: 10px; }
.btn-mess:hover { background: #2a9bff; border-color: #2a9bff; color: #fff; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }


/* ---------- 6) GIỚI THIỆU / LIÊN HỆ / CHÂN TRANG ---------- */
.info-section { padding: 64px 0; border-top: 1px solid var(--line); }
.info-section h2 { color: var(--text); margin-bottom: 18px; }
.info-section p { color: var(--muted); max-width: 720px; }
.contact-list { list-style: none; margin-top: 8px; }
.contact-list li { margin-bottom: 8px; color: var(--muted); }

.site-footer {
  background: var(--bg-soft);
  color: var(--muted);
  text-align: center;
  padding: 28px 0;
  margin-top: 40px;
  font-size: 0.88rem;
  border-top: 1px solid var(--line);
  letter-spacing: 0.3px;
}
/* Dòng ghi nguồn ảnh ở chân trang — chữ nhỏ, mờ. */
.footer-credits {
  margin-top: 10px;
  font-size: 0.74rem;
  color: #6b6659;
}


/* ---------- 7) GIỎ HÀNG (DRAWER) + FORM ĐẶT HÀNG ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease;
  z-index: 200;
}
.overlay.open { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed; top: 0; right: 0;
  width: 400px; max-width: 92vw; height: 100%;
  background: var(--bg-soft);
  border-left: 1px solid var(--line);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 210;
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.cart-header h2 { font-family: var(--font-serif); font-weight: 500; font-size: 1.3rem; color: var(--text); }
.icon-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--text); }

.cart-items { flex: 1; overflow-y: auto; padding: 20px 24px; }
.cart-empty-text { color: var(--muted); text-align: center; margin-top: 40px; }

.cart-item { display: flex; gap: 14px; margin-bottom: 20px; }
.cart-item img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.cart-item-price { color: var(--gold); font-size: 0.85rem; }

.qty-controls { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.qty-controls button {
  width: 28px; height: 28px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text);
  border-radius: 6px; cursor: pointer; font-weight: 700;
  transition: border-color 0.2s ease;
}
.qty-controls button:hover { border-color: var(--gold); }
.qty-controls span { min-width: 18px; text-align: center; }
.qty-controls .remove { margin-left: auto; color: #c0796b; background: none; border: none; cursor: pointer; font-size: 0.95rem; }

.cart-footer { border-top: 1px solid var(--line); padding: 20px 24px; }
.cart-total-row { display: flex; justify-content: space-between; font-size: 1.05rem; margin-bottom: 18px; }
.cart-total-row strong { color: var(--gold); font-size: 1.2rem; }

.order-form { display: flex; flex-direction: column; gap: 12px; }
.order-form h3 { font-family: var(--font-serif); font-weight: 500; font-size: 1.05rem; color: var(--text); margin-top: 6px; }
.order-form input, .order-form textarea, .order-form select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
}
.order-form input::placeholder, .order-form textarea::placeholder { color: #777163; }
.order-form input:focus, .order-form textarea:focus, .order-form select:focus { outline: none; border-color: var(--gold); }
/* Ô chọn (select): mũi tên + trạng thái khoá khi chưa chọn tỉnh. */
.order-form select { cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%23c6a256' stroke-width='1.6'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
.order-form select:disabled { opacity: 0.5; cursor: not-allowed; }

.order-result { margin-top: 12px; font-size: 0.9rem; font-weight: 600; text-align: center; }
.order-result.success { color: var(--gold-soft); }
.order-result.error { color: #d98b7a; }

/* Khung mã QR thanh toán (VietQR). */
.qr-panel {
  margin-top: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: 10px;
  text-align: center;
}
.qr-heading { font-family: var(--font-serif); font-weight: 500; font-size: 1.02rem; color: var(--text); margin-bottom: 14px; }
/* QR phải nền trắng để app ngân hàng quét được trên giao diện tối. */
.qr-img { width: 220px; height: 220px; background: #fff; border-radius: 8px; padding: 8px; margin: 0 auto 14px; display: block; }
.qr-details { text-align: left; font-size: 0.86rem; color: var(--muted); display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.qr-details span { color: #8a857a; }
.qr-details strong { color: var(--gold); }
.qr-guide { font-size: 0.8rem; color: var(--muted); line-height: 1.55; }


/* ---------- 8) RESPONSIVE (MÀN HÌNH NHỎ / ĐIỆN THOẠI) ---------- */
@media (max-width: 720px) {
  .main-nav { display: none; }      /* ẩn menu chữ cho gọn */
  .hero { min-height: 80vh; }
  .products-section { padding: 56px 0; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}


/* ---------- 9) LIÊN KẾT THẺ SẢN PHẨM (sang trang chi tiết) ---------- */
.product-link { color: inherit; text-decoration: none; display: block; }
.product-card:hover .product-name { color: var(--gold); }   /* tên đổi vàng khi rê chuột */


/* ---------- 10) TRANG CHI TIẾT SẢN PHẨM (product.html) ---------- */
/* Chừa khoảng trống phía trên vì header dán cố định. */
.detail-main { padding-top: 110px; padding-bottom: 60px; min-height: 70vh; }

.detail-back {
  display: inline-block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 26px;
  transition: color 0.2s ease;
}
.detail-back:hover { color: var(--gold); }

.detail-notfound { color: var(--muted); padding: 40px 0; text-align: center; }

/* Bố cục 2 cột: ảnh trái — thông tin phải. */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: start;
}
.detail-media {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.detail-media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }

.detail-eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-size: 0.76rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.detail-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 2.2rem;
  line-height: 1.15;
  margin-bottom: 14px;
}
.detail-price {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 14px;
}
/* Nhãn còn / hết hàng. */
.stock-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.stock-badge.in { color: #a7c957; border: 1px solid #3f4d33; background: rgba(90,107,88,0.15); }
.stock-badge.out { color: #d98b7a; border: 1px solid #5a3a33; background: rgba(120,60,50,0.15); }

.detail-short { color: var(--muted); margin-bottom: 26px; }

/* Hàng chọn số lượng. */
.qty-row { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.qty-label { color: var(--muted); font-size: 0.9rem; }
.qty-stepper { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
.qty-stepper button {
  width: 28px; height: 28px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  font-weight: 700; cursor: pointer;
}
.qty-stepper button:hover { border-color: var(--gold); }
.qty-stepper span { min-width: 22px; text-align: center; font-weight: 600; }

.detail-add { max-width: 280px; }

/* Phần mô tả dài + bảng thông số. */
.detail-body { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 36px; }
.detail-section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.4rem;
  margin-bottom: 16px;
}
.detail-long { color: var(--muted); max-width: 760px; margin-bottom: 36px; }

.specs-table { width: 100%; max-width: 560px; border-collapse: collapse; }
.specs-table tr { border-bottom: 1px solid var(--line); }
.specs-table th {
  text-align: left; font-weight: 500; color: var(--muted);
  padding: 12px 0; width: 40%; font-size: 0.92rem;
}
.specs-table td { padding: 12px 0; color: var(--text); font-size: 0.92rem; }

/* Trên điện thoại: chi tiết xếp 1 cột. */
@media (max-width: 760px) {
  .detail-grid { grid-template-columns: 1fr; gap: 26px; }
  .detail-name { font-size: 1.7rem; }
  .detail-add { max-width: none; }
}


/* ---------- 9) TỒN KHO + TRANG CẨM NANG (BLOG) ----------
   Phần bổ sung cho: nhãn tồn kho trên thẻ sản phẩm, nút hết hàng,
   lưới bài viết (blog.html) và trang đọc bài (article.html). */

/* Nhãn tồn kho nhỏ đứng cạnh giá trên thẻ sản phẩm (dùng lại .stock-badge). */
.product-price .stock-badge { margin-left: 10px; vertical-align: middle; }

/* Nút bị khoá (vd "Tạm hết hàng"): mờ đi và không bấm được. */
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary:disabled:hover { background: var(--gold); border-color: var(--gold); }

/* Phụ kiện hết hàng trong thẻ "gói": mờ dòng + khoá ô tích. */
.bundle-item.out-of-stock { opacity: 0.55; }
.bundle-item.out-of-stock .bundle-check { cursor: not-allowed; }

/* ----- Trang Cẩm nang: tiêu đề + lưới thẻ bài viết ----- */
.blog-page-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 2.2rem;
  margin-bottom: 8px;
}
.blog-page-sub { color: var(--muted); margin-bottom: 36px; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px;
}

/* Một thẻ bài viết (cả thẻ là 1 đường link). */
.blog-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.blog-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.blog-card img { width: 100%; height: 180px; object-fit: cover; }
.blog-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.blog-card-date { color: var(--muted); font-size: 0.82rem; }
.blog-card-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.35;
}
.blog-card-excerpt {
  color: var(--muted);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;          /* tóm tắt dài quá thì cắt sau 3 dòng */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-more { color: var(--gold); font-size: 0.88rem; margin-top: auto; }

/* Dòng thông báo (đang tải / chưa có bài / chưa cấu hình). */
.blog-empty { color: var(--muted); padding: 30px 0; }

/* ----- Trang đọc 1 bài viết ----- */
.article-page { max-width: 760px; }
.article-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.article-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 2.1rem;
  line-height: 1.25;
  margin-bottom: 10px;
}
.article-date { color: var(--muted); font-size: 0.88rem; margin-bottom: 30px; }

/* Nội dung bài (HTML sinh từ Portable Text — xem js/sanity.js). */
.article-content { color: var(--text); }
.article-content p { margin-bottom: 18px; color: var(--muted); }
.article-content h2, .article-content h3, .article-content h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  margin: 30px 0 14px;
}
.article-content h2 { font-size: 1.5rem; }
.article-content h3 { font-size: 1.25rem; }
.article-content ul, .article-content ol { margin: 0 0 18px 22px; color: var(--muted); }
.article-content li { margin-bottom: 8px; }
.article-content blockquote {
  border-left: 3px solid var(--gold);
  padding-left: 18px;
  margin: 22px 0;
  color: var(--muted);
  font-style: italic;
}
.article-content a { color: var(--gold); text-decoration: underline; }
.article-content a:hover { color: var(--gold-soft); }
.article-content code {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.88em;
}
.article-img { border-radius: var(--radius); margin: 22px 0; }

/* Trên điện thoại: tiêu đề bài nhỏ lại một chút. */
@media (max-width: 760px) {
  .blog-page-title { font-size: 1.7rem; }
  .article-title { font-size: 1.6rem; }
}

/* Nút tăng/giảm số lượng khi bị khoá (sản phẩm hết hàng). */
.qty-stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.qty-stepper button:disabled:hover { border-color: var(--line); }

/* ---------- GIỎ HÀNG 2 BƯỚC ----------
   Bước 1 (mặc định): danh sách món + tổng tiền + nút "Đặt hàng".
   Bước 2 (thêm class .checkout-mode vào #cartDrawer): ẩn danh sách,
   hiện form điền thông tin (cuộn được) + nút quay lại giỏ. */
.order-form { display: none; }
#btnCheckout { width: 100%; margin-top: 4px; }
.cart-drawer.checkout-mode .order-form { display: flex; }
.cart-drawer.checkout-mode #cartItems { display: none; }
.cart-drawer.checkout-mode #cartCrossSell { display: none; }   /* bước 2 (form): ẩn gợi ý */
.cart-drawer.checkout-mode #btnCheckout { display: none; }
.cart-drawer.checkout-mode .cart-footer { flex: 1; overflow-y: auto; }

/* Nút "← Quay lại giỏ hàng" trông như đường link. */
.cart-back {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  text-align: left;
  padding: 0;
  font-size: 0.92rem;
  font-family: var(--font-sans);
}
.cart-back:hover { color: var(--gold-soft); }

/* Link trong mục Liên hệ (email, Instagram): màu vàng đồng, gạch chân khi rê. */
.contact-list a { color: var(--gold); }
.contact-list a:hover { color: var(--gold-soft); text-decoration: underline; }


/* ---------- KHUNG NỔI THEO DÕI TRẠNG THÁI ĐƠN ----------
   Hiện ở góc dưới màn hình sau khi khách đặt hàng. Web hỏi lại kho mỗi ~20 giây,
   khi chủ shop đổi trạng thái đơn trong Google Sheet thì khung này tự cập nhật. */
.order-tracker {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;                    /* nổi trên mọi thứ, kể cả header */
  width: calc(100% - 40px);
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);   /* dải màu bên trái đổi theo trạng thái */
  border-radius: var(--radius);
  padding: 16px 42px 16px 18px;     /* chừa chỗ bên phải cho nút đóng */
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
  font-family: var(--font-sans);
}
.order-tracker[hidden] { display: none; }   /* chắc chắn ẩn khi có thuộc tính hidden */

.order-tracker .tracker-code { color: var(--muted); font-size: 0.9rem; margin-bottom: 4px; }
.order-tracker .tracker-code strong { color: var(--gold); letter-spacing: 0.5px; }
.order-tracker .tracker-msg { color: var(--text); font-size: 1rem; line-height: 1.5; }
.order-tracker .tracker-hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.order-tracker .tracker-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.order-tracker .tracker-close:hover { color: var(--text); }

/* Ba "tông" theo nhóm trạng thái: chờ (vàng), tốt (xanh lá), hủy/hết hạn (đỏ nhạt). */
.order-tracker.tone-success { border-left-color: #6fbf73; }
.order-tracker.tone-success .tracker-code strong { color: #8fd693; }
.order-tracker.tone-cancel { border-left-color: #c96f6f; }
.order-tracker.tone-cancel .tracker-code strong { color: #e39a9a; }

/* Trượt lên nhẹ khi vừa hiện/cập nhật để thu hút chú ý. */
@keyframes trackerPop {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.order-tracker:not([hidden]) { animation: trackerPop 0.3s ease; }

/* Điện thoại: kéo dài gần hết chiều ngang cho dễ đọc. */
@media (max-width: 520px) {
  .order-tracker { right: 10px; left: 10px; bottom: 10px; width: auto; max-width: none; }
}


/* ============================================================================
   GỢI Ý MUA THÊM (cross-sell)
   ---------------------------------------------------------------------------- */

/* --- Trang chi tiết: khu gợi ý dùng lại .product-card nhưng THẺ NHỎ HƠN
   (ảnh nhỏ lại) so với trang chủ để đỡ chiếm chỗ. --- */
.related-section { margin-top: 48px; }
.related-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
/* Thẻ + ảnh nhỏ lại; ảnh dạng ngang (4/3) cho gọn chiều cao. */
.related-section .product-card img { aspect-ratio: 4 / 3; }
.related-section .product-body { padding: 16px; }
.related-section .product-name { font-size: 1.05rem; }
.related-section .product-desc { font-size: 0.85rem; margin-bottom: 12px; }
.related-section .product-price { font-size: 1.02rem; margin-bottom: 12px; }

/* MỘT HÀNG KÉO NGANG: tất cả gợi ý trên 1 dòng, không xuống hàng, cuộn ngang
   để xem thêm sản phẩm. */
.related-scroll .product-grid {
  display: flex;
  grid-template-columns: none;   /* bỏ chế độ lưới, chuyển sang flex 1 hàng */
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 12px;          /* chừa chỗ cho thanh cuộn */
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.related-scroll .product-card {
  flex: 0 0 200px;               /* bề rộng thẻ cố định, KHÔNG co lại */
  scroll-snap-align: start;
}

/* --- Giỏ hàng: dải gợi ý gọn (hàng ngang nhỏ cho vừa bề ngang drawer) --- */
.cart-cross-sell {
  border-top: 1px solid var(--line);
  padding: 14px 4px 4px;
}
.cart-cross-sell .cross-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.3px;
  margin-bottom: 12px;
}
.cross-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.cross-mini + .cross-mini { border-top: 1px solid var(--line); }
.cross-mini img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.cross-mini-info { flex: 1; min-width: 0; }   /* min-width:0 để tên dài tự cắt gọn */
.cross-mini-name {
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cross-mini-price { font-size: 0.85rem; font-weight: 600; color: var(--gold); margin-top: 2px; }
.cross-mini-add {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.cross-mini-add:hover { background: var(--gold); color: var(--bg); }
