.custom-checkbox-square {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 28px;
  cursor: pointer;
  flex-shrink: 0;

  @media (max-width: 769px) {
    width: 20px;
    height: 20px;
  }
}

.custom-checkbox-square input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: pointer;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0.75rem;
  font-weight: bold;
  transition: all 0.2s ease;

  @media (width > 768px) {
    font-size: 1.25rem;
  }
}

.checkmark--white {
  background-color: #ffffff;
}
.checkmark--blue {
  background-color: #f3f3f3;
}

/* Когда отмечен — делаем белый фон и показываем галочку */
.custom-checkbox-square input:checked ~ .checkmark {
  background-color: #101010 !important;
  color: #fff;
}

/* Анимация появления галочки */
.custom-checkbox-square input:checked ~ .checkmark::before {
  color: #fff;
  font-size: 1.25rem;
  font-weight: bold;
  animation: fadeInCheck 0.2s ease-out;
}

@keyframes fadeInCheck {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
