/* TT v3.10.4 — unified WooCommerce selling states */
.tt-card-stock{position:absolute;z-index:3;top:9px;right:9px;display:inline-flex;align-items:center;min-height:28px;padding:4px 9px;border:1px solid #a5deb3;border-radius:9px;background:#effbf2;color:#23813b;font-size:10px;font-weight:900;line-height:1.1}
.tt-card-stock.is-backorder,.tt-sc-stock.is-backorder{border-color:#ffd28a;background:#fff7e8;color:#a45a00}
.tt-card-stock.is-out,.tt-sc-stock.is-out{border-color:#e0e3e8;background:#f6f7f8;color:#707887}
.tt-card-stock.is-discontinued,.tt-sc-stock.is-discontinued{border-color:#d8dce3;background:#eef0f3;color:#3f4754}
.tt-product-status .is-in,.tt-product-state-label.is-in{color:#23813b}
.tt-product-status .is-backorder,.tt-product-state-label.is-backorder{color:#b56700}
.tt-product-status .is-out,.tt-product-state-label.is-out{color:#707887}
.tt-product-status .is-discontinued,.tt-product-state-label.is-discontinued{color:#4b5563}
.tt-price-state--discontinued{color:#5d6674!important;font-size:.82em!important;font-weight:900!important}

.tt-card-state-cta{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:0 12px;border:0;border-radius:9px;background:var(--tt-red,#e3131b);color:#fff!important;font:inherit;font-weight:900;cursor:pointer;text-decoration:none!important}
.tt-card-state-cta svg{width:15px;height:15px;stroke:currentColor}
.tt-card-state-cta.is-disabled{background:#eef0f3;color:#5f6875!important;cursor:default}
.tt-card-actions[data-tt-state="outofstock"],.tt-card-actions[data-tt-state="backorder"],.tt-card-actions[data-tt-state="discontinued"]{align-items:center}
.tt-card-actions[data-tt-state="outofstock"] .tt-card-state-cta,.tt-card-actions[data-tt-state="backorder"] .tt-card-state-cta,.tt-card-actions[data-tt-state="discontinued"] .tt-card-state-cta{margin-left:auto}

/* Shortcode item action geometry: special stock states use detail icon + one clear CTA. */
.tt-sc-actions--icon[data-tt-state="outofstock"],
.tt-sc-actions--icon[data-tt-state="backorder"],
.tt-sc-actions--icon[data-tt-state="discontinued"]{grid-template-columns:var(--tt-sc-action-icon,42px) minmax(0,1fr)!important}
.tt-sc-actions--icon[data-tt-state="outofstock"]>.tt-sc-btn-buy,
.tt-sc-actions--icon[data-tt-state="backorder"]>.tt-sc-btn-buy,
.tt-sc-actions--icon[data-tt-state="discontinued"]>.tt-sc-btn-state{grid-column:2!important;width:100%!important;min-width:0!important}
.tt-sc-btn-disabled{border-color:#dfe3e8!important;background:#eef0f3!important;color:#626b78!important;cursor:default!important}
.tt-sc-btn-call svg{flex:none;width:15px!important;height:15px!important;stroke:currentColor!important}
.tt-sc-actions--text[data-tt-state="outofstock"] .tt-sc-btn-buy,
.tt-sc-actions--text[data-tt-state="backorder"] .tt-sc-btn-buy,
.tt-sc-actions--text[data-tt-state="discontinued"] .tt-sc-btn-state{flex:1 1 150px}

/* Product detail */
.tt-purchase-actions[data-tt-state="outofstock"],
.tt-purchase-actions[data-tt-state="backorder"],
.tt-purchase-actions[data-tt-state="discontinued"]{display:flex!important;align-items:center!important;gap:10px!important}
.tt-btn-state-action{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;min-width:210px!important;min-height:46px!important}
.tt-btn-state-action svg{width:18px;height:18px;stroke:currentColor}
.tt-btn-preorder{background:#e3131b!important;border-color:#e3131b!important;color:#fff!important}
.tt-btn-call-order{background:#e3131b!important;border-color:#e3131b!important;color:#fff!important}
.tt-btn-discontinued{border-color:#d9dde4!important;background:#eef0f3!important;color:#5f6875!important;cursor:default!important}
.tt-wc-availability.is-in{color:#23813b!important}.tt-wc-availability.is-backorder{color:#b56700!important}.tt-wc-availability.is-out{color:#707887!important}.tt-wc-availability.is-discontinued{color:#4b5563!important}

@media(max-width:767px){
  .tt-card-stock{top:6px;right:6px;min-height:24px;padding:3px 7px;border-radius:8px;font-size:8px}
  body.tt-mobile #tt-main .tt-sc-actions--icon[data-tt-state="outofstock"],
  body.tt-mobile #tt-main .tt-sc-actions--icon[data-tt-state="backorder"],
  body.tt-mobile #tt-main .tt-sc-actions--icon[data-tt-state="discontinued"]{grid-template-columns:minmax(0,1fr)!important;gap:5px!important}
  body.tt-mobile #tt-main .tt-sc-actions--icon[data-tt-state="outofstock"]>.tt-sc-btn-detail,
  body.tt-mobile #tt-main .tt-sc-actions--icon[data-tt-state="backorder"]>.tt-sc-btn-detail,
  body.tt-mobile #tt-main .tt-sc-actions--icon[data-tt-state="discontinued"]>.tt-sc-btn-detail{display:none!important}
  body.tt-mobile #tt-main .tt-sc-actions--icon[data-tt-state="outofstock"]>.tt-sc-btn-buy,
  body.tt-mobile #tt-main .tt-sc-actions--icon[data-tt-state="backorder"]>.tt-sc-btn-buy,
  body.tt-mobile #tt-main .tt-sc-actions--icon[data-tt-state="discontinued"]>.tt-sc-btn-state{grid-column:1!important;width:100%!important;max-width:none!important;min-width:0!important}
  body.tt-mobile #tt-main .tt-sc-actions--icon[data-tt-state="outofstock"]>.tt-sc-btn-call .tt-sc-buy-label{display:inline!important}
  body.tt-mobile #tt-main .tt-sc-actions--icon[data-tt-state="outofstock"]>.tt-sc-btn-call svg{display:none!important}
  .tt-buy-box[data-tt-state="outofstock"],.tt-buy-box[data-tt-state="backorder"],.tt-buy-box[data-tt-state="discontinued"]{grid-template-columns:1fr!important}
  .tt-buy-box[data-tt-state="outofstock"] .tt-btn-state-action,.tt-buy-box[data-tt-state="backorder"] .tt-btn-state-action,.tt-buy-box[data-tt-state="discontinued"] .tt-btn-state-action{width:100%!important;min-width:0!important;min-height:40px!important;height:40px!important;margin:0!important;border-radius:9px!important;font-size:12px!important}
}


/* Strong final overrides for the compact item library (it has ID-level grid rules). */
body.tt-desktop #tt-main .tt-sc-product--compact .tt-sc-actions--icon[data-tt-state="outofstock"],
body.tt-desktop #tt-main .tt-sc-product--compact .tt-sc-actions--icon[data-tt-state="backorder"],
body.tt-desktop #tt-main .tt-sc-product--compact .tt-sc-actions--icon[data-tt-state="discontinued"]{
  grid-template-columns:var(--tt-sc-action-icon,42px) minmax(0,1fr)!important;
}
body.tt-desktop #tt-main .tt-sc-product--compact .tt-sc-actions--icon[data-tt-state="outofstock"]>.tt-sc-btn-buy,
body.tt-desktop #tt-main .tt-sc-product--compact .tt-sc-actions--icon[data-tt-state="backorder"]>.tt-sc-btn-buy,
body.tt-desktop #tt-main .tt-sc-product--compact .tt-sc-actions--icon[data-tt-state="discontinued"]>.tt-sc-btn-state{
  grid-column:2!important;width:100%!important;min-width:0!important;max-width:none!important;
}
.tt-product-card .tt-card-actions>.tt-card-state-cta{
  display:flex!important;align-items:center!important;justify-content:center!important;min-width:0!important;width:100%!important;min-height:38px!important;height:38px!important;margin:0!important;padding:0 9px!important;border-radius:10px!important;box-sizing:border-box!important;line-height:1!important;font-size:10px!important;font-weight:900!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
}
body.tt-mobile .tt-product-card .tt-card-actions>.tt-card-state-cta{min-height:36px!important;height:36px!important;padding:0 5px!important;border-radius:9px!important;font-size:8.5px!important}
body.tt-mobile #tt-main .tt-sc-actions--icon[data-tt-state="backorder"] .tt-sc-buy-label{display:inline!important}

/* v3.10.5 — special-state CTA text must never be hidden by icon-action rules. */
.tt-sc-actions[data-tt-state="outofstock"] .tt-sc-state-label,
.tt-sc-actions[data-tt-state="backorder"] .tt-sc-state-label,
.tt-sc-actions[data-tt-state="discontinued"] .tt-sc-state-label{
  display:inline!important;
  visibility:visible!important;
  opacity:1!important;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tt-sc-actions[data-tt-state="outofstock"]>.tt-sc-btn-call,
.tt-sc-actions[data-tt-state="backorder"]>.tt-sc-btn-buy,
.tt-sc-actions[data-tt-state="discontinued"]>.tt-sc-btn-state{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  min-width:0!important;
  width:100%!important;
}
body.tt-desktop #tt-main .tt-sc-product--compact .tt-sc-actions--icon[data-tt-state="outofstock"]>.tt-sc-btn-call,
body.tt-desktop #tt-main .tt-sc-product--compact .tt-sc-actions--icon[data-tt-state="backorder"]>.tt-sc-btn-buy,
body.tt-desktop #tt-main .tt-sc-product--compact .tt-sc-actions--icon[data-tt-state="discontinued"]>.tt-sc-btn-state{
  grid-column:2!important;
  width:100%!important;
  max-width:none!important;
}
@media(max-width:767px){
  body.tt-mobile #tt-main .tt-sc-product--compact .tt-sc-actions--icon[data-tt-state="outofstock"]>.tt-sc-btn-call,
  body.tt-mobile #tt-main .tt-sc-product--compact .tt-sc-actions--icon[data-tt-state="backorder"]>.tt-sc-btn-buy,
  body.tt-mobile #tt-main .tt-sc-product--compact .tt-sc-actions--icon[data-tt-state="discontinued"]>.tt-sc-btn-state{
    grid-column:1!important;
    width:100%!important;
    max-width:none!important;
  }
}


/* v3.10.7 — state CTA width lock.
 * Stock state and action state are intentionally separate: an in-stock product can
 * have no price and therefore render “Gọi đặt hàng”. All one-CTA cards use the
 * same geometry so the label can never collapse into an icon-sized column. */
.tt-sc-actions--icon.tt-sc-actions--state-cta{
  display:grid!important;
  grid-template-columns:var(--tt-sc-action-icon,42px) minmax(0,1fr)!important;
  align-items:stretch!important;
  justify-content:stretch!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
}
.tt-sc-actions--icon.tt-sc-actions--state-cta>.tt-sc-btn-detail{
  grid-column:1!important;
  grid-row:1!important;
}
.tt-sc-actions--icon.tt-sc-actions--state-cta>.tt-sc-btn-buy,
.tt-sc-actions--icon.tt-sc-actions--state-cta>.tt-sc-btn-state{
  grid-column:2/-1!important;
  grid-row:1!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:var(--tt-sc-action-h,42px)!important;
  min-height:var(--tt-sc-action-h,42px)!important;
  padding:0 12px!important;
  border-radius:11px!important;
  box-sizing:border-box!important;
  font-size:11px!important;
  line-height:1!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.tt-sc-actions--icon.tt-sc-actions--state-cta>.tt-sc-btn-call svg{
  display:none!important;
}
.tt-sc-actions--icon.tt-sc-actions--state-cta .tt-sc-state-label{
  display:block!important;
  width:auto!important;
  max-width:100%!important;
  visibility:visible!important;
  opacity:1!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.tt-sc-actions--text.tt-sc-actions--state-cta>.tt-sc-btn-buy,
.tt-sc-actions--text.tt-sc-actions--state-cta>.tt-sc-btn-state{
  flex:1 1 150px!important;
  min-width:120px!important;
}

/* Very narrow cards: preserve the label by giving the CTA the whole row. */
@container (max-width:210px){
  .tt-sc-actions--icon.tt-sc-actions--state-cta{
    grid-template-columns:minmax(0,1fr)!important;
  }
  .tt-sc-actions--icon.tt-sc-actions--state-cta>.tt-sc-btn-detail{display:none!important}
  .tt-sc-actions--icon.tt-sc-actions--state-cta>.tt-sc-btn-buy,
  .tt-sc-actions--icon.tt-sc-actions--state-cta>.tt-sc-btn-state{
    grid-column:1!important;
    width:100%!important;
    min-width:0!important;
    font-size:9.5px!important;
  }
}

@media(max-width:767px){
  body.tt-mobile #tt-main .tt-sc-actions--icon.tt-sc-actions--state-cta{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
    max-width:none!important;
    gap:0!important;
  }
  body.tt-mobile #tt-main .tt-sc-actions--icon.tt-sc-actions--state-cta>.tt-sc-btn-detail{display:none!important}
  body.tt-mobile #tt-main .tt-sc-actions--icon.tt-sc-actions--state-cta>.tt-sc-btn-buy,
  body.tt-mobile #tt-main .tt-sc-actions--icon.tt-sc-actions--state-cta>.tt-sc-btn-state{
    grid-column:1!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:38px!important;
    min-height:38px!important;
    padding:0 7px!important;
    border-radius:10px!important;
    font-size:10px!important;
  }
}
