/* ==========================================================================
   Bison – Trang danh mục đồ nghề (balo, túi, thùng, hộp)
   Phạm vi: chỉ áp dụng trong .bc-page để không ảnh hưởng theme Flatsome
   ========================================================================== */

.bc-page {
  --bc-red: #C8161D;
  --bc-red-dark: #9E1016;
  --bc-black: #141414;
  --bc-bg-soft: #F4F4F4;
  --bc-line: #E3E3E3;
  --bc-line-strong: #CFCFCF;
  --bc-text-2: #3D3D3D;
  --bc-text-3: #4A4A4A;
  --bc-muted: #5A5A5A;
  --bc-radius: 14px;

  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px 64px;
  box-sizing: border-box;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--bc-black);
  font-size: 16px;
  line-height: 1.5;
}
.bc-page *, .bc-page *::before, .bc-page *::after { box-sizing: border-box; }

/* Reset các style mặc định của Flatsome cho button/select/ul trong phạm vi trang */
.bc-page button,
.bc-page .bc-chip,
.bc-page .bc-more,
.bc-page select {
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  min-height: 0;
  line-height: 1.2;
  box-shadow: none;
  font-family: inherit;
}
.bc-page ul { margin: 0; padding: 0; list-style: none; }
.bc-page ul li { margin: 0; }
.bc-page h1, .bc-page h2, .bc-page h3 { font-family: inherit; color: var(--bc-black); text-transform: none; letter-spacing: normal; }
.bc-page a:focus-visible,
.bc-page button:focus-visible,
.bc-page select:focus-visible,
.bc-page summary:focus-visible { outline: 3px solid var(--bc-red); outline-offset: 2px; }

