/* ==========================================================================
   Thành phần dùng chung — 2 trang sản phẩm
   TỰ SINH — không sửa tay. Nguồn: figma mcp/css/components.css
   Sinh lại bằng scratchpad/prefix_css.py (xem CLAUDE.md muc 8).
   Mọi selector đã được bọc trong `.tbtc-page` để không đụng CSS của
   Flatsome/WooCommerce, nhờ đó markup giữ nguyên tên class của prototype.
   ========================================================================== */

/* ==========================================================================
   Component dùng chung — dựng từ các COMPONENT_SET trong Figma
   ========================================================================== */

/* ---- Skip link (a11y) ------------------------------------------------- */

.tbtc-page .skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 200;
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-blue);
  color: var(--c-white);
  font-weight: var(--fw-semibold);
  border-radius: var(--r-md);
  transition: top var(--dur) var(--ease);
}

.tbtc-page .skip-link:focus {
  top: var(--sp-4);
}

/* ---- Button — Figma component_set "btn" ------------------------------- */

.tbtc-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 10px var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--fs-body-md);
  line-height: var(--lh-body-md);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  transition:
    box-shadow var(--dur) var(--ease),
    filter var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.tbtc-page .btn__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

/* Biến thể to hơn dùng trong Hero (node 210:1240).
   Chữ nhỏ hơn nhưng padding lớn hơn — đúng theo thiết kế, không phải nhầm. */
.tbtc-page .btn--lg {
  padding: 12px var(--sp-5);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

/* Gradient xanh — biến thể chủ đạo (node 210:1345) */
.tbtc-page .btn--primary {
  background-image: linear-gradient(104.11deg, #3f8cff 0%, var(--c-blue) 100%);
  color: var(--c-white);
  box-shadow: var(--sh-button);
}

.tbtc-page .btn--primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 20px 0 rgba(20, 130, 252, 0.18);
}

.tbtc-page .btn--primary:active {
  filter: brightness(0.96);
}

/* ---- Cụm tiêu đề section (lặp lại ở hầu hết section) ------------------ */

.tbtc-page .section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
  max-width: 644px;
  margin-inline: auto;
  text-align: center;
}

.tbtc-page .eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
  font-weight: var(--fw-semibold);
  color: var(--c-orange);
  white-space: nowrap;
}

.tbtc-page .eyebrow img {
  width: 18px;
  height: 10px;
  flex-shrink: 0;
}

/* Vạch bên phải là bản soi gương của vạch bên trái (Figma: rotate180 + scaleY-1) */
.tbtc-page .eyebrow img:last-child {
  transform: scaleX(-1);
}

.tbtc-page .section-title {
  font-size: var(--fs-display-1);
  line-height: 1.3;
  font-weight: var(--fw-bold);
  color: var(--c-navy);
}

.tbtc-page .section-desc {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
  color: var(--c-desc);
}

/* ---- Tab lọc — Figma component_set "Tab" (148:721) -------------------- */

.tbtc-page .tab-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.tbtc-page .tab {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  /* Tab là <button>, mà _base.css đặt `min-width: 0` cho mọi button (để gỡ
     min-width 24px của Flatsome). Mất min-width:auto thì flex item co được
     nhỏ hơn nội dung: trên mobile dải tab bị bóp bẹp chỉ còn ~35px mỗi tab
     thay vì tràn ra để cuộn ngang. */
  flex-shrink: 0;
  padding: 10px var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--c-white);
  background: rgba(255, 255, 255, 0.5);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  white-space: nowrap;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.tbtc-page .tab img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.tbtc-page .tab:hover {
  background: var(--c-white);
  border-color: var(--c-border-2);
}

.tbtc-page .tab[aria-selected="true"] {
  background: var(--c-blue);
  border-color: rgba(0, 86, 214, 0.16);
  color: var(--c-white);
}

/* Icon trong tab đang chọn cần đổi sang trắng — SVG gốc màu tối */
.tbtc-page .tab[aria-selected="true"] img {
  filter: brightness(0) invert(1);
}

/* ---- Link kèm mũi tên — Figma component_set "arrow" (152:1083) -------- */

.tbtc-page .link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-body-md);
  line-height: var(--lh-body-md);
  font-weight: var(--fw-semibold);
  color: var(--c-navy);
  transition: color var(--dur) var(--ease);
}

.tbtc-page .link-arrow img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--dur) var(--ease);
}

.tbtc-page .link-arrow:hover {
  color: var(--c-blue);
}

.tbtc-page .link-arrow:hover img {
  transform: translateX(4px);
}

/* ---- Card sản phẩm 310×408 — Figma instance 210:2210 ------------------ */

