/* START OF FILE: css/ptm-style.css - FULL AND COMPLETE CODE (with !important) */
.related-products-grid {
    display: grid !important;
	grid-template-columns: repeat(4, 1fr) !important;    gap: 20px !important;
    margin: 30px 0 !important;
    padding: 20px !important;
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: var(--ptm-border-radius, 10px) !important;
}
@media (max-width:1200px){ .related-products-grid{grid-template-columns:repeat(3,1fr)!important;} }
@media (max-width:900px){  .related-products-grid{grid-template-columns:repeat(2,1fr)!important;} }
@media (max-width:600px){  .related-products-grid{grid-template-columns:repeat(1,1fr)!important;} }
.related-products-grid.ptm-lazy-animate .product {
    opacity: 0 !important;
    transform: translateY(20px) !important;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}
.related-products-grid.ptm-visible .product {
    opacity: 1 !important;
    transform: translateY(0) !important;
}
.related-products-grid.ptm-visible .product:nth-child(2) { transition-delay: 0.1s !important; }
.related-products-grid.ptm-visible .product:nth-child(3) { transition-delay: 0.2s !important; }
.related-products-grid.ptm-visible .product:nth-child(4) { transition-delay: 0.3s !important; }

.related-products-grid .product {
    background: #ffffff !important;
    border-radius: var(--ptm-border-radius, 10px) !important;
    box-shadow: 0 4px 12px var(--ptm-shadow-color, rgba(0,0,0,0.08)) !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 15px !important;
    text-align: center !important;
	transition: transform .28s ease, box-shadow .28s ease !important;
    will-change: transform, box-shadow;
}
.related-products-grid .product:hover {
	transform: translateY(-3px) !important; /* قبلاً -5px بود */
	box-shadow: 0 10px 20px var(--ptm-shadow-color, rgba(0,0,0,.12)) !important;
}
.related-products-grid .product a { 
    text-decoration: none !important; 
    color: inherit !important; 
    display: block !important; 
}
.related-products-grid .product img {
    width: 100% !important; 
    height: auto !important; 
    aspect-ratio: 1 / 1 !important; 
    object-fit: cover !important;
    border-radius: calc(var(--ptm-border-radius, 10px) - 5px) !important; 
    margin-bottom: 15px !important;
    background-color: #eee !important;
}
.related-products-grid .product .woocommerce-loop-product__title {
    font-size: var(--ptm-title-fs, 16px) !important;
    margin: 0 0 10px !important;
    color: var(--ptm-title-color, #333) !important;
    min-height: 48px !important;
    transition: color 0.3s ease !important;
}
.related-products-grid .product a:hover .woocommerce-loop-product__title {
    color: var(--ptm-title-hover-color, #c20072) !important;
}
.related-products-grid .price {
    font-size: var(--ptm-price-fs, 15px) !important;
    font-weight: bold !important;
    color: var(--ptm-regular-price-color, #555) !important;
    margin-bottom: 10px !important;
}
.related-products-grid .price del, 
.related-products-grid .price del .amount {
    color: var(--ptm-regular-price-color, #555) !important;
    opacity: 0.7 !important;
}
.related-products-grid .price ins, 
.related-products-grid .price ins .amount {
    text-decoration: none !important;
    color: var(--ptm-sale-price-color, #1fb061) !important;
}
.related-products-grid .price > .woocommerce-Price-amount.amount {
    color: var(--ptm-regular-price-color, #555) !important;
}
.related-products-grid .price > del + ins > .woocommerce-Price-amount.amount,
.related-products-grid .price > ins > .woocommerce-Price-amount.amount {
    color: var(--ptm-sale-price-color, #1fb061) !important;
}

.related-products-grid .posted_in { 
    font-size: 12px !important; 
    color: #777 !important; 
    margin-bottom: 10px !important; 
    line-height: 1.4 !important; 
}
.related-products-grid .posted_in a { 
    text-decoration: none !important; 
    color: #555 !important; 
}
.related-products-grid .posted_in a:hover { 
    text-decoration: underline !important; 
}

.related-products-grid .ptm_ajax_add_to_cart {
    position: relative !important; 
    display: inline-block !important;
    background-color: var(--ptm-button-color, #1abc9c) !important;
    color: #fff !important; 
    padding: 10px !important; 
    border: none !important;
    border-radius: 5px !important; 
    text-decoration: none !important; 
    cursor: pointer !important;
    transition: background-color 0.3s ease, color 0.3s ease !important;
    margin-top: auto !important; 
    font-size: 14px !important; 
    width: 100% !important;
    overflow: hidden !important; 
    min-height: 40px !important;
}
.related-products-grid .ptm_ajax_add_to_cart:hover {
    background-color: var(--ptm-button-hover-color, #16a085) !important;
}
.ptm_ajax_add_to_cart .ptm-button-text { 
    transition: opacity 0.2s ease, visibility 0.2s ease !important; 
}
.ptm_ajax_add_to_cart.loading .ptm-button-text { 
    opacity: 0 !important; 
    visibility: hidden !important; 
}
.ptm_ajax_add_to_cart.loading { 
    pointer-events: none !important; 
}
.ptm_ajax_add_to_cart.loading::after {
    content: '' !important; 
    position: absolute !important; 
    width: 20px !important; 
    height: 20px !important;
    top: 50% !important; 
    left: 50% !important; 
    margin: -10px 0 0 -10px !important;
    border: 3px solid rgba(255, 255, 255, 0.3) !important;
    border-top-color: #fff !important; 
    border-radius: 50% !important;
    animation: ptm-spin 0.6s linear infinite !important;
}
/* !important داخل keyframes مجاز نیست؛ این بخش بدون تغییر مانده */
@keyframes ptm-spin { to { transform: rotate(360deg); } }

.ptm_ajax_add_to_cart.success {
    background-color: #27ae60 !important;
}
.ptm-phrase-list { 
    list-style: none !important; 
    margin: 10px 0 !important; 
    padding: 0 !important; 
    max-height: 200px !important; 
    overflow-y: auto !important; 
    border: 1px solid #ddd !important; 
    border-radius: 4px !important; 
    background: #fff !important; 
}
.ptm-phrase-list li { 
    padding: 8px 12px !important; 
    border-bottom: 1px solid #eee !important; 
    display: flex !important; 
    justify-content: space-between !important; 
    align-items: center !important; 
}
.ptm-phrase-list li:last-child { 
    border-bottom: none !important; 
}
.ptm-remove-phrase { 
    cursor: pointer !important; 
    color: #a00 !important; 
    border: 1px solid #fcc !important; 
    background: #ffebe8 !important; 
    border-radius: 50% !important; 
    width: 20px !important; 
    height: 20px !important; 
    line-height: 18px !important; 
    text-align: center !important; 
    font-weight: bold !important; 
}
.ptm-remove-phrase:hover { 
    background: #a00 !important; 
    color: #fff !important; 
    border-color: #a00 !important; 
}
/* END OF FILE: css/ptm-style.css */

/* --- Force Hide WooCommerce's "View Cart" Link --- */

/* This hides the link if it's anywhere inside our product grid */
.related-products-grid .added_to_cart {
    display: none !important;
    visibility: hidden !important;
}

/* This hides the link if it's placed directly after our button */
.related-products-grid .ptm_ajax_add_to_cart + .added_to_cart {
    display: none !important;
    visibility: hidden !important;
}
/* --- Advanced Toast Notification Styles --- */
.ptm-toast-advanced {
  position: fixed !important;
  top: 20px !important;
  left: 20px !important;
  transform: translateX(-120%) !important;
  background-color: #fff !important;
  color: #333 !important;
  padding: 15px 20px !important;
  border-radius: 8px !important;
  z-index: 9999 !important;
  font-size: 15px !important;
  display: flex !important;
  align-items: center !important;
  gap: 15px !important;
  box-shadow: 0 5px 15px rgba(0,0,0,0.15) !important;
  opacity: 0 !important;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}
.ptm-toast-advanced.show {
  transform: translateX(0) !important;
  opacity: 1 !important;
}
.ptm-toast-advanced .toast-icon {
  font-size: 20px !important;
  color: #27ae60 !important;
}
.ptm-toast-advanced a {
  text-decoration: none !important;
  background-color: #f0f0f0 !important;
  color: #333 !important;
  padding: 5px 10px !important;
  border-radius: 5px !important;
  font-size: 13px !important;
  font-weight: bold !important;
}
 .ptm-toast-advanced a:hover {
   background-color: #e0e0e0 !important;
 }

/* کانتینر تصویر برای پوزیشن بج */
.related-products-grid .product .ptm-thumb{ position:relative; }

/* بج درصد خود افزونه (قبلی را فقط background را به این تغییر بده) */
.related-products-grid .product .ptm-off-badge{
  position:absolute; top:10px; right:10px; z-index:10;
  width:34px; height:34px; border-radius:9999px;
  background: var(--ptm-discount-badge-bg, #23c6a0);
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:13px; box-shadow:0 2px 6px rgba(0,0,0,.15);
}

/* === Discount Banner (final, 3 vars only) === */
.ptm-discount-banner{
  position: relative !important;
  overflow: visible !important;
  margin-top:16px !important;
  padding:12px 14px !important;
  border-radius:10px !important;
  background: var(--ptm-discount-banner-bg, #fff) !important;
  color: var(--ptm-discount-banner-text,#333) !important;       /* از تنظیمات: رنگ متن */
  display:flex !important;
  align-items:center !important;
  gap:12px !important;
  flex-wrap:wrap !important;
  box-shadow:0 2px 6px rgba(0,0,0,.06) !important;
  border:1px solid #c2e0da !important;
  direction: rtl !important;
  max-width: 820px !important;
  margin-left:auto !important;
  margin-right:auto !important;
  justify-content: center !important;
}

/* متن راهنما سمت راست */
.ptm-discount-banner > span:not(.ptm-discount-label):not(.ptm-code-group):not(.ptm-discount-code){
  order:1 !important;
  color: var(--ptm-discount-banner-text,#000000) !important;
  font-weight: 700 !important;
}

/* گروه «کد + دکمه» */
.ptm-discount-banner .ptm-code-group{
  order:2 !important;
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  background: rgba(0,0,0,.04) !important;  /* خنثی؛ وابسته به تنظیمات نیست */
  padding:6px 8px !important;
  border-radius:10px !important;
  flex-direction: row-reverse !important; /* کلیدِ حل مشکل */
}

/* کد */
.ptm-discount-banner .ptm-discount-code{
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
  padding:6px 10px !important;
  border-radius:8px !important;
  border:1px dashed #00a313 !important;
  background:#cdf1ee !important;
  color: var(--ptm-discount-banner-text,#000000) !important;       /* از تنظیمات: متن */
}

/* دکمه کپی (از متغیرهای عمومی دکمه) */
.ptm-discount-banner .ptm-copy-code-btn{
  display:inline-grid !important;
  place-items:center !important;
  min-width:86px !important;
  height:32px !important;
  line-height:1 !important;
  padding:0 12px !important;
  border:0 !important;
  border-radius:10px !important;
  cursor:pointer !important;
  background: var(--ptm-button-color,#23c6a0) !important;       /* عمومی */
  color:#fff !important;
  font-weight:600 !important;
}
.ptm-discount-banner .ptm-copy-code-btn:hover{
  background: var(--ptm-button-hover-color,#16a085) !important; /* عمومی */
}

/* بج بالا-راست */
.ptm-discount-banner .ptm-discount-label{
  position:absolute !important;
  top:-10px !important;
  right:18px !important;
  z-index:20 !important;
  background: var(--ptm-discount-badge-bg,#23c6a0) !important;  /* از تنظیمات: رنگ بج */
  color:#fff !important;
  padding:4px 10px !important;
  border-radius:8px !important;
  font-weight:800 !important;
  box-shadow:0 6px 14px rgba(0,0,0,.12) !important;
}
.ptm-discount-banner .ptm-discount-label::after{
  content:"" !important;
  position:absolute !important;
  top:100% !important;
  right:16px !important;
  border:7px solid transparent !important;
  border-top-color: var(--ptm-discount-badge-bg,#23c6a0) !important; /* مثلث بج */
}