/* ==========================================🎨 استایل کاروسل محصولات - بهینه‌شده ========================================== */
.recently-updated-products {
position: relative;
    overflow: hidden;
    border-radius: 12px;
    padding: 1rem;
    transition: background 0.3s ease;
}
.recently-updated-products img {
  width: 100%;
  height: 220px; /* ارتفاع ثابت برای تصویر */
  object-fit: cover; /* برش متناسب تصویر */
  border-radius: 10px;
}

.index-prices-pro {
    height: 45px;
}
.price_onsale_ar {
  float: left;
	text-align: left;
}
.index-prices-pro .index-discount-pro {
    background-color: bisque;
}
@media (max-width: 990px) {
    .index-prices-pro {
        height: 45px;
        margin: auto;
    }
}

/* لایت‌آوت اولیه - قبل از JavaScript */
.recently-updated-products .swiper-wrapper {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    transform: all 0.3s ease;
}


/* موبایل */
@media (max-width: 1024px) {
    .recently-updated-products .swiper-wrapper {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .recently-updated-products .swiper-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* وقتی Swiper آماده شد */
.recently-updated-products.swiper-ready .swiper-wrapper {
    display: flex !important;
    grid-template-columns: none !important;
}


/*📦 کارت محصول */
.product-card-baha {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.25,0.8,0.25,1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.product-card-baha img {
  width: 100%;
  height: 220px; /* ارتفاع ثابت برای تصویر */
  object-fit: cover; /* برش متناسب تصویر */
  border-radius: 10px;
}
.product-card-baha:hover {
    transform: translateY(-0.5rem);
    border-color: rgba(44,90,160,0.2);
}

/*🖼️ تصویر محصول */
.product-image-wrapper {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
}

.product-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25,0.8,0.25,1);
}

.product-card-baha:hover .product-thumb {
    transform: scale(1.08);
}

.product-thumb.placeholder {
    opacity: 0.7;
    filter: grayscale(0.3);
}

/* 🔥 نشان حراج */
.sale-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: linear-gradient(45deg, #ff4757, #ff3838);
    color: #fff;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 2px 8px rgba(255,71,87,0.4);
    animation: pulse 2s infinite;
    z-index: 10;
}

@keyframes pulse {
    0%,100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 📝 عنوان محصول */
.product-title-baha {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #2c3e50;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8em;
    flex-grow: 1;
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-link:hover .product-title-baha {
    color: #2c5aa0;
}

/* 💰 قیمت محصول */
.product-price {
    font-weight: 700;
    
    color: #27ae60;
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
    align-items: stretch;
margin-top: 10px;
}

.product-price div span.woocommerce-Price-amount price_sale {
font-size: clamp(1rem, 1vw + 0.5rem, 1.1rem)!important;
}

.product-price .woocommerce-Price-amount {
    font-weight: 800;
}

.product-price del {
    color: #95a5a6;
    font-weight: 400;
    font-size: 0.9rem;
}

.product-price ins {
    text-decoration: none;
    color: #e74c3c;
    font-weight: 800;
}

/* ⭐ امتیاز محصول */
.product-rating {
    padding: 0 1rem 1.2rem;
    margin-top: auto;
}

.star-rating {
    font-size: 0.875rem;
    color: #f39c12;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* 🎮 دکمه‌های ناوبری */
.swiper-button-next,
.swiper-button-prev {
    color: #2c5aa0;
    background: rgba(255,255,255,0.95);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(44,90,160,0.15), 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid rgba(44,90,160,0.1);
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: rgba(44,90,160,0.1);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(44,90,160,0.25), 0 3px 6px rgba(0,0,0,0.15);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 1.125rem;
    font-weight: 700;
}

.swiper-button-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 🔴 نقاط صفحه‌بندی */
.swiper-pagination {
    bottom: -0.625rem;
    padding: 1.25rem 0;
}

.swiper-pagination-bullet {
    width: 0.75rem;
    height: 0.75rem;
    background: rgba(44,90,160,0.3);
    opacity: 1;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background: #2c5aa0;
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(44,90,160,0.4);
}

/* 📱 ریسپانسیو */
@media (max-width: 768px) {
    .recently-updated-products { padding: 0.5rem; }
    .swiper-button-next, .swiper-button-prev { width: 2.5rem; height: 2.5rem; }
    .product-title-baha {  }
    .product-price { font-size: 1rem; }
    .product-rating { padding: 0 0.8rem 1rem; }
}

@media (max-width: 480px) {
    .swiper-button-next, .swiper-button-prev { display: none; }
    .recently-updated-products, .product-card-baha { border-radius: 8px; padding: 10px; }
}

/* 🎯 حالت بارگذاری */
.recently-updated-products.loading {
    opacity: 0.7;
    pointer-events: none;
}

.recently-updated-products.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.5rem;
    height: 2.5rem;
    border: 0.25rem solid rgba(44,90,160,0.2);
    border-top: 0.25rem solid #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 🔄 انیمیشن بارگذاری */
.recently-updated-products:not(.swiper-initialized) {
    position: relative;
    min-height: 300px;
}

.recently-updated-products:not(.swiper-initialized)::before {
    content: '⏳ در حال بارگذاری...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    color: #666;
    z-index: 10;
}

.recently-updated-products:not(.swiper-initialized) .swiper-wrapper {
    opacity: 0.3;
}


/* 🚫 حالت خطا */
.wc-error,
.no-products {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

/* 🔍 دسترسی و SEO */
.product-card-baha:focus-within,
.swiper-button-next:focus,
.swiper-button-prev:focus {
    outline: 3px solid rgba(44,90,160,0.5);
    outline-offset: 2px;
}

/*🌙 حالت تیره */
@media (prefers-color-scheme: dark) {
    .recently-updated-products { background: linear-gradient(135deg,#2c3e50 0%,#34495e 100%); }
    .product-card-baha { background: #34495e; border-color: rgba(255,255,255,0.1); color: #ecf0f1; }
    .product-title-baha { color: #ecf0f1; }
    .product-link:hover .product-title-baha { color: #74b9ff; }
    .swiper-button-next, .swiper-button-prev { background: rgba(44,62,80,0.95); color: #74b9ff; }
}




.recipe-container2 {
  background: rgba(189, 181, 181, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 25px;
  padding: 30px 0;
  width: min(1200px, 100%);
}

.recipe-container2 h1 {
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  color: #dda3b6;
  margin: 20px 0 40px;
}

.swiper2 {
  width: 80%;
  height: 100%;
  margin-bottom: 30px;
}

.swiper-scrollbar2 {
  --swiper-scrollbar-bottom: 0;
  --swiper-scrollbar-drag-bg-color: #dda3b6;
  --swiper-scrollbar-size: 5px;
}

.post2 {
  max-width: 400px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--clr-text);
  background: rgba(236, 149, 200, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 16px 16px 0;
  margin-bottom: 16px;
}

.post-img2 {
  width: 100%;
  max-width: 400px;
  object-fit: cover;
  overflow: hidden;
  aspect-ratio: 4/3;
  border-radius: 6px;
  user-select: none;
  pointer-events: none;
}

.post-body2 {
  display: grid;
  grid-template-columns: 15% 60% 20%;
  align-items: center;
  gap: 8px;
  padding: 15px 0;
  cursor: default;
}

.post-name2 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-author2 {
  width: fit-content;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.6;
  color: var(--clr-text);
}

.post-avatar2 {
  width: 40px;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 5px;
  cursor: pointer;
}

.post-actions2 {
  position: relative;
}

.post-actions-content2 {
  position: absolute;
  bottom: 130%;
  right: 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(172, 172, 172, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 2px 2px 10px 2px hsl(0, 0%, 0%, 0.25);
  transition: opacity 0.25s, scale 0.25s;
  transform-origin: bottom right;
}

.post-actions-content2[data-visible="false"] {
  pointer-events: none;
  opacity: 0;
  scale: 0;
}

.post-actions-content2[data-visible="true"] {
  pointer-events: unset;
  scale: 1;
  opacity: 1;
}

.post-actions-content2 li {
  padding: 0.5rem 0.65rem;
  border-radius: 0.25rem;
  list-style: none;
}

.post-actions-content2 li:is(:hover, :focus-within) {
  background-color: rgba(248, 132, 169, 0.7);
}

.post-actions-link2 {
  width: max-content;
  display: grid;
  grid-template-columns: 1rem 1fr;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.post-like2 {
  text-decoration: none;
  color: var(--clr-text);
  margin-right: 5px;
  font-size: 1.1rem;
  opacity: 0.65;
  border-radius: 50%;
  overflow: hidden;
  transition: all 0.35s ease;
}

.post-actions-controller2 {
  border: 0;
  background: none;
  color: var(--clr-text);
  cursor: pointer;
  opacity: 0.65;
}

.post-like2:hover,
.post-actions-controller:hover {
  opacity: 1;
}

.post-like2:focus {
  outline: none;
}

.post-like2.active {
  color: rgb(255, 0, 0);
  opacity: 1;
  transform: scale(1.2);
}

/* MEDIA QUERIES */

@media (max-width: 1200px) { 
  .swiper2 {
      width: 80%;
    }
}

@media (max-width: 900px) {
  #recipes {
    padding: 60px 80px;
  }

  .swiper2 {
    width: 50%;
  }
}

@media (max-width: 765px) {
  .swiper2 {
    width: 70%;
  }
}

@media (max-width: 550px) {
  #recipes {
    padding: 40px 40px;
  }

  .swiper2 {
    width: 80%;
  }
}
