/* =========================================
   Baby Haven — Minimal Product Card (V3)
   نسخة خفيفة + احترافية + بدون لمعان + بدون هوفر مزعج
========================================= */

:root {
  --card:        #FFFFFF;
  /* خفّفت لون الخلفية البديلة ليقرب من الخلفية العامة */
  --card-alt:    #FDF9F4;
  --border:      rgba(0,0,0,0.08);
  --radius:      14px;

  --title:       #111827;
  --text:        #6B7280;

  --price:       #E86A4A;
  --price-old:   #9CA3AF;

  --teal:   #2FA3A0;
  --coral:  #F07A63;
  --mint:   #8ED1B2;
  --sun:    #F2B84B;

  --qty-bg:      #F3F4F6;
  --qty-border:  #E5E7EB;
  --btn-bg:      #2FA3A0;
  --btn-bg-hover:#1d726e;
  --btn-text:    #FFF;
}

/* ========================
   الكرت — نظيف وبدون لمعة
======================== */

.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: box-shadow .14s ease;
}

/* هوفر بسيط جداً — فقط ظل خفيف */
.card:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

/* ========================
   الصورة — ثابتة وواضحة
======================== */

.card-media {
  width: 100%;
  /* نحذف الـ aspect-ratio لو تحس إنه يسبب تمديد غريب للصورة
     أو خله موجود لو عاجبك التساوي بين كل الكروت */
  /* aspect-ratio: 1 / 1; */

  /* ✅ نخلي الخلفية شفافة أو نفس خلفية الكرت */
  background: transparent !important;
  /* أو لو تحبها مثل الكرت:
     background: var(--card) !important; */

  overflow: hidden;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;

  /* ✅ عشان البادجات تتموضع فوق الصورة */
  position: relative;
}

/* حاوية البادجات فوق الصورة (جديد / خصم %) */
.card-media .badges {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 2;
  pointer-events: none; /* ما تعيق الضغط على الكرت */
}

/* شكل البادج العام */
.badge-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* بادج "جديد" */
.badge-chip.badge-new {
  background: var(--mint);
  color: #064e3b;
}

/* بادج نسبة الخصم -٪ */
.badge-chip.badge-sale {
  background: var(--coral);
  color: #FFF;
  font-weight: 700;
}

/* ========================
   الصورة نفسها
======================== */

.card-media img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: auto;

  /* ✅ نخلي الصورة كاملة بدون قص غريب */
  object-fit: contain !important;

  display: block;
  transition: none !important; /* يمنع أي لمعان */
}

/* ========================
   جسم الكرت
======================== */

.card-body {
  padding: 0.75rem 0.85rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--title);
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  transition: none !important;
}

.meta-row {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text);
}

/* ========================
   الشارات (المخزون)
======================== */

.badge-qty {
  font-size: 0.75rem;
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  font-weight: 700;
}

/* متوفر */
.badge-qty.in { background: var(--teal); color: #FFF; }

/* قرب ينتهي */
.badge-qty.low { background: #FBBF24; color: #78350F; }

/* غير متوفر */
.badge-qty.out { background: #F87171; color: #7F1D1D; }

/* ========================
   الأسعار (الكروت)
======================== */

.price-row {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.25rem;
}

.price-now {
  font-size: 1.02rem;
  color: var(--price);
  font-weight: 800;
}

.price-old {
  font-size: 0.78rem;
  color: var(--price-old);
  text-decoration: line-through;
}

/* ========================
   الأزرار + التحكم في الكمية
======================== */

.card-actions {
  margin-top: 0.35rem;
  width: 100%;
}

.btn {
  width: 100%;
  padding: 0.65rem;
  background: var(--btn-bg);
  color: var(--btn-text);
  border-radius: 10px;
  border: none;
  font-size: 1.0rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease;
}

.btn:hover { background: var(--btn-bg-hover); }

/* التحكم في الكمية */
.qty-control {
  margin-top: 0.4rem;
  width: 100%;
  padding: 0.32rem 0.55rem;
  border: 1px solid var(--qty-border);
  border-radius: 10px;
  background: var(--qty-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.qty-num {
  flex: 1;
  text-align: center;
  font-weight: 700;
  color: var(--title);
}

.qty-btn {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  border: 1px solid var(--qty-border);
  background: #FFF;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

/* ========================
   موبايل
======================== */

@media (max-width: 640px) {
  .card-title { font-size: 0.94rem; }
  .price-now { font-size: 0.96rem; }
}

/* =========================================================
   أسعار عربة التسوق (السطر اللي في الدروار)
   يستخدمها include.js لما يبني priceHtml
   <span class="cart-price-old">...</span>
   <span class="cart-price-now">...</span>
========================================================= */

.cart-price-old {
  color: var(--price-old) !important;   /* رمادي */
  text-decoration: line-through;
  opacity: 0.9;
  font-size: 0.78rem;
  margin-inline-end: 4px;
}

.cart-price-now {
  color: var(--price) !important;       /* نفس لون السعر الرئيسي */
  font-weight: 800;
}

/* لو عندك حاوية عامة للسعر في الدروار */
.cart-drawer__item-price {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.25rem;
}
