/**
 * CSS: Category Subcategories Bar (Pre-computed Cache Layouts)
 * Package: Flatsome Lite
 * Author: Xe nâng Khuê Đăng / Antigravity
 */

/* Khung bao ngoài chung */
.category-subcategories-wrapper {
  margin: 12px 0 16px 0;
  clear: both;
}

.cat-subcat-nav {
  position: relative;
  width: 100%;
}

/* Thanh cuộn ngang mượt mà, chống tràn màn hình */
.cat-subcat-scroll-track {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 4px 2px 8px 2px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.cat-subcat-scroll-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* ==========================================================================
   1. KIỂU: IMAGE_LEFT (HÌNH ẢNH BÊN TRÁI CHỮ - DẠNG VIÊN THUỐC PILL BADGE)
   ========================================================================== */
.cat-subcat-style-image_left .cat-subcat-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 99px;
  padding: 4px 14px 4px 5px;
  text-decoration: none;
  color: #1e293b;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}

.cat-subcat-style-image_left .cat-subcat-item:hover {
  background: #f8fafc;
  border-color: var(--primary-color, #dd3333);
  color: var(--primary-color, #dd3333);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.cat-subcat-style-image_left .cat-subcat-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #f1f5f9;
  flex-shrink: 0;
}

.cat-subcat-style-image_left .cat-subcat-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.cat-subcat-style-image_left .cat-subcat-count {
  font-size: 11px;
  color: #64748b;
  font-weight: normal;
  margin-left: 3px;
}

/* ==========================================================================
   2. KIỂU: IMAGE_TOP (HÌNH ẢNH PHÍA TRÊN CHỮ - DẠNG THẺ CARD NHỎ)
   ========================================================================== */
.cat-subcat-style-image_top .cat-subcat-scroll-track {
  display: flex;
  flex-wrap: wrap;
  overflow-x: visible;
  overflow-y: visible;
  gap: 12px;
  padding-bottom: 10px;
}

.cat-subcat-style-image_top .cat-subcat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 110px;
  width: 110px;
  max-width: 110px;
  box-sizing: border-box;
  padding: 5px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  color: #1e293b;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cat-subcat-style-image_top .cat-subcat-item:hover {
  border-color: var(--primary-color, #dd3333);
  color: var(--primary-color, #dd3333);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.cat-subcat-style-image_top .cat-subcat-img-wrap {
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-subcat-style-image_top .cat-subcat-img-wrap img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cat-subcat-style-image_top .cat-subcat-item:hover .cat-subcat-img-wrap img {
  transform: scale(1.06);
}

.cat-subcat-style-image_top .cat-subcat-name {
  font-size: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.cat-subcat-style-image_top .cat-subcat-count {
  display: block;
  font-size: 10.5px;
  color: #64748b;
  font-weight: normal;
  margin-top: 2px;
}

/* ==========================================================================
   3. KIỂU: TEXT_ONLY (CHỈ CHỮ - DẠNG TAG NÚT BẤM GỌN GÀNG)
   ========================================================================== */
.cat-subcat-style-text_only .cat-subcat-item {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 12px;
  text-decoration: none;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cat-subcat-style-text_only .cat-subcat-item:hover {
  background: var(--primary-color, #dd3333);
  color: #ffffff;
  border-color: var(--primary-color, #dd3333);
}

.cat-subcat-style-text_only .cat-subcat-count {
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.8;
}

/* Mobile responsive */
@media (max-width: 767px) {
  .category-subcategories-wrapper {
    margin: 8px 0 12px 0;
  }
  .cat-subcat-scroll-track {
    padding-left: 0;
    padding-right: 0;
    gap: 8px;
  }
  .cat-subcat-style-image_left .cat-subcat-item {
    font-size: 12.5px;
    padding: 3px 10px 3px 4px;
  }
  .cat-subcat-style-image_left .cat-subcat-img-wrap {
    width: 28px;
    height: 28px;
  }
  .cat-subcat-style-image_top .cat-subcat-scroll-track {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 8px;
  }
  .cat-subcat-style-image_top .cat-subcat-item {
    flex: 0 0 110px;
    width: 110px;
    max-width: 110px;
    box-sizing: border-box;
    padding: 5px;
  }
  .cat-subcat-style-image_top .cat-subcat-name {
    font-size: 11.5px;
  }
}
