/* ==========================================================================
   NVB Play - Shop & Product Archive UI/UX Upgrade
   ========================================================================== */

/* 1. Safe typography & preserve Flatsome / WooCommerce icon fonts */
body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body [class^="icon-"],
body [class*=" icon-"],
body .fl-icons,
body .star-rating::before,
body .star-rating span::before {
  font-family: "fl-icons" !important;
}

/* 2. Archive canvas */
.archive.woocommerce #main,
.post-type-archive-product #main,
.tax-product_cat #main,
.tax-product_tag #main {
  background-color: #f5f5fa;
}

/* Hide redundant WooCommerce 8.8 default H1 inside main column */
.archive .nvb-shop-main .woocommerce-products-header__title {
  display: none;
}

/* 3. Shop & Category Hero Header + Quick Category Pills */
.nvb-shop-header-wrap {
  padding-top: 20px;
}

.nvb-shop-header-wrap > .row {
  padding-left: 15px;
  padding-right: 15px;
}

.nvb-shop-header-wrap > .row > .col {
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
}

.nvb-shop-header {
  background: #ffffff;
  border: 1px solid #ebebf0;
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.nvb-shop-breadcrumb .woocommerce-breadcrumb {
  margin: 0 0 10px;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  color: #64646d;
  text-transform: none;
  letter-spacing: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.nvb-shop-breadcrumb .woocommerce-breadcrumb a {
  color: #64646d;
  font-weight: 500;
  transition: color 0.18s ease;
}

.nvb-shop-breadcrumb .woocommerce-breadcrumb a:hover {
  color: #ff3f1a;
}

.nvb-shop-breadcrumb .nvb-bc-sep {
  color: #c4c4cf;
}

.nvb-shop-header-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nvb-shop-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #18181b;
}

.nvb-shop-subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #64646d;
  max-width: 720px;
}

.nvb-shop-quick-cats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f0f0f5;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.nvb-shop-quick-cats::-webkit-scrollbar {
  display: none;
}

.nvb-cat-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #e4e4ec;
  background: #f8f9fc;
  color: #38383d;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.nvb-cat-pill:hover {
  border-color: #ff3f1a;
  color: #ff3f1a;
  background: #fff5f3;
}

.nvb-cat-pill.is-active {
  background: #ff3f1a;
  border-color: #ff3f1a;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 63, 26, 0.22);
}

.nvb-cat-pill .nvb-cat-count {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(39, 39, 42, 0.07);
  color: #64646d;
}

.nvb-cat-pill.is-active .nvb-cat-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* 4. Main Archive Grid Layout */
.archive .category-page-row {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 24px;
  padding-top: 20px;
  padding-bottom: 48px;
  padding-left: 15px;
  padding-right: 15px;
  align-items: start;
}

.archive .category-page-row .nvb-shop-sidebar-col,
.archive .category-page-row .nvb-shop-main {
  min-width: 0;
  max-width: 100%;
  flex-basis: auto;
}

