/* ==========================================================================
   Section stats — element trang chủ
   TỰ SINH — không sửa tay. Nguồn: figma mcp/css/sections/stats.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.
   ========================================================================== */

/* ==========================================================================
   Thanh số liệu "Number" — Figma node 7:4652 (1312 × 144)
   Nằm đè lên đáy Hero 72px (Figma: y=608, Hero cao 680)
   ========================================================================== */

.tbtc-page .stats {
  position: relative;
  z-index: 2;
  margin-top: -72px;
}

.tbtc-page .stats__wrap {
  max-width: var(--page-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.tbtc-page .stats__card {
  background: var(--c-white);
  border-radius: var(--r-xl);
  box-shadow: 0 6px 32px 0 rgba(0, 86, 214, 0.08);
  padding: var(--sp-5) var(--sp-4);
}

.tbtc-page .stats__list {
  display: flex;
  align-items: stretch;
  gap: var(--sp-4);
}

.tbtc-page .stats__item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-6);
  padding: var(--sp-2) var(--sp-4);
  border-right: 1px dashed var(--c-border-2);
}

.tbtc-page .stats__item:last-child {
  border-right: 0;
}

.tbtc-page .stats__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  padding: var(--sp-2);
  border-radius: var(--r-md);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(0, 86, 214, 0.1) 100%
  );
}

.tbtc-page .stats__icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.tbtc-page .stats__text {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}

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

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

/* ---- Responsive fallback --------------------------------------------- */

@media (max-width: 1279px) {
  .tbtc-page .stats__wrap {
    padding-inline: var(--sp-6);
  }

  .tbtc-page .stats__item {
    gap: var(--sp-4);
  }

  .tbtc-page .stats__value {
    font-size: var(--fs-display-3);
  }
}

@media (max-width: 991px) {
  .tbtc-page .stats {
    margin-top: var(--sp-10);
  }

  .tbtc-page .stats__list {
    flex-wrap: wrap;
    gap: 0;
  }

  .tbtc-page .stats__item {
    flex: 1 1 50%;
    padding-block: var(--sp-4);
  }

  .tbtc-page .stats__item:nth-child(2n) {
    border-right: 0;
  }

  .tbtc-page .stats__item:nth-child(-n + 2) {
    border-bottom: 1px dashed var(--c-border-2);
  }
}

/* ==========================================================================
   Mobile — Figma 371:2201 "Number" (353 × 356)
   Lưới 2×2, icon nằm trên chữ, không còn vạch ngăn giữa các ô.
   ========================================================================== */

@media (max-width: 767px) {
  /* Figma đặt thẻ ở y=680 trong khi Hero kết thúc ở y=756 */
  .tbtc-page .stats {
    margin-top: -76px;
  }

  .tbtc-page .stats__wrap {
    padding-inline: var(--gutter);
  }

  .tbtc-page .stats__card {
    padding: var(--sp-5);
    border-radius: var(--r-lg);
  }

  .tbtc-page .stats__list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-5);
  }

  /* Kèm cả hai bộ chọn :nth-child của dải 991px vì chúng có độ ưu tiên
     cao hơn, không ghi đè bằng .stats__item đơn lẻ được. */
  .tbtc-page .stats__item, .tbtc-page .stats__item:nth-child(2n), .tbtc-page .stats__item:nth-child(-n + 2), .tbtc-page .stats__item:last-child {
    flex-direction: column;
    gap: var(--sp-5);
    padding: 0;
    border: 0;
  }

  .tbtc-page .stats__text {
    gap: 2px;
  }

  .tbtc-page .stats__value {
    font-size: var(--fs-display-3);
  }

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