/* =========================
   CARD RESET (NO WHITE SPACE)
   ========================= */
.pReview{ display:flex; align-items:center; gap:4px; font-size:10px; margin:0; }
.pStar{ color:#f5a623; }
.pRating{ font-weight:800; color:#2b2f36; }
.pReviews{ color:#9aa0a6; font-weight:700; }

.pCard,
.pMedia,
.pInfo,
.pBottom,
.pName,
.pOldPrice,
.pNewPrice,
.pPercent {
  margin: 0 !important;
  padding: 0 !important;
}

/* =========================
   CARD BASE
   ========================= */

.pCard{
  background:#fff;
  border:1px solid #e6e6e6;
  border-radius:0px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

/* =========================
   IMAGE (FULL – NO GAP)
   ========================= */

.pMedia{
  position:relative;
  line-height:0 !important;
}

.pImg{
  width:100% !important;
  aspect-ratio: 244 / 288;
  height:auto !important;
  object-fit:cover !important;
  display:block !important;
  background:transparent !important;
}

/* =========================
   DISCOUNT STRIP
   ✅ يحجز مكانه دائمًا
   ========================= */

.pDiscountImg{
  display:block;
  width:100%;
  height:20px;                 /* الارتفاع الفعلي */
  max-height:40px;             /* ⬅️ يحجز المكان حتى لو الصورة مش موجودة */
  object-fit:cover;
  background:transparent;
}

/* =========================
   INFO AREA (TIGHT)
   ========================= */

.pInfo{
  padding:6px 8px 8px !important;
}

/* =========================
   PRODUCT NAME (2 LINES)
   ========================= */

.pName{
  font-size:12px;
  font-weight:600;
  line-height:1.25;
  margin-bottom:4px !important;

  display:-webkit-box;
  -webkit-line-clamp:2;        /* ✅ سطرين */
  -webkit-box-orient:vertical;
  overflow:hidden;
  min-height:2.5em;            /* ⬅️ يحجز ارتفاع سطرين دائمًا */
}

/* =========================
   OLD PRICE + REVIEW ROW
   ========================= */

.pOldRow{
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:4px !important;
}

.pOldPrice{
  font-size:12px;
  color:#9aa0a6;
  text-decoration:line-through;
}

/* review slot (يحافظ على المكان) */
.pReviewSlot{
  margin-left:auto;
  min-width:20px;
  min-height:20px;
  display:flex;
  justify-content:flex-end;
  align-items:center;
}

.pReviewSlot.empty{
  visibility:hidden;
}

/* =========================
   REVIEW BADGE (SMALL)
   ========================= */

.pReview{
  display:inline-flex;
  align-items:center;
  gap:2px;
  background:#0ea34a;
  color:#fff;
  border-radius:999px;
  padding:3px 6px;
  font-weight:800;
  font-size:10px;
  line-height:1;
}

.pStar{
  color:#fff;
  font-size:10px;
  margin-left:3px;
}

.pRating{
  font-weight:800;
  color:#fff;
}

.pReviews{
  color:#666;
  font-weight:700;
  font-size:10px;
  margin-left:3px;
}

/* =========================
   PRICE ROW
   ========================= */

.pBottom{
  display:flex;
  align-items:center;
  gap:6px;
}

.pPercent{
  border:1.2px solid #b3262d;
  color:#b3262d;
  font-size:11px;
  font-weight:700;
  padding:3px 6px !important;
  border-radius:8px;
  white-space:nowrap;
}

.pNewPrice{
  font-size:18px;
  font-weight:900;
  color:#111;
}

/* =========================
   CART BUTTON
   ========================= */

.pCartBtn{
  margin-left:auto;
  width:36px;
  height:36px;
  border-radius:10px;
  background:#fff;
  border:1px solid #ddd;
  display:flex;
  align-items:center;
  justify-content:center;
}

.pCartSvg{
  width:18px;
  height:18px;
  color:#2b2f36;
}

/* =========================
   NO DISCOUNT
   ========================= */

.pCard.noPct .pPercent{
  display:none;
}

.pCard.noPct .pNewPrice{
  margin-left:0;
}

/* =========================
   GRID & SCROLL
   ========================= */

.productsGrid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:8px;
}

.productsMini{
  display:flex;
  gap:8px;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
}

.pCardMini{
  flex:0 0 auto;
  width:44vw;
  max-width:220px;
  scroll-snap-align:start;
}

/* =========================
   REMOVE ANY GLOBAL GAPS
   ========================= */

.pCard *{
  box-sizing:border-box;
}




/* =========================
   Cart button loading spinner
   ========================= */

.pCartBtn.isLoading{
  pointer-events:none;
  opacity:.9;
}

/* نخفي الأيقونة وقت اللودنغ (اختياري) */
.pCartBtn.isLoading .pCartSvg{
  opacity:.25;
}

/* spinner */
/* =========================
   Cart button loading spinner (RED)
   ========================= */

.pCartBtn.isLoading{
  pointer-events:none;
  opacity:.9;
}

/* نخفي الأيقونة وقت اللودنغ */
.pCartBtn.isLoading .pCartSvg{
  opacity:.25;
}

/* spinner أحمر */
.pCartBtn.isLoading::after{
  content:"";
  position:absolute;
  inset:0;
  margin:auto;
  width:18px;
  height:18px;
  border-radius:50%;
  border:2px solid rgba(225, 29, 72, .25);   /* أحمر فاتح */
  border-top-color:#e11d48;                  /* أحمر قوي (Tailwind red-600) */
  animation:pcSpin .7s linear infinite;
}

@keyframes pcSpin{
  to{ transform:rotate(360deg); }
}




/* =========================
   SOLD OUT PRODUCT CARD (RESPONSIVE)
   ========================= */

/* media مرجع للـ overlay */
.pCard.isSoldOut .pMedia{
  position:relative;
}

/* ✅ تغميق خفيف (أقل من قبل) + grayscale */
.pCard.isSoldOut .pImg{
  filter: grayscale(0.35) brightness(0.92) contrast(0.98);
  opacity: 0.95;
}

/* طبقة SOLD OUT */
.pCard.isSoldOut .pSoldOut{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:6;
  pointer-events:none;
  padding:8px; /* يساعد لما الكارد صغير */
}

/* ✅ النص Responsive */
.pCard.isSoldOut .pSoldOut span{
  color:#fff;
  font-weight:900;
  text-transform:uppercase;

  /* ✅ يتكيّف مع حجم الكارد */
  font-size: clamp(11px, 2.4vw, 20px);
  padding: clamp(6px, 1.4vw, 10px) clamp(8px, 2vw, 14px);
  border-radius: clamp(8px, 1.6vw, 10px);

  /* ✅ letter spacing مرنة */
  letter-spacing: clamp(.10em, .22vw, .28em);

  /* ✅ عرض مناسب للكارد الصغير */
  max-width: 90%;
  text-align:center;
  line-height:1.15;

  background:rgba(0,0,0,.28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-shadow:0 10px 25px rgba(0,0,0,.45);
}

/* ✅ إخفاء زر السلة */
.pCard.isSoldOut .pCartBtn{
  display:none !important;
}