/* =========================================================
   MahakShop Child — Homepage product grid hotfix v1.5.3
   هدف: فقط اصلاح تعداد ستون‌ها و چینش قیمت، بدون یکسان‌سازی استایل کارت‌ها
   ========================================================= */

body.mahak-home-product-grid-ready,
body.mahak-home-product-grid-ready .mahak-home-premium {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.mahak-home-product-grid-ready .mahak-home-premium main,
body.mahak-home-product-grid-ready .mahak-home-premium .site-header,
body.mahak-home-product-grid-ready .mahak-home-premium .site-footer {
  width: 100%;
  max-width: 100%;
}

body.mahak-home-product-grid-ready .mahak-home-premium .container {
  max-width: 1380px;
  margin-inline: auto;
}

/* دسکتاپ: همه گریدهای محصول صفحه اصلی چهارستونه */
body.mahak-home-product-grid-ready .mahak-home-premium .product-grid,
body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid,
body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--masala,
body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric,
body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--saffron,
body.mahak-home-product-grid-ready .mahak-home-premium .mahak-home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px;
  align-items: stretch;
}

body.mahak-home-product-grid-ready .mahak-home-premium .product-grid>.product-card,
body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid>.product-card {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 100%;
}

/* کارت پرفروش‌ها روی ۴ ستون، بدون بهم‌زدن زبان طراحی قبلی */
body.mahak-home-product-grid-ready .mahak-home-premium .mahak-home-basic-card {
  min-width: 0;
}

body.mahak-home-product-grid-ready .mahak-home-premium .mahak-home-basic-card .product-card__title {
  min-height: 44px;
  line-height: 1.55;
}

