.fsl-category-container {
  margin: 0;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.fsl-category-container::-webkit-scrollbar {
  display: none;
}

.fsl-category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 0 20px 0;
  overflow: auto;
}

.fsl-cat-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  background-color: #f1f1f1;
  color: #444 !important;
  border-radius: 12px;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  border: none;
}

.fsl-cat-item:hover {
  background-color: #e5e5e5;
  transform: translateY(-2px);
}

.fsl-cat-item.active {
  background-color: var(--primary-color) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.row.category-page-row {
  padding: 0;
}

/* Chỉ ép 100% cho cột chính trên trang archive khi sidebar bị ẩn */
.post-type-archive-product .category-page-row > .col.large-9,
.post-type-archive-product .category-page-row > .col.large-12,
.tax-product_cat .category-page-row > .col.large-9,
.tax-product_cat .category-page-row > .col.large-12 {
  width: 100% !important;
  max-width: 100% !important;
  flex-basis: 100% !important;
  border: none !important;
}

@media (max-width: 768px) {
  .fsl-cat-item {
    padding: 8px 18px;
    font-size: 14px;
  }
  .fsl-category-container {
    margin: 0;
  }
}

.product-main .product-title {
  margin: 0;
}

.product-main .price-wrapper {
  padding: 20px 0;
}

.product-small .category-uppercase,
.product-small .product-category,
.product-small .category,
.product-small p.category,
.product-small .show-short-description,
.product-small .box-excerpt,
.product-small .is-divider {
  display: none !important;
}

.fsl-product-cat {
  width: max-content;
  color: var(--fs-color-primary);
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-align: left;
  line-height: 1;
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
}

.fsl-product-cat::after {
  content: "";
  background-color: currentcolor;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
  border-radius: 30px;
}

.fsl-product-excerpt {
  font-size: 13px !important;
  color: #000 !important;
  line-height: 1.5 !important;
  margin: 10px 0 !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  text-align: left !important;
  height: 3em !important;
  font-weight: 400 !important;
}

.product-small .box-text {
  text-align: left !important;
  padding-top: 15px !important;
}

.product-small .price-wrapper {
  justify-content: flex-start !important;
  margin-top: auto !important;
}

.product-small .price {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  justify-content: flex-start !important;
}

.product-small .price ins {
  text-decoration: none !important;
  order: 1 !important;
}

.product-small .price del {
  font-size: 0.85em !important;
  color: #999 !important;
  font-weight: 400 !important;
  order: 2 !important;
  margin: 0 !important;
}

.product-small .product-title {
  font-size: 16px !important;
  margin-bottom: 5px !important;
  height: auto !important;
  font-weight: 600 !important;
}

.product-small .box-text {
  position: relative !important;
  padding-right: 0px !important;
  height: auto !important; /* Loại bỏ height cố định của Flatsome */
}

.box-text-products {
  height: auto !important;
}

.product-small .price-wrapper {
  justify-content: flex-start !important;
  margin-top: auto !important;
  height: auto !important; /* Loại bỏ height cố định của Flatsome */
  padding-bottom: 10px !important;
}

.fsl-add-to-cart-wrapper {
  position: absolute !important;
  right: 15px !important;
  bottom: 15px !important;
}

.fsl-add-to-cart-btn {
  width: 42px !important;
  height: 42px !important;
  background-color: var(--primary-color) !important;
  color: #fff !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
}

.fsl-add-to-cart-btn:hover {
  transform: scale(1.1) !important;
  background-color: #000 !important;
}

.fsl-add-to-cart-btn i {
  font-size: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  top: 0 !important;
  left: 0 !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.fsl-add-to-cart-btn i::before {
  margin: 0 !important;
  display: block !important;
}

.product-small .fsl-add-to-cart-btn.added,
.ppg-add-to-cart-btn.added,
.psc-add-to-cart-btn.added {
  background-color: var(--primary-color) !important;
  color: #fff !important;
}

.fsl-add-to-cart-btn + .added_to_cart,
.ppg-add-to-cart-btn + .added_to_cart,
.psc-add-to-cart-btn + .added_to_cart {
  display: none !important;
}

.fsl-add-to-cart-btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: fsl-spin 0.8s linear infinite;
}

.fsl-add-to-cart-btn.loading i {
  visibility: hidden;
}

@keyframes fsl-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 851px) and (max-width: 1100px) {
  .header-nav-main nav > ul > li > a {
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 0.9em !important;
  }
  .header-main .flex-col.hide-for-medium {
    display: flex !important;
  }
}

@media (max-width: 1024px) {
  /* Chỉ ép 3 cột cho danh sách sản phẩm trên tablet nếu là trang archive */
  .post-type-archive-product .products.row > .col,
  .tax-product_cat .products.row > .col {
    width: 33.333%;
    max-width: 33.333%;
    flex-basis: 33.333%;
  }

  .fsl-add-to-cart-btn {
    width: 36px !important;
    height: 36px !important;
  }

  #button-contact-vr {
    bottom: 100px !important;
  }
}

@media (max-width: 600px) {
  /* Chỉ ép 2 cột cho danh sách sản phẩm trên mobile nếu là trang archive */
  /* Hoặc khi có class .small-columns-2 chủ động */
  .post-type-archive-product .products.row > .col,
  .tax-product_cat .products.row > .col,
  .products.small-columns-2 > .col {
    width: 50%;
    max-width: 50%;
    flex-basis: 50%;
    padding: 0 5px 10px 5px !important;
  }

  .fsl-add-to-cart-wrapper {
    right: 10px !important;
    bottom: 20px !important;
  }

  .fsl-add-to-cart-btn i {
    font-size: 14px !important;
  }

  #button-contact-vr {
    bottom: 110px !important;
  }
}

@media (min-width: 851px) {
  .cart-item.has-dropdown .nav-dropdown {
    left: auto !important;
    right: -10px !important;
    transform: none !important;
    margin-top: -1px !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    background: #ffffff !important;
    overflow: visible !important;
    min-width: 340px !important;
    z-index: 9999 !important;
  }
}

.nav-dropdown .widget_shopping_cart_content {
  padding: 10px 20px 20px 20px !important;
}

.nav-dropdown .woocommerce-mini-cart__buttons {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 0 !important;
  margin-top: 20px !important;
}

.nav-dropdown .woocommerce-mini-cart__buttons a {
  margin: 0 !important;
  border-radius: 30px !important;
  height: 48px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  transition: all 0.3s ease !important;
}

.nav-dropdown .woocommerce-mini-cart__buttons a.checkout {
  background-color: #ef2323 !important;
  color: #fff !important;
}

.nav-dropdown .woocommerce-mini-cart__buttons a.checkout:hover {
  background-color: #d11a1a !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 5px 15px rgba(239, 35, 35, 0.3) !important;
}

.nav-dropdown .woocommerce-mini-cart__buttons a:not(.checkout) {
  background-color: #2da44e !important;
  color: #fff !important;
}

.nav-dropdown .woocommerce-mini-cart__buttons a:not(.checkout):hover {
  background-color: #268d42 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 5px 15px rgba(45, 164, 78, 0.3) !important;
}
