/*
 Theme Name: Hello Elementor Child
 Template: hello-elementor
 Description: Child theme for Hello Elementor — WooCommerce product card (single padding, no-crop image)
 Version: 1.0.0
 Text Domain: hello-elementor-child
*/

/* ================== WooCommerce Product Card (Single-padding, No-Crop Image) ================== */

/* گرید کارت‌ها: ستون‌های کنترل‌شده، بدون اسکرول افقی */
ul.products{
  display: grid;
  grid-auto-rows: auto;
  grid-gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
  justify-content: center;
  align-content: start;
  margin: 0 auto;
  max-width: 100%;
}
@media (max-width: 480px){
  ul.products{ grid-template-columns: 1fr; }
}

/* رَپر اصلی کارت محصول — فقط همین‌جا padding داریم */
ul.products li.product{
  box-sizing: border-box;
  width: 100%;
  max-width: 380px;        /* کنترل عرض کارت */
  padding: 10px !important;           /* تنها منبع padding کارت */
  background: #F7FCF2;     /* رنگ خواسته‌شده */
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
ul.products li.product:hover{
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(0,0,0,.08);
}

/* ================== INTERNALS (بدون padding داخلی) ================== */

/* تصویر — نمایش کامل بدون کراپ و بدون نسبت اجباری */
ul.products li.product a.woocommerce-LoopProduct-link{
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  padding: 0 !important;            /* هیچ padding داخلی در لینک تصویر */
  background: transparent;
}
/* حذف نسبت اجباریِ قبلی */
ul.products li.product a.woocommerce-LoopProduct-link::before{
  content: none !important;
}
/* تصویر کامل؛ بدون object-fit: cover */
ul.products li.product a.woocommerce-LoopProduct-link img{
  width: 100%;
  height: auto;                      /* ارتفاع متناسب با عرض */
  display: block;
  object-fit: contain;               /* عکس کامل دیده می‌شود */
  transition: transform 0.25s ease;
  border-radius: 6px !important;               /* لبه‌ی نرم داخل کارت */
}
ul.products li.product:hover a.woocommerce-LoopProduct-link img{
  transform: scale(1.02);
}

/* ردیف «عنوان راست | قیمت چپ» — padding صفر؛ فاصله با margin */
ul.products li.product .md-meta-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 !important;
  margin-top: 10px;                  /* فاصله از تصویر */
  background: transparent;
     /* جداکننده ظریف */
}

/* عنوان — دوخطی، بدون padding داخلی */
ul.products li.product .md-meta-row h2.woocommerce-loop-product__title{
  margin: 0;
  padding: 0 !important;
  font-size: 15px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* لینک عنوان */
ul.products li.product .md-meta-row .md-title-link{
  color: #14190E !important;
  text-decoration: none;
}
ul.products li.product .md-meta-row .md-title-link:hover{
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* قیمت — فشرده و خوانا، بدون padding داخلی */
ul.products li.product .md-meta-row .price{
  color: #14190E !important;
  margin: 0;
  padding: 0 !important;
  font-weight: 700;
  opacity: .9;
  white-space: nowrap;
  flex-shrink: 0;
}
ul.products li.product .md-meta-row .price del{
  opacity: .55;
  font-weight: 400;
}

/* دکمه CTA تمام‌عرض — فقط padding داخلی خود دکمه */
ul.products li.product a.button,
ul.products li.product .add_to_cart_button,
ul.products li.product .added_to_cart{
  display: block;
  width: 100%;
  margin-top: 10px;                  /* فاصله از ردیف متا */
  border-radius: 10px;
  padding: 12px 14px;                /* padding فقط داخل دکمه */
  text-align: center;
  font-weight: 700;
  background: #b7e48b;
  color: #0e4610;
  border: 0;
  box-shadow: 0 8px 18px rgba(183,228,139,.4);
  transition: transform 0.15s ease, filter 0.15s ease;
}
ul.products li.product a.button:hover{
  transform: translateY(-1px);
  filter: brightness(1.03);
}

/* بَج تخفیف — با توجه به padding رَپر اصلی */
ul.products li.product span.onsale{
  position: absolute;
  top: 18px; left: 18px;
  background: #111; color: #fff;
  border-radius: 999px;
  padding: 6px 10px; font-size: 12px; line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  z-index: 3;
}

/* ایمنی‌های اضافی: هر padding ناخواسته داخلی را صفر کن (در صورت تم/ویجت متفاوت) */
ul.products li.product *[class*="__inner"],
ul.products li.product .product-inner,
ul.products li.product .inner,
ul.products li.product .content,
ul.products li.product .summary{
  padding: 0 !important;
  background: transparent;
  border: none;
}