body.mahak-home-product-grid-ready .mahak-home-premium .mahak-home-basic-card .product-card__meta {
  min-height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* قیمت خطی: کنترل layout سطح بالاتر فقط؛ استایل خود قیمت در product-card-price.css */
body.mahak-home-product-grid-ready .mahak-home-premium .mahak-home-product-price,
body.mahak-home-product-grid-ready .mahak-home-premium .product-card__deal {
  min-width: 0;
}

body.mahak-home-product-grid-ready .mahak-home-premium .product-card__deal {
  flex-wrap: nowrap;
}

body.mahak-home-product-grid-ready .mahak-home-premium .product-card__sale-side {
  min-width: 0;
  flex: 1 1 auto;
}

/* اندازه‌های ظریف‌تر برای چهارستونه شدن، بدون تغییر نوع کارت‌ها */
body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card__media--masala {
  height: 178px;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card__media--saffron {
  height: 148px;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card--turmeric {
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card__media--turmeric {
  height: 124px;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card__pills {
  flex-wrap: wrap;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card__pill {
  min-width: 0;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card__button {
  min-width: 0;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card__button span,
body.mahak-home-product-grid-ready .mahak-home-premium .product-grid .btn--cart span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1199px) {

  body.mahak-home-product-grid-ready .mahak-home-premium .product-grid,
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid,
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--masala,
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric,
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--saffron,
  body.mahak-home-product-grid-ready .mahak-home-premium .mahak-home-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px;
  }
}

@media (max-width: 900px) {

  body.mahak-home-product-grid-ready .mahak-home-premium .product-grid,
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid,
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--masala,
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric,
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--saffron,
  body.mahak-home-product-grid-ready .mahak-home-premium .mahak-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card--turmeric {
    grid-template-columns: 1fr;
    direction: rtl;
  }

  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card__media--turmeric {
    height: 136px;
  }
}

@media (max-width: 420px) {

  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card__media--masala,
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card__media--saffron,
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card__media--turmeric {
    height: 132px;
  }

  body.mahak-home-product-grid-ready .mahak-home-premium .product-card__price-current>span,
  body.mahak-home-product-grid-ready .mahak-home-premium .product-card__sale-price span {
    font-size: 13px !important;
  }

  body.mahak-home-product-grid-ready .mahak-home-premium .product-card__price-old>span,
  body.mahak-home-product-grid-ready .mahak-home-premium .product-card__old-price>span {
    font-size: 9.5px !important;
  }
}

/* =========================================================
   PYM v1.5.11 — Turmeric card action alignment, safe
   فقط فاصله و جایگاه دکمه‌های کارت زردچوبه را اصلاح می‌کند؛
   قیمت و محتوای کارت دیگر به پایین کارت هل داده نمی‌شوند.
   ========================================================= */
body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric .product-card--turmeric {
  align-items: stretch !important;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric .product-card--turmeric .product-card__body--turmeric {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  height: auto !important;
  min-height: 0 !important;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric .product-card--turmeric .product-card__deal,
body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric .product-card--turmeric .mahak-card-price-box {
  margin-top: 8px !important;
  min-height: 58px !important;
  display: flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric .product-card--turmeric .product-card__dashed-divider {
  flex: 0 0 auto !important;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric .product-card--turmeric .product-card__dashed-divider--tight {
  margin: 8px 0 !important;
  flex: 0 0 auto !important;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric .product-card--turmeric .product-card__actions--turmeric {
  margin-top: 0 !important;
  flex: 0 0 auto !important;
}

@media (max-width: 900px) {
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric .product-card--turmeric .product-card__deal,
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric .product-card--turmeric .mahak-card-price-box {
    min-height: 54px !important;
  }
}

/* =========================================================
   PYM v1.5.14 — final requested homepage refinements
   ========================================================= */
body.mahak-home-product-grid-ready .mahak-home-premium .hero-pill,
body.mahak-home-product-grid-ready .mahak-home-premium .hero-pill:visited,
body.mahak-home-product-grid-ready .mahak-home-premium .hero-pill:hover,
body.mahak-home-product-grid-ready .mahak-home-premium .hero-pill:focus {
  color: #ffffff !important;
}

body.mahak-home-product-grid-ready .mahak-home-premium .hero-pill svg,
body.mahak-home-product-grid-ready .mahak-home-premium .hero-pill svg * {
  color: #ffffff !important;
  stroke: currentColor !important;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric .product-card__subtitle,
body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric.mahak-home-grid--turmeric .product-card__subtitle {
  display: block !important;
  max-width: clamp(145px, 18vw, 230px) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 680px) {
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric .product-card__subtitle,
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid--turmeric.mahak-home-grid--turmeric .product-card__subtitle {
    max-width: 100% !important;
  }
}

/* =========================================================
   PYM v1.6.6 — Home product media polish, scoped
   ========================================================= */
body.mahak-home-product-grid-ready .mahak-home-premium .hero-product__media img {
  border-radius: 20px !important;
  overflow: hidden !important;
}

body.mahak-home-product-grid-ready .mahak-home-premium .mahak-home-grid--basic .product-card__media,
body.mahak-home-product-grid-ready .mahak-home-premium .mahak-home-grid--basic .product-card__media img {
  border-radius: 20px !important;
  overflow: hidden !important;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card__media--turmeric {
  height: 225px !important;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section .product-card__media--saffron {
  border-radius: 20px !important;
  overflow: hidden !important;
}

body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section .product-card__media--saffron .product-card__image--contain,
body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section .product-card__media--saffron img {
  width: auto !important;
  max-width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  display: block !important;
  margin-inline: auto !important;
}

@media (max-width: 900px) {
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card__media--turmeric {
    height: 180px !important;
  }
}

@media (max-width: 420px) {
  body.mahak-home-product-grid-ready .mahak-home-premium .featured-product-section__grid .product-card__media--turmeric {
    height: 152px !important;
  }
}

/* =========================================================
   MahakShop Child v1.6.17 — Home/card title hover color lock
   هدف: عنوان دسته و عنوان کارت محصول در هاور مشکی برند بماند.
   ========================================================= */
html body:not(.wp-admin).mahak-home-premium-page .mahak-home-premium .category-card:hover h3.category-card__title,
html body:not(.wp-admin).mahak-home-premium-page .mahak-home-premium .category-card:hover .category-card__title {
  color: #241726 !important;
}

html body:not(.wp-admin).mahak-home-premium-page .mahak-home-premium .product-card:hover h2.product-card__title a,
html body:not(.wp-admin).mahak-home-premium-page .mahak-home-premium .product-card:hover h3.product-card__title a,
html body:not(.wp-admin).mahak-home-premium-page .mahak-home-premium .product-card__title a:hover,
html body:not(.wp-admin).mahak-home-premium-page .mahak-home-premium .product-card__title a:focus-visible {
  color: #241726 !important;
}