.tbtc-page .card-product {
  position: relative;
  display: block;
  width: 310px;
  height: 408px;
  flex-shrink: 0;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: 0 2px 12px 0 rgba(0, 86, 214, 0.04);
  overflow: hidden;
  transition:
    box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.tbtc-page .card-product:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-card-hover);
}

.tbtc-page .card-product__media {
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 232px;
  overflow: hidden;
}

.tbtc-page .card-product__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tbtc-page .card-product__badge {
  position: absolute;
  left: 23px;
  top: 191px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3);
  background: var(--c-white);
  border-radius: var(--r-md);
  filter: drop-shadow(0 2px 8px rgba(20, 130, 252, 0.08));
}

.tbtc-page .card-product__badge img {
  width: 32px;
  height: 32px;
}

.tbtc-page .card-product__text {
  position: absolute;
  left: 50%;
  top: 263px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: 262px;
}

.tbtc-page .card-product__title {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: var(--fw-semibold);
  color: var(--c-navy);
}

.tbtc-page .card-product__desc {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c-desc);
}

.tbtc-page .card-product__link {
  position: absolute;
  left: 23px;
  bottom: 23px;
}

/* ---- Icon button (ô tìm kiếm — node 7:4466) --------------------------- */

.tbtc-page .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.tbtc-page .icon-btn img {
  width: 24px;
  height: 24px;
}

.tbtc-page .icon-btn:hover {
  border-color: var(--c-border-2);
  box-shadow: var(--sh-button);
}

/* ---- Nút viền xanh — Figma component 107:686 ------------------------- */

.tbtc-page .btn--outline {
  background: var(--c-white);
  border: 1px solid var(--c-blue);
  color: var(--c-blue);
  padding: 11px var(--sp-5);
  box-shadow: var(--sh-button);
}

.tbtc-page .btn--outline:hover {
  background: var(--c-blue-50);
}

/* ---- Nút phụ nền cam nhạt — Figma component 210:1315 ------------------ */

.tbtc-page .btn--soft {
  background: #fff0e6;
  color: var(--c-orange);
  padding: 12px var(--sp-5);
}

.tbtc-page .btn--soft:hover {
  background: #ffe4d3;
}

/* ---- Băng chuyền: nút điều hướng + chấm chỉ trang -------------------- */
/* Figma 210:1444 (nút) và 46:653 (chấm). Vị trí top do từng section tự đặt. */

.tbtc-page .carousel-nav {
  position: absolute;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 10px;
  border-radius: var(--r-pill);
  z-index: 2;
  transition: background-color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.tbtc-page .carousel-nav img {
  width: 20px;
  height: 20px;
}

.tbtc-page .carousel-nav--prev {
  left: -32px;
  background: rgba(0, 86, 214, 0.1);
}

.tbtc-page .carousel-nav--next {
  right: -32px;
  background: var(--c-blue);
}

.tbtc-page .carousel-nav:hover {
  filter: brightness(1.08);
}

.tbtc-page .carousel-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tbtc-page .carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-8);
}

.tbtc-page .carousel-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-blue);
  opacity: 0.1;
  transition: opacity var(--dur) var(--ease);
}

.tbtc-page .carousel-dots button[aria-current="true"] {
  opacity: 1;
}

/* ---- Card sản phẩm lớn 421×528 — Figma component 210:2321 ------------- */

.tbtc-page .card-featured {
  position: relative;
  display: block;
  width: 421px;
  height: 528px;
  flex-shrink: 0;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: 0 2px 12px 0 rgba(0, 86, 214, 0.04);
  overflow: hidden;
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.tbtc-page .card-featured:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-card-hover);
}

.tbtc-page .card-featured__media {
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 316px;
  overflow: hidden;
}

.tbtc-page .card-featured__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Nhãn trạng thái — Figma component 210:2613 */
.tbtc-page .card-featured__status {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-blue);
  background: linear-gradient(0deg, rgba(0, 86, 214, 0.05), rgba(0, 86, 214, 0.05)), var(--c-white);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-blue);
  z-index: 1;
}

.tbtc-page .card-featured__head {
  position: absolute;
  left: 24px;
  top: 340px;
  width: 373px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.tbtc-page .card-featured__category {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
  font-weight: var(--fw-medium);
  color: var(--c-orange);
}

.tbtc-page .card-featured__title {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  font-weight: var(--fw-semibold);
  color: var(--c-navy);
}

/* ---- Bảng thông số (Figma 210:2281) ----------------------------------- */

.tbtc-page .spec-list {
  position: absolute;
  left: 24px;
  top: 422px;
  width: 373px;
  display: flex;
  gap: var(--sp-6);
}

.tbtc-page .spec-list__item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  flex: 1 1 0;
  min-width: 0;
  padding-right: var(--sp-6);
  border-right: 1px solid #e7e7e7;
}

