/* BTIMEX - Trang khách sỉ: thêm nhanh sản phẩm vào giỏ */
.bti-wholesale-note {
  margin: -4px 0 18px;
  color: #666;
  font-size: 14px;
}
.bti-wholesale-card-atc {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f1f1;
}
.bti-wholesale-card-atc .bti-wholesale-label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  color: #666;
}
.bti-wholesale-card-control,
.bti-wholesale-variant-select {
  width: 100%;
  height: 34px;
  margin-bottom: 8px;
  padding: 0 8px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 13px;
}
.bti-wholesale-qty-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.bti-wholesale-qty {
  width: 58px;
  height: 36px;
  padding: 0 6px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  text-align: center;
  font-size: 13px;
  background: #fff;
}
.bti-wholesale-add-btn {
  min-height: 36px;
  flex: 1;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bti-wholesale-atc-message {
  min-height: 18px;
  margin-top: 6px;
  font-size: 12px;
  color: #2e7d32;
}
.bti-wholesale-atc-message.is-error {
  color: #c62828;
}
body#template-page\.khach-si .action-bar {
  display: none;
}
body#template-page\.khach-si .item_product_main form.variants {
  height: 100%;
}
body#template-page\.khach-si .product-info {
  display: flex;
  flex-direction: column;
}
body#template-page\.khach-si .product-info .bti-wholesale-card-atc {
  margin-top: auto;
}
@media (max-width: 575px) {
  .bti-wholesale-qty-row {
    gap: 6px;
  }
  .bti-wholesale-qty {
    width: 50px;
  }
  .bti-wholesale-add-btn {
    font-size: 12px;
  }
}

/* BTIMEX color-first wholesale picker */
.bti-wholesale-picker {
  margin-top: 8px;
}
.bti-wholesale-color-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  margin: 4px 0 7px;
  padding: 1px 0 4px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.bti-color-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 2px;
  border: 1px solid #d8d8d8;
  background: #fff;
  color: #333;
  border-radius: 50%;
  cursor: pointer;
  flex: 0 0 auto;
  transition: border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.bti-color-option.is-active {
  border-color: #ff8a3d;
  box-shadow: 0 0 0 1px #ff8a3d inset;
  color: #0b2b5c;
}
.bti-color-option.is-soldout,
.bti-color-option:disabled {
  color: #aaa;
  background: #f3f3f3;
  border-color: #e1e1e1;
  cursor: not-allowed;
  opacity: .55;
  pointer-events: none;
}
.bti-color-option.is-soldout .bti-color-thumb,
.bti-color-option:disabled .bti-color-thumb {
  filter: grayscale(1);
  opacity: .55;
}
.bti-color-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #e1e1e1;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  flex: 0 0 22px;
}
.bti-color-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.bti-size-label {
  margin-top: 6px;
}
.bti-size-panel {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
  margin: 4px 0 8px;
  width: 100%;
}
.bti-size-panel[hidden] {
  display: none !important;
}
.bti-size-option {
  min-width: 0;
  width: 100%;
  min-height: 28px;
  padding: 3px 2px;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 11px;
  line-height: 1.1;
  letter-spacing: -0.1px;
  text-align: center;
  cursor: pointer;
}
.bti-size-option.is-active {
  border-color: #ff8a3d;
  background: #fff7f0;
  color: #0b2b5c;
}
.bti-size-option:disabled,
.bti-size-option.is-soldout {
  color: #aaa;
  background: #f3f3f3;
  border-color: #e1e1e1;
  cursor: not-allowed;
  text-decoration: none;
  opacity: .72;
}
.bti-wholesale-card-atc .bti-wholesale-add-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}
@media (max-width: 575px) {
  .bti-color-option {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
  }
  .bti-color-thumb {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }
  .bti-size-panel {
    gap: 3px;
  }
  .bti-size-option {
    min-height: 26px;
    padding: 2px 1px;
    font-size: 10px;
    letter-spacing: -0.2px;
  }
}

