/* =========================================================================
 *  Product card V4 (Figma «Product card - Mobile - V4») — روی کارت V3 override
 *  دسکتاپ: ۲۸۲px / پدینگ ۱۶ — موبایل: ۳۲۰px / پدینگ ۲۰
 * ====================================================================== */

@media (min-width: 768px) {
  /* Keep the price columns readable when the filters leave less space. */
  .tk-archive-v2 ul.products.tk_v3_grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr));
  }
  .tk-archive-v2 .tk_v3_card { min-height: 520px; }
}

@media (min-width: 1024px) {
  main.tk-archive-v2:not(.tk-brand-v2) ul.products.tk_v3_grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  main.tk-archive-v2:not(.tk-brand-v2) ul.products.tk_v3_grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1600px) {
  main.tk-archive-v2:not(.tk-brand-v2) ul.products.tk_v3_grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---- top: تصویر ۱۰۸، بج‌های شناور در سمت راست ---- */
.tk-archive-v2 .tk_v3_card .tk_v3_top {
  gap: 12px;
  padding: 12px 16px 16px;
}
.tk-archive-v2 .tk_v3_card .tk_v3_thumb_link,
.tk-archive-v2 .tk_v3_card .tk_v3_thumb {
  width: 108px;
  height: 108px;
}
.tk-archive-v2 .tk_v3_card .tk_v3_float_badges {
  top: 16px;
  right: 20px;
  align-items: flex-start;
  gap: 4px;
}
.tk-archive-v2 .tk_v3_card .tk_v3_fbadge {
  height: 24px;
  gap: 4px;
  padding: 0 4px 0 8px;
  background: #FFFFFF;
  box-shadow: 0 0 1px #7E928F;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.tk-archive-v2 .tk_v3_card .tk_v3_fbadge:hover { background: #F5F6F6; }
.tk-archive-v2 .tk_v3_card .tk_v3_fbadge_txt {
  font-weight: 400;
  font-size: 10px;
  line-height: 110%;
  letter-spacing: 0;
}
.tk-archive-v2 .tk_v3_card .tk_v3_fbadge img,
.tk-archive-v2 .tk_v3_card .tk_v3_fbadge_store img {
  width: 16px;
  height: 16px;
}

/* «موجود» روی تصویر، سمت راست (top:100) — عنوان بلافاصله زیر تصویر */
.tk-archive-v2 .tk_v3_card .tk_v3_head { gap: 0; }
.tk-archive-v2 .tk_v3_card .tk_v3_title {
  height: calc(13px * 1.9 * 3);
  padding: 0;
  font-size: 13px !important;
}
.tk-archive-v2 .tk_v3_card .tk_v3_title a { font-weight: 450; }
.tk-archive-v2 .tk_v3_card .tk_v3_stock {
  position: absolute;
  top: 100px;
  right: 20px;
  z-index: 3;
  height: 24px;
  padding: 0 6px 0 8px;
  border: 0;
  background: #FFFFFF;
  box-shadow: 0 0 1px #7E928F;
  font-size: 12px;
  font-weight: 400;
  color: #394040;
}
.tk-archive-v2 .tk_v3_card .tk_v3_stock .tk_v3_ico { width: 14px; height: 14px; }
.tk-archive-v2 .tk_v3_card .tk_v3_stock_ph { display: none; }

@media (min-width: 768px) {
  .tk-archive-v2 .tk_v3_card .tk_v3_float_badges,
  .tk-archive-v2 .tk_v3_card .tk_v3_stock {
    right: 16px;
  }
}

/* ---- bottom ---- */
.tk-archive-v2 .tk_v3_card .tk_v3_bottom {
  gap: 8px;
  padding: 0 16px 16px;
}
.tk-archive-v2 .tk_v3_card .tk_v3_priceblock { gap: 12px; }
.tk-archive-v2 .tk_v3_card .tk_v3_actions { gap: 8px; }

/* بج‌های وضعیت قیمت: متن بدون زمینه، ۱۲/۵۰۰ */
.tk-archive-v2 .tk_v3_card .tk_v3_fresh,
.tk-archive-v2 .tk_v3_card .tk_v3_currency {
  height: auto;
  min-height: 17px;
  padding: 0 4px 0 6px;
  background: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
/* قیمت ساده (بدون پله) — قیمت در سمت چپ، وضعیت قیمت بالای دکمه */
.tk-archive-v2 .tk_v3_card .tk_v3_priceblock .tk_v3_price_row {
  height: auto;
  min-height: 0;
  padding: 4px 2px 6px;
  justify-content: flex-end;
}
/* Keep the two amounts in the same RTL grid column, with a shared left edge. */
.tk-archive-v2 .tk_v3_card .tk_v3_price_col,
.tk-archive-v2 .tk_v3_card .tkdp-v4-pricecol {
  display: grid;
  align-items: center;
  gap: 2px;
}
.tk-archive-v2 .tk_v3_card .tk_v3_price_col { flex: 0 0 auto; }
.tk-archive-v2 .tk_v3_card .tk_v3_price_now,
.tk-archive-v2 .tk_v3_card .tkdp-v4-price { display: contents; }
.tk-archive-v2 .tk_v3_card .tk_v3_price_num,
.tk-archive-v2 .tk_v3_card .tkdp-v4-price .tkdp-v4-num {
  grid-area: 1 / 1;
  justify-self: end;
}
.tk-archive-v2 .tk_v3_card .tk_v3_price_cur,
.tk-archive-v2 .tk_v3_card .tkdp-v4-price small {
  grid-area: 1 / 2;
  white-space: nowrap;
}
.tk-archive-v2 .tk_v3_card .tk_v3_price_old,
.tk-archive-v2 .tk_v3_card .tkdp-v4-ref {
  grid-area: 2 / 1;
  justify-self: end;
  white-space: nowrap;
}
.tk-archive-v2 .tk_v3_card .tk_v3_price_num { font-size: 16px; font-weight: 600; }
.tk-archive-v2 .tk_v3_card .tk_v3_price_cur { font-size: 10px; color: #394040; }
.tk-archive-v2 .tk_v3_card .tk_v3_discount {
  direction: ltr;
  height: 14px;
  min-width: 21px;
  padding: 1px 2px 0;
  border-radius: 4px;
  background: #FFFFFF;
  box-shadow: 0 0 1px #ED1C24;
  font-size: 12px;
  line-height: 14px;
  color: #394040;
}

/* ---- دکمه‌ها ---- */
.tk-archive-v2 .tk_v3_card .tk_v3_actions .tk_v3_btn {
  height: auto;
  min-height: 36px;
  padding-block: 6px;
}
.tk-archive-v2 .tk_v3_card .tk_v3_actions .tk_v3_btn_inquiry {
  border-width: 1px;
  padding-inline: 16px;
  gap: 8px;
}
.tk-archive-v2 .tk_v3_card .tk_v3_inquiry_success {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: auto;
  min-height: 36px;
  padding: 6px 16px;
  border-radius: 2px;
  background: rgba(4, 114, 77, .08);
  color: #04724D;
  font-size: 12px;
  font-weight: 600;
}
.tk-archive-v2 .tk_v3_card .tk_v3_inquiry_success[hidden] { display: none; }
.tk-archive-v2 .tk_v3_card .tk_v3_actions .tk_v3_btn_ghost {
  border-radius: 4px;
  padding: 6px 20px 6px 16px;
  color: #394040;
}
.tk-archive-v2 .tk_v3_card .tk_v3_cart_row { gap: 8px; }
.tk-archive-v2 .tk_v3_card .quantity { gap: 0; }
.tk-archive-v2 .tk_v3_card .quantity .plus,
.tk-archive-v2 .tk_v3_card .quantity .minus,
.tk-archive-v2 .tk_v3_card .quantity .trash {
  flex-basis: clamp(36px, 36%, 48px);
  background-color: #FFFFFF;
}
.tk-archive-v2 .tk_v3_card .quantity .plus { border-inline-end: 1px solid #E4E9E9; }
.tk-archive-v2 .tk_v3_card .quantity .minus,
.tk-archive-v2 .tk_v3_card .quantity .trash { border-inline-start: 1px solid #E4E9E9; }

/* ---- بلوک قیمت عمده (tkdp-v4) ---- */
.tk-archive-v2 .tk_v3_card .tkdp-card.tkdp-v4 {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.tk-archive-v2 .tk_v3_card .tkdp-v4-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 400;
  line-height: 140%;
  color: #060707;
}
.tk-archive-v2 .tk_v3_card .tkdp-v4-cart { flex: none; order: -1; }
.tk-archive-v2 .tk_v3_card .tkdp-v4-box {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #F5F6F6;
  border-radius: 4px;
  overflow: hidden;
}
.tk-archive-v2 .tk_v3_card .tkdp-v4-row {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding: 2px;
  background: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
  line-height: 140%;
  color: #060707;
}
.tk-archive-v2 .tk_v3_card .tkdp-v4-row.is-big { align-items: flex-start; padding: 4px 2px 6px; }
.tk-archive-v2 .tk_v3_card .tkdp-v4-label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: start;
  overflow-wrap: anywhere;
}
.tk-archive-v2 .tk_v3_card .tkdp-v4-row.is-big .tkdp-v4-label { padding-top: 2px; }
.tk-archive-v2 .tk_v3_card .tkdp-v4-label-unit {
  font-size: 10px;
  font-weight: 400;
  color: #394040;
}
.tk-archive-v2 .tk_v3_card .tkdp-v4-pricecol { flex: none; }
.tk-archive-v2 .tk_v3_card .tkdp-v4-num { white-space: nowrap; }
.tk-archive-v2 .tk_v3_card .tkdp-v4-num,
.tk-archive-v2 .tk_v3_card .tkdp-v4-ref { line-height: 1.4; }
.tk-archive-v2 .tk_v3_card .tkdp-v4-price .tkdp-v4-pct {
  grid-area: 1 / 3;
  margin-inline-start: 6px;
}
.tk-archive-v2 .tk_v3_card .tkdp-v4-row.is-big .tkdp-v4-num { font-size: 16px; font-weight: 600; }
.tk-archive-v2 .tk_v3_card .tkdp-v4-price small { font-size: 10px; font-weight: 500; color: #394040; }
.tk-archive-v2 .tk_v3_card .tkdp-v4-ref {
  padding-left: 0;
  font-size: 11px;
  font-weight: 400;
  color: #7E928F;
  text-decoration: line-through;
}
.tk-archive-v2 .tk_v3_card .tkdp-v4-pct {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 14px;
  min-width: 21px;
  padding: 1px 2px 0;
  border-radius: 4px;
  background: #FFFFFF;
  box-shadow: 0 0 1px #ED1C24;
  font-size: 12px;
  font-weight: 500;
  line-height: 14px;
  color: #394040;
}
.tk-archive-v2 .tk_v3_card .tkdp-v4-pct.is-empty { visibility: hidden; }
.tk-archive-v2 .tk_v3_card .tkdp-v4-call {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 6px 16px 6px 20px;
  background: #F5F6F6;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 500;
  color: #060707;
  text-decoration: none;
}
.tk-archive-v2 .tk_v3_card .tkdp-v4-call-desktop {
  width: 100%;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.tk-archive-v2 .tk_v3_card .tkdp-v4-call-mobile { display: none; }
@media (width < 768px) {
  .tk-archive-v2 .tk_v3_card .tkdp-v4-call-desktop { display: none; }
  .tk-archive-v2 .tk_v3_card .tkdp-v4-call-mobile { display: flex; }
}
.tk-archive-v2 .tk_v3_card .tkdp-v4-call:hover { background: #E4E9E9; }
.tk-archive-v2 .tk_v3_card .tkdp-v4-call svg { transform: scaleX(-1); }
.tk-archive-v2 .tk_v3_card .tkdp-v4 .tk_v3_fresh {
  margin-top: 6px;
  align-self: flex-start;
}

@media (width < 768px) {
  .tk-archive-v2 ul.products.tk_v3_grid { grid-template-columns: minmax(0, 1fr); }
  main.tk-archive-v2:not(.tk-brand-v2) ul.products.tk_v3_grid {
    /* Cancel the section's 20px inset before sizing the grid against the page. */
    box-sizing: border-box;
    margin-inline: -20px !important;
    padding-inline: clamp(0px, (100% - 280px) / 2, 40px);
  }
  .tk-archive-v2 .tk_v3_card {
    min-width: 0;
    max-width: 360px;
    justify-self: center;
  }
  .tk-archive-v2 .tk_v3_card .tk_v3_top { padding: 12px 20px 16px; }
  .tk-archive-v2 .tk_v3_card .tk_v3_bottom { padding: 0 20px 16px; }
  .tk-archive-v2 .tk_v3_card .tk_v3_stock { font-size: 11px; font-weight: 500; }
  .tk-archive-v2 .tk_v3_card .tkdp-v4-head { font-size: 11px; }
  .tk-archive-v2 .tk_v3_card .tkdp-v4-label-unit { font-size: 9px; }
}

/* Archive confirmation */
.tk-archive-v2 .tk_archive_cart_toast {
  position: fixed;
  z-index: 9999999999;
  --tk-cart-toast-top: 120px;
  top: var(--tk-cart-toast-top);
  left: 50%;
  box-sizing: border-box;
  width: min(312px, calc(100% - 32px));
  min-height: 56px;
  display: flex;
  direction: rtl;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 4px;
  background: #fff;
  color: #060707;
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  box-shadow: 0 12px 20px #00000026;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - var(--tk-cart-toast-top)));
  transition: opacity .18s ease, transform .18s ease;
}
.tk_archive_cart_toast_icon {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #25f893;
}
@media (width < 768px) {
  .tk-archive-v2 .tk_archive_cart_toast {
    --tk-cart-toast-top: 80px;
    width: min(280px, calc(100% - 32px));
    font-size: 14px;
  }
}
.tk-archive-v2 .tk_archive_cart_toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (prefers-reduced-motion: reduce) {
  .tk-archive-v2 .tk_archive_cart_toast { transition: none; }
}