.bc-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Đầu danh mục ---------- */
.bc-head { padding: 28px 0 24px; }
.bc-breadcrumb, .bc-head .rank-math-breadcrumb, .bc-head #breadcrumbs { font-size: 14px; color: var(--bc-muted); }
.bc-breadcrumb a, .bc-head .rank-math-breadcrumb a, .bc-head #breadcrumbs a { color: var(--bc-muted); text-decoration: none; }
.bc-breadcrumb a:hover, .bc-head .rank-math-breadcrumb a:hover { color: var(--bc-red); }
.bc-title { margin: 12px 0 10px; font-size: 40px; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
.bc-intro { margin: 0; max-width: 760px; font-size: 17px; line-height: 1.6; color: var(--bc-text-2); }
.bc-usp { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 18px !important; font-size: 15px; font-weight: 600; }
.bc-usp li { display: flex; align-items: center; gap: 8px; }
.bc-usp svg { color: var(--bc-red); flex: none; }

/* Tiêu đề + breadcrumb mặc định của Flatsome: template đã có H1/breadcrumb riêng */
body.bc-on .shop-page-title,
body.bc-on .category-page-title,
body.bc-on .page-title.shop-page-title { display: none !important; }

/* Ghi chú bản thử nghiệm (chỉ admin thấy) */
.bc-preview-note {
  margin: 16px 0 0; padding: 10px 14px; border: 1px dashed var(--bc-red); border-radius: 10px;
  background: #FFF4F4; font-size: 14px; color: var(--bc-text-2);
}
.bc-preview-note a { color: var(--bc-red); font-weight: 700; text-decoration: underline; }

/* ---------- Tab danh mục (chỉ trang /shop/) ---------- */
.bc-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.bc-tab {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 12px; border: 2px solid var(--bc-line); border-radius: var(--bc-radius);
  background: #fff; color: var(--bc-black); text-decoration: none; text-align: center;
  transition: border-color .15s ease;
}
.bc-tab:hover { border-color: var(--bc-black); color: var(--bc-black); }
.bc-tab.is-active { border-color: var(--bc-red); background: #FFF4F4; }
.bc-tab__icon { width: 64px; height: 64px; border-radius: 12px; background: var(--bc-bg-soft); display: flex; align-items: center; justify-content: center; }
.bc-tab__label { font-size: 17px; font-weight: 700; }
.bc-tab__count { font-size: 14px; color: var(--bc-muted); }

/* ---------- Bộ lọc ---------- */
.bc-filters {
  margin-top: 24px; padding: 18px 0;
  border-top: 1px solid var(--bc-line); border-bottom: 1px solid var(--bc-line);
  display: flex; flex-direction: column; gap: 14px;
}
.bc-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bc-filter-label { font-size: 15px; font-weight: 700; min-width: 96px; }
.bc-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.bc-chip {
  height: 44px; padding: 0 18px; border-radius: 22px;
  border: 1.5px solid var(--bc-line-strong); background: #fff; color: var(--bc-black);
  font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.bc-chip:hover { border-color: var(--bc-black); background: #fff; color: var(--bc-black); }
.bc-chip[aria-pressed="true"] { background: var(--bc-black); border-color: var(--bc-black); color: #fff; }
.bc-clear {
  height: 44px; padding: 0 8px; background: none; border: 0; cursor: pointer;
  color: var(--bc-red); font-size: 15px; font-weight: 600; text-decoration: underline;
}
.bc-clear:hover { background: none; color: var(--bc-red-dark); }
.bc-spacer { flex: 1; }
.bc-total { font-size: 15px; color: var(--bc-text-2); }
.bc-total strong { color: var(--bc-black); }
.bc-sort-label { font-size: 15px; color: var(--bc-text-2); margin: 0; font-weight: 400; }
.bc-page .bc-sort {
  width: auto; height: 44px; padding: 0 36px 0 12px; border: 1px solid var(--bc-line-strong);
  border-radius: 8px; background-color: #fff; font-size: 15px; color: var(--bc-black);
}

/* ---------- Lưới sản phẩm ---------- */
.bc-grid { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-top: 28px !important; transition: opacity .2s ease; }
.bc-grid.is-loading { opacity: .45; pointer-events: none; }
.bc-grid__item { display: flex; min-width: 0; }

.bc-card {
  display: flex; flex-direction: column; width: 100%;
  background: #fff; border: 1px solid var(--bc-line); border-radius: var(--bc-radius);
  overflow: hidden; color: var(--bc-black); text-decoration: none;
  transition: border-color .15s ease;
}
.bc-card:hover { border-color: var(--bc-black); color: var(--bc-black); }
.bc-card__media {
  position: relative; display: block; aspect-ratio: 1 / 1; background: var(--bc-bg-soft); overflow: hidden;
}
.bc-card__media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; padding: 8%; transition: opacity .25s ease;
}
.bc-card__media svg { position: absolute; inset: 21%; width: 58%; height: 58%; }
.bc-card__img--alt { opacity: 0; object-fit: cover !important; padding: 0 !important; }
@media (hover: hover) {
  .bc-card:hover .bc-card__img--alt { opacity: 1; }
  .bc-card:hover .bc-card__img--main.has-alt { opacity: 0; }
}
.bc-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-size: 13px; font-weight: 700; line-height: 1.2; padding: 5px 12px; border-radius: 6px;
}
.bc-badge--ban-chay, .bc-badge--sale { background: var(--bc-red); color: #fff; }
.bc-badge--moi { background: var(--bc-black); color: #fff; }
.bc-badge--combo { background: #fff; color: var(--bc-red); border: 1.5px solid var(--bc-red); }

.bc-card__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 18px 18px 20px; }
.bc-card__name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 18px; font-weight: 700; line-height: 1.35; min-height: 2.7em;
}
.bc-card__spec { font-size: 15px; line-height: 1.4; color: var(--bc-text-3); }
.bc-card__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-size: 22px; font-weight: 800; color: var(--bc-red); }
.bc-card__price del { font-size: 15px; font-weight: 500; color: #6B6B6B; }
.bc-card__btn {
  margin-top: auto; height: 48px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--bc-black); border-radius: 10px; font-size: 16px; font-weight: 700;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.bc-card:hover .bc-card__btn { background: var(--bc-red); border-color: var(--bc-red); color: #fff; }

/* ---------- Dải tư vấn Zalo (chiếm trọn 1 hàng lưới) ---------- */
.bc-band {
  grid-column: 1 / -1;
  display: flex; align-items: center; flex-wrap: wrap; gap: 28px;
  margin: 8px 0; padding: 32px 40px; border-radius: 18px;
  background: var(--bc-black); color: #fff;
}
.bc-band__icon { width: 72px; height: 72px; flex: none; border-radius: 50%; background: var(--bc-red); display: flex; align-items: center; justify-content: center; color: #fff; }
.bc-band__text { flex: 1 1 360px; display: flex; flex-direction: column; gap: 6px; }
.bc-page .bc-band__title { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.25; color: #fff; }
.bc-band__sub { margin: 0; font-size: 16px; line-height: 1.5; color: #D6D6D6; }
.bc-band__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.bc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; padding: 0 26px; border-radius: 12px;
  font-size: 17px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.bc-btn--red { background: var(--bc-red); color: #fff; }
.bc-btn--red:hover { background: var(--bc-red-dark); color: #fff; }
.bc-btn--ghost { border: 1.5px solid #fff; color: #fff; }
.bc-btn--ghost:hover { background: #fff; color: var(--bc-black); }

/* ---------- Không có sản phẩm ---------- */
.bc-empty {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 48px 24px; text-align: center; border: 1px dashed var(--bc-line-strong); border-radius: 16px;
}
.bc-empty__title { margin: 0; font-size: 20px; font-weight: 700; }
.bc-empty__sub { margin: 0; font-size: 16px; color: var(--bc-text-2); }

/* ---------- Xem thêm ---------- */
.bc-more-wrap { margin-top: 36px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.bc-more-wrap:empty { display: none; }
.bc-more-count { margin: 0; font-size: 16px; color: var(--bc-text-2); }
.bc-more-count strong { color: var(--bc-black); }
.bc-progress { width: 280px; max-width: 100%; height: 6px; background: var(--bc-line); border-radius: 3px; overflow: hidden; }
.bc-progress__bar { height: 100%; background: var(--bc-red); border-radius: 3px; transition: width .3s ease; }
.bc-more {
  margin-top: 6px; min-width: 320px; height: 54px; padding: 0 28px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 2px solid var(--bc-black); border-radius: 12px; background: #fff; color: var(--bc-black);
  font-size: 17px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.bc-more:hover { background: var(--bc-black); color: #fff; }
.bc-more[aria-busy="true"] { opacity: .6; pointer-events: none; }

/* ---------- Mô tả danh mục + FAQ ---------- */
.bc-content {
  margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--bc-line);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px;
}
.bc-desc__inner { max-height: 260px; overflow: hidden; }
.bc-desc.is-open .bc-desc__inner { max-height: none; }
.bc-desc h2 { margin: 0 0 14px; font-size: 26px; line-height: 1.3; font-weight: 800; }
.bc-desc h3 { margin: 18px 0 6px; font-size: 18px; font-weight: 700; }
.bc-desc p, .bc-desc li { font-size: 16px; line-height: 1.7; color: #333; }
.bc-desc p { margin: 0 0 12px; }
.bc-desc ul { list-style: disc; padding-left: 20px; margin: 0 0 12px; }
.bc-desc__toggle {
  margin-top: 14px; height: 44px; padding: 0 20px; cursor: pointer;
  border: 1.5px solid var(--bc-black); border-radius: 10px; background: #fff; color: var(--bc-black);
  font-size: 15px; font-weight: 700;
}
.bc-desc__toggle:hover { background: var(--bc-black); color: #fff; }
.bc-desc.is-short .bc-desc__toggle { display: none; }

.bc-faq__title { margin: 0 0 14px; font-size: 26px; line-height: 1.3; font-weight: 800; }
.bc-faq__list { border-top: 1px solid var(--bc-line); }
.bc-faq details { border-bottom: 1px solid var(--bc-line); }
.bc-faq summary {
  min-height: 60px; padding: 12px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 17px; font-weight: 700; cursor: pointer; list-style: none;
}
.bc-faq summary::-webkit-details-marker { display: none; }
.bc-faq summary::after { content: '+'; flex: none; width: 24px; text-align: center; font-size: 24px; font-weight: 600; color: var(--bc-red); }
.bc-faq details[open] summary::after { content: '\2212'; }
.bc-faq details p { margin: 0 0 16px; font-size: 16px; line-height: 1.7; color: #333; }

/* PC: cột FAQ dính bên phải, chạy song song khi cuộn đoạn mô tả dài.
   style.css cũ đặt body { overflow: hidden } làm position: sticky không chạy → đổi sang clip (vẫn chặn cuộn ngang). */
@media (min-width: 1024px) {
  body.bc-on { overflow: visible !important; overflow-x: clip !important; }
  .bc-content { align-items: start; }
  .bc-faq {
    position: sticky; top: 100px;
    max-height: calc(100vh - 120px); overflow-y: auto; overscroll-behavior: contain;
    padding-right: 6px; scrollbar-width: thin;
  }
  .admin-bar .bc-faq { top: 132px; max-height: calc(100vh - 152px); }
}

/* Liên hệ nhanh trên mobile: thanh điều hướng đáy (assets/bc-nav.css) */

/* ---------- Tablet ---------- */
@media (max-width: 1023px) {
  .bc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .bc-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .bc-content { gap: 32px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  .bc-page { padding: 0 16px 32px; }
  .bc-preview-note { font-size: 13px; }
  .bc-head { padding: 16px 0 8px; }
  .bc-title { font-size: 26px; margin: 8px 0; }
  .bc-intro { font-size: 15px; }
  .bc-usp { gap: 14px; font-size: 13px; margin-top: 12px !important; }

  .bc-tabs { display: flex; overflow-x: auto; gap: 10px; padding: 8px 0 4px; scrollbar-width: none; }
  .bc-tabs::-webkit-scrollbar { display: none; }
  .bc-tab { flex: 0 0 auto; min-width: 92px; padding: 10px 14px; gap: 2px; }
  .bc-tab__icon { display: none; }
  .bc-tab__label { font-size: 15px; }
  .bc-tab__count { font-size: 12px; }

  .bc-filters { margin-top: 12px; padding: 12px 0; gap: 10px; }
  .bc-filter-row { flex-wrap: nowrap; }
  .bc-filter-row--meta { flex-wrap: wrap; }
  .bc-filter-label { min-width: auto; font-size: 14px; white-space: nowrap; }
  .bc-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .bc-chips::-webkit-scrollbar { display: none; }
  .bc-chip { height: 40px; padding: 0 14px; font-size: 14px; }
  .bc-sort-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

  .bc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px !important; }
  .bc-card { border-radius: 12px; }
  .bc-card__body { padding: 12px 12px 14px; gap: 6px; }
  .bc-card__name { font-size: 15px; }
  .bc-card__spec { font-size: 13px; }
  .bc-card__price { font-size: 18px; }
  .bc-card__price del { font-size: 13px; }
  .bc-card__btn { height: 44px; font-size: 14px; }
  .bc-badge { top: 10px; left: 10px; font-size: 12px; padding: 4px 9px; }

  .bc-band { flex-direction: column; align-items: stretch; gap: 14px; padding: 22px 20px; border-radius: 16px; }
  .bc-band__icon { width: 52px; height: 52px; }
  /* Xếp dọc: bỏ flex-basis 360px (lúc này thành chiều cao → khung đen bị kéo dài) */
  .bc-band__text { flex: 0 0 auto; }
  .bc-band__actions { flex-direction: column; }
  .bc-btn { width: 100%; height: 52px; font-size: 16px; }

  .bc-more-wrap { margin-top: 24px; }
  .bc-more { width: 100%; min-width: 0; height: 52px; font-size: 16px; }

  .bc-content { grid-template-columns: 1fr; gap: 28px; margin-top: 28px; padding-top: 24px; }
  .bc-desc h2, .bc-faq__title { font-size: 21px; }
  .bc-desc__inner { max-height: 200px; }
  .bc-faq summary { font-size: 15px; min-height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .bc-page * { transition: none !important; }
}