/* BTIMEX instant color tooltip */
.bti-color-tooltip {
  position: fixed;
  z-index: 99999;
  display: none;
  max-width: 220px;
  padding: 4px 8px;
  border-radius: 3px;
  background: rgba(25, 25, 25, .96);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.bti-color-tooltip.is-show {
  display: block;
}
body .bti-wholesale-card-atc {
  border-top: 0;
  padding-top: 4px;
}


/* BTIMEX update: sold-out colors move to the end of the horizontal color row */
.bti-wholesale-color-list .bti-color-option {
  order: 1;
}
.bti-wholesale-color-list .bti-color-option.is-soldout,
.bti-wholesale-color-list .bti-color-option:disabled {
  order: 99;
}

/* BTIMEX update: force size choices to stay on one compact row */
.bti-wholesale-size-groups .bti-size-panel {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 3px !important;
  margin: 4px 0 8px !important;
  width: 100% !important;
  overflow: visible !important;
}
.bti-wholesale-size-groups .bti-size-panel[hidden] {
  display: none !important;
}
.bti-wholesale-size-groups .bti-size-option {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: auto !important;
  min-height: 28px !important;
  padding: 2px 1px !important;
  font-size: 10.5px !important;
  line-height: 1.05 !important;
  letter-spacing: -0.25px !important;
  text-align: center !important;
  white-space: nowrap !important;
}
@media (max-width: 575px) {
  .bti-wholesale-size-groups .bti-size-panel {
    gap: 2px !important;
  }
  .bti-wholesale-size-groups .bti-size-option {
    min-height: 25px !important;
    font-size: 9.5px !important;
    padding: 1px 0 !important;
  }
}


/* BTIMEX search page uses the same wholesale product-card UI */
.search-main .search-type-tabs {
  display: flex !important;
  justify-content: flex-end;
  margin-bottom: 6px;
}
.search-main .tab-link.active,
.search-main .tab-link.current {
  border-bottom: 2px solid #f59d56;
}
.search-main .product-col .item_product_main {
  height: 100%;
}

/* BTIMEX pinned products: 64000 / 76000 / HA00 stay first in visible product grids */
.product-col[data-bti-pinned-product="1"],
.product-col[data-bti-pinned-product="2"],
.product-col[data-bti-pinned-product="3"] {
  order: 1;
}

/* BTIMEX product detail: use the same color/size picker as collection cards */
.details-pro .bti-product-detail-picker-wrap {
  margin: 12px 0 14px;
}
.details-pro .bti-wholesale-label {
  display: block;
  margin: 9px 0 6px;
  color: #666;
  font-size: 13px;
  line-height: 1.2;
}
.details-pro .bti-wholesale-color-list {
  max-width: 100%;
}
.details-pro .bti-size-panel {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
  width: 100% !important;
  overflow: visible !important;
}
.details-pro .bti-size-panel[hidden] {
  display: none !important;
}
.details-pro .bti-size-option {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 39px !important;
  min-height: 30px !important;
  padding: 4px 10px !important;
  font-size: 13px !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}
.details-pro .bti-size-option.is-soldout,
.details-pro .bti-size-option:disabled,
.details-pro .bti-color-option.is-soldout,
.details-pro .bti-color-option:disabled {
  opacity: .45 !important;
  filter: grayscale(1);
  cursor: not-allowed !important;
  pointer-events: none !important;
}
.details-pro .bti-product-detail-atc-message {
  width: 100%;
  margin-top: 8px;
  min-height: 18px;
  color: #e3342f;
  font-size: 13px;
  line-height: 1.35;
}
.details-pro .bti-product-detail-atc-message:not(.is-error) {
  color: #198754;
}

/* BTIMEX product detail quantity message fix */
.details-pro .bti-product-detail-atc-message {
  clear: both;
}