/* 5. Promo Banners inside Shop */
.nvb-shop-banners {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.nvb-shop-banners.is-single {
  grid-template-columns: 1fr;
}

.nvb-shop-banners.is-multi {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nvb-shop-banners .item {
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #ebebf0;
}

.nvb-shop-banners .item a {
  display: block;
  overflow: hidden;
}

.nvb-shop-banners .item img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.nvb-shop-banners .item a:hover img {
  transform: scale(1.02);
}

/* 6. Sort & Result Count Toolbar */
.archive .category-page-row .facet-sort-wrap {
  background: #ffffff;
  border: 1px solid #ebebf0;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.02);
}

.archive .category-page-row .facet-sort-wrap .facetwp-facet-count {
  color: #38383d;
  font-size: 14px;
  font-weight: 500;
}

.archive .category-page-row .facet-sort-wrap .type-sort {
  display: flex;
  align-items: center;
  gap: 10px;
}

.archive .category-page-row .facet-sort-wrap .type-sort > span {
  color: #64646d;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.archive .category-page-row .facet-sort-wrap .facetwp-type-sort select {
  border-radius: 10px;
  border: 1px solid #dddde3;
  background-color: #f8f9fc;
  color: #27272a;
  font-size: 13px;
  font-weight: 600;
  min-height: 38px;
  height: 38px;
  min-width: 185px;
  padding: 0 36px 0 14px;
  background-position: right 10px center;
  background-size: 18px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.archive .category-page-row .facet-sort-wrap .facetwp-type-sort select:hover {
  border-color: #b8b8c4;
  background-color: #ffffff;
}

.archive .category-page-row .facet-sort-wrap .facetwp-type-sort select:focus {
  border-color: #ff3f1a;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 63, 26, 0.12);
  outline: none;
}

/* 7. Sidebar Filter Redesign & Interactive Accordions */
@media screen and (min-width: 1025px) {
  .archive .category-page-row .nvb-shop-sidebar-col {
    position: sticky;
    top: 96px;
  }

  .archive .category-page-row .sidebar-product {
    max-height: calc(100vh - 116px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d4d4dc transparent;
  }

  .archive .category-page-row .sidebar-product::-webkit-scrollbar {
    width: 5px;
  }

  .archive .category-page-row .sidebar-product::-webkit-scrollbar-thumb {
    background: #d4d4dc;
    border-radius: 999px;
  }
}

.archive .category-page-row .sidebar-product {
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #ebebf0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
  padding-bottom: 16px;
}

.archive .category-page-row .sidebar-product h2 {
  font-size: 15px;
  font-weight: 700;
  color: #18181b;
  margin: 0;
  padding: 16px 16px 14px 44px;
  background-position: 16px center;
  background-size: 20px;
  border-bottom: 1px solid #f0f0f5;
}

.archive .category-page-row .sidebar-product .search-filters {
  padding: 12px 16px;
}

.archive .category-page-row .sidebar-product .search-filters:has(.facetwp-selections:empty) {
  display: none;
}

.archive .category-page-row .sidebar-product .facetwp-item .inner:empty {
  display: none;
}

.archive .category-page-row .sidebar-product .facetwp-item h3 {
  position: relative;
  font-size: 14px;
  font-weight: 700;
  color: #27272a;
  padding: 14px 28px 12px 0;
  background-image: none;
  cursor: pointer;
  user-select: none;
  transition: color 0.18s ease;
}

.archive .category-page-row .sidebar-product .facetwp-item h3:hover {
  color: #ff3f1a;
}

.archive .category-page-row .sidebar-product .facetwp-item h3::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  background: url("../icon/chevron-down.svg") no-repeat center / 18px;
  transition: transform 0.22s ease;
}

.archive .category-page-row .sidebar-product .facetwp-item.is-collapsed h3::after {
  transform: rotate(-90deg);
}

.archive .category-page-row .sidebar-product .facetwp-item.is-collapsed .facetwp-facet,
.archive .category-page-row .sidebar-product .facetwp-item.is-collapsed .label-price,
.archive .category-page-row .sidebar-product .facetwp-item.is-collapsed .facetwp-selections {
  display: none !important;
}

.archive .category-page-row .sidebar-product .facetwp-item.is-collapsed .inner {
  border-bottom: 1px solid #f0f0f5;
}

/* Show product count subtly on category filter items */
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-categories .facetwp-checkbox {
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 28px;
  background-size: 18px;
  margin-bottom: 4px;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-categories .facetwp-checkbox:hover {
  color: #ff3f1a;
}

.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-categories .facetwp-checkbox:hover .facetwp-display-value {
  color: #ff3f1a;
}

.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-categories .facetwp-counter {
  display: inline-block;
  margin-left: auto;
  padding-left: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #8e8e97;
  flex-shrink: 0;
}

/* Filter chips (checkboxes & radios) */
.archive .category-page-row .facetwp-type-checkboxes:not(.facetwp-facet-categories, .facetwp-facet-color) .facetwp-checkbox,
.archive .category-page-row .facetwp-type-radio .facetwp-radio {
  border-radius: 8px;
  border: 1px solid #e4e4ec;
  background: #ffffff;
  padding: 7px 10px !important;
  font-size: 13px;
  font-weight: 500;
  color: #38383d;
  transition: all 0.16s ease;
}

.archive .category-page-row .facetwp-type-checkboxes:not(.facetwp-facet-categories, .facetwp-facet-color) .facetwp-checkbox:hover,
.archive .category-page-row .facetwp-type-radio .facetwp-radio:hover {
  border-color: #0d5bb5;
  background: #f5f9ff;
}

.archive .category-page-row .facetwp-type-checkboxes:not(.facetwp-facet-categories, .facetwp-facet-color) .facetwp-checkbox.checked,
.archive .category-page-row .facetwp-type-radio .facetwp-radio.checked {
  border-color: #0d5bb5;
  background-color: #f0f7ff;
  color: #0d5bb5;
  font-weight: 600;
}

.archive .category-page-row .facetwp-type-checkboxes:not(.facetwp-facet-categories, .facetwp-facet-color) .facetwp-checkbox.checked .facetwp-display-value {
  color: #0d5bb5;
  font-weight: 600;
}

/* Expanded Color Swatches + Safe Text Fallback for Unmapped Colors */
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox {
  width: 30px;
  height: 30px;
  outline: 1px solid #d4d4dc;
  transition: transform 0.15s ease, outline-color 0.15s ease;
}

.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox:hover {
  transform: scale(1.08);
  outline-color: #0d5bb5;
}

.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="do"],
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="red"] {
  background-color: #dc2626;
}
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="vang"],
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="yellow"] {
  background-color: #eab308;
}
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="xam"],
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="ghi"],
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="gray"] {
  background-color: #9ca3af;
}
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="hong"],
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="pink"] {
  background-color: #ec4899;
}
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="tim"],
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="purple"] {
  background-color: #7c3aed;
}
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="nau"],
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="brown"] {
  background-color: #78350f;
}
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="xanh-navy"],
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="navy"],
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="xanh-den"] {
  background-color: #1e3a8a;
}
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="xanh-ngoc"],
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="mint"] {
  background-color: #14b8a6;
}
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="xanh-reu"] {
  background-color: #4d7c0f;
}
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="be"],
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="kem"] {
  background-color: #e7dec8;
}
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="bac"],
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="silver"] {
  background-color: #cbd5e1;
}
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="xanh-duong"] {
  background-color: #2563eb;
}
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox[data-value="xanh-la"] {
  background-color: #16a34a;
}

