/* ==========================
   FINAL ALIGNMENT & POLISH
   ========================== */

/* Equal height fix (grid me gap na aaye) */
.ew-course-card{
  min-height: 100%;
}

/* Image size consistency (logos bhi centered dikhen) */
.ew-course-thumb{
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f8fafc;
}
.ew-course-thumb img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;   /* important for logo-type images */
}

/* Price block strict alignment */
.ew-course-price{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  line-height:1.1;
}
.ew-course-price .ew-now{
  white-space: nowrap;
}
.ew-course-price .ew-old{
  white-space: nowrap;
}

/* Footer always stick to bottom */
.ew-course-footer{
  margin-top:auto;
}

/* Buy button premium look */
.ew-buy-btn{
  background: linear-gradient(135deg,#4f46e5,#6366f1);
  border: none;
  color:#fff;
  box-shadow: 0 6px 14px rgba(79,70,229,.25);
}
.ew-buy-btn:hover{
  background: linear-gradient(135deg,#4338ca,#4f46e5);
  box-shadow: 0 10px 22px rgba(79,70,229,.35);
}

/* Mobile polish */
@media (max-width: 576px){
  .ew-course-title{
    font-size:14px;
    min-height:auto;
  }
  .ew-course-thumb{
    aspect-ratio: 4 / 3;
  }
}
/* ==========================
   Examwise Professional Course Card (FINAL)
   ========================== */

.ew-course-card{
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16,24,40,.06);
  transition: transform .18s ease, box-shadow .18s ease;
  height: 100%;
  display:flex;
  flex-direction:column;
}
.ew-course-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(16,24,40,.12);
}

/* Thumbnail */
.ew-course-thumb{
  position: relative;
  display:flex;
  align-items:center;
  justify-content:center;
  aspect-ratio: 16 / 9;
  background: #f8fafc;
  overflow:hidden;
  text-decoration:none;
}
.ew-course-thumb img{
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* logo images ke liye best */
  transition: transform .22s ease;
}
.ew-course-card:hover .ew-course-thumb img{
  transform: scale(1.04);
}

/* Badges */
.ew-course-badges{
  position:absolute;
  top:10px;
  left:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
  z-index:2;
}
.ew-badge{
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: .2px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.06);
  backdrop-filter: blur(6px);
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.ew-badge-free{ color:#027a48; }
.ew-badge-sale{ color:#b42318; }
.ew-badge-new{  color:#175cd3; }
.ew-badge-paid{ color:#344054; }
.ew-badge-corner{
  position:absolute;
  top:10px;
  right:10px;
  z-index:2;
}

/* Body */
.ew-course-body{
  padding: 14px 14px 14px;
  display:flex;
  flex-direction:column;
  gap:8px;
  flex:1;
}
.ew-course-title{
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  color: #101828;
  text-decoration:none;
  min-height: 38px;
}
.ew-course-title:hover{ text-decoration: underline; }

.ew-course-meta{
  font-size: 12px;
  color: #667085;
  margin-top: -2px;
  min-height: 18px;
}

/* Footer + Price alignment */
.ew-course-footer{
  margin-top:auto;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  padding-top: 8px;
}
.ew-course-price{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  line-height:1.1;
}
.ew-course-price .ew-now{
  font-size: 18px;
  font-weight: 900;
  color: #1f2a37;
  white-space: nowrap;
}
.ew-course-price .ew-old{
  font-size: 13px;
  color: #98a2b3;
  text-decoration: line-through;
  margin-top: 2px;
  white-space: nowrap;
}

/* Buy button */
.ew-buy-btn{
  border-radius: 10px;
  font-weight: 800;
  padding: 8px 12px;
  background: linear-gradient(135deg,#4f46e5,#6366f1);
  border: none;
  color:#fff;
  box-shadow: 0 6px 14px rgba(79,70,229,.25);
}
.ew-buy-btn:hover{
  background: linear-gradient(135deg,#4338ca,#4f46e5);
  box-shadow: 0 10px 22px rgba(79,70,229,.35);
  color:#fff;
}

/* Mobile */
@media (max-width: 576px){
  .ew-course-title{ font-size:14px; min-height:auto; }
  .ew-course-thumb{ aspect-ratio: 4 / 3; }
}
/* ==========================
   FIX: Buy button click blocked (overlay / badges)
   ========================== */

/* Allow clicks through overlay elements */
.ew-course-badges,
.ew-badge,
.ew-course-thumb::before,
.ew-course-thumb::after,
.ew-course-card::before,
.ew-course-card::after{
  pointer-events: none !important;
}

/* Ensure footer + button stays on top and clickable */
.ew-course-footer{
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.ew-buy-btn,
.ew-course-footer a,
.ew-course-footer button{
  position: relative;
  z-index: 20;
  pointer-events: auto !important;
}
/* ✅ Fix: Buy Course button click not working (overlay issue) */
.ew-course-card { position: relative; }
.ew-course-body { position: relative; z-index: 3; }
.ew-course-footer { position: relative; z-index: 4; }
.ew-buy-btn { position: relative; z-index: 5; pointer-events: auto; }

/* badges/thumb should not block button clicks */
.ew-course-badges { pointer-events: none; }
.ew-course-thumb { position: relative; z-index: 1; }
/* =========================
   FIX: Buy button click issue (overlay / z-index)
   ========================= */
.ew-course-card,
.ew-course-body,
.ew-course-footer{
  position: relative;
  z-index: 1;
}

.ew-course-thumb{
  position: relative;
  z-index: 0;
}

/* Button always on top + clickable */
.ew-course-footer .ew-buy-btn{
  position: relative;
  z-index: 9999 !important;
  pointer-events: auto !important;
}

/* If any overlay is covering, this helps */
.ew-course-card *{
  pointer-events: auto;
}
/* =========================
   FINAL: Buy Course button always clickable (WEB + APP)
   ========================= */

.ew-course-card{ position: relative; }

/* keep thumb under */
.ew-course-thumb{
  position: relative;
  z-index: 0;
}

/* body/footer above thumb */
.ew-course-body{
  position: relative;
  z-index: 1;
}
.ew-course-footer{
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

/* button always highest */
.ew-course-footer .ew-buy-btn,
.ew-course-footer .addToCartBtn{
  position: relative !important;
  z-index: 9999 !important;
  pointer-events: auto !important;
}

/* overlays/badges never block clicks */
.ew-course-badges,
.ew-badge,
.ew-course-thumb::before,
.ew-course-thumb::after,
.ew-course-card::before,
.ew-course-card::after{
  pointer-events: none !important;
}

