/* TF Product Card widgets — base layout helpers */

.tf-pco-brand img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}

.tf-pco-brand__placeholder {
  display: inline-block;
  padding: 8px 12px;
  background: #f0f0f1;
  color: #646970;
  font-size: 12px;
  border-radius: 2px;
}

.tf-pco-image {
  text-align: center;
}

.tf-pco-image img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

.tf-pco-title {
  margin: 0;
}

/* Theme/Woo often set font-size on <a>; inherit so Elementor typography on .tf-pco-title wins. */
.tf-pco-title a {
  text-decoration: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-style: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.tf-pco-price-label {
  margin-bottom: 4px;
}

.tf-pco-price .price,
.tf-pco-price .amount,
.tf-pco-price del,
.tf-pco-price ins,
.tf-pco-price bdi,
.tf-pco-price .woocommerce-Price-amount,
.tf-pco-price .woocommerce-Price-currencySymbol {
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: #000 !important;
}

.tf-pco-price del,
.tf-pco-price del .amount,
.tf-pco-price del bdi,
.tf-pco-price del .woocommerce-Price-currencySymbol {
  text-decoration: line-through !important;
  text-decoration-color: #07502c !important;
  text-decoration-thickness: 2px;
}

.tf-pco-price ins,
.tf-pco-price ins .amount,
.tf-pco-price ins bdi,
.tf-pco-price ins .woocommerce-Price-currencySymbol {
  text-decoration: none !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  font-weight: inherit;
}

.tf-pco-attributes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.tf-pco-attributes__icon,
.tf-pco-attr-icon {
  display: inline-block;
  width: 22px;
  height: 14px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Cpath fill='%23000' d='M5 11l1.5-4.5A2 2 0 018.4 5h7.2a2 2 0 011.9 1.5L19 11h1a1 1 0 011 1v2a1 1 0 01-1 1h-1.1a2.5 2.5 0 01-4.8 0H9.9a2.5 2.5 0 01-4.8 0H4a1 1 0 01-1-1v-2a1 1 0 011-1h1zm2.5 3a1.5 1.5 0 100-3 1.5 1.5 0 000 3zm9 0a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM8.4 7l-1 3h9.2l-1-3H8.4z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Cpath fill='%23000' d='M5 11l1.5-4.5A2 2 0 018.4 5h7.2a2 2 0 011.9 1.5L19 11h1a1 1 0 011 1v2a1 1 0 01-1 1h-1.1a2.5 2.5 0 01-4.8 0H9.9a2.5 2.5 0 01-4.8 0H4a1 1 0 01-1-1v-2a1 1 0 011-1h1zm2.5 3a1.5 1.5 0 100-3 1.5 1.5 0 000 3zm9 0a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM8.4 7l-1 3h9.2l-1-3H8.4z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.tf-pco-attributes__text {
  margin-left: auto;
  text-align: right;
}

.tf-pco-attr {
  display: inline-block;
  line-height: 1.3;
}

.tf-pco-qty {
  display: inline-flex;
  align-items: stretch;
}

.tf-pco-qty button,
.tf-pco-qty input {
  box-sizing: border-box;
  border: 1px solid #ccc;
  background: #fff;
  height: 40px;
  margin: 0;
}

.tf-pco-qty button {
  width: 36px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.tf-pco-qty input {
  width: 48px;
  text-align: center;
  border-left: 0;
  border-right: 0;
  -moz-appearance: textfield;
}

.tf-pco-qty input::-webkit-outer-spin-button,
.tf-pco-qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Beat theme a.button radius/padding so Elementor Style wins */
.tf-pco-atc,
a.button.tf-pco-atc,
a.tf-pco-atc.add_to_cart_button {
  display: inline-block !important;
  float: none !important;
  text-align: center;
  text-decoration: none !important;
  border: 0;
  cursor: pointer;
  box-sizing: border-box;
  margin: 0 !important;
}

/* Hide Woo AJAX “View cart” next to ATC */
.tf-pco-card a.added_to_cart,
.tf-pco-card-item a.added_to_cart,
li.product.tf-pco-card-item a.added_to_cart,
.tf-pco-starter-actions a.added_to_cart,
.tf-pco-starter-bottom a.added_to_cart {
  display: none !important;
}

/* Hide (+ 15% Vat) if theme injects a class/span we didn't strip */
.tf-pco-price .price .vat,
.tf-pco-price .vat-suffix,
.tf-pco-price .woocommerce-price-suffix {
  display: none !important;
}

.tf-pco-offer-tag--text {
  display: inline-block;
  font-weight: 600;
  line-height: 1.2;
}

.tf-pco-offer-tag--image img {
  display: block;
  max-width: 100%;
  height: auto;
}

.tf-pco-offer-cards {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.tf-pco-offer-card-pill {
  display: inline-block;
  border: 1px solid currentColor;
  border-radius: 2px;
  line-height: 1.3;
  font-weight: 600;
}

/* Neutralize Woo default circular onsale so Elementor radius controls work in editor + frontend */
/* .tf-pco-sale-flash .onsale,
.woocommerce .tf-pco-sale-flash span.onsale,
.woocommerce ul.products li.product .tf-pco-sale-flash span.onsale {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  margin: 0 !important;
  border-radius: 50% !important;
  min-height: 0 !important;
  font-weight: 700;
  text-align: center;
  box-shadow: none !important;
} */

/* Shop grid when TF Elementor cards are used */
.woocommerce ul.products:has(.tf-pco-card),
.woocommerce-page ul.products:has(.tf-pco-card) {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px !important;
  float: none !important;
  clear: both;
}

.woocommerce ul.products.columns-2:has(.tf-pco-card),
.woocommerce-page ul.products.columns-2:has(.tf-pco-card) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.woocommerce ul.products.columns-4:has(.tf-pco-card),
.woocommerce-page ul.products.columns-4:has(.tf-pco-card) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.woocommerce ul.products:has(.tf-pco-card)::before,
.woocommerce ul.products:has(.tf-pco-card)::after {
  display: none !important;
  content: none !important;
}

.woocommerce ul.products:has(.tf-pco-card) li.product,
.woocommerce-page ul.products:has(.tf-pco-card) li.product,
.woocommerce ul.products li.product.tf-pco-card-item {
  width: auto !important;
  max-width: none !important;
  float: none !important;
  margin: 0 !important;
  clear: none !important;
  height: auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.tf-pco-card {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #fff;
  box-sizing: border-box;
}

.tf-pco-card .elementor,
.tf-pco-card .elementor-element.e-con.tf-pco-starter-card,
.tf-pco-starter-card,
.tf-pco-card .elementor > .e-con.e-parent {
  height: 100% !important;
  min-height: 100%;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box;
}

.tf-pco-starter-top {
  flex: 0 1 auto;
  width: 100%;
}

.tf-pco-starter-bottom {
  flex: 0 0 auto;
  width: 100%;
  margin-top: auto;
}

@media (max-width: 768px) {
  .woocommerce ul.products:has(.tf-pco-card),
  .woocommerce-page ul.products:has(.tf-pco-card) {
    grid-template-columns: 1fr;
    gap: 16px !important;
  }
}

@media (max-width: 480px) {
  .woocommerce ul.products:has(.tf-pco-card),
  .woocommerce-page ul.products:has(.tf-pco-card) {
    grid-template-columns: 1fr;
  }
}

/* Starter layout helpers only.
 * :where() keeps specificity at 0 so Elementor Style controls always win. */
:where(.tf-pco-starter-card) {
  height: 100%;
  box-sizing: border-box;
}

:where(.tf-pco-starter-title) .tf-pco-title {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
  color: #1d2327;
}

:where(.tf-pco-starter-attrs) .tf-pco-attributes,
:where(.tf-pco-starter-attrs-bar) {
  font-size: 12px;
  color: #3c434a;
  border-radius: 2px;
}

:where(.tf-pco-starter-price) .tf-pco-price {
  font-size: 18px;
  font-weight: 700;
  color: #07502c;
}

:where(.tf-pco-starter-price) .tf-pco-price-label {
  font-size: 12px;
  font-weight: 400;
  color: #646970;
}

:where(.tf-pco-starter-atc) .tf-pco-atc {
  flex: 1 1 auto;
  width: 100%;
  font-weight: 700;
  letter-spacing: 0.02em;
}

:where(.tf-pco-starter-actions) {
  width: 100%;
}

:where(.tf-pco-starter-tag) .tf-pco-offer-tag--text {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 0 0 0 4px;
}

:where(.tf-pco-starter-tag) .tf-pco-offer-tag--image img {
  max-width: 140px;
}

:where(.tf-pco-starter-cards) .tf-pco-offer-card-pill {
  font-size: 11px;
  padding: 3px 8px;
}