/* Text pill fallback for any unmapped color slug */
.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox.nvb-color-text-fallback {
  width: auto;
  height: auto;
  border-radius: 999px;
  padding: 4px 10px;
  outline: none;
  border: 1px solid #d4d4dc;
  background: #f8f9fc;
  transform: none;
}

.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox.nvb-color-text-fallback .facetwp-display-value {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: #38383d;
}

.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox.nvb-color-text-fallback.checked {
  border-color: #0d5bb5;
  background: #f0f7ff;
  box-shadow: none;
  outline: none;
}

.archive .category-page-row .facetwp-type-checkboxes.facetwp-facet-color .facetwp-checkbox.nvb-color-text-fallback.checked .facetwp-display-value {
  color: #0d5bb5;
  font-weight: 600;
}

.archive .category-page-row button.clear-filter {
  border-radius: 10px;
  background: #f3f4f8;
  color: #38383d;
  font-weight: 600;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.archive .category-page-row button.clear-filter:hover {
  background: #fff0f1;
  color: #d93843;
}

/* 8. Product Grid (Archive / Shop) */
.archive .category-page-row .products.row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100%;
  transition: opacity 0.2s ease;
}

.archive .category-page-row .products.row.nvb-is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.archive .category-page-row .products.row::before,
.archive .category-page-row .products.row::after {
  display: none !important;
  content: none !important;
}

.archive .category-page-row .products.row > .product-small.col {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  flex-basis: auto !important;
  width: 100% !important;
}