.tbtc-page .spec-list__item:last-child {
  border-right: 0;
  padding-right: 0;
}

/* Thiết kế có sẵn ô icon "Fill/chip" nhưng đặt visible=false, nên không dựng. */

.tbtc-page .spec-list__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tbtc-page .spec-list__label {
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  color: var(--c-desc);
  white-space: nowrap;
}

.tbtc-page .spec-list__value {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-medium);
  color: var(--c-text);
  white-space: nowrap;
}

.tbtc-page .card-featured__link {
  position: absolute;
  left: 24px;
  bottom: 24px;
}

/* ---- Breadcrumb — Figma 249:3947 / 218:8155 -------------------------- */
/* Dùng chung cho trang danh mục và trang chi tiết sản phẩm. */

.tbtc-page .breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-block: var(--sp-6);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-medium);
}

.tbtc-page .breadcrumb a {
  color: var(--c-text);
  transition: color var(--dur) var(--ease);
}

.tbtc-page .breadcrumb a:hover {
  color: var(--c-blue);
}

.tbtc-page .breadcrumb img {
  width: 9px;
  height: 10px;
}

.tbtc-page .breadcrumb [aria-current="page"] {
  color: var(--c-blue);
}

/* ==========================================================================
   Mobile — các thành phần dùng chung ở khổ 393px
   (Figma "Homepage - Mobile" 369:4384)
   ========================================================================== */

@media (max-width: 767px) {
  /* ---- Cụm tiêu đề: canh trái thay vì canh giữa — Figma 371:2313 ------ */

  .tbtc-page .section-head {
    align-items: flex-start;
    gap: var(--sp-3);
    text-align: left;
  }

  /* Thiết kế để 16px giữa eyebrow và tiêu đề, 12px giữa tiêu đề và mô tả.
     Markup chỉ có một khoảng gap chung nên bù thêm 4px ở đây. */
  .tbtc-page .eyebrow {
    margin-bottom: var(--sp-1);
    gap: var(--sp-2);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
  }

  .tbtc-page .section-title {
    font-size: var(--fs-display-3); /* 32px */
  }

  .tbtc-page .section-desc {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
  }

  /* ---- Tab lọc: một dải ngang cuộn được — Figma 371:2325 -------------- */

  .tbtc-page .tab-list {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .tbtc-page .tab-list::-webkit-scrollbar {
    display: none;
  }

  .tbtc-page .tab {
    padding: var(--sp-2) var(--sp-3);
  }

  /* ---- Card sản phẩm 277×367 — Figma 371:2475 ------------------------- */

  .tbtc-page .card-product {
    width: 277px;
    height: 367px;
    border-radius: var(--r-md);
  }

  .tbtc-page .card-product__media {
    height: 207px;
  }

  .tbtc-page .card-product__badge {
    left: 19px;
    top: 166px;
  }

  .tbtc-page .card-product__text {
    left: 19px;
    top: 238px;
    transform: none;
    width: 237px;
  }

  .tbtc-page .card-product__desc {
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body-sm);
  }

  .tbtc-page .card-product__link {
    left: 19px;
    bottom: 19px;
  }

  /* ---- Card sản phẩm lớn 277×391 — Figma 397:3681 / 414:4007 --------- */
  /* Giữ nguyên cách định vị tuyệt đối như desktop, chỉ đổi toạ độ. */

  .tbtc-page .card-featured {
    width: 277px;
    height: 391px;
    border-radius: var(--r-md);
  }

  .tbtc-page .card-featured__media {
    height: 207px;
  }

  .tbtc-page .card-featured__head {
    left: 20px;
    top: 227px;
    width: 237px;
    gap: var(--sp-2);
  }

  .tbtc-page .card-featured__title {
    font-size: var(--fs-h3);
    line-height: var(--lh-h3);
  }

  .tbtc-page .spec-list {
    left: 20px;
    top: 297px;
    width: 237px;
    gap: var(--sp-2);
  }

  /* Thiết kế mobile bỏ vạch ngăn giữa các thông số */
  .tbtc-page .spec-list__item, .tbtc-page .spec-list__item:last-child {
    padding-right: 0;
    border-right: 0;
  }

  .tbtc-page .card-featured__link {
    left: 20px;
    bottom: 20px;
  }

  /* ---- Breadcrumb — Figma 414:2624 / 404:3741 ------------------------ */
  /* Cả hai thiết kế mobile đều để lề trên dưới 16px thay cho 24px. */

  .tbtc-page .breadcrumb {
    padding-block: var(--sp-4);
  }
}
