/* Add custom CSS styles below */ 
/* ============================================ */
/* صناديق المقاسات - التصميم النهائي */
/* ============================================ */

.salla-size-grid{
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 8px !important;
  margin: 10px 0 14px !important;
}

@media (max-width: 640px){
  .salla-size-grid{
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 6px !important;
  }
}

.salla-size-box{
  position: relative !important;
  cursor: pointer !important;
  user-select: none !important;
}

.salla-size-box input{
  position: absolute !important;
  inset: 0 !important;
  opacity: 0 !important;
}

.salla-size-box span{
  display: grid !important;
  place-items: center !important;
  height: 45px !important;
  border: 1.5px solid #e5e7eb !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  transition: .2s ease !important;
  width: auto !important;
}

@media (max-width: 640px){
  .salla-size-box span{
    height: 38px !important;
    font-size: 13px !important;
  }
}

.salla-size-box input:checked + span{
  border-color: #2563eb !important;
  background: rgba(37,99,235,.08) !important;
  color: #2563eb !important;
}

.salla-size-box input:disabled + span{
  opacity: .45 !important;
  cursor: not-allowed !important;
}

/* إخفاء الـselect بعد التحويل */
.salla-size-hidden{
  display: none !important;
}

/* X أحمر على المقاسات المنتهية */
.salla-size-box.is-oos span{
  position: relative !important;
  opacity: .55 !important;
  color: #9ca3af !important;
}

.salla-size-box.is-oos span::before,
.salla-size-box.is-oos span::after{
  content: "" !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 60% !important;
  height: 2px !important;
  background: #ef4444 !important;
  border-radius: 2px !important;
  transform-origin: center !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

.salla-size-box.is-oos span::before{
  transform: translate(-50%,-50%) rotate(45deg) !important;
}

.salla-size-box.is-oos span::after{
  transform: translate(-50%,-50%) rotate(-45deg) !important;
}

.salla-size-box.is-oos{
  cursor: not-allowed !important;
}

.salla-size-box.is-oos input{
  pointer-events: none !important;
}