/* 9. Upgraded Product Card Styling */
.archive .product-small.col .box,
.products.row .product-small.col .box {
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #ebebf0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.archive .product-small.col .box:hover,
.products.row .product-small.col .box:hover {
  transform: translateY(-3px);
  border-color: #d6d6e0;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

/* Square Studio Image Frame */
.archive .product-small.col .box-image,
.products.row .product-small.col .box-image {
  position: relative;
  padding: 0;
  background: #f8f9fb;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.archive .product-small.col .box-image > div:first-child,
.products.row .product-small.col .box-image > div:first-child {
  width: 100%;
  height: 100%;
}

.archive .product-small.col .box-image a,
.products.row .product-small.col .box-image a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 12px;
}

.archive .product-small.col .box-image img,
.products.row .product-small.col .box-image img {
  width: 100%;
  height: 100% !important;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.archive .product-small.col .box:hover .box-image img,
.products.row .product-small.col .box:hover .box-image img {
  transform: scale(1.04);
}

/* Dim slightly when out of stock / contact */
.product-small.col.out-of-stock .box-image img {
  opacity: 0.78;
}

/* Replace Flatsome's ugly full-width mid-image "Liên hệ" strip with a sleek pill badge */
.product-small.col .box-image .out-of-stock-label {
  top: auto !important;
  right: auto !important;
  bottom: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.84);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-transform: none;
  opacity: 1;
  backdrop-filter: blur(4px);
  z-index: 3;
}

/* Clean Top Badges */
.product-small.col .badge-container {
  padding: 10px 10px 0;
  gap: 6px;
  pointer-events: none;
}

.product-small.col .badge-container .badge-inner {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  align-items: center;
  gap: 4px;
}

.product-small.col .badge-container .badge-inner::before {
  width: 14px;
  height: 14px;
  margin-left: 0;
  margin-top: 0;
  transform: none;
}

.product-small.col .badge-container .badge-inner.new-bubble-auto {
  position: static;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Card Text Area */
.archive .product-small.col .box-text,
.products.row .product-small.col .box-text {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  text-align: left;
}

.archive .product-small.col .box-text .category,
.products.row .product-small.col .box-text .category {
  font-size: 11px;
  font-weight: 600;
  color: #808089;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  opacity: 1;
}

.archive .product-small.col .box-text .product-title,
.products.row .product-small.col .box-text .product-title {
  margin: 0 0 8px;
}

.archive .product-small.col .box-text .product-title a,
.products.row .product-small.col .box-text .product-title a {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: #1f2024;
  min-height: 41px;
  transition: color 0.16s ease;
}

.archive .product-small.col .box-text .product-title a:hover,
.products.row .product-small.col .box-text .product-title a:hover {
  color: #ff3f1a;
}

/* Swatches on Card */
.archive .product-small.col .box-text .ux-swatches,
.products.row .product-small.col .box-text .ux-swatches {
  padding-bottom: 8px;
  gap: 5px;
}

.archive .product-small.col .box-text .ux-swatches .ux-swatch--color,
.products.row .product-small.col .box-text .ux-swatches .ux-swatch--color {
  width: 20px;
  height: 20px;
  border: 1px solid #e4e4ec;
}

/* Unified Price Hierarchy (Simple & Variable Products) */
.archive .product-small.col .box-text .price-wrapper,
.products.row .product-small.col .box-text .price-wrapper {
  margin-top: auto;
  padding-top: 6px;
  min-height: 46px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.archive .product-small.col .box-text .price-wrapper .price,
.products.row .product-small.col .box-text .price-wrapper .price,
.archive .product-small.col.product-type-variable .box-text .price-wrapper .price,
.products.row .product-small.col.product-type-variable .box-text .price-wrapper .price {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 16px;
  line-height: 1.35;
}

.archive .product-small.col .box-text .price-wrapper .price ins,
.products.row .product-small.col .box-text .price-wrapper .price ins {
  flex: 1 0 100%;
  order: 1;
  text-decoration: none;
  background: transparent;
}

.archive .product-small.col .box-text .price-wrapper .price > .woocommerce-Price-amount,
.products.row .product-small.col .box-text .price-wrapper .price > .woocommerce-Price-amount,
.archive .product-small.col .box-text .price-wrapper .price ins .woocommerce-Price-amount,
.products.row .product-small.col .box-text .price-wrapper .price ins .woocommerce-Price-amount {
  color: #ff3f1a;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.archive .product-small.col .box-text .price-wrapper .price del,
.products.row .product-small.col .box-text .price-wrapper .price del {
  order: 2;
  opacity: 1;
  color: #8e8e97;
  font-size: 12px;
  font-weight: 500;
  text-decoration: line-through;
}

.archive .product-small.col .box-text .price-wrapper .price del span,
.products.row .product-small.col .box-text .price-wrapper .price del span {
  color: #8e8e97;
  font-size: 12px;
  font-weight: 500;
}

.nvb-sale-badge {
  order: 3;
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fff0f1;
  color: #d93843 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}

/* Rating row */
.archive .product-small.col .box-text .star-rating-wrapper,
.products.row .product-small.col .box-text .star-rating-wrapper {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 10. Pagination */
.nvb-shop-pagination {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.nvb-shop-pagination .facetwp-facet-pagination {
  padding-top: 0 !important;
  width: 100%;
}

.nvb-shop-pagination .facetwp-page {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e4e4ec;
  color: #38383d;
  font-weight: 600;
  transition: all 0.16s ease;
}

.nvb-shop-pagination .facetwp-page:hover {
  border-color: #ff3f1a;
  color: #ff3f1a;
  background: #fff5f3;
}

.nvb-shop-pagination .facetwp-page.active {
  background: #ff3f1a;
  border-color: #ff3f1a;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 63, 26, 0.25);
}

/* 11. Empty State */
.nvb-empty-state {
  grid-column: 1 / -1;
  background: #ffffff !important;
  border: 1px solid #ebebf0 !important;
  border-radius: 16px;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.nvb-empty-img {
  width: 200px;
  max-width: 70%;
  height: auto;
  margin-bottom: 4px;
}

.nvb-empty-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #18181b;
}

.nvb-empty-desc {
  margin: 0;
  font-size: 14px;
  color: #64646d;
  max-width: 440px;
  line-height: 1.55;
}

.nvb-empty-actions {
  margin-top: 8px;
}

.nvb-empty-reset-btn {
  margin: 0;
  padding: 10px 22px;
  border: 0;
  border-radius: 10px;
  background: #ff3f1a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.nvb-empty-reset-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  color: #ffffff;
}

/* Desktop hide mobile drawer footer */
.nvb-sidebar-mobile-footer {
  display: none;
}

/* 12. Tablet & Mobile Responsive (<= 1200px / <= 1024px / <= 640px) */
@media screen and (max-width: 1200px) {
  .archive .category-page-row {
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 18px;
  }

  .archive .category-page-row .products.row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media screen and (max-width: 1024px) {
  .nvb-shop-header-wrap {
    padding-top: 12px;
  }

  .nvb-shop-header-wrap > .row {
    padding-left: 12px;
    padding-right: 12px;
  }

  .nvb-shop-header {
    padding: 16px;
    border-radius: 12px;
  }

  .nvb-shop-title {
    font-size: 20px;
  }

  .nvb-shop-subtitle {
    font-size: 13px;
  }

  .archive .category-page-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 12px 36px;
  }

  .archive .category-page-row .facet-sort-wrap {
    padding: 10px 14px;
    margin-bottom: 12px;
  }

  .archive .category-page-row .products.row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  /* Mobile Sticky Filter + Working Sort Bar */
  .archive .sidebar-inner-mobile {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #ebebf0;
    border-radius: 12px;
    overflow: hidden;
  }

  .archive .sidebar-inner-mobile .filter {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f5;
  }

  .archive .sidebar-inner-mobile .filter button {
    font-size: 14px;
    font-weight: 600;
    color: #18181b;
    gap: 6px;
    background: transparent;
  }

  .archive .sidebar-inner-mobile .filter > span {
    font-size: 13px;
    color: #64646d;
    font-weight: 500;
  }

  .archive .sidebar-inner-mobile .nvb-mobile-sort {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    background: #fafafc;
  }

  .archive .sidebar-inner-mobile .nvb-mobile-sort-label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #64646d;
    white-space: nowrap;
  }

  .archive .sidebar-inner-mobile .nvb-mobile-sort-select {
    flex: 1;
    margin: 0;
    height: 36px;
    min-height: 36px;
    border-radius: 8px;
    border: 1px solid #dddde3;
    background-color: #ffffff;
    color: #18181b;
    font-size: 13px;
    font-weight: 600;
    padding: 0 32px 0 12px;
  }

  /* Smooth Mobile Filter Bottom-Sheet Drawer (fixes hidden .title-top bug!) */
  .archive .sidebar-wrap {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0 !important;
    top: auto;
    width: 100%;
    max-height: 85vh;
    z-index: 1003;
    background: #ffffff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 35px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s ease;
  }

  .archive .sidebar-wrap.toggle {
    transform: translateY(0);
    visibility: visible;
  }

  .archive .sidebar-wrap .title-top {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #ebebf0;
    background: #ffffff;
    flex-shrink: 0;
  }

  .archive .sidebar-wrap .title-top .title-top-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #18181b;
  }

  .archive .sidebar-wrap .title-top .close-sidebar {
    margin: 0;
    padding: 6px;
    min-height: auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: #f3f4f8;
    color: #27272a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .archive .sidebar-wrap .nvb-sidebar-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .archive .sidebar-wrap .sidebar-product {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    max-height: none;
    overflow: visible;
  }

  .archive .sidebar-wrap .sidebar-product h2 {
    display: none;
  }

  .archive .sidebar-wrap .nvb-sidebar-mobile-footer {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #ebebf0;
    background: #ffffff;
    flex-shrink: 0;
  }

  .nvb-btn-reset-mobile,
  .nvb-btn-apply-mobile {
    margin: 0;
    height: 42px;
    min-height: 42px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    cursor: pointer;
  }

  .nvb-btn-reset-mobile {
    background: #f3f4f8;
    color: #27272a;
    border: 1px solid #e4e4ec;
  }

  .nvb-btn-apply-mobile {
    background: #ff3f1a;
    color: #ffffff;
    border: 0;
  }
}

@media screen and (max-width: 640px) {
  .nvb-shop-banners.is-multi {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .archive .category-page-row .products.row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .archive .product-small.col .box-image a,
  .products.row .product-small.col .box-image a {
    padding: 8px;
  }

  .archive .product-small.col .box-text,
  .products.row .product-small.col .box-text {
    padding: 10px 10px 12px;
  }

  .archive .product-small.col .box-text .product-title a,
  .products.row .product-small.col .box-text .product-title a {
    font-size: 13px;
    min-height: 38px;
  }

  .archive .product-small.col .box-text .price-wrapper .price > .woocommerce-Price-amount,
  .products.row .product-small.col .box-text .price-wrapper .price > .woocommerce-Price-amount,
  .archive .product-small.col .box-text .price-wrapper .price ins .woocommerce-Price-amount,
  .products.row .product-small.col .box-text .price-wrapper .price ins .woocommerce-Price-amount {
    font-size: 14px;
  }

  .nvb-empty-state {
    padding: 32px 16px;
  }
}

/* ==========================================================================
   11. Card polish (2026-11)
   - Tiêu đề luôn căn trên cùng, swatch màu nằm dưới tiêu đề -> các thẻ đều nhau
   - Giảm giá chỉ hiện 1 lần (chip cạnh giá), bỏ badge % lặp ở góc ảnh
   ========================================================================== */
.archive .product-small.col .box-text,
.products.row .product-small.col .box-text {
  justify-content: flex-start;
}

.archive .product-small.col .box-text .title-wrapper,
.products.row .product-small.col .box-text .title-wrapper {
  order: 1;
}

.archive .product-small.col .box-text .ux-swatches,
.products.row .product-small.col .box-text .ux-swatches {
  order: 2;
  padding: 0 0 8px;
  margin: 0;
}

.archive .product-small.col .box-text .price-wrapper,
.products.row .product-small.col .box-text .price-wrapper {
  order: 3;
}

.product-small.col .badge-container .badge-inner.on-sale,
.product-small.col .badge-container .badge:has(> .on-sale) {
  display: none;
}

/* 12. Mobile/tablet: chỉ giữ 1 ô sắp xếp (ô trong khối lọc); select của FacetWP vẫn nằm trong DOM để đồng bộ */
@media screen and (max-width: 1024px) {
  .archive .category-page-row .facet-sort-wrap .type-sort {
    display: none;
  }
}

/* ==========================================================================
   13. Sidebar: ưu tiên Thương hiệu & Khoảng giá lên đầu (đổi thứ tự bằng CSS,
       không cần sửa widget trong DB). Danh mục chuyển xuống, mặc định thu gọn.
   ========================================================================== */
.archive .category-page-row .sidebar-product {
  display: flex;
  flex-direction: column;
}

.archive .category-page-row .sidebar-product > * {
  flex-shrink: 0;
  order: 10;
}

.archive .category-page-row .sidebar-product > h2 { order: 0; }
.archive .category-page-row .sidebar-product > .search-filters { order: 1; }
.archive .category-page-row .sidebar-product > .facetwp-item:has([data-name="brand"]) { order: 3; }
.archive .category-page-row .sidebar-product > .facetwp-item:has([data-name="price"]),
.archive .category-page-row .sidebar-product > .facetwp-item:has(.facetwp-price) { order: 2; }
.archive .category-page-row .sidebar-product > .facetwp-item:has([data-name="categories"]) { order: 4; }
.archive .category-page-row .sidebar-product > .facetwp-item:has([data-name="doi_tuong"]) { order: 5; }
.archive .category-page-row .sidebar-product > .clear-bottom { order: 99; }

/* Danh sách thương hiệu dài (20 chip): giới hạn ~4 hàng, phần còn lại cuộn trong khung */
.archive .category-page-row .sidebar-product .facetwp-facet-brand {
  max-height: 188px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #d4d4dc transparent;
}

/* 14. Thương hiệu trên thẻ sản phẩm */
.archive .product-small.col .box-text .nvb-card-brand,
.products.row .product-small.col .box-text .nvb-card-brand {
  order: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #808089;
  margin-bottom: 4px;
}